From 3178ef3a51cfd3f499172d1d27bf5cc26d4536c0 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Sun, 27 Sep 2020 18:18:41 +0800 Subject: [PATCH 1/9] format and cleanup code --- .travis.yml | 2 +- connectors/http-connector/pom.xml | 163 +- .../connectors/http/HttpCommand.java | 18 +- .../http/HttpExecutorServiceImpl.java | 8 +- .../connectors/http/HttpResponseImpl.java | 45 +- connectors/httpclient/pom.xml | 115 +- connectors/httpclient/src/all.xml | 12 +- .../HttpClientConfigInterceptor.java | 10 +- .../httpclient/HttpClientFactory.java | 5 +- .../connectors/httpclient/HttpCommand.java | 47 +- .../httpclient/HttpExecutorServiceImpl.java | 16 +- .../httpclient/HttpResponseImpl.java | 8 +- connectors/jersey2/pom.xml | 151 +- .../connectors/jersey2/ClientFactory.java | 26 +- .../connectors/jersey2/HttpCommand.java | 68 +- .../jersey2/HttpExecutorServiceImpl.java | 23 +- .../connectors/jersey2/HttpResponseImpl.java | 23 +- connectors/okhttp/pom.xml | 3 +- connectors/okhttp/src/all.xml | 12 +- .../connectors/okhttp/HttpCommand.java | 60 +- .../okhttp/HttpExecutorServiceImpl.java | 16 +- .../connectors/okhttp/HttpResponseImpl.java | 24 +- connectors/pom.xml | 7 +- connectors/resteasy/pom.xml | 147 +- .../connectors/resteasy/HttpCommand.java | 11 +- .../resteasy/HttpExecutorServiceImpl.java | 15 +- .../connectors/resteasy/HttpResponseImpl.java | 23 +- .../resteasy/ResteasyClientFactory.java | 15 +- .../executors/ApacheHttpClientEngine.java | 6 +- core-integration-test/it-httpclient/pom.xml | 100 +- core-integration-test/it-jersey2/pom.xml | 100 +- core-integration-test/it-okhttp/pom.xml | 100 +- core-integration-test/it-resteasy/pom.xml | 100 +- core-integration-test/pom.xml | 257 +-- .../org/openstack4j/api/BuilderSpec.groovy | 13 +- .../v3/KeystoneAuthenticationSpec.groovy | 60 +- .../v3/KeystoneCredentialServiceSpec.groovy | 9 +- .../v3/KeystoneDomainServiceSpec.groovy | 27 +- .../v3/KeystoneGroupServiceSpec.groovy | 9 +- .../v3/KeystonePolicyServiceSpec.groovy | 31 +- .../v3/KeystoneProjectServiceSpec.groovy | 29 +- .../v3/KeystoneRegionServiceSpec.groovy | 29 +- .../v3/KeystoneRoleServiceSpec.groovy | 12 +- .../KeystoneServiceEndpointServiceSpec.groovy | 37 +- .../v3/KeystoneTokenServiceSpec.groovy | 28 +- .../v3/KeystoneUserServiceSpec.groovy | 9 +- .../authenticate_v3_token_tape.yaml | 120 +- ...henticate_v3_userId_password_domainId.yaml | 78 +- ...serId_password_domainId_regionInvalid.yaml | 78 +- ..._userId_password_domainId_regionValid.yaml | 116 +- ...nticate_v3_userId_password_domainName.yaml | 78 +- ...enticate_v3_userId_password_projectId.yaml | 78 +- ..._password_projectName_projectDomainId.yaml | 84 +- ...d_password_unscopedTokenToScopedToken.yaml | 72 +- ...te_v3_userId_password_unscoped_reauth.yaml | 72 +- ...nticate_v3_userName_password_domainId.yaml | 84 +- ...rName_password_userDomainId_projectId.yaml | 84 +- .../credentialService_all_tape.yaml | 412 ++--- .../identity.v3/domainService_crud_tape.yaml | 284 +-- .../groupService_group_crud_tape.yaml | 590 +++---- .../identity.v3/policyService_all_tape.yaml | 378 ++-- .../identity.v3/projectService_crud_tape.yaml | 400 ++--- .../identity.v3/regionService_all_tape.yaml | 284 +-- .../identity.v3/roleService_all_tape.yaml | 1008 +++++------ .../serviceEndpoints_all_tape.yaml | 420 ++--- .../tapes/identity.v3/tokenService_crud.yaml | 312 ++-- .../tokenService_getUserToken.yaml | 72 +- .../identity.v3/userService_user_crud.yaml | 738 ++++---- core-test/pom.xml | 91 +- .../java/org/openstack4j/api/SkipTest.java | 15 +- .../org/openstack4j/api/SkipTestListener.java | 12 +- .../artifact/ToscaTemplatesArtifactTests.java | 5 +- .../api/barbican/ContainerTests.java | 6 +- .../api/compute/ExtensionTests.java | 2 +- .../openstack4j/api/compute/FlavorTests.java | 156 +- .../api/compute/FloatingIPTests.java | 54 +- .../api/compute/HostAggregateTests.java | 64 +- .../openstack4j/api/compute/ImageTests.java | 16 +- .../api/compute/MigrationTests.java | 16 +- .../api/compute/NovaHostTests.java | 40 +- .../api/compute/ServerTagTests.java | 56 +- .../openstack4j/api/compute/ServerTests.java | 79 +- .../openstack4j/api/compute/ServiceTests.java | 88 +- .../api/compute/ext/InstanceActionsTests.java | 10 +- .../api/gbp/ExternalPolicyServiceTest.java | 55 +- .../api/gbp/ExternalSegmentServiceTest.java | 46 +- .../openstack4j/api/gbp/GroupServiceTest.java | 51 +- .../api/gbp/L2policyServiceTest.java | 55 +- .../api/gbp/L3policyServiceTest.java | 53 +- .../api/gbp/NatPoolServiceTest.java | 53 +- .../api/gbp/NetworkPolicyServiceTest.java | 26 +- .../api/gbp/PolicyActionServiceTest.java | 55 +- .../api/gbp/PolicyClassifierServiceTest.java | 55 +- .../api/gbp/PolicyRuleServiceTest.java | 55 +- .../api/gbp/PolicyRuleSetServiceTest.java | 57 +- .../api/gbp/PolicyTargetServiceTest.java | 53 +- .../api/gbp/ServiceProfileServiceTest.java | 1 + .../api/gbp/ServicechainServiceTest.java | 1 + .../openstack4j/api/heat/ResourcesTests.java | 24 +- .../api/heat/StackServiceTests.java | 22 +- .../v2/CustomEndpointURLResolverTest.java | 138 +- .../api/identity/v2/KeystoneTests.java | 24 +- .../api/identity/v2/ServiceVersionTests.java | 4 +- .../v3/CustomEndpointURLResolverTest.java | 162 +- .../v3/KeystoneAuthenticationTests.java | 81 +- .../v3/KeystoneCredentialServiceTests.java | 4 +- .../v3/KeystoneDomainServiceTests.java | 4 +- .../v3/KeystoneGroupServiceTests.java | 20 +- .../v3/KeystonePolicyServiceTest.java | 4 +- .../v3/KeystoneProjectServiceTests.java | 16 +- .../v3/KeystoneRegionServiceTest.java | 4 +- .../identity/v3/KeystoneRoleServiceTests.java | 16 +- .../KeystoneServiceEndpointServiceTest.java | 4 +- .../identity/v3/KeystoneUserServiceTests.java | 37 +- .../api/image/v1/ImageV1Tests.java | 10 +- .../api/image/v2/ImageV2Tests.java | 71 +- .../openstack4j/api/magnum/MagnumTests.java | 32 +- .../openstack4j/api/manila/QuotaSetTests.java | 3 +- .../api/manila/SchedulerStatsTests.java | 2 +- .../api/manila/SecurityServiceTests.java | 2 +- .../api/manila/ShareInstanceTests.java | 2 +- .../api/manila/ShareNetworkTests.java | 2 +- .../api/manila/ShareServerTests.java | 2 +- .../api/manila/ShareSnapshotTests.java | 2 +- .../openstack4j/api/manila/ShareTests.java | 4 +- .../api/manila/ShareTypeTests.java | 4 +- .../openstack4j/api/manila/SharesTests.java | 4 +- .../openstack4j/api/metering/AlarmTests.java | 36 +- .../api/murano/v1/ActionTests.java | 2 +- .../api/murano/v1/DeploymentTests.java | 12 +- .../api/murano/v1/EnvironmentTests.java | 6 +- .../api/murano/v1/ServicesTests.java | 6 +- .../api/murano/v1/SessionTests.java | 6 +- .../api/network/AvailabilityZoneTests.java | 44 +- .../api/network/HealthMonitorTests.java | 432 ++--- .../api/network/HealthMonitorV2Tests.java | 8 +- .../openstack4j/api/network/LbPoolTests.java | 179 +- .../api/network/LbPoolV2Tests.java | 9 +- .../api/network/ListenerV2Tests.java | 11 +- .../api/network/LoadBalancerV2Tests.java | 9 +- .../openstack4j/api/network/MemberTests.java | 141 +- .../api/network/MemberV2Tests.java | 10 +- .../openstack4j/api/network/NetQuotaTest.java | 1 + .../openstack4j/api/network/NetworkTests.java | 79 +- .../openstack4j/api/network/PortTests.java | 3 +- .../api/network/SecurityGroupTests.java | 2 +- .../network/ServiceFunctionChainTests.java | 47 +- .../openstack4j/api/network/SubnetTests.java | 38 +- .../org/openstack4j/api/network/VipTests.java | 187 +- .../firewalls/FirewallPolicyTests.java | 197 +-- .../network/firewalls/FirewallRuleTests.java | 143 +- .../api/network/firewalls/FirewallTests.java | 136 +- .../api/octavia/HealthMonitorV2Tests.java | 8 +- .../api/octavia/LbPoolV2Tests.java | 9 +- .../api/octavia/ListenerV2Tests.java | 11 +- .../api/octavia/LoadBalancerV2Tests.java | 9 +- .../api/octavia/MemberV2Tests.java | 10 +- .../openstack4j/api/sahara/ClusterTests.java | 62 +- .../api/senlin/v1/ActionServiceTest.java | 16 +- .../api/senlin/v1/BuildInfoServiceTest.java | 9 +- .../senlin/v1/ClusterPolicyServiceTest.java | 16 +- .../api/senlin/v1/ClusterServiceTest.java | 32 +- .../api/senlin/v1/EventServiceTest.java | 16 +- .../api/senlin/v1/NodeServiceTest.java | 32 +- .../api/senlin/v1/PolicyServiceTest.java | 32 +- .../api/senlin/v1/PolicyTypeServiceTest.java | 16 +- .../api/senlin/v1/ProfileServiceTest.java | 31 +- .../api/senlin/v1/ProfileTypeServiceTest.java | 16 +- .../api/senlin/v1/ReceiverServiceTest.java | 24 +- .../api/senlin/v1/VersionServiceTest.java | 7 +- .../api/senlin/v1/WebHookServiceTest.java | 8 +- .../api/storage/ObjectStorageTests.java | 33 +- .../storage/SchedulerStatsGetPoolTests.java | 5 +- .../openstack4j/api/storage/ServiceTests.java | 40 +- .../api/storage/VolumeBackupTests.java | 370 ++-- .../api/storage/VolumeSnapshotTests.java | 25 +- .../openstack4j/api/storage/VolumeTests.java | 80 +- .../api/storage/VolumeTypeTests.java | 10 +- .../api/tacker/v1/TackerVimTests.java | 190 +- .../api/tacker/v1/TackerVnfTests.java | 136 +- .../api/tacker/v1/TackerVnfdTests.java | 136 +- .../openstack4j/api/telemetry/AlarmTests.java | 22 +- .../api/telemetry/CapabilitiesTest.java | 8 +- .../openstack4j/api/telemetry/EventTests.java | 2 +- .../api/telemetry/MeterSampleTests.java | 23 +- .../api/telemetry/ResourceTest.java | 10 +- .../api/telemetry/SampleTests.java | 10 +- .../api/trove/DBDatabaseServiceImplTest.java | 10 +- .../api/trove/DBDatastoreServiceImplTest.java | 16 +- .../api/trove/DBFlavorServiceImplTest.java | 18 +- .../api/trove/DBInstanceServiceImplTest.java | 7 +- .../api/trove/DBUserServiceImplTest.java | 8 +- .../api/workflow/CronTriggerTest.java | 6 +- .../openstack/common/ServiceTypeTest.java | 80 +- .../common/TelemetryDateDeserializerTest.java | 91 +- .../internal/MicroVersionedServiceTest.java | 4 - core-test/src/main/resources/all.xml | 6 +- .../resources/compute/aggregate_create.json | 9 +- .../main/resources/compute/aggregates.json | 66 +- .../compute/ext/instance_action.json | 50 +- .../compute/ext/instance_actions.json | 40 +- .../main/resources/compute/extensions.json | 28 +- .../src/main/resources/compute/flavor.json | 42 +- .../main/resources/compute/flavor_create.json | 24 +- .../src/main/resources/compute/flavors.json | 124 +- .../resources/compute/flavors_detailed.json | 84 +- .../main/resources/compute/floatingips.json | 68 +- .../main/resources/compute/host_describe.json | 58 +- .../main/resources/compute/migrations.json | 60 +- .../compute/server_console_output.json | 2 +- .../main/resources/compute/server_create.json | 40 +- .../resources/compute/server_evacuate.json | 2 +- .../src/main/resources/compute/servers.json | 104 +- .../src/main/resources/compute/services.json | 74 +- .../src/main/resources/compute/tags.json | 5 +- .../src/main/resources/heat/abandon.json | 93 +- core-test/src/main/resources/heat/adopt.json | 18 +- .../main/resources/identity/v2/access.json | 507 +++--- .../resources/identity/v2/extensions.json | 117 +- .../resources/identity/v2/member-role.json | 8 +- .../src/main/resources/identity/v2/roles.json | 44 +- .../resources/identity/v2/tenant-admin.json | 12 +- .../resources/identity/v2/tenant-users.json | 29 +- .../main/resources/identity/v2/tenants.json | 40 +- .../src/main/resources/identity/v2/users.json | 107 +- .../v3/authv3_authorizationerror.json | 10 +- .../resources/identity/v3/authv3_domain.json | 629 +++---- .../resources/identity/v3/authv3_token.json | 43 +- .../identity/v3/authv3_token_unscoped.json | 27 +- .../identity/v3/authv3_unscoped.json | 34 +- .../resources/identity/v3/create_user.json | 24 +- .../v3/credentials_update_response.json | 20 +- .../identity/v3/domains_create_response.json | 18 +- .../identity/v3/domains_update_response.json | 18 +- .../identity/v3/groups_create_response.json | 18 +- .../identity/v3/groups_getByName_empty.json | 12 +- .../identity/v3/groups_get_byId.json | 18 +- .../identity/v3/groups_update_response.json | 18 +- .../identity/v3/list_domain_user_roles.json | 26 +- .../identity/v3/list_project_user_roles.json | 26 +- .../identity/v3/list_user_groups.json | 48 +- .../identity/v3/list_user_projects.json | 56 +- .../identity/v3/policies_get_byId.json | 20 +- .../identity/v3/policies_update_response.json | 20 +- .../identity/v3/projects_create_response.json | 6 +- .../identity/v3/projects_getByName_empty.json | 12 +- .../main/resources/identity/v3/read_user.json | 30 +- .../identity/v3/regions_get_byId.json | 16 +- .../identity/v3/regions_update_response.json | 16 +- .../resources/identity/v3/roles_get_byId.json | 16 +- .../identity/v3/roles_grantRole_error.json | 10 +- .../resources/identity/v3/roles_list.json | 12 +- .../identity/v3/roles_multiple_entries.json | 4 +- .../identity/v3/roles_one_entry.json | 2 +- .../identity/v3/roles_revokeRole_error.json | 10 +- .../resources/identity/v3/roles_update.json | 16 +- .../identity/v3/services_get_byId.json | 20 +- .../identity/v3/services_update_response.json | 20 +- .../resources/identity/v3/update_user.json | 32 +- .../identity/v3/user_add_ToGroup_fail.json | 10 +- .../identity/v3/user_delete_fail.json | 10 +- .../resources/identity/v3/user_get_byId.json | 22 +- .../identity/v3/user_get_byName.json | 53 +- .../v3/user_get_byName_byDomainId.json | 32 +- .../user_get_byName_byDomainId_not_exist.json | 12 +- .../src/main/resources/identity/v3/users.json | 134 +- .../image/v2/image-with-locations.json | 17 +- .../src/main/resources/image/v2/images.json | 1 - .../magnum/baymodel_create_resp.json | 85 +- .../magnum/baymodel_get_all_resp.json | 97 +- .../src/main/resources/magnum/mservices.json | 22 +- .../src/main/resources/metering/alarms.json | 152 +- .../main/resources/murano/v1/deployments.json | 104 +- .../murano/v1/environment-rename.json | 14 +- .../main/resources/murano/v1/environment.json | 166 +- .../resources/murano/v1/environments.json | 30 +- .../resources/murano/v1/filtered_reports.json | 56 +- .../src/main/resources/murano/v1/reports.json | 146 +- .../src/main/resources/murano/v1/service.json | 63 +- .../main/resources/murano/v1/services.json | 224 +-- .../src/main/resources/murano/v1/session.json | 14 +- .../src/main/resources/network/agents.json | 529 +++--- .../resources/network/availability_zones.json | 14 +- .../resources/network/firewalls/firewall.json | 18 +- .../network/firewalls/firewallpolicies.json | 26 +- .../network/firewalls/firewallpolicy.json | 22 +- .../network/firewalls/firewallpolicyrule.json | 22 +- .../firewalls/firewallpolicyupdate.json | 20 +- .../network/firewalls/firewallrule.json | 34 +- .../network/firewalls/firewallrules.json | 38 +- .../network/firewalls/firewallruleupdate.json | 34 +- .../network/firewalls/firewalls.json | 22 +- .../network/firewalls/firewallupdate.json | 18 +- .../network/gbp/external_policies.json | 78 +- .../network/gbp/external_policy.json | 60 +- .../network/gbp/external_policy_update.json | 40 +- .../network/gbp/external_segment.json | 42 +- .../network/gbp/external_segment_update.json | 42 +- .../network/gbp/external_segments.json | 108 +- .../resources/network/gbp/l2_policies.json | 244 +-- .../main/resources/network/gbp/l2_policy.json | 24 +- .../network/gbp/l2_policy_update.json | 24 +- .../resources/network/gbp/l3_policies.json | 96 +- .../main/resources/network/gbp/l3_policy.json | 36 +- .../network/gbp/l3_policy_update.json | 36 +- .../main/resources/network/gbp/nat_pool.json | 22 +- .../network/gbp/nat_pool_update.json | 22 +- .../main/resources/network/gbp/nat_pools.json | 49 +- .../network/gbp/network_service_policies.json | 44 +- .../network/gbp/network_service_policy.json | 31 +- .../gbp/network_service_policy_update.json | 21 +- .../resources/network/gbp/policy_action.json | 18 +- .../network/gbp/policy_action_update.json | 18 +- .../resources/network/gbp/policy_actions.json | 40 +- .../network/gbp/policy_classifier.json | 20 +- .../network/gbp/policy_classifier_update.json | 20 +- .../network/gbp/policy_classifiers.json | 44 +- .../resources/network/gbp/policy_rule.json | 24 +- .../network/gbp/policy_rule_set.json | 35 +- .../network/gbp/policy_rule_set_update.json | 35 +- .../network/gbp/policy_rule_sets.json | 362 ++-- .../network/gbp/policy_rule_update.json | 24 +- .../resources/network/gbp/policy_rules.json | 244 +-- .../resources/network/gbp/policy_target.json | 18 +- .../network/gbp/policy_target_group.json | 71 +- .../gbp/policy_target_group_update.json | 71 +- .../network/gbp/policy_target_groups.json | 467 +++-- .../network/gbp/policy_target_update.json | 18 +- .../resources/network/gbp/policy_targets.json | 184 +- .../src/main/resources/network/lbpool.json | 34 +- .../main/resources/network/lbpool_update.json | 34 +- .../src/main/resources/network/lbpools.json | 44 +- .../src/main/resources/network/lbpoolsv2.json | 2 - .../src/main/resources/network/lbpoolv2.json | 1 - .../resources/network/lbpoolv2_update.json | 1 - .../main/resources/network/listenersv2.json | 2 - .../resources/network/loadbalancersv2.json | 1 - .../resources/network/loadbalancerv2.json | 1 - .../network/loadbalancerv2_update.json | 1 - .../resources/network/network-external.json | 46 +- .../src/main/resources/network/network.json | 44 +- .../main/resources/network/network_zone.json | 42 +- .../resources/network/networks_filtered.json | 32 +- .../main/resources/network/port_external.json | 32 +- .../resources/network/ports_external.json | 94 +- .../network/sfc/flow_classifier.json | 38 +- .../network/sfc/flow_classifiers.json | 80 +- .../resources/network/sfc/port_chain.json | 26 +- .../resources/network/sfc/port_chains.json | 60 +- .../main/resources/network/sfc/port_pair.json | 20 +- .../network/sfc/port_pair_group.json | 22 +- .../network/sfc/port_pair_groups.json | 52 +- .../resources/network/sfc/port_pairs.json | 48 +- .../main/resources/network/subnet_ipv6.json | 56 +- .../src/main/resources/octavia/lbpoolsv2.json | 2 - .../src/main/resources/octavia/lbpoolv2.json | 1 - .../resources/octavia/lbpoolv2_update.json | 1 - .../main/resources/octavia/listenersv2.json | 2 - .../resources/octavia/loadbalancersv2.json | 1 - .../resources/octavia/loadbalancerv2.json | 1 - .../octavia/loadbalancerv2_update.json | 1 - .../resources/sahara/cluster_create_req.json | 49 +- .../resources/sahara/cluster_create_resp.json | 208 +-- .../src/main/resources/senlin/v1/action.json | 42 +- .../src/main/resources/senlin/v1/actions.json | 182 +- .../main/resources/senlin/v1/build_info.json | 14 +- .../src/main/resources/senlin/v1/cluster.json | 44 +- .../resources/senlin/v1/cluster_policies.json | 40 +- .../resources/senlin/v1/cluster_policy.json | 18 +- .../main/resources/senlin/v1/clusters.json | 220 +-- .../src/main/resources/senlin/v1/event.json | 28 +- .../src/main/resources/senlin/v1/events.json | 566 +++--- .../src/main/resources/senlin/v1/node.json | 40 +- .../src/main/resources/senlin/v1/nodes.json | 124 +- .../main/resources/senlin/v1/policies.json | 402 ++--- .../src/main/resources/senlin/v1/policy.json | 44 +- .../main/resources/senlin/v1/policy_type.json | 78 +- .../resources/senlin/v1/policy_types.json | 40 +- .../src/main/resources/senlin/v1/profile.json | 176 +- .../resources/senlin/v1/profile_type.json | 88 +- .../resources/senlin/v1/profile_types.json | 22 +- .../main/resources/senlin/v1/profiles.json | 718 ++++---- .../main/resources/senlin/v1/receiver.json | 46 +- .../main/resources/senlin/v1/receivers.json | 214 +-- .../main/resources/senlin/v1/resp_action.json | 2 +- .../src/main/resources/senlin/version.json | 20 +- .../main/resources/storage/containers.json | 20 +- .../main/resources/storage/ext/services.json | 38 +- .../src/main/resources/storage/v1/volume.json | 56 +- .../resources/storage/v1/volumebackup.json | 47 +- .../v1/volumebackup_create_response.json | 25 +- .../v1/volumebackup_from_snapshot.json | 17 +- .../resources/storage/v1/volumebackups.json | 141 +- .../storage/v1/volumebackups_filtered.json | 49 +- .../storage/v1/volumes-bootable.json | 101 +- .../main/resources/storage/v1/volumes.json | 142 +- .../storage/v1/volumes_filtered.json | 84 +- .../resources/storage/v1/volumesnapshots.json | 48 +- .../storage/v1/volumesnapshots_filtered.json | 25 +- .../storage/v2/createVolume-muitiattach.json | 20 +- .../storage/v2/createVolumeTypeResponse.json | 12 +- .../src/main/resources/storage/v2/volume.json | 79 +- .../src/main/resources/tacker/v1/vim.json | 58 +- .../src/main/resources/tacker/v1/vims.json | 62 +- .../main/resources/tacker/v1/vnf-create.json | 37 +- .../src/main/resources/tacker/v1/vnf-get.json | 35 +- .../main/resources/tacker/v1/vnf-update.json | 36 +- .../src/main/resources/tacker/v1/vnfd.json | 34 +- .../src/main/resources/tacker/v1/vnfs.json | 39 +- .../src/main/resources/telemetry/alarm.json | 56 +- .../src/main/resources/telemetry/alarms.json | 430 +++-- .../resources/telemetry/capabilities.json | 56 +- .../main/resources/telemetry/resource.json | 64 +- .../main/resources/telemetry/resources.json | 126 +- .../src/main/resources/telemetry/sample.json | 60 +- .../src/main/resources/trove/datastore.json | 53 +- .../resources/trove/datastore_version.json | 3 +- .../src/main/resources/trove/datastores.json | 4 +- .../main/resources/trove/instance_flavor.json | 22 +- .../resources/trove/instance_flavors.json | 42 +- .../main/resources/workflow/action_def.json | 5 +- .../resources/workflow/action_def_create.json | 5 +- .../main/resources/workflow/action_defs.json | 5 +- .../main/resources/workflow/cron_trigger.json | 2 +- .../workflow/cron_trigger_create.json | 2 +- .../main/resources/workflow/task_exec.json | 8 +- .../main/resources/workflow/task_execs.json | 16 +- .../src/main/resources/workflow/wb_def.json | 5 +- .../resources/workflow/wb_def_create.json | 5 +- .../src/main/resources/workflow/wb_defs.json | 5 +- .../src/main/resources/workflow/wf_def.json | 5 +- .../resources/workflow/wf_def_create.json | 5 +- .../src/main/resources/workflow/wf_defs.json | 5 +- .../resources/workflow/wf_exec_create.json | 4 +- .../src/main/resources/workflow/wf_execs.json | 5 +- core/pom.xml | 412 ++--- .../java/org/openstack4j/api/APIProvider.java | 32 +- .../main/java/org/openstack4j/api/Apis.java | 50 +- .../java/org/openstack4j/api/Builders.java | 93 +- .../api/EndpointTokenProvider.java | 30 +- .../java/org/openstack4j/api/OSClient.java | 53 +- .../api/artifact/ArtifactService.java | 2 - .../ToscaTemplatesArtifactService.java | 1 - .../api/barbican/BarbicanService.java | 2 +- .../api/barbican/ContainerService.java | 3 + .../api/barbican/SecretService.java | 6 +- .../openstack4j/api/client/CloudProvider.java | 3 +- .../api/client/IOSClientBuilder.java | 25 +- .../api/compute/ComputeFloatingIPService.java | 150 +- .../api/compute/ComputeImageService.java | 121 +- .../compute/ComputeSecurityGroupService.java | 129 +- .../api/compute/ComputeService.java | 232 ++- .../api/compute/FlavorService.java | 271 +-- .../api/compute/HostAggregateService.java | 107 +- .../openstack4j/api/compute/HostService.java | 31 +- .../api/compute/KeypairService.java | 71 +- .../api/compute/QuotaSetService.java | 149 +- .../api/compute/ServerGroupService.java | 68 +- .../api/compute/ServerService.java | 158 +- .../api/compute/ServerTagService.java | 24 +- .../ext/FloatingIPDNSDomainService.java | 26 +- .../ext/FloatingIPDNSEntryService.java | 46 +- .../api/compute/ext/FloatingIPDNSService.java | 8 +- .../compute/ext/InstanceActionsService.java | 15 +- .../api/compute/ext/InterfaceService.java | 27 +- .../api/compute/ext/MigrationService.java | 14 +- .../api/compute/ext/ServicesService.java | 20 +- .../api/compute/ext/ZoneService.java | 32 +- .../openstack4j/api/dns/v2/DNSService.java | 25 +- .../api/dns/v2/RecordsetService.java | 112 +- .../openstack4j/api/dns/v2/ZoneService.java | 4 +- .../api/exceptions/ApiNotFoundException.java | 54 +- .../exceptions/AuthenticationException.java | 16 +- .../exceptions/ClientResponseException.java | 62 +- .../api/exceptions/ConnectionException.java | 10 +- .../ContainerNotEmptyException.java | 2 +- .../api/exceptions/OS4JException.java | 8 +- .../RegionEndpointNotFoundException.java | 7 +- .../api/exceptions/ResponseException.java | 60 +- .../exceptions/ServerResponseException.java | 60 +- .../api/exceptions/StatusCode.java | 205 ++- .../api/gbp/ExternalPolicyService.java | 29 +- .../api/gbp/ExternalSegmentService.java | 27 +- .../org/openstack4j/api/gbp/GbpService.java | 50 +- .../org/openstack4j/api/gbp/GroupService.java | 29 +- .../openstack4j/api/gbp/L2policyService.java | 27 +- .../openstack4j/api/gbp/L3policyService.java | 27 +- .../openstack4j/api/gbp/NatPoolService.java | 25 +- .../api/gbp/NetworkPolicyService.java | 10 +- .../api/gbp/PolicyActionService.java | 25 +- .../api/gbp/PolicyClassifierService.java | 25 +- .../api/gbp/PolicyRuleService.java | 25 +- .../api/gbp/PolicyRuleSetService.java | 22 +- .../api/gbp/PolicyTargetService.java | 43 +- .../api/gbp/ServiceProfileService.java | 3 +- .../api/gbp/ServicechainService.java | 3 +- .../openstack4j/api/heat/EventsService.java | 69 +- .../org/openstack4j/api/heat/HeatService.java | 70 +- .../api/heat/ResourcesService.java | 127 +- .../api/heat/SoftwareConfigService.java | 12 +- .../openstack4j/api/heat/StackService.java | 187 +- .../openstack4j/api/heat/TemplateService.java | 58 +- .../api/identity/EndpointURLResolver.java | 8 +- .../api/identity/v2/IdentityService.java | 90 +- .../api/identity/v2/RoleService.java | 189 +- .../identity/v2/ServiceManagerService.java | 126 +- .../api/identity/v2/TenantService.java | 115 +- .../api/identity/v2/UserService.java | 26 +- .../api/identity/v3/CredentialService.java | 11 +- .../api/identity/v3/DomainService.java | 11 +- .../api/identity/v3/GroupService.java | 22 +- .../api/identity/v3/IdentityService.java | 11 +- .../api/identity/v3/PolicyService.java | 14 +- .../api/identity/v3/ProjectService.java | 123 +- .../api/identity/v3/RegionService.java | 11 +- .../api/identity/v3/RoleService.java | 55 +- .../identity/v3/ServiceEndpointService.java | 26 +- .../api/identity/v3/TokenService.java | 18 +- .../api/identity/v3/UserService.java | 207 ++- .../openstack4j/api/image/ImageService.java | 47 +- .../api/image/v2/ImageService.java | 28 +- .../openstack4j/api/image/v2/TaskService.java | 5 + .../openstack4j/api/magnum/MagnumService.java | 160 +- .../api/manila/QuotaSetService.java | 46 +- .../api/manila/SchedulerStatsService.java | 1 + .../api/manila/SecurityServiceService.java | 2 +- .../api/manila/ShareInstanceService.java | 2 +- .../api/manila/ShareNetworkService.java | 6 +- .../openstack4j/api/manila/ShareService.java | 6 +- .../api/manila/ShareSnapshotService.java | 4 +- .../api/manila/ShareTypeService.java | 6 +- .../openstack4j/api/manila/SharesService.java | 17 +- .../api/murano/v1/MuranoActionService.java | 19 +- .../murano/v1/MuranoApplicationService.java | 21 +- .../murano/v1/MuranoDeploymentService.java | 5 +- .../murano/v1/MuranoEnvironmentService.java | 1 + .../api/murano/v1/MuranoSessionService.java | 6 +- .../networking/AvailabilityZoneService.java | 11 +- .../api/networking/NetFloatingIPService.java | 124 +- .../api/networking/NetworkService.java | 105 +- .../api/networking/NetworkingService.java | 19 +- .../api/networking/PortService.java | 95 +- .../api/networking/RouterService.java | 162 +- .../networking/SecurityGroupRuleService.java | 84 +- .../api/networking/SecurityGroupService.java | 8 +- .../api/networking/SubnetService.java | 22 +- .../api/networking/ext/AgentService.java | 19 +- .../api/networking/ext/FirewallAsService.java | 72 +- .../networking/ext/FirewallPolicyService.java | 63 +- .../networking/ext/FirewallRuleService.java | 43 +- .../api/networking/ext/FirewallService.java | 41 +- .../networking/ext/FlowClassifierService.java | 6 +- .../networking/ext/HealthMonitorService.java | 25 +- .../ext/HealthMonitorV2Service.java | 8 +- .../api/networking/ext/LbPoolService.java | 169 +- .../api/networking/ext/LbPoolV2Service.java | 28 +- .../api/networking/ext/LbaasV2Service.java | 1 + .../api/networking/ext/ListenerV2Service.java | 2 + .../networking/ext/LoadBalancerService.java | 5 +- .../networking/ext/LoadBalancerV2Service.java | 10 +- .../api/networking/ext/MemberService.java | 24 +- .../api/networking/ext/NetQuotaService.java | 27 +- .../api/networking/ext/PortChainService.java | 13 +- .../networking/ext/PortPairGroupService.java | 6 +- .../api/networking/ext/PortPairService.java | 7 +- .../ext/ServiceFunctionChainService.java | 31 +- .../api/networking/ext/VipService.java | 21 +- .../api/octavia/HealthMonitorV2Service.java | 6 +- .../api/octavia/LbPoolV2Service.java | 28 +- .../api/octavia/ListenerV2Service.java | 2 + .../api/octavia/LoadBalancerV2Service.java | 9 +- .../api/octavia/OctaviaService.java | 2 +- .../api/sahara/ClusterService.java | 37 +- .../api/sahara/ClusterTemplateService.java | 21 +- .../api/sahara/DataSourceService.java | 19 +- .../api/sahara/JobBinaryInternalService.java | 39 +- .../api/sahara/JobBinaryService.java | 38 +- .../api/sahara/JobExecutionService.java | 18 +- .../openstack4j/api/sahara/JobService.java | 33 +- .../api/sahara/NodeGroupTemplateService.java | 21 +- .../api/sahara/SaharaImageService.java | 37 +- .../api/sahara/SaharaPluginService.java | 30 +- .../openstack4j/api/sahara/SaharaService.java | 6 +- .../api/senlin/SenlinActionService.java | 32 +- .../api/senlin/SenlinBuildInfoService.java | 15 +- .../senlin/SenlinClusterPolicyService.java | 35 +- .../api/senlin/SenlinClusterService.java | 100 +- .../api/senlin/SenlinEventService.java | 32 +- .../api/senlin/SenlinNodeService.java | 115 +- .../api/senlin/SenlinPolicyService.java | 88 +- .../api/senlin/SenlinPolicyTypeService.java | 32 +- .../api/senlin/SenlinProfileService.java | 94 +- .../api/senlin/SenlinProfileTypeService.java | 30 +- .../api/senlin/SenlinReceiverService.java | 66 +- .../openstack4j/api/senlin/SenlinService.java | 184 +- .../api/senlin/SenlinVersionService.java | 15 +- .../api/senlin/SenlinWebHookService.java | 15 +- .../api/storage/BlockQuotaSetService.java | 26 +- .../api/storage/BlockStorageService.java | 90 +- .../api/storage/BlockVolumeBackupService.java | 111 +- .../api/storage/BlockVolumeService.java | 335 ++-- .../storage/BlockVolumeSnapshotService.java | 104 +- .../storage/BlockVolumeTransferService.java | 38 +- .../api/storage/CinderZoneService.java | 12 +- .../storage/ObjectStorageAccountService.java | 26 +- .../ObjectStorageContainerService.java | 60 +- .../storage/ObjectStorageObjectService.java | 105 +- .../api/storage/ObjectStorageService.java | 12 +- .../ext/BlockStorageServiceService.java | 20 +- .../openstack4j/api/tacker/TackerService.java | 9 +- .../api/tacker/TackerServiceImpl.java | 25 +- .../openstack4j/api/tacker/VimService.java | 55 +- .../openstack4j/api/tacker/VnfService.java | 62 +- .../openstack4j/api/tacker/VnfdService.java | 53 +- .../api/telemetry/AlarmAodhService.java | 1 - .../api/telemetry/AlarmService.java | 65 +- .../api/telemetry/EventService.java | 4 +- .../api/telemetry/MeterService.java | 96 +- .../api/telemetry/ResourceService.java | 4 +- .../api/telemetry/SampleService.java | 16 +- .../api/telemetry/TelemetryService.java | 10 +- .../api/trove/DatabaseService.java | 3 + .../api/trove/DatastoreService.java | 4 + .../api/trove/InstanceFlavorService.java | 2 + .../api/trove/InstanceService.java | 4 +- .../openstack4j/api/trove/TroveService.java | 1 - .../openstack4j/api/trove/UserService.java | 6 + .../org/openstack4j/api/types/Facing.java | 41 +- .../openstack4j/api/types/ServiceType.java | 84 +- .../api/workflow/ActionDefinitionService.java | 4 +- .../workflow/WorkbookDefinitionService.java | 4 +- .../workflow/WorkflowDefinitionService.java | 4 +- .../api/workflow/WorkflowService.java | 26 +- .../org/openstack4j/common/Buildable.java | 55 +- .../org/openstack4j/common/RestService.java | 2 +- .../core/transport/ClientConstants.java | 2 +- .../openstack4j/core/transport/Config.java | 46 +- .../core/transport/ExecutionOptions.java | 19 +- .../openstack4j/core/transport/Handle.java | 123 +- .../core/transport/HttpEntityHandler.java | 2 +- .../core/transport/HttpExceptionHandler.java | 10 +- .../core/transport/HttpExecutorService.java | 28 +- .../core/transport/HttpMethod.java | 4 +- .../core/transport/HttpRequest.java | 739 ++++---- .../core/transport/HttpResponse.java | 121 +- .../openstack4j/core/transport/ListType.java | 4 +- .../core/transport/ObjectMapperSingleton.java | 8 +- .../core/transport/PropagateResponse.java | 5 +- .../openstack4j/core/transport/ProxyHost.java | 26 +- .../core/transport/UntrustedSSL.java | 23 +- .../EndpointURIFromRequestFunction.java | 11 +- .../ParseActionResponseFromJsonMap.java | 33 +- .../functions/ResponseToActionResponse.java | 7 +- .../core/transport/internal/HttpExecutor.java | 8 +- .../transport/internal/HttpLoggingFilter.java | 11 +- .../internal/OSBadBooleanDeserializer.java | 131 +- .../propagation/PropagateOnStatus.java | 12 +- .../org/openstack4j/model/ModelEntity.java | 2 +- .../org/openstack4j/model/ResourceEntity.java | 24 +- .../openstack4j/model/artifact/Artifact.java | 2 - .../model/artifact/ArtifactType.java | 3 +- .../openstack4j/model/artifact/Artifacts.java | 2 - .../artifact/ToscaTemplatesArtifact.java | 1 - .../ToscaTemplatesArtifactBuilder.java | 2 +- .../builder/ContainerCreateBuilder.java | 3 + .../model/common/ActionResponse.java | 78 +- .../openstack4j/model/common/BaseFilter.java | 18 +- .../model/common/BasicResource.java | 26 +- .../openstack4j/model/common/DLPayload.java | 18 +- .../openstack4j/model/common/Extension.java | 64 +- .../openstack4j/model/common/IdEntity.java | 8 +- .../openstack4j/model/common/Identifier.java | 23 +- .../org/openstack4j/model/common/Link.java | 32 +- .../org/openstack4j/model/common/Payload.java | 38 +- .../openstack4j/model/common/Payloads.java | 68 +- .../model/common/QuotaDetails.java | 13 +- .../openstack4j/model/common/Resource.java | 26 +- .../common/builder/BasicResourceBuilder.java | 60 +- .../model/common/builder/LinkBuilder.java | 34 +- .../model/common/builder/ResourceBuilder.java | 44 +- .../common/functions/IdEntityToString.java | 7 +- .../functions/RangesToHeaderNameValue.java | 13 +- .../model/common/header/HeaderNameValue.java | 8 +- .../model/common/header/HeaderOption.java | 4 +- .../model/common/header/IfCondition.java | 52 +- .../model/common/header/Range.java | 26 +- .../model/common/payloads/FilePayload.java | 107 +- .../common/payloads/InputStreamPayload.java | 93 +- .../model/common/payloads/URLPayload.java | 101 +- .../LatestServiceVersionResolver.java | 6 +- .../resolvers/ServiceVersionResolver.java | 18 +- .../StableServiceVersionResolver.java | 6 +- .../model/compute/AbsoluteLimit.java | 402 ++--- .../org/openstack4j/model/compute/Action.java | 86 +- .../openstack4j/model/compute/Address.java | 38 +- .../openstack4j/model/compute/Addresses.java | 48 +- .../model/compute/BDMDestType.java | 12 +- .../model/compute/BDMSourceType.java | 9 +- .../compute/BlockDeviceMappingCreate.java | 1 - .../org/openstack4j/model/compute/Fault.java | 46 +- .../org/openstack4j/model/compute/Flavor.java | 162 +- .../model/compute/FlavorAccess.java | 26 +- .../openstack4j/model/compute/FloatingIP.java | 63 +- .../model/compute/HostAggregate.java | 108 +- .../model/compute/HostResource.java | 34 +- .../model/compute/HostResourceBody.java | 10 +- .../openstack4j/model/compute/IPProtocol.java | 39 +- .../org/openstack4j/model/compute/Image.java | 174 +- .../model/compute/InstanceAction.java | 2 +- .../model/compute/InterfaceAttachment.java | 32 +- .../openstack4j/model/compute/Keypair.java | 132 +- .../org/openstack4j/model/compute/Limits.java | 30 +- .../model/compute/NetworkCreate.java | 33 +- .../model/compute/Personality.java | 61 +- .../openstack4j/model/compute/PortState.java | 27 +- .../openstack4j/model/compute/QuotaSet.java | 140 +- .../model/compute/QuotaSetUpdate.java | 4 +- .../openstack4j/model/compute/RateLimit.java | 100 +- .../openstack4j/model/compute/RebootType.java | 14 +- .../model/compute/SecGroupExtension.java | 255 ++- .../model/compute/SecurityGroup.java | 2 +- .../org/openstack4j/model/compute/Server.java | 570 +++--- .../model/compute/ServerCreate.java | 307 ++-- .../model/compute/ServerGroup.java | 54 +- .../model/compute/ServerPassword.java | 7 +- .../model/compute/ServerUpdateOptions.java | 20 +- .../model/compute/SimpleTenantUsage.java | 214 +-- .../openstack4j/model/compute/VNCConsole.java | 97 +- .../model/compute/VolumeAttachment.java | 52 +- .../model/compute/actions/BackupOptions.java | 32 +- .../compute/actions/BaseActionOptions.java | 19 +- .../compute/actions/EvacuateOptions.java | 38 +- .../compute/actions/LiveMigrateOptions.java | 34 +- .../model/compute/actions/RebuildOptions.java | 34 +- .../builder/BlockDeviceMappingBuilder.java | 122 +- .../compute/builder/ComputeBuilders.java | 2 - .../model/compute/builder/FlavorBuilder.java | 90 +- .../compute/builder/FloatingIPBuilder.java | 52 +- .../builder/QuotaSetUpdateBuilder.java | 4 +- .../builder/SecurityGroupRuleBuilder.java | 84 +- .../compute/builder/ServerCreateBuilder.java | 54 +- .../model/compute/ext/AvailabilityZone.java | 12 +- .../model/compute/ext/DNSEntry.java | 20 +- .../model/compute/ext/DNSRecordType.java | 76 +- .../model/compute/ext/DomainEntry.java | 35 +- .../compute/ext/HypervisorStatistics.java | 168 +- .../model/compute/ext/Migration.java | 32 +- .../model/compute/ext/MigrationsFilter.java | 24 +- .../model/compute/ext/Service.java | 8 +- .../org/openstack4j/model/dns/v2/Action.java | 31 +- .../openstack4j/model/dns/v2/Recordset.java | 148 +- .../org/openstack4j/model/dns/v2/Status.java | 31 +- .../openstack4j/model/dns/v2/ZoneType.java | 31 +- .../dns/v2/builder/NameserverBuilder.java | 16 +- .../dns/v2/builder/RecordsetBuilder.java | 152 +- .../model/dns/v2/builder/ZoneBuilder.java | 176 +- .../org/openstack4j/model/gbp/Direction.java | 11 +- .../openstack4j/model/gbp/ExternalPolicy.java | 9 +- .../model/gbp/ExternalPolicyCreate.java | 17 +- .../openstack4j/model/gbp/ExternalRoutes.java | 5 +- .../model/gbp/ExternalSegment.java | 7 +- .../openstack4j/model/gbp/IPVersionType.java | 10 +- .../org/openstack4j/model/gbp/L2Policy.java | 6 +- .../org/openstack4j/model/gbp/L3Policy.java | 8 +- .../org/openstack4j/model/gbp/NatPool.java | 2 +- .../model/gbp/NetworkServiceParamType.java | 10 +- .../model/gbp/NetworkServiceParamValue.java | 10 +- .../model/gbp/NetworkServicePolicy.java | 6 +- .../openstack4j/model/gbp/PolicyAction.java | 18 +- .../model/gbp/PolicyActionUpdate.java | 6 +- .../model/gbp/PolicyClassifier.java | 4 +- .../model/gbp/PolicyClassifierUpdate.java | 5 +- .../org/openstack4j/model/gbp/PolicyRule.java | 8 +- .../openstack4j/model/gbp/PolicyRuleSet.java | 6 +- .../openstack4j/model/gbp/PolicyTarget.java | 2 +- .../model/gbp/PolicyTargetGroup.java | 6 +- .../model/gbp/PolicyTargetGroupCreate.java | 12 +- .../org/openstack4j/model/gbp/Protocol.java | 12 +- .../gbp/builder/ExternalPolicyBuilder.java | 14 +- .../gbp/builder/ExternalRoutesBuilder.java | 6 +- .../gbp/builder/ExternalSegmentBuilder.java | 15 +- .../model/gbp/builder/L2PolicyBuilder.java | 12 +- .../model/gbp/builder/L3PolicyBuilder.java | 13 +- .../model/gbp/builder/NatPoolBuilder.java | 10 +- .../builder/NetworkServicePolicyBuilder.java | 3 + .../builder/PolicyActionCreateBuilder.java | 6 +- .../builder/PolicyActionUpdateBuilder.java | 7 +- .../gbp/builder/PolicyClassifierBuilder.java | 9 +- .../PolicyClassifierUpdateBuilder.java | 9 +- .../model/gbp/builder/PolicyRuleBuilder.java | 11 +- .../gbp/builder/PolicyRuleSetBuilder.java | 10 +- .../gbp/builder/PolicyTargetBuilder.java | 7 +- .../gbp/builder/PolicyTargetGroupBuilder.java | 15 +- .../model/heat/AdoptStackData.java | 8 +- .../model/heat/BaseStackCreateUpdate.java | 17 +- .../org/openstack4j/model/heat/Event.java | 148 +- .../org/openstack4j/model/heat/Resource.java | 136 +- .../model/heat/ResourceHealth.java | 4 +- .../model/heat/SoftwareConfig.java | 52 +- .../org/openstack4j/model/heat/Stack.java | 191 +- .../openstack4j/model/heat/StackCreate.java | 11 +- .../openstack4j/model/heat/StackUpdate.java | 2 +- .../org/openstack4j/model/heat/Template.java | 35 +- .../model/heat/TemplateResponse.java | 3 +- .../heat/builder/SoftwareConfigBuilder.java | 40 +- .../heat/builder/StackUpdateBuilder.java | 17 +- .../model/heat/builder/TemplateBuilder.java | 40 +- .../openstack4j/model/identity/AuthStore.java | 60 +- .../model/identity/AuthVersion.java | 6 +- .../openstack4j/model/identity/v2/Access.java | 147 +- .../model/identity/v2/Endpoint.java | 103 +- .../openstack4j/model/identity/v2/Role.java | 62 +- .../model/identity/v2/Service.java | 48 +- .../model/identity/v2/ServiceEndpoint.java | 66 +- .../openstack4j/model/identity/v2/Tenant.java | 65 +- .../model/identity/v2/TenantUser.java | 8 +- .../openstack4j/model/identity/v2/Token.java | 42 +- .../model/identity/v2/TokenV2.java | 12 +- .../openstack4j/model/identity/v2/User.java | 60 +- .../identity/v2/builder/EndpointBuilder.java | 108 +- .../identity/v2/builder/RoleBuilder.java | 52 +- .../identity/v2/builder/ServiceBuilder.java | 32 +- .../v2/builder/ServiceEndpointBuilder.java | 56 +- .../identity/v2/builder/TenantBuilder.java | 42 +- .../identity/v2/builder/UserBuilder.java | 85 +- .../model/identity/v3/Authentication.java | 4 +- .../model/identity/v3/Credential.java | 4 +- .../openstack4j/model/identity/v3/Domain.java | 6 +- .../model/identity/v3/Endpoint.java | 6 +- .../openstack4j/model/identity/v3/Group.java | 6 +- .../openstack4j/model/identity/v3/Policy.java | 4 +- .../model/identity/v3/Project.java | 19 +- .../openstack4j/model/identity/v3/Role.java | 10 +- .../model/identity/v3/RoleAssignment.java | 6 +- .../model/identity/v3/Service.java | 6 +- .../openstack4j/model/identity/v3/Tenant.java | 1 - .../openstack4j/model/identity/v3/Token.java | 7 +- .../openstack4j/model/identity/v3/User.java | 4 +- .../v3/builder/CredentialBuilder.java | 6 +- .../identity/v3/builder/DomainBuilder.java | 6 +- .../identity/v3/builder/EndpointBuilder.java | 8 +- .../identity/v3/builder/GroupBuilder.java | 6 +- .../v3/builder/IdentityV3Builders.java | 2 - .../identity/v3/builder/PolicyBuilder.java | 6 +- .../identity/v3/builder/ProjectBuilder.java | 116 +- .../identity/v3/builder/RoleBuilder.java | 8 +- .../identity/v3/builder/ServiceBuilder.java | 6 +- .../identity/v3/builder/UserBuilder.java | 9 +- .../openstack4j/model/image/CachedImage.java | 5 - .../model/image/ContainerFormat.java | 92 +- .../openstack4j/model/image/DiskFormat.java | 118 +- .../org/openstack4j/model/image/Image.java | 27 +- .../openstack4j/model/image/ImageMember.java | 30 +- .../openstack4j/model/image/StoreType.java | 46 +- .../model/image/builder/ImageBuilder.java | 145 +- .../model/image/v2/CachedImage.java | 6 +- .../model/image/v2/ContainerFormat.java | 8 +- .../model/image/v2/DiskFormat.java | 6 +- .../org/openstack4j/model/image/v2/Image.java | 20 +- .../model/image/v2/ImageUpdate.java | 2 + .../openstack4j/model/image/v2/Member.java | 10 +- .../org/openstack4j/model/image/v2/Task.java | 27 +- .../model/image/v2/builder/ImageBuilder.java | 5 +- .../model/image/v2/builder/TaskBuilder.java | 3 +- .../org/openstack4j/model/magnum/Bay.java | 240 +-- .../openstack4j/model/magnum/BayBuilder.java | 172 +- .../openstack4j/model/magnum/Baymodel.java | 131 +- .../model/magnum/BaymodelBuilder.java | 5 +- .../openstack4j/model/magnum/Carequest.java | 4 +- .../openstack4j/model/magnum/Certificate.java | 10 +- .../model/magnum/CertificateBuilder.java | 4 +- .../org/openstack4j/model/magnum/Cluster.java | 26 +- .../model/magnum/ClusterBuilder.java | 4 +- .../model/magnum/Clustertemplate.java | 66 +- .../model/magnum/ClustertemplateBuilder.java | 4 +- .../openstack4j/model/magnum/Container.java | 22 +- .../model/magnum/ContainerBuilder.java | 4 +- .../openstack4j/model/magnum/Environment.java | 2 + .../org/openstack4j/model/magnum/Label.java | 2 +- .../openstack4j/model/magnum/Mservice.java | 114 +- .../model/magnum/MserviceBuilder.java | 51 +- .../org/openstack4j/model/magnum/Pod.java | 20 +- .../openstack4j/model/magnum/PodBuilder.java | 4 +- .../manila/SecurityServiceUpdateOptions.java | 9 +- .../openstack4j/model/manila/ShareServer.java | 1 + .../model/manila/ShareTypeAccess.java | 8 +- .../builder/SecurityServiceCreateBuilder.java | 8 + .../manila/builder/ShareCreateBuilder.java | 8 +- .../manila/builder/ShareManageBuilder.java | 3 +- .../builder/ShareNetworkCreateBuilder.java | 2 +- .../builder/ShareSnapshotCreateBuilder.java | 4 +- .../builder/ShareTypeCreateBuilder.java | 16 +- .../murano/v1/builder/EnvironmentBuilder.java | 1 - .../model/murano/v1/domain/ActionResult.java | 16 +- .../murano/v1/domain/AppCatalogSession.java | 2 +- .../model/murano/v1/domain/Application.java | 2 - .../model/murano/v1/domain/Deployment.java | 9 - .../murano/v1/domain/DeploymentResult.java | 4 - .../v1/domain/EnvironmentDescription.java | 4 - .../model/murano/v1/domain/Report.java | 9 - .../org/openstack4j/model/network/Agent.java | 5 +- .../model/network/AllowedAddressPair.java | 20 +- .../model/network/AttachInterfaceType.java | 4 +- .../model/network/AvailabilityZone.java | 33 +- .../model/network/ExternalGateway.java | 34 +- .../model/network/ExtraDhcpOptCreate.java | 3 +- .../openstack4j/model/network/FloatingIP.java | 196 +-- .../openstack4j/model/network/HostRoute.java | 26 +- .../org/openstack4j/model/network/IP.java | 20 +- .../model/network/IPVersionType.java | 57 +- .../model/network/Ipv6AddressMode.java | 54 +- .../openstack4j/model/network/Ipv6RaMode.java | 50 +- .../model/network/NetFloatingIP.java | 101 +- .../openstack4j/model/network/NetQuota.java | 20 +- .../openstack4j/model/network/Network.java | 128 +- .../model/network/NetworkType.java | 48 +- .../model/network/NetworkUpdate.java | 14 +- .../org/openstack4j/model/network/Pool.java | 22 +- .../org/openstack4j/model/network/Port.java | 122 +- .../org/openstack4j/model/network/Router.java | 73 +- .../model/network/RouterInterface.java | 40 +- .../model/network/SecurityGroup.java | 36 +- .../model/network/SecurityGroupRule.java | 147 +- .../model/network/SecurityGroupUpdate.java | 2 +- .../org/openstack4j/model/network/State.java | 41 +- .../org/openstack4j/model/network/Subnet.java | 90 +- .../model/network/builder/AgentBuilder.java | 2 +- .../network/builder/ExtraDhcpOptBuilder.java | 5 +- .../network/builder/NetFloatingIPBuilder.java | 34 +- .../network/builder/NetQuotaBuilder.java | 22 +- .../builder/NetSecurityGroupBuilder.java | 42 +- .../builder/NetSecurityGroupRuleBuilder.java | 102 +- .../model/network/builder/NetworkBuilder.java | 90 +- .../network/builder/NetworkBuilders.java | 1 + .../network/builder/NetworkUpdateBuilder.java | 10 +- .../model/network/builder/PortBuilder.java | 198 +-- .../model/network/builder/RouterBuilder.java | 119 +- .../model/network/builder/SubnetBuilder.java | 38 +- .../model/network/ext/Ethertype.java | 3 +- .../model/network/ext/Firewall.java | 107 +- .../model/network/ext/FirewallPolicy.java | 116 +- .../network/ext/FirewallPolicyUpdate.java | 76 +- .../model/network/ext/FirewallRule.java | 183 +- .../model/network/ext/FirewallRuleUpdate.java | 139 +- .../model/network/ext/FirewallUpdate.java | 68 +- .../model/network/ext/FlowClassifier.java | 7 +- .../model/network/ext/HealthMonitor.java | 134 +- .../network/ext/HealthMonitorAssociate.java | 13 +- .../model/network/ext/HealthMonitorType.java | 11 +- .../network/ext/HealthMonitorUpdate.java | 106 +- .../model/network/ext/HealthMonitorV2.java | 23 +- .../network/ext/HealthMonitorV2Update.java | 15 +- .../model/network/ext/LbMethod.java | 6 +- .../model/network/ext/LbOperatingStatus.java | 3 +- .../openstack4j/model/network/ext/LbPool.java | 144 +- .../model/network/ext/LbPoolStats.java | 38 +- .../model/network/ext/LbPoolUpdate.java | 45 +- .../model/network/ext/LbPoolV2.java | 5 +- .../model/network/ext/LbPoolV2Update.java | 8 +- .../network/ext/LbProvisioningStatus.java | 3 +- .../model/network/ext/ListenerProtocol.java | 4 +- .../model/network/ext/ListenerV2.java | 3 +- .../model/network/ext/ListenerV2Update.java | 6 + .../model/network/ext/LoadBalancerV2.java | 12 +- .../network/ext/LoadBalancerV2Stats.java | 5 +- .../network/ext/LoadBalancerV2StatusTree.java | 2 + .../network/ext/LoadBalancerV2Update.java | 4 + .../openstack4j/model/network/ext/Member.java | 92 +- .../model/network/ext/MemberUpdate.java | 31 +- .../model/network/ext/MemberV2.java | 5 +- .../model/network/ext/MemberV2Update.java | 1 + .../model/network/ext/PortChain.java | 7 +- .../model/network/ext/PortPair.java | 5 +- .../model/network/ext/PortPairGroup.java | 9 +- .../model/network/ext/Protocol.java | 3 +- .../model/network/ext/SessionPersistence.java | 28 +- .../network/ext/SessionPersistenceType.java | 11 +- .../openstack4j/model/network/ext/Vip.java | 167 +- .../model/network/ext/VipUpdate.java | 84 +- .../network/ext/builder/FirewallBuilder.java | 97 +- .../ext/builder/FirewallPolicyBuilder.java | 90 +- .../builder/FirewallPolicyUpdateBuilder.java | 76 +- .../ext/builder/FirewallRuleBuilder.java | 154 +- .../builder/FirewallRuleUpdateBuilder.java | 152 +- .../ext/builder/FirewallUpdateBuilder.java | 81 +- .../ext/builder/FlowClassifierBuilder.java | 9 +- .../HealthMonitorAssociateBuilder.java | 15 +- .../ext/builder/HealthMonitorBuilder.java | 117 +- .../builder/HealthMonitorUpdateBuilder.java | 103 +- .../ext/builder/HealthMonitorV2Builder.java | 42 +- .../builder/HealthMonitorV2UpdateBuilder.java | 35 +- .../network/ext/builder/LbPoolBuilder.java | 112 +- .../ext/builder/LbPoolUpdateBuilder.java | 65 +- .../network/ext/builder/LbPoolV2Builder.java | 37 +- .../ext/builder/LbPoolV2UpdateBuilder.java | 47 +- .../ext/builder/ListenerV2Builder.java | 37 +- .../ext/builder/ListenerV2UpdateBuilder.java | 16 +- .../ext/builder/LoadBalancerV2Builder.java | 29 +- .../builder/LoadBalancerV2UpdateBuilder.java | 14 +- .../network/ext/builder/MemberBuilder.java | 88 +- .../ext/builder/MemberUpdateBuilder.java | 42 +- .../network/ext/builder/MemberV2Builder.java | 27 +- .../ext/builder/MemberV2UpdateBuilder.java | 9 +- .../network/ext/builder/PortChainBuilder.java | 10 +- .../network/ext/builder/PortPairBuilder.java | 10 +- .../ext/builder/PortPairGroupBuilder.java | 10 +- .../builder/SessionPersistenceBuilder.java | 33 +- .../model/network/ext/builder/VipBuilder.java | 178 +- .../network/ext/builder/VipUpdateBuilder.java | 106 +- .../ext/status/HealthMonitorV2Status.java | 6 +- .../network/ext/status/LbPoolV2Status.java | 7 + .../network/ext/status/ListenerV2Status.java | 5 + .../ext/status/LoadBalancerV2Status.java | 6 + .../network/ext/status/MemberV2Status.java | 6 + .../network/options/PortListOptions.java | 48 +- .../model/octavia/HealthMonitorType.java | 11 +- .../model/octavia/HealthMonitorV2.java | 25 +- .../model/octavia/HealthMonitorV2Update.java | 20 +- .../openstack4j/model/octavia/LbMethod.java | 6 +- .../model/octavia/LbOperatingStatus.java | 3 +- .../openstack4j/model/octavia/LbPoolV2.java | 5 +- .../model/octavia/LbPoolV2Update.java | 8 +- .../model/octavia/LbProvisioningStatus.java | 3 +- .../model/octavia/ListenerProtocol.java | 4 +- .../openstack4j/model/octavia/ListenerV2.java | 3 +- .../model/octavia/ListenerV2Update.java | 6 + .../model/octavia/LoadBalancerV2.java | 12 +- .../model/octavia/LoadBalancerV2Stats.java | 5 +- .../octavia/LoadBalancerV2StatusTree.java | 2 + .../model/octavia/LoadBalancerV2Update.java | 4 + .../openstack4j/model/octavia/MemberV2.java | 5 +- .../model/octavia/MemberV2Update.java | 1 + .../openstack4j/model/octavia/Protocol.java | 3 +- .../model/octavia/SessionPersistence.java | 28 +- .../model/octavia/SessionPersistenceType.java | 11 +- .../builder/HealthMonitorV2Builder.java | 44 +- .../builder/HealthMonitorV2UpdateBuilder.java | 39 +- .../octavia/builder/LbPoolV2Builder.java | 36 +- .../builder/LbPoolV2UpdateBuilder.java | 47 +- .../octavia/builder/ListenerV2Builder.java | 33 +- .../builder/ListenerV2UpdateBuilder.java | 16 +- .../builder/LoadBalancerV2Builder.java | 35 +- .../builder/LoadBalancerV2UpdateBuilder.java | 14 +- .../octavia/builder/MemberV2Builder.java | 25 +- .../builder/MemberV2UpdateBuilder.java | 9 +- .../builder/SessionPersistenceBuilder.java | 33 +- .../octavia/status/HealthMonitorV2Status.java | 6 +- .../model/octavia/status/LbPoolV2Status.java | 7 + .../octavia/status/ListenerV2Status.java | 5 + .../octavia/status/LoadBalancerV2Status.java | 6 + .../model/octavia/status/MemberV2Status.java | 6 + .../org/openstack4j/model/sahara/Cluster.java | 31 +- .../model/sahara/ClusterTemplate.java | 138 +- .../openstack4j/model/sahara/ConfigInfo.java | 94 +- .../openstack4j/model/sahara/DataSource.java | 6 +- .../model/sahara/DataSourceCredentials.java | 2 +- .../org/openstack4j/model/sahara/Image.java | 161 +- .../openstack4j/model/sahara/Instance.java | 89 +- .../org/openstack4j/model/sahara/Job.java | 12 +- .../openstack4j/model/sahara/JobBinary.java | 8 +- .../model/sahara/JobBinaryCredentials.java | 2 +- .../model/sahara/JobBinaryInternal.java | 6 +- .../openstack4j/model/sahara/JobConfig.java | 8 +- .../model/sahara/JobConfigHint.java | 3 +- .../model/sahara/JobConfigHintConfig.java | 2 +- .../model/sahara/JobExecution.java | 6 +- .../model/sahara/JobExecutionAction.java | 8 +- .../model/sahara/JobExecutionInfo.java | 6 +- .../openstack4j/model/sahara/NodeGroup.java | 170 +- .../model/sahara/NodeGroupTemplate.java | 188 +- .../org/openstack4j/model/sahara/Plugin.java | 78 +- .../model/sahara/ServiceConfig.java | 8 +- .../openstack4j/model/sahara/ServiceInfo.java | 8 +- .../model/sahara/builder/ClusterBuilder.java | 140 +- .../builder/ClusterTemplateBuilder.java | 113 +- .../builder/DataProcessingBuilders.java | 2 - .../sahara/builder/DataSourceBuilder.java | 14 +- .../sahara/builder/JobBinaryBuilder.java | 12 +- .../model/sahara/builder/JobBuilder.java | 10 +- .../sahara/builder/JobConfigBuilder.java | 8 +- .../sahara/builder/JobExecutionBuilder.java | 10 +- .../sahara/builder/NodeGroupBuilder.java | 143 +- .../builder/NodeGroupTemplateBuilder.java | 155 +- .../sahara/builder/ServiceConfigBuilder.java | 28 +- .../org/openstack4j/model/senlin/Action.java | 6 +- .../openstack4j/model/senlin/ActionID.java | 11 +- .../openstack4j/model/senlin/BuildInfo.java | 6 +- .../org/openstack4j/model/senlin/Cluster.java | 7 +- .../model/senlin/ClusterActionCreate.java | 3 +- .../model/senlin/ClusterCreate.java | 3 +- .../model/senlin/ClusterPolicy.java | 103 +- .../model/senlin/ClusterStatus.java | 68 +- .../org/openstack4j/model/senlin/Event.java | 150 +- .../org/openstack4j/model/senlin/Node.java | 6 +- .../model/senlin/NodeActionCreate.java | 3 +- .../openstack4j/model/senlin/NodeCreate.java | 3 +- .../org/openstack4j/model/senlin/Policy.java | 6 +- .../model/senlin/PolicyCreate.java | 3 +- .../openstack4j/model/senlin/PolicyType.java | 30 +- .../org/openstack4j/model/senlin/Profile.java | 6 +- .../model/senlin/ProfileCreate.java | 3 +- .../openstack4j/model/senlin/ProfileType.java | 30 +- .../openstack4j/model/senlin/Receiver.java | 151 +- .../model/senlin/ReceiverCreate.java | 3 +- .../org/openstack4j/model/senlin/Version.java | 43 +- .../builder/ClusterActionCreateBuilder.java | 142 +- .../senlin/builder/ClusterCreateBuilder.java | 100 +- .../builder/NodeActionCreateBuilder.java | 30 +- .../senlin/builder/NodeCreateBuilder.java | 82 +- .../senlin/builder/PolicyCreateBuilder.java | 142 +- .../senlin/builder/ProfileCreateBuilder.java | 48 +- .../senlin/builder/ReceiverCreateBuilder.java | 84 +- .../model/storage/block/BlockLimits.java | 24 +- .../model/storage/block/BlockQuotaSet.java | 3 - .../storage/block/BlockQuotaSetUsage.java | 10 +- .../model/storage/block/Volume.java | 285 ++- .../model/storage/block/VolumeAttachment.java | 64 +- .../model/storage/block/VolumeBackup.java | 205 ++- .../storage/block/VolumeBackupCreate.java | 74 +- .../storage/block/VolumeBackupRestore.java | 10 +- .../model/storage/block/VolumeSnapshot.java | 97 +- .../model/storage/block/VolumeTransfer.java | 24 +- .../model/storage/block/VolumeType.java | 42 +- .../storage/block/VolumeUploadImage.java | 24 +- .../block/builder/BlockQuotaSetBuilder.java | 5 +- .../block/builder/StorageBuilders.java | 4 +- .../builder/VolumeBackupCreateBuilder.java | 32 +- .../storage/block/builder/VolumeBuilder.java | 172 +- .../block/builder/VolumeSnapshotBuilder.java | 83 +- .../block/builder/VolumeTypeBuilder.java | 32 +- .../model/storage/block/ext/Service.java | 6 +- .../block/options/DownloadOptions.java | 33 +- .../block/options/UploadImageData.java | 23 +- .../model/storage/object/SwiftAccount.java | 22 +- .../model/storage/object/SwiftContainer.java | 15 +- .../model/storage/object/SwiftHeaders.java | 10 +- .../model/storage/object/SwiftObject.java | 46 +- .../object/options/ContainerListOptions.java | 66 +- .../options/CreateUpdateContainerOptions.java | 46 +- .../object/options/ObjectDeleteOptions.java | 7 +- .../object/options/ObjectListOptions.java | 63 +- .../object/options/ObjectLocation.java | 10 +- .../object/options/ObjectPutOptions.java | 36 +- .../org/openstack4j/model/tacker/Vim.java | 116 +- .../org/openstack4j/model/tacker/Vnf.java | 117 +- .../openstack4j/model/tacker/VnfUpdate.java | 10 +- .../org/openstack4j/model/tacker/Vnfd.java | 87 +- .../model/tacker/builder/NfvBuilders.java | 10 +- .../model/tacker/builder/VimBuilder.java | 87 +- .../model/tacker/builder/VnfBuilder.java | 73 +- .../tacker/builder/VnfUpdateBuilder.java | 12 +- .../model/tacker/builder/VnfdBuilder.java | 89 +- .../openstack4j/model/telemetry/Alarm.java | 805 +++++---- .../openstack4j/model/telemetry/Event.java | 2 +- .../model/telemetry/EventCriteria.java | 68 +- .../openstack4j/model/telemetry/Meter.java | 109 +- .../model/telemetry/MeterSample.java | 244 +-- .../openstack4j/model/telemetry/Sample.java | 6 +- .../model/telemetry/SampleCriteria.java | 80 +- .../model/telemetry/Statistics.java | 134 +- .../model/telemetry/builder/AlarmBuilder.java | 28 +- .../telemetry/builder/TelemetryBuilders.java | 2 - .../model/trove/DBCharacterSet.java | 10 +- .../openstack4j/model/trove/DBCollation.java | 10 +- .../org/openstack4j/model/trove/Database.java | 2 + .../openstack4j/model/trove/DatabaseUser.java | 1 + .../openstack4j/model/trove/Datastore.java | 4 +- .../model/trove/DatastoreVersion.java | 5 + .../org/openstack4j/model/trove/Flavor.java | 5 + .../model/trove/builder/DatabaseBuilder.java | 4 +- .../trove/builder/DatabaseUserBuilder.java | 2 + .../model/workflow/ActionDefinition.java | 6 +- .../model/workflow/ActionExecution.java | 6 +- .../model/workflow/Definition.java | 67 +- .../model/workflow/EventTrigger.java | 3 +- .../openstack4j/model/workflow/Execution.java | 42 +- .../model/workflow/TaskExecution.java | 5 +- .../model/workflow/WorkbookDefinition.java | 2 +- .../model/workflow/WorkflowDefinition.java | 6 +- .../model/workflow/WorkflowExecution.java | 9 +- .../builder/ActionDefinitionBuilder.java | 12 +- .../builder/ActionExecutionBuilder.java | 20 +- .../workflow/builder/CronTriggerBuilder.java | 100 +- .../workflow/builder/DefinitionBuilder.java | 90 +- .../workflow/builder/EventTriggerBuilder.java | 20 +- .../workflow/builder/ExecutionBuilder.java | 61 +- .../builder/TaskExecutionBuilder.java | 94 +- .../builder/WorkbookDefinitionBuilder.java | 8 +- .../builder/WorkflowDefinitionBuilder.java | 10 +- .../builder/WorkflowEnvironmentBuilder.java | 70 +- .../builder/WorkflowExecutionBuilder.java | 10 +- .../org/openstack4j/openstack/OSFactory.java | 56 +- .../artifact/domain/ArtifactUpdateModel.java | 1 - .../artifact/domain/ToscaTemplates.java | 2 +- .../artifact/domain/ToscaTemplatesList.java | 1 - .../internal/ArtifactServiceImpl.java | 3 - .../internal/BaseArtifactServiceImpl.java | 29 +- .../ToscaTemplatesArtifactServiceImpl.java | 10 - .../barbican/domain/BarbicanContainer.java | 11 +- .../domain/BarbicanContainerSecret.java | 6 +- .../barbican/domain/BarbicanSecret.java | 13 +- .../internal/BarbicanServiceImpl.java | 4 +- .../internal/ContainerServiceImpl.java | 5 +- .../barbican/internal/SecretServiceImpl.java | 2 +- .../openstack/client/OSClientBuilder.java | 11 +- .../openstack4j/openstack/common/Auth.java | 2 +- .../openstack/common/BasicResourceEntity.java | 55 +- .../openstack/common/DLPayloadEntity.java | 25 +- .../openstack/common/ExtensionValue.java | 172 +- .../openstack/common/GenericLink.java | 224 +-- .../openstack/common/IdResourceEntity.java | 7 +- .../openstack/common/ListEntity.java | 16 +- .../openstack/common/ListResult.java | 26 +- .../openstack/common/MapEntity.java | 10 +- .../openstack/common/Metadata.java | 11 +- .../openstack/common/QuotaDetailsEntity.java | 5 +- .../common/TelemetryDateDeserializer.java | 84 +- .../common/functions/EnforceVersionToURL.java | 18 +- .../HeaderNameValuesToHeaderMap.java | 15 +- .../openstack/common/functions/OneOrNull.java | 10 +- .../functions/RemoveVersionFromURL.java | 12 +- .../openstack/compute/domain/AdminPass.java | 11 +- .../compute/domain/AggregateAddHost.java | 52 +- .../compute/domain/AggregateRemoveHost.java | 50 +- .../compute/domain/ConsoleOutput.java | 28 +- .../compute/domain/ConsoleOutputOptions.java | 50 +- .../compute/domain/ExtraSpecsWrapper.java | 61 +- .../compute/domain/HostAggregateMetadata.java | 52 +- .../compute/domain/MetaDataWrapper.java | 64 +- .../compute/domain/NovaAbsoluteLimit.java | 595 ++++--- .../compute/domain/NovaAddresses.java | 181 +- .../domain/NovaBlockDeviceMappingCreate.java | 182 +- .../openstack/compute/domain/NovaFault.java | 90 +- .../openstack/compute/domain/NovaFlavor.java | 494 +++--- .../compute/domain/NovaFlavorAccess.java | 132 +- .../compute/domain/NovaFloatingIP.java | 295 ++-- .../compute/domain/NovaFloatingIPPools.java | 74 +- .../openstack/compute/domain/NovaHost.java | 31 +- .../compute/domain/NovaHostAggregate.java | 290 +-- .../domain/NovaHostAggregateCreate.java | 74 +- .../domain/NovaHostAggregateUpdate.java | 74 +- .../compute/domain/NovaHostResource.java | 201 +-- .../compute/domain/NovaHostResourceBody.java | 25 +- .../openstack/compute/domain/NovaImage.java | 292 ++- .../compute/domain/NovaInstanceAction.java | 11 +- .../domain/NovaInterfaceAttachment.java | 17 +- .../openstack/compute/domain/NovaKeypair.java | 303 ++-- .../openstack/compute/domain/NovaLimits.java | 66 +- .../compute/domain/NovaNetworkCreate.java | 98 +- .../compute/domain/NovaPassword.java | 11 +- .../compute/domain/NovaQuotaSet.java | 329 ++-- .../compute/domain/NovaQuotaSetUpdate.java | 146 +- .../compute/domain/NovaRateLimit.java | 233 ++- .../compute/domain/NovaSecGroupExtension.java | 678 ++++--- .../compute/domain/NovaSecurityGroup.java | 5 +- .../openstack/compute/domain/NovaServer.java | 561 +++--- .../compute/domain/NovaServerCreate.java | 75 +- .../NovaServerCreateWithHintsWrapper.java | 39 +- .../compute/domain/NovaServerGroup.java | 174 +- .../compute/domain/NovaServerTag.java | 41 +- .../compute/domain/NovaServerUpdate.java | 15 +- .../compute/domain/NovaSimpleTenantUsage.java | 485 +++-- .../compute/domain/NovaVNCConsole.java | 79 +- .../compute/domain/NovaVolumeAttachment.java | 89 +- .../compute/domain/actions/BackupAction.java | 16 +- .../compute/domain/actions/BasicActions.java | 99 +- .../domain/actions/CreateSnapshotAction.java | 23 +- .../domain/actions/EvacuateAction.java | 16 +- .../domain/actions/FloatingIpActions.java | 22 +- .../domain/actions/LiveMigrationAction.java | 15 +- .../compute/domain/actions/RebuildAction.java | 20 +- .../domain/actions/ResetStateAction.java | 11 +- .../domain/actions/SecurityGroupActions.java | 16 +- .../compute/domain/actions/ServerAction.java | 2 +- .../domain/ext/ExtAvailabilityZone.java | 26 +- .../compute/domain/ext/ExtDNSEntry.java | 17 +- .../compute/domain/ext/ExtDomainEntry.java | 15 +- .../compute/domain/ext/ExtHypervisor.java | 1 - .../domain/ext/ExtHypervisorStatistics.java | 195 +- .../compute/domain/ext/ExtMigration.java | 23 +- .../compute/domain/ext/ExtService.java | 34 +- .../functions/JsonToMessageFunction.java | 12 +- .../functions/ToActionResponseFunction.java | 1 - .../WrapServerIfApplicableFunction.java | 13 +- .../compute/internal/BaseComputeServices.java | 12 +- .../ComputeFloatingIPServiceImpl.java | 24 +- .../internal/ComputeImageServiceImpl.java | 133 +- .../ComputeSecurityGroupServiceImpl.java | 148 +- .../compute/internal/ComputeServiceImpl.java | 237 ++- .../compute/internal/FlavorServiceImpl.java | 332 ++-- .../internal/HostAggregateServiceImpl.java | 147 +- .../compute/internal/HostServiceImpl.java | 55 +- .../compute/internal/KeypairServiceImpl.java | 79 +- .../compute/internal/QuotaSetServiceImpl.java | 58 +- .../internal/ServerGroupServiceImpl.java | 52 +- .../compute/internal/ServerServiceImpl.java | 91 +- .../internal/ServerTagServiceImpl.java | 96 +- .../compute/internal/ServicesServiceImpl.java | 103 +- .../ext/FloatingIPDNSDomainServiceImpl.java | 18 +- .../ext/FloatingIPDNSEntryServiceImpl.java | 16 +- .../ext/FloatingIPDNSServiceImpl.java | 2 +- .../ext/InstanceActionsServiceImpl.java | 10 +- .../internal/ext/InterfaceServiceImpl.java | 20 +- .../internal/ext/MigrationServiceImpl.java | 8 +- .../compute/internal/ext/ZoneServiceImpl.java | 4 +- .../dns/v2/builder/DesignateV2Builders.java | 10 +- .../dns/v2/domain/DesignateNameserver.java | 235 ++- .../dns/v2/domain/DesignateRecordset.java | 7 +- .../dns/v2/domain/DesignateZone.java | 3 +- .../dns/v2/internal/BaseDNSServices.java | 6 +- .../dns/v2/internal/DNSServiceImpl.java | 6 - .../dns/v2/internal/RecordsetServiceImpl.java | 2 +- .../dns/v2/internal/ZoneServiceImpl.java | 5 +- .../gbp/domain/GbpExternalPolicy.java | 18 +- .../gbp/domain/GbpExternalPolicyCreate.java | 58 +- .../gbp/domain/GbpExternalRoutes.java | 23 +- .../gbp/domain/GbpExternalSegment.java | 54 +- .../openstack/gbp/domain/GbpL2Policy.java | 40 +- .../openstack/gbp/domain/GbpL3Policy.java | 44 +- .../openstack/gbp/domain/GbpNatPool.java | 37 +- .../gbp/domain/GbpNetworkServiceParams.java | 2 +- .../gbp/domain/GbpNetworkServicePolicy.java | 14 +- .../openstack/gbp/domain/GbpPolicyAction.java | 34 +- .../gbp/domain/GbpPolicyActionUpdate.java | 21 +- .../gbp/domain/GbpPolicyClassifier.java | 61 +- .../gbp/domain/GbpPolicyClassifierUpdate.java | 76 +- .../openstack/gbp/domain/GbpPolicyRule.java | 38 +- .../gbp/domain/GbpPolicyRuleSet.java | 38 +- .../openstack/gbp/domain/GbpPolicyTarget.java | 38 +- .../gbp/domain/GbpPolicyTargetGroup.java | 21 +- .../domain/GbpPolicyTargetGroupCreate.java | 65 +- .../internal/ExternalPolicyServiceImpl.java | 38 +- .../internal/ExternalSegmentServiceImpl.java | 23 +- .../gbp/internal/GbpServiceImpl.java | 33 +- .../gbp/internal/GroupServiceImpl.java | 30 +- .../gbp/internal/L2policyServiceImpl.java | 30 +- .../gbp/internal/L3policyServiceImpl.java | 20 +- .../gbp/internal/NatPoolServiceImpl.java | 21 +- .../internal/NetworkPolicyServiceImpl.java | 4 +- .../gbp/internal/PolicyActionServiceImpl.java | 21 +- .../internal/PolicyClassifierServiceImpl.java | 21 +- .../gbp/internal/PolicyRuleServiceImpl.java | 23 +- .../internal/PolicyRuleSetServiceImpl.java | 33 +- .../gbp/internal/PolicyTargetServiceImpl.java | 25 +- .../internal/ServiceProfileServiceImpl.java | 3 +- .../gbp/internal/ServicechainServiceImpl.java | 3 +- .../openstack/heat/builder/HeatBuilders.java | 13 +- .../heat/domain/HeatAdoptStackData.java | 25 +- .../openstack/heat/domain/HeatEvent.java | 190 +- .../openstack/heat/domain/HeatResource.java | 171 +- .../heat/domain/HeatResourceHealth.java | 6 +- .../heat/domain/HeatSoftwareConfig.java | 41 +- .../openstack/heat/domain/HeatStack.java | 244 ++- .../openstack/heat/domain/HeatStackAdopt.java | 17 +- .../heat/domain/HeatStackCreate.java | 307 ++-- .../heat/domain/HeatStackUpdate.java | 7 +- .../openstack/heat/domain/HeatTemplate.java | 18 +- .../heat/internal/BaseHeatServices.java | 9 +- .../heat/internal/EventsServiceImpl.java | 43 +- .../heat/internal/HeatServiceImpl.java | 43 +- .../heat/internal/ResourcesServiceImpl.java | 96 +- .../internal/SoftwareConfigServiceImpl.java | 12 +- .../heat/internal/StackServiceImpl.java | 13 +- .../heat/internal/TemplateServiceImpl.java | 24 +- .../openstack/heat/utils/Environment.java | 26 +- .../openstack/heat/utils/Template.java | 50 +- .../openstack/heat/utils/TemplateUtils.java | 24 +- .../identity/functions/ServiceFunctions.java | 14 +- .../internal/DefaultEndpointURLResolver.java | 36 +- .../openstack/identity/v2/domain/Auth.java | 59 +- .../identity/v2/domain/Credentials.java | 19 +- .../identity/v2/domain/KeystoneAccess.java | 542 +++--- .../v2/domain/KeystoneCreateRole.java | 35 +- .../identity/v2/domain/KeystoneEndpoint.java | 498 +++--- .../identity/v2/domain/KeystoneRole.java | 278 ++- .../identity/v2/domain/KeystoneService.java | 193 +- .../v2/domain/KeystoneServiceEndpoint.java | 378 ++-- .../identity/v2/domain/KeystoneTenant.java | 435 +++-- .../v2/domain/KeystoneTenantUser.java | 11 +- .../identity/v2/domain/KeystoneToken.java | 79 +- .../identity/v2/domain/KeystoneUser.java | 305 ++-- .../v2/domain/RaxApiKeyCredentials.java | 13 +- .../identity/v2/domain/TokenAuth.java | 12 +- .../v2/functions/ServiceToServiceType.java | 19 +- .../v2/internal/IdentityServiceImpl.java | 66 +- .../identity/v2/internal/RoleServiceImpl.java | 245 ++- .../internal/ServiceManagerServiceImpl.java | 140 +- .../v2/internal/TenantServiceImpl.java | 84 +- .../identity/v2/internal/UserServiceImpl.java | 178 +- .../openstack/identity/v3/domain/Auth.java | 2 +- .../identity/v3/domain/Credentials.java | 5 +- .../identity/v3/domain/KeystoneAuth.java | 54 +- .../v3/domain/KeystoneCredential.java | 13 +- .../identity/v3/domain/KeystoneDomain.java | 13 +- .../identity/v3/domain/KeystoneEndpoint.java | 18 +- .../identity/v3/domain/KeystoneGroup.java | 13 +- .../identity/v3/domain/KeystonePolicy.java | 13 +- .../identity/v3/domain/KeystoneProject.java | 65 +- .../identity/v3/domain/KeystoneRegion.java | 15 +- .../identity/v3/domain/KeystoneRole.java | 13 +- .../v3/domain/KeystoneRoleAssignment.java | 3 - .../identity/v3/domain/KeystoneService.java | 14 +- .../identity/v3/domain/KeystoneToken.java | 21 +- .../identity/v3/domain/KeystoneUser.java | 49 +- .../v3/functions/ServiceToServiceType.java | 23 +- .../v3/internal/BaseIdentityServices.java | 6 +- .../v3/internal/CredentialServiceImpl.java | 10 +- .../v3/internal/DomainServiceImpl.java | 10 +- .../v3/internal/GroupServiceImpl.java | 10 +- .../v3/internal/IdentityServiceImpl.java | 11 +- .../v3/internal/PolicyServiceImpl.java | 10 +- .../v3/internal/ProjectServiceImpl.java | 22 +- .../v3/internal/RegionServiceImpl.java | 11 +- .../identity/v3/internal/RoleServiceImpl.java | 11 +- .../internal/ServiceEndpointServiceImpl.java | 17 +- .../v3/internal/TokenServiceImpl.java | 7 +- .../identity/v3/internal/UserServiceImpl.java | 35 +- .../openstack/image/domain/GlanceImage.java | 783 ++++----- .../image/domain/GlanceImageMember.java | 110 +- .../openstack/image/domain/ImageHeader.java | 26 +- .../functions/ImageForUpdateToHeaders.java | 42 +- .../functions/ImageFromHeadersFunction.java | 132 +- .../image/internal/BaseImageServices.java | 8 +- .../image/internal/ImageServiceImpl.java | 22 +- .../image/v2/domain/GlanceImage.java | 39 +- .../image/v2/domain/GlanceImageUpdate.java | 5 +- .../image/v2/domain/GlanceMember.java | 3 + .../openstack/image/v2/domain/GlanceTask.java | 12 +- .../image/v2/domain/PatchOperation.java | 7 +- .../image/v2/internal/ImageServiceImpl.java | 38 +- .../image/v2/internal/TaskServiceImpl.java | 3 +- .../internal/BaseOpenStackService.java | 59 +- .../openstack/internal/MicroVersion.java | 1 - .../openstack/internal/OSAuthenticator.java | 82 +- .../openstack/internal/OSClientSession.java | 52 +- .../openstack/internal/Parser.java | 28 +- .../openstack/magnum/MagnumBay.java | 534 +++--- .../openstack/magnum/MagnumBaymodel.java | 53 +- .../openstack/magnum/MagnumCarequest.java | 10 +- .../openstack/magnum/MagnumCertificate.java | 11 +- .../openstack/magnum/MagnumCluster.java | 11 +- .../magnum/MagnumClustertemplate.java | 13 +- .../openstack/magnum/MagnumContainer.java | 11 +- .../openstack/magnum/MagnumEnvironment.java | 6 +- .../openstack/magnum/MagnumLabel.java | 6 +- .../openstack/magnum/MagnumMservice.java | 506 +++--- .../openstack/magnum/MagnumPod.java | 10 +- .../magnum/internal/MagnumServiceImpl.java | 119 +- .../manila/domain/ManilaQuotaSetUpdate.java | 3 +- .../domain/ManilaSecurityServiceUpdate.java | 3 +- .../manila/domain/ManilaShareCreate.java | 10 +- .../manila/domain/ManilaShareManage.java | 2 +- .../domain/ManilaShareNetworkCreate.java | 4 +- .../domain/ManilaShareNetworkUpdate.java | 3 +- .../domain/ManilaShareSnapshotCreate.java | 3 +- .../domain/ManilaShareSnapshotUpdate.java | 3 +- .../manila/domain/ManilaShareTypeCreate.java | 10 +- .../manila/domain/ManilaShareUpdate.java | 3 +- .../domain/actions/SecurityServiceAction.java | 2 +- .../manila/domain/actions/ShareAction.java | 3 +- .../manila/domain/actions/ShareActions.java | 7 +- .../domain/actions/ShareInstanceActions.java | 3 +- .../domain/actions/ShareSnapshotAction.java | 3 +- .../domain/actions/ShareSnapshotActions.java | 3 +- .../domain/actions/ShareTypeAction.java | 3 +- .../internal/SchedulerStatsServiceImpl.java | 2 +- .../manila/internal/ShareServiceImpl.java | 2 +- .../internal/ShareSnapshotServiceImpl.java | 4 +- .../manila/internal/ShareTypeServiceImpl.java | 2 +- .../manila/internal/SharesServiceImpl.java | 10 +- .../murano/v1/builder/MuranoBuilders.java | 2 +- .../murano/v1/domain/MuranoActionInfo.java | 1 - .../murano/v1/domain/MuranoApplication.java | 47 +- .../murano/v1/domain/MuranoDeployment.java | 1 + .../murano/v1/domain/MuranoEnvironment.java | 4 +- .../murano/v1/domain/MuranoServiceInfo.java | 6 +- .../v1/internal/BaseMuranoServices.java | 1 - .../v1/internal/MuranoActionServiceImpl.java | 2 +- .../MuranoApplicationServiceImpl.java | 28 +- .../internal/MuranoDeploymentServiceImpl.java | 4 +- .../MuranoEnvironmentServiceImpl.java | 9 +- .../v1/internal/MuranoSessionServiceImpl.java | 3 - .../networking/builder/NeutronBuilders.java | 20 +- .../domain/AddRouterInterfaceAction.java | 17 +- .../networking/domain/NeutronAgent.java | 13 +- .../domain/NeutronAllowedAddressPair.java | 76 +- .../domain/NeutronAvailabilityZone.java | 171 +- .../domain/NeutronExternalGateway.java | 76 +- .../domain/NeutronExtraDhcpOptCreate.java | 14 +- .../networking/domain/NeutronFloatingIP.java | 495 +++--- .../networking/domain/NeutronHostRoute.java | 77 +- .../networking/domain/NeutronIP.java | 80 +- .../networking/domain/NeutronNetQuota.java | 27 +- .../networking/domain/NeutronNetwork.java | 62 +- .../domain/NeutronNetworkUpdate.java | 9 +- .../networking/domain/NeutronPool.java | 110 +- .../networking/domain/NeutronPort.java | 948 +++++----- .../networking/domain/NeutronPortCreate.java | 198 ++- .../networking/domain/NeutronRouter.java | 14 +- .../domain/NeutronRouterInterface.java | 182 +- .../domain/NeutronSecurityGroup.java | 376 ++-- .../domain/NeutronSecurityGroupRule.java | 11 +- .../networking/domain/NeutronSubnet.java | 643 ++++--- .../domain/NeutronSubnetUpdate.java | 15 +- .../ext/AbstractNeutronFirewallPolicy.java | 331 ++-- .../domain/ext/FirewallRuleStrategy.java | 58 +- .../networking/domain/ext/HttpMethod.java | 39 +- .../networking/domain/ext/ListItem.java | 13 +- .../NeutronHealthMonitorV2Status.java | 5 +- .../NeutronLbPoolV2Status.java | 9 +- .../NeutronListenerV2Status.java | 7 +- .../NeutronLoadBalancerV2Status.java | 7 +- .../NeutronLoadBalancerV2StatusTree.java | 5 +- .../NeutronMemberV2Status.java | 7 +- .../ext/LoadBalancerV2StatusTree/Status.java | 7 +- .../domain/ext/NeutronFirewall.java | 427 +++-- .../domain/ext/NeutronFirewallPolicy.java | 12 +- .../domain/ext/NeutronFirewallPolicyRule.java | 13 +- .../ext/NeutronFirewallPolicyUpdate.java | 248 +-- .../domain/ext/NeutronFirewallRule.java | 641 ++++--- .../domain/ext/NeutronFirewallRuleUpdate.java | 426 ++--- .../domain/ext/NeutronFirewallUpdate.java | 253 +-- .../domain/ext/NeutronFlowClassifier.java | 12 +- .../domain/ext/NeutronHealthMonitor.java | 581 +++--- .../ext/NeutronHealthMonitorAssociate.java | 116 +- .../ext/NeutronHealthMonitorUpdate.java | 438 +++-- .../domain/ext/NeutronHealthMonitorV2.java | 59 +- .../ext/NeutronHealthMonitorV2Update.java | 51 +- .../networking/domain/ext/NeutronLbPool.java | 584 +++--- .../domain/ext/NeutronLbPoolStats.java | 88 +- .../domain/ext/NeutronLbPoolUpdate.java | 252 +-- .../domain/ext/NeutronLbPoolV2.java | 50 +- .../domain/ext/NeutronLbPoolV2Update.java | 21 +- .../domain/ext/NeutronListenerV2.java | 59 +- .../domain/ext/NeutronListenerV2Update.java | 31 +- .../domain/ext/NeutronLoadBalancerV2.java | 45 +- .../ext/NeutronLoadBalancerV2Stats.java | 10 +- .../ext/NeutronLoadBalancerV2Update.java | 26 +- .../networking/domain/ext/NeutronMember.java | 425 +++-- .../domain/ext/NeutronMemberUpdate.java | 212 +-- .../domain/ext/NeutronMemberV2.java | 41 +- .../domain/ext/NeutronMemberV2Update.java | 19 +- .../domain/ext/NeutronPortChain.java | 11 +- .../domain/ext/NeutronPortPair.java | 13 +- .../domain/ext/NeutronPortPairGroup.java | 16 +- .../domain/ext/NeutronSessionPersistence.java | 197 ++- .../networking/domain/ext/NeutronVip.java | 67 +- .../domain/ext/NeutronVipUpdate.java | 348 ++-- .../internal/AvailabilityZoneServiceImpl.java | 18 +- .../internal/BaseNetworkingServices.java | 8 +- .../internal/FloatingIPServiceImpl.java | 16 +- .../internal/NetworkServiceImpl.java | 109 +- .../internal/NetworkingServiceImpl.java | 26 +- .../networking/internal/PortServiceImpl.java | 8 +- .../internal/RouterServiceImpl.java | 192 +- .../SecurityGroupRuleServiceImpl.java | 10 +- .../internal/SecurityGroupServiceImpl.java | 10 +- .../internal/SubnetServiceImpl.java | 10 +- .../internal/ext/AgentServiceImpl.java | 14 +- .../internal/ext/FirewallAsServiceImpl.java | 82 +- .../ext/FirewallPolicyServiceImpl.java | 164 +- .../internal/ext/FirewallRuleServiceImpl.java | 110 +- .../internal/ext/FirewallServiceImpl.java | 110 +- .../ext/FlowClassifierServiceImpl.java | 8 +- .../ext/HealthMonitorServiceImpl.java | 118 +- .../ext/HealthMonitorV2ServiceImpl.java | 21 +- .../internal/ext/LbPoolServiceImpl.java | 33 +- .../internal/ext/LbPoolV2ServiceImpl.java | 39 +- .../internal/ext/LbaasV2ServiceImpl.java | 15 +- .../internal/ext/ListenerV2ServiceImpl.java | 20 +- .../internal/ext/LoadBalancerServiceImpl.java | 10 +- .../ext/LoadBalancerV2ServiceImpl.java | 29 +- .../internal/ext/MemberServiceImpl.java | 71 +- .../internal/ext/NetQuotaServiceImpl.java | 16 +- .../internal/ext/PortChainServiceImpl.java | 8 +- .../ext/PortPairGroupServiceImpl.java | 8 +- .../internal/ext/PortPairServiceImpl.java | 10 +- .../ext/ServiceFunctionChainServiceImpl.java | 6 +- .../internal/ext/VipServiceImpl.java | 115 +- .../octavia/builder/OctaviaBuilders.java | 20 +- .../openstack/octavia/domain/ListItem.java | 13 +- .../OctaviaHealthMonitorV2Status.java | 5 +- .../OctaviaLbPoolV2Status.java | 9 +- .../OctaviaListenerV2Status.java | 7 +- .../OctaviaLoadBalancerV2Status.java | 7 +- .../OctaviaLoadBalancerV2StatusTree.java | 5 +- .../OctaviaMemberV2Status.java | 7 +- .../LoadBalancerV2StatusTree/Status.java | 7 +- .../domain/OctaviaHealthMonitorV2.java | 64 +- .../domain/OctaviaHealthMonitorV2Update.java | 57 +- .../octavia/domain/OctaviaLbPoolV2.java | 52 +- .../octavia/domain/OctaviaLbPoolV2Update.java | 21 +- .../octavia/domain/OctaviaListenerV2.java | 57 +- .../domain/OctaviaListenerV2Update.java | 31 +- .../octavia/domain/OctaviaLoadBalancerV2.java | 51 +- .../domain/OctaviaLoadBalancerV2Stats.java | 10 +- .../domain/OctaviaLoadBalancerV2Update.java | 26 +- .../octavia/domain/OctaviaMemberV2.java | 41 +- .../octavia/domain/OctaviaMemberV2Update.java | 19 +- .../domain/OctaviaSessionPersistence.java | 190 +- .../octavia/internal/BaseOctaviaServices.java | 8 +- .../internal/HealthMonitorV2ServiceImpl.java | 19 +- .../octavia/internal/LbPoolV2ServiceImpl.java | 39 +- .../internal/ListenerV2ServiceImpl.java | 19 +- .../internal/LoadBalancerV2ServiceImpl.java | 31 +- .../octavia/internal/OctaviaServiceImpl.java | 2 +- .../provider/DefaultAPIProvider.java | 330 +--- .../sahara/domain/SaharaCluster.java | 685 ++++---- .../sahara/domain/SaharaClusterTemplate.java | 529 +++--- .../SaharaClusterTemplateUnwrapped.java | 29 +- .../sahara/domain/SaharaClusterUnwrapped.java | 29 +- .../sahara/domain/SaharaConfigInfo.java | 19 +- .../sahara/domain/SaharaDataSource.java | 43 +- .../domain/SaharaDataSourceCredentials.java | 11 +- .../domain/SaharaDataSourceUnwrapped.java | 9 +- .../openstack/sahara/domain/SaharaImage.java | 307 ++-- .../sahara/domain/SaharaInstance.java | 229 ++- .../openstack/sahara/domain/SaharaJob.java | 39 +- .../sahara/domain/SaharaJobBinary.java | 37 +- .../domain/SaharaJobBinaryCredentials.java | 11 +- .../domain/SaharaJobBinaryInternal.java | 27 +- .../domain/SaharaJobBinaryUnwrapped.java | 7 +- .../sahara/domain/SaharaJobConfig.java | 21 +- .../sahara/domain/SaharaJobConfigHint.java | 17 +- .../domain/SaharaJobConfigHintConfig.java | 11 +- .../sahara/domain/SaharaJobExecution.java | 51 +- .../domain/SaharaJobExecutionAction.java | 51 +- .../sahara/domain/SaharaJobExecutionInfo.java | 51 +- .../domain/SaharaJobExecutionUnwrapped.java | 3 +- .../sahara/domain/SaharaJobUnwrapped.java | 3 +- .../sahara/domain/SaharaNodeGroup.java | 563 +++--- .../domain/SaharaNodeGroupTemplate.java | 637 ++++--- .../SaharaNodeGroupTemplateUnwrapped.java | 29 +- .../openstack/sahara/domain/SaharaPlugin.java | 21 +- .../sahara/domain/SaharaServiceConfig.java | 120 +- .../sahara/domain/SaharaServiceInfo.java | 40 +- .../sahara/domain/actions/SaharaActions.java | 33 +- .../sahara/internal/BaseSaharaServices.java | 9 +- .../sahara/internal/ClusterServiceImpl.java | 18 +- .../internal/ClusterTemplateServiceImpl.java | 16 +- .../internal/DataSourceServiceImpl.java | 14 +- .../JobBinaryInternalServiceImpl.java | 24 +- .../sahara/internal/JobBinaryServiceImpl.java | 22 +- .../internal/JobExecutionServiceImpl.java | 12 +- .../sahara/internal/JobServiceImpl.java | 12 +- .../NodeGroupTemplateServiceImpl.java | 16 +- .../internal/SaharaImageServiceImpl.java | 32 +- .../internal/SaharaPluginServiceImpl.java | 13 +- .../sahara/internal/SaharaServiceImpl.java | 74 +- .../openstack/senlin/domain/SenlinAction.java | 354 ++-- .../senlin/domain/SenlinActionID.java | 29 +- .../senlin/domain/SenlinBuildInfo.java | 43 +- .../senlin/domain/SenlinCluster.java | 370 ++-- .../domain/SenlinClusterActionCreate.java | 287 ++- .../senlin/domain/SenlinClusterCreate.java | 223 ++- .../senlin/domain/SenlinClusterPolicy.java | 142 +- .../openstack/senlin/domain/SenlinEvent.java | 244 ++- .../openstack/senlin/domain/SenlinNode.java | 356 ++-- .../senlin/domain/SenlinNodeActionCreate.java | 159 +- .../senlin/domain/SenlinNodeCreate.java | 197 +-- .../openstack/senlin/domain/SenlinPolicy.java | 212 ++- .../senlin/domain/SenlinPolicyCreate.java | 293 ++- .../senlin/domain/SenlinPolicyType.java | 84 +- .../senlin/domain/SenlinProfile.java | 212 ++- .../senlin/domain/SenlinProfileCreate.java | 177 +- .../senlin/domain/SenlinProfileType.java | 84 +- .../senlin/domain/SenlinReceiver.java | 271 ++- .../senlin/domain/SenlinReceiverCreate.java | 197 +-- .../senlin/domain/SenlinVersion.java | 85 +- .../senlin/internal/BaseSenlinServices.java | 9 +- .../internal/SenlinActionServiceImpl.java | 20 +- .../internal/SenlinBuildInfoServiceImpl.java | 10 +- .../SenlinClusterPolicyServiceImpl.java | 24 +- .../internal/SenlinClusterServiceImpl.java | 74 +- .../internal/SenlinEventServiceImpl.java | 20 +- .../internal/SenlinNodeServiceImpl.java | 74 +- .../internal/SenlinPolicyServiceImpl.java | 60 +- .../internal/SenlinPolicyTypeServiceImpl.java | 20 +- .../internal/SenlinProfileServiceImpl.java | 60 +- .../SenlinProfileTypeServiceImpl.java | 20 +- .../internal/SenlinReceiverServiceImpl.java | 46 +- .../senlin/internal/SenlinServiceImpl.java | 130 +- .../internal/SenlinVersionServiceImpl.java | 16 +- .../internal/SenlinWebHookServiceImpl.java | 18 +- .../storage/block/builder/CinderBuilders.java | 11 +- .../storage/block/domain/AttachAction.java | 102 +- .../block/domain/AvailabilityZone.java | 9 +- .../domain/CinderBackendStoragePool.java | 57 +- .../block/domain/CinderBlockLimits.java | 17 +- .../block/domain/CinderBlockQuotaSet.java | 11 +- .../domain/CinderBlockQuotaSetUsage.java | 11 +- .../block/domain/CinderUploadImageData.java | 13 +- .../storage/block/domain/CinderVolume.java | 718 ++++---- .../block/domain/CinderVolumeAttachment.java | 82 +- .../block/domain/CinderVolumeBackup.java | 340 ++-- .../domain/CinderVolumeBackupCreate.java | 295 ++-- .../domain/CinderVolumeBackupRestore.java | 101 +- .../block/domain/CinderVolumeMigration.java | 42 +- .../block/domain/CinderVolumeSnapshot.java | 403 ++--- .../block/domain/CinderVolumeTransfer.java | 13 +- .../domain/CinderVolumeTransferAccept.java | 16 +- .../block/domain/CinderVolumeType.java | 109 +- .../block/domain/CinderVolumeUploadImage.java | 17 +- .../storage/block/domain/DetachAction.java | 45 +- .../block/domain/ExtAvailabilityZone.java | 13 +- .../storage/block/domain/ExtendAction.java | 27 +- .../block/domain/ForceDeleteAction.java | 8 +- .../block/domain/ForceDetachAction.java | 79 +- .../block/domain/ForceDetachConnector.java | 30 +- .../block/domain/ResetStatusAction.java | 24 +- .../block/domain/SetBootableAction.java | 27 +- .../domain/UpdateReadOnlyFlagAction.java | 24 +- .../storage/block/domain/ext/ExtService.java | 11 +- .../internal/BaseBlockStorageServices.java | 6 +- .../internal/BlockQuotaSetServiceImpl.java | 12 +- .../internal/BlockStorageServiceImpl.java | 89 +- .../BlockStorageServiceServiceImpl.java | 18 +- .../BlockVolumeBackupServiceImpl.java | 177 +- .../internal/BlockVolumeServiceImpl.java | 35 +- .../BlockVolumeSnapshotServiceImpl.java | 138 +- .../BlockVolumeTransferServiceImpl.java | 18 +- .../block/internal/CinderZoneServiceImpl.java | 12 +- .../SchedulerStatsGetPoolServiceImpl.java | 2 +- .../domain/MetaHeaderRequestWrapper.java | 18 +- .../object/domain/SwiftAccountImpl.java | 13 +- .../object/domain/SwiftContainerImpl.java | 11 +- .../object/domain/SwiftObjectImpl.java | 29 +- .../ApplyContainerToObjectFunction.java | 14 +- .../MapWithoutMetaPrefixFunction.java | 16 +- .../functions/MetadataToHeadersFunction.java | 22 +- .../functions/ParseAccountFunction.java | 28 +- .../object/functions/ParseObjectFunction.java | 38 +- .../internal/BaseObjectStorageService.java | 10 +- .../ObjectStorageAccountServiceImpl.java | 20 +- .../ObjectStorageContainerServiceImpl.java | 67 +- .../ObjectStorageObjectServiceImpl.java | 116 +- .../internal/ObjectStorageServiceImpl.java | 2 +- .../tacker/builders/TackerBuilders.java | 41 +- .../tacker/domain/AuthCredentials.java | 355 ++-- .../openstack/tacker/domain/TackerVim.java | 445 +++-- .../tacker/domain/TackerVimStatus.java | 39 +- .../openstack/tacker/domain/TackerVnf.java | 455 +++-- .../tacker/domain/TackerVnfStatus.java | 51 +- .../tacker/domain/TackerVnfUpdate.java | 100 +- .../openstack/tacker/domain/TackerVnfd.java | 373 ++-- .../tacker/domain/VimPlacementAttribute.java | 31 +- .../openstack/tacker/domain/VimProject.java | 121 +- .../tacker/domain/VnfAttributes.java | 239 ++- .../tacker/domain/VnfPlacementAttribute.java | 29 +- .../tacker/domain/VnfUpdateAttributes.java | 53 +- .../tacker/domain/VnfdAttributes.java | 53 +- .../tacker/domain/VnfdServiceTypes.java | 81 +- .../tacker/internal/BaseTackerServices.java | 8 +- .../tacker/internal/VimServiceImpl.java | 97 +- .../tacker/internal/VnfServiceImpl.java | 105 +- .../tacker/internal/VnfdServiceImpl.java | 85 +- .../telemetry/builder/CeilometerBuilders.java | 5 +- .../telemetry/domain/CeiloMeterSample.java | 11 +- .../telemetry/domain/CeilometerAlarm.java | 1564 ++++++++--------- .../domain/CeilometerCapabilities.java | 6 +- .../telemetry/domain/CeilometerEvent.java | 6 +- .../telemetry/domain/CeilometerMeter.java | 151 +- .../domain/CeilometerMeterSample.java | 423 +++-- .../telemetry/domain/CeilometerResource.java | 9 +- .../domain/CeilometerStatistics.java | 315 ++-- .../internal/AlarmAodhServiceImpl.java | 94 +- .../telemetry/internal/AlarmServiceImpl.java | 100 +- .../internal/BaseTelemetryAodhServices.java | 21 +- .../internal/BaseTelemetryServices.java | 61 +- .../internal/CapabilitiesServiceImpl.java | 2 +- .../telemetry/internal/MeterServiceImpl.java | 26 +- .../internal/ResourceServiceImpl.java | 10 +- .../telemetry/internal/SampleServiceImpl.java | 14 +- .../internal/TelemetryAodhServiceImpl.java | 1 - .../internal/TelemetryServiceImpl.java | 10 +- .../openstack/trove/domain/TroveDatabase.java | 2 +- .../trove/domain/TroveDatabaseUser.java | 2 +- .../trove/domain/TroveDatastore.java | 7 +- .../openstack/trove/domain/TroveInstance.java | 33 +- .../trove/domain/TroveInstanceCreate.java | 35 +- .../trove/internal/DBDatabaseServiceImpl.java | 6 +- .../internal/DBDatastoreServiceImpl.java | 4 +- .../trove/internal/DBInstanceServiceImpl.java | 8 +- .../trove/internal/DBUserServiceImpl.java | 12 +- .../trove/internal/TroveServiceImpl.java | 7 +- .../domain/MistralActionDefinition.java | 112 +- .../domain/MistralActionExecution.java | 158 +- .../workflow/domain/MistralTaskExecution.java | 216 +-- .../domain/MistralWorkbookDefinition.java | 78 +- .../domain/MistralWorkflowDefinition.java | 115 +- .../domain/MistralWorkflowExecution.java | 154 +- .../internal/CronTriggerServiceImpl.java | 2 +- .../internal/WorkflowServiceImpl.java | 2 - .../test/common/EndpointVersionTest.java | 22 +- .../HeaderNameValuesToHeaderMapTest.java | 20 +- .../test/common/MicroVersionTest.java | 5 +- .../test/core/transport/ConfigTest.java | 91 +- distribution/pom.xml | 163 +- distribution/settings.xml | 16 +- src/main/resources/features.xml | 253 +-- 1800 files changed, 56512 insertions(+), 56928 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5c1d1991..9066be05b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ # re-downloaded. cache: directories: - - $HOME/.m2 + - $HOME/.m2 language: java diff --git a/connectors/http-connector/pom.xml b/connectors/http-connector/pom.xml index 02446d0ef..dfe5dca46 100644 --- a/connectors/http-connector/pom.xml +++ b/connectors/http-connector/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.pacesys.openstack4j.connectors @@ -10,87 +11,87 @@ openstack4j-http-connector jar - - - - org.apache.felix - maven-bundle-plugin - 1.0.0 - true - - - ${project.name} - - org.openstack4j.connectors.http - - - !org.openstack4j.connectors.http - * - - - - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" - - - osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService - - - - + This bundle defines an implementation for following services in META-INF-services: + org.openstack4j.core.transport.HttpExecutorService + --> + + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + + osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService + + + + - - - org.apache.maven.plugins - maven-compiler-plugin - 3.0 - - 1.8 - 1.8 - UTF-8 - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.felix - - - maven-bundle-plugin - - - [1.0.0,) - - - manifest - - - - - - - - - - - - - + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + 1.8 + 1.8 + UTF-8 + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.felix + + + maven-bundle-plugin + + + [1.0.0,) + + + manifest + + + + + + + + + + + + + diff --git a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpCommand.java b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpCommand.java index 8724ef1d5..3007c4fb6 100644 --- a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpCommand.java +++ b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpCommand.java @@ -10,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.net.ssl.HttpsURLConnection; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.InputStream; @@ -20,8 +21,6 @@ import java.util.List; import java.util.Map; -import javax.net.ssl.HttpsURLConnection; - /** * HttpCommand is responsible for executing the actual request driven by the * HttpExecutor. @@ -75,10 +74,8 @@ public HttpResponse execute() throws Exception { if (request.getEntity() != null) { if (InputStream.class.isAssignableFrom(request.getEntity().getClass())) { - requestBody = ByteStreams.toByteArray((InputStream)request.getEntity()); - } - else - { + requestBody = ByteStreams.toByteArray((InputStream) request.getEntity()); + } else { String content = ObjectMapperSingleton.getContext(request.getEntity().getClass()).writer().writeValueAsString(request.getEntity()); requestBody = content.getBytes(); } @@ -115,10 +112,9 @@ public HttpResponse execute() throws Exception { } /** - * @see https://java.net/jira/browse/JERSEY-639 - * * @param httpURLConnection the HttpURLConnection - * @param method the methods name (GET, PUT, POST,... exception is thrown when trying to do a PATCH) + * @param method the methods name (GET, PUT, POST,... exception is thrown when trying to do a PATCH) + * @see https://java.net/jira/browse/JERSEY-639 */ private static final void setRequestMethodUsingWorkaroundForJREBug(final HttpURLConnection httpURLConnection, final String method) { try { @@ -210,9 +206,7 @@ private void populateHeaders() throws IOException { Proxy proxy = new Proxy(Type.HTTP, new InetSocketAddress(config.getProxy().getRawHost(), config.getProxy().getPort())); connection = (HttpURLConnection) connectionUrl.openConnection(proxy); - } - else - { + } else { connection = (HttpURLConnection) connectionUrl.openConnection(); } connection.setRequestProperty("Content-Type", request.getContentType()); diff --git a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpExecutorServiceImpl.java b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpExecutorServiceImpl.java index 31c082b98..f478a8f79 100644 --- a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpExecutorServiceImpl.java +++ b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpExecutorServiceImpl.java @@ -38,7 +38,7 @@ public HttpResponse execute(HttpRequest request) { /** * Invokes the given request * - * @param the return type + * @param the return type * @param request the request to invoke * @return the response * @throws Exception the exception @@ -59,13 +59,11 @@ private HttpResponse invokeRequest(HttpCommand command) throws Exception HttpResponse response = command.execute(); if (command.getRetries() == 0 && response.getStatus() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) { - try - { + try { OSAuthenticator.reAuthenticate(); command.getRequest().getHeaders().put(ClientConstants.HEADER_X_AUTH_TOKEN, OSClientSession.getCurrent().getTokenId()); return invokeRequest(command.incrementRetriesAndReturn()); - } - finally { + } finally { response.close(); } } diff --git a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java index 3dc8ac2be..2abc498c7 100644 --- a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java +++ b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java @@ -23,7 +23,7 @@ public class HttpResponseImpl implements HttpResponse { private byte[] data; private HttpResponseImpl(Map> headers, - int responseCode, String responseMessage, byte[] data) { + int responseCode, String responseMessage, byte[] data) { this.headers = headers; this.responseCode = responseCode; this.responseMessage = responseMessage; @@ -39,7 +39,7 @@ private HttpResponseImpl(Map> headers, * @return the HttpResponse */ public static HttpResponseImpl wrap(Map> headers, - int responseCode, String responseMessage, byte[] data) { + int responseCode, String responseMessage, byte[] data) { return new HttpResponseImpl(headers, responseCode, responseMessage, data); } @@ -47,7 +47,7 @@ public static HttpResponseImpl wrap(Map> headers, * Gets the entity and Maps any errors which will result in a * ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type * @return the entity */ @@ -59,9 +59,9 @@ public T getEntity(Class returnType) { * Gets the entity and Maps any errors which will result in a * ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type - * @param options the execution options + * @param options the execution options * @return the entity */ @Override @@ -90,8 +90,8 @@ public String getStatusMessage() { * @return the input stream */ public InputStream getInputStream() { - if (data == null) - return null; + if (data == null) + return null; return new ByteArrayInputStream(data); } @@ -103,14 +103,13 @@ public InputStream getInputStream() { * @return the header as a String or null if not found */ public String header(String name) { - if (name == null) return null; - for (String key : headers.keySet()) { - if (key != null && key.equalsIgnoreCase(name)) - { - return headers.get(key).get(0); - } - } - return null; + if (name == null) return null; + for (String key : headers.keySet()) { + if (key != null && key.equalsIgnoreCase(name)) { + return headers.get(key).get(0); + } + } + return null; } /** @@ -147,13 +146,13 @@ public T readEntity(Class typeToReadAs) { } } - @Override - public void close() throws IOException { - // Not Implemented - closing handle by HttpCommand - } + @Override + public void close() throws IOException { + // Not Implemented - closing handle by HttpCommand + } - @Override - public String getContentType() { - return header(ClientConstants.HEADER_CONTENT_TYPE); - } + @Override + public String getContentType() { + return header(ClientConstants.HEADER_CONTENT_TYPE); + } } diff --git a/connectors/httpclient/pom.xml b/connectors/httpclient/pom.xml index 8d6a24953..943c0c614 100644 --- a/connectors/httpclient/pom.xml +++ b/connectors/httpclient/pom.xml @@ -1,61 +1,62 @@ - - - org.pacesys.openstack4j.connectors - openstack4j-connectors - 3.2.1-SNAPSHOT - - 4.0.0 - openstack4j-httpclient - OpenStack4j HttpComponents-HttpClient Connector - http://github.com/ContainX/openstack4j/ - jar + + + org.pacesys.openstack4j.connectors + openstack4j-connectors + 3.2.1-SNAPSHOT + + 4.0.0 + openstack4j-httpclient + OpenStack4j HttpComponents-HttpClient Connector + http://github.com/ContainX/openstack4j/ + jar - - 4.3.1 - + + 4.3.1 + - - - org.apache.httpcomponents - httpclient - 4.3.6 - jar - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - - org.openstack4j.connectors.httpclient - - - !org.openstack4j.connectors.httpclient, - * - - - - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" - - - osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService - - - - - - + + + org.apache.httpcomponents + httpclient + 4.3.6 + jar + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.name} + + org.openstack4j.connectors.httpclient + + + !org.openstack4j.connectors.httpclient, + * + + + + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + + osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService + + + + + + diff --git a/connectors/httpclient/src/all.xml b/connectors/httpclient/src/all.xml index c190e1c84..2096ec8f9 100644 --- a/connectors/httpclient/src/all.xml +++ b/connectors/httpclient/src/all.xml @@ -1,9 +1,9 @@ - + - - - - - + + + + + \ No newline at end of file diff --git a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientConfigInterceptor.java b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientConfigInterceptor.java index 858cd793b..2162d4a79 100644 --- a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientConfigInterceptor.java +++ b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientConfigInterceptor.java @@ -7,17 +7,17 @@ /** * Allows for interception during the creation of a new HttpClient. To register a custom singleton interceptor you must invoke * {@link HttpClientFactory#registerInterceptor(HttpClientConfigInterceptor)} - * + * * @author Jeremy Unruh */ public interface HttpClientConfigInterceptor { /** - * This method is invoked prior to the HttpClientBuilder build is called allowing any overrides or custom configuration. - * - * @param client the http client builder + * This method is invoked prior to the HttpClientBuilder build is called allowing any overrides or custom configuration. + * + * @param client the http client builder * @param requestConfig the request config builder - * @param config the openstack4j config + * @param config the openstack4j config */ void onClientCreate(HttpClientBuilder client, RequestConfig.Builder requestConfig, Config config); } diff --git a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientFactory.java b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientFactory.java index 3193f6730..659f60ce6 100644 --- a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientFactory.java +++ b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpClientFactory.java @@ -36,7 +36,7 @@ public class HttpClientFactory { */ CloseableHttpClient getClient(Config config) { if (client == null) { - synchronized(this) { + synchronized (this) { if (client == null) { client = buildClient(config); } @@ -67,8 +67,7 @@ private CloseableHttpClient buildClient(Config config) { } } - if (config.isIgnoreSSLVerification()) - { + if (config.isIgnoreSSLVerification()) { cb.setSslcontext(UntrustedSSL.getSSLContext()); cb.setHostnameVerifier(new AllowAllHostnameVerifier()); } diff --git a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpCommand.java b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpCommand.java index 2ba6e4a70..45a98dff4 100644 --- a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpCommand.java +++ b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpCommand.java @@ -37,9 +37,8 @@ private HttpCommand(HttpRequest request) { /** * Creates a new HttpCommand from the given request - * - * @param request - * the request + * + * @param request the request * @return the command */ public static HttpCommand create(HttpRequest request) { @@ -58,27 +57,27 @@ private void initialize() { client = HttpClientFactory.INSTANCE.getClient(request.getConfig()); switch (request.getMethod()) { - case POST: - clientReq = new HttpPost(url); - break; - case PUT: - clientReq = new HttpPut(url); - break; - case DELETE: - clientReq = new HttpDelete(url); - break; - case HEAD: - clientReq = new HttpHead(url); - break; - case PATCH: - clientReq = new HttpPatch(url); - break; - case GET: - clientReq = new HttpGet(url); - break; - default: - throw new IllegalArgumentException("Unsupported http method: " + request.getMethod()); - } + case POST: + clientReq = new HttpPost(url); + break; + case PUT: + clientReq = new HttpPut(url); + break; + case DELETE: + clientReq = new HttpDelete(url); + break; + case HEAD: + clientReq = new HttpHead(url); + break; + case PATCH: + clientReq = new HttpPatch(url); + break; + case GET: + clientReq = new HttpGet(url); + break; + default: + throw new IllegalArgumentException("Unsupported http method: " + request.getMethod()); + } clientReq.setHeader("Accept", MediaType.JSON_UTF_8.toString()); populateHeaders(request); } diff --git a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpExecutorServiceImpl.java b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpExecutorServiceImpl.java index 4fdaecd19..c650aa3e7 100644 --- a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpExecutorServiceImpl.java +++ b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpExecutorServiceImpl.java @@ -30,11 +30,9 @@ public class HttpExecutorServiceImpl implements HttpExecutorService { public HttpResponse execute(HttpRequest request) { try { return invoke(request); - } - catch (ResponseException re) { + } catch (ResponseException re) { throw re; - } - catch (Exception e) { + } catch (Exception e) { LOG.error(e.getMessage(), e); return null; } @@ -43,7 +41,7 @@ public HttpResponse execute(HttpRequest request) { /** * Invokes the given request * - * @param the return type + * @param the return type * @param request the request to invoke * @return the response * @throws Exception the exception @@ -55,7 +53,7 @@ private HttpResponse invoke(HttpRequest request) throws Exception { try { return invokeRequest(command); } catch (ResponseException re) { - throw re; + throw re; } catch (Exception pe) { throw new ConnectionException(pe.getMessage(), 0, pe); } @@ -64,10 +62,8 @@ private HttpResponse invoke(HttpRequest request) throws Exception { private HttpResponse invokeRequest(HttpCommand command) throws Exception { CloseableHttpResponse response = command.execute(); - if (command.getRetries() == 0 && response.getStatusLine().getStatusCode() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) - { - try - { + if (command.getRetries() == 0 && response.getStatusLine().getStatusCode() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) { + try { OSAuthenticator.reAuthenticate(); command.getRequest().getHeaders().put(ClientConstants.HEADER_X_AUTH_TOKEN, OSClientSession.getCurrent().getTokenId()); } finally { diff --git a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpResponseImpl.java b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpResponseImpl.java index 05545ec2d..acbb46303 100644 --- a/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpResponseImpl.java +++ b/connectors/httpclient/src/main/java/org/openstack4j/connectors/httpclient/HttpResponseImpl.java @@ -46,7 +46,7 @@ public CloseableHttpResponse unwrap() { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type * @return the entity */ @@ -57,9 +57,9 @@ public T getEntity(Class returnType) { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type - * @param options execution options + * @param options execution options * @return the entity */ @Override @@ -114,7 +114,7 @@ public String header(String name) { */ public Map headers() { Map retHeaders = new HashMap(); - Header[] headers = response.getAllHeaders(); + Header[] headers = response.getAllHeaders(); for (Header h : headers) { retHeaders.put(h.getName(), h.getValue()); diff --git a/connectors/jersey2/pom.xml b/connectors/jersey2/pom.xml index ac7849331..8bca35bd2 100644 --- a/connectors/jersey2/pom.xml +++ b/connectors/jersey2/pom.xml @@ -1,81 +1,82 @@ - - - org.pacesys.openstack4j.connectors - openstack4j-connectors - 3.2.1-SNAPSHOT - - 4.0.0 - openstack4j-jersey2 - OpenStack4j Jersey2 Connector - http://github.com/ContainX/openstack4j/ - jar + + + org.pacesys.openstack4j.connectors + openstack4j-connectors + 3.2.1-SNAPSHOT + + 4.0.0 + openstack4j-jersey2 + OpenStack4j Jersey2 Connector + http://github.com/ContainX/openstack4j/ + jar - - 2.22.1 - + + 2.22.1 + - - - org.glassfish.jersey.core - jersey-client - ${jersey-client-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - 2.11 - - + + + org.glassfish.jersey.core + jersey-client + ${jersey-client-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + 2.11 + + - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - - org.openstack4j.connectors.jersey2 - - - !org.openstack4j.connectors.jersey2, - * - - - - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" - - - osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService - - - - + This bundle defines an implementation for following services in META-INF-services: + org.openstack4j.core.transport.HttpExecutorService + --> + + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + + osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService + + + + - - - org.apache.maven.plugins - maven-compiler-plugin - 3.0 - - 1.8 - 1.8 - UTF-8 - - - - + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + 1.8 + 1.8 + UTF-8 + + + + diff --git a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/ClientFactory.java b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/ClientFactory.java index dd7af582d..106bafd46 100644 --- a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/ClientFactory.java +++ b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/ClientFactory.java @@ -38,12 +38,13 @@ class ClientFactory { private static final CustomContextResolver RESOLVER = new CustomContextResolver(); private static LoadingCache CACHE = CacheBuilder.newBuilder() - .expireAfterAccess(20, TimeUnit.MINUTES) - .build(new CacheLoader() { - @Override - public Client load(Config config) throws Exception { - return buildClientFromConfig(config); - } }); + .expireAfterAccess(20, TimeUnit.MINUTES) + .build(new CacheLoader() { + @Override + public Client load(Config config) throws Exception { + return buildClientFromConfig(config); + } + }); /** * Creates or Returns a Client @@ -67,11 +68,11 @@ private static Client buildClientFromConfig(Config config) { } ClientBuilder cb = ClientBuilder.newBuilder() - .withConfig(clientConfig) - .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, "true") - .register(JacksonFeature.class) - .register(RESOLVER) - .register(new RequestFilter()); + .withConfig(clientConfig) + .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, "true") + .register(JacksonFeature.class) + .register(RESOLVER) + .register(new RequestFilter()); if (config.getSslContext() != null) cb.sslContext(config.getSslContext()); @@ -104,7 +105,8 @@ private static void addProxy(ClientConfig cc, Config config) { @Override public HttpURLConnection getConnection(URL url) throws IOException { return (HttpURLConnection) url.openConnection(proxy); - }}); + } + }); } } diff --git a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpCommand.java b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpCommand.java index 0da16c569..f0ac2e698 100644 --- a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpCommand.java +++ b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpCommand.java @@ -1,9 +1,12 @@ package org.openstack4j.connectors.jersey2; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.logging.Logger; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.client.RequestEntityProcessing; +import org.glassfish.jersey.filter.LoggingFilter; +import org.openstack4j.core.transport.ClientConstants; +import org.openstack4j.core.transport.HttpRequest; +import org.openstack4j.core.transport.internal.HttpLoggingFilter; import javax.ws.rs.client.Client; import javax.ws.rs.client.Entity; @@ -11,18 +14,14 @@ import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.client.RequestEntityProcessing; -import org.glassfish.jersey.client.HttpUrlConnectorProvider; -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack4j.core.transport.ClientConstants; -import org.openstack4j.core.transport.HttpRequest; -import org.openstack4j.core.transport.internal.HttpLoggingFilter; +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; /** - * HttpCommand is responsible for executing the actual request driven by the HttpExecutor. - * + * HttpCommand is responsible for executing the actual request driven by the HttpExecutor. + * * @param */ public final class HttpCommand { @@ -38,6 +37,7 @@ private HttpCommand(HttpRequest request) { /** * Creates a new HttpCommand from the given request + * * @param request the request * @return the command */ @@ -50,50 +50,46 @@ public static HttpCommand create(HttpRequest request) { private void initialize() { Client client = ClientFactory.create(request.getConfig()); //try to set unsupported HTTP method. In our case used for PATCH. - if( request.getMethod().name()=="PATCH" ) + if (request.getMethod().name() == "PATCH") client.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); - + WebTarget target = client.target(request.getEndpoint()).path(request.getPath()); - + if (HttpLoggingFilter.isLoggingEnabled()) target.register(new LoggingFilter(Logger.getLogger("os"), 10000)); target = populateQueryParams(target, request); invocation = target.request(MediaType.APPLICATION_JSON); - - populateHeaders(invocation, request); + + populateHeaders(invocation, request); entity = (request.getEntity() == null) ? null : Entity.entity(request.getEntity(), request.getContentType()); } /** * Executes the command and returns the Response - * + * * @return the response */ public Response execute() { Response response = null; if (hasEntity()) { - if (isInputStreamEntity()) - { + if (isInputStreamEntity()) { // Issue #20 - Out of Memory in Jersey for large streams invocation.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024); invocation.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.CHUNKED); } response = invocation.method(request.getMethod().name(), getEntity()); - } - else if(request.hasJson()) { + } else if (request.hasJson()) { response = invocation.method(request.getMethod().name(), Entity.entity(request.getJson(), ClientConstants.CONTENT_TYPE_JSON)); - } - else - { + } else { response = invocation.method(request.getMethod().name()); } - + return response; } - + private boolean isInputStreamEntity() { return (hasEntity() && InputStream.class.isAssignableFrom(entity.getEntity().getClass())); } @@ -111,21 +107,21 @@ public Entity getEntity() { public boolean hasEntity() { return entity != null; } - + /** * @return current retry execution count for this command */ public int getRetries() { return retries; } - + /** * @return incremement's the retry count and returns self */ public HttpCommand incrementRetriesAndReturn() { - initialize(); - retries++; - return this; + initialize(); + retries++; + return this; } public HttpRequest getRequest() { @@ -136,7 +132,7 @@ private WebTarget populateQueryParams(WebTarget target, HttpRequest request) if (!request.hasQueryParams()) return target; - for(Map.Entry > entry : request.getQueryParams().entrySet()) { + for (Map.Entry> entry : request.getQueryParams().entrySet()) { for (Object o : entry.getValue()) { target = target.queryParam(entry.getKey(), o); } @@ -148,7 +144,7 @@ private void populateHeaders(Invocation.Builder invocation, HttpRequest reque if (!request.hasHeaders()) return; - for(Map.Entry h : request.getHeaders().entrySet()) { + for (Map.Entry h : request.getHeaders().entrySet()) { invocation.header(h.getKey(), h.getValue()); } } diff --git a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpExecutorServiceImpl.java b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpExecutorServiceImpl.java index 2eab0e820..b460712c2 100644 --- a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpExecutorServiceImpl.java +++ b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpExecutorServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.connectors.jersey2; -import javax.ws.rs.ClientErrorException; -import javax.ws.rs.ProcessingException; -import javax.ws.rs.core.Response; - import org.openstack4j.api.exceptions.ConnectionException; import org.openstack4j.api.exceptions.ResponseException; import org.openstack4j.core.transport.ClientConstants; @@ -13,17 +9,21 @@ import org.openstack4j.openstack.internal.OSAuthenticator; import org.openstack4j.openstack.internal.OSClientSession; +import javax.ws.rs.ClientErrorException; +import javax.ws.rs.ProcessingException; +import javax.ws.rs.core.Response; + /** * HttpExecutor is the default implementation for HttpExecutorService which is responsible for interfacing with Jersey and mapping common status codes, requests and responses * back to the common API - * + * * @author Jeremy Unruh */ public class HttpExecutorServiceImpl implements HttpExecutorService { private static final String NAME = "Jersey 2 Connector"; - + /** * {@inheritDoc} */ @@ -31,11 +31,9 @@ public class HttpExecutorServiceImpl implements HttpExecutorService { public HttpResponse execute(HttpRequest request) { try { return invoke(request); - } - catch (ResponseException re) { + } catch (ResponseException re) { throw re; - } - catch (Exception e) { + } catch (Exception e) { throw new ConnectionException("Error during execution: " + e, 0, e); } } @@ -43,7 +41,7 @@ public HttpResponse execute(HttpRequest request) { /** * Invokes the given request * - * @param the return type + * @param the return type * @param request the request to invoke * @return the response * @throws Exception the exception @@ -63,8 +61,7 @@ private HttpResponse invoke(HttpRequest request) throws Exception { private HttpResponse invokeRequest(HttpCommand command) throws Exception { Response response = command.execute(); - if (command.getRetries() == 0 && response.getStatus() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) - { + if (command.getRetries() == 0 && response.getStatus() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) { OSAuthenticator.reAuthenticate(); command.getRequest().getHeaders().put(ClientConstants.HEADER_X_AUTH_TOKEN, OSClientSession.getCurrent().getTokenId()); return invokeRequest(command.incrementRetriesAndReturn()); diff --git a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpResponseImpl.java b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpResponseImpl.java index 674a4ec54..a538c8136 100644 --- a/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpResponseImpl.java +++ b/connectors/jersey2/src/main/java/org/openstack4j/connectors/jersey2/HttpResponseImpl.java @@ -1,17 +1,16 @@ package org.openstack4j.connectors.jersey2; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -import javax.ws.rs.core.Response; - import org.openstack4j.core.transport.ClientConstants; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.HttpEntityHandler; import org.openstack4j.core.transport.HttpResponse; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + public class HttpResponseImpl implements HttpResponse { private final Response response; @@ -42,7 +41,7 @@ public Response unwrap() { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type * @return the entity */ @@ -53,9 +52,9 @@ public T getEntity(Class returnType) { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type - * @param options the execution options + * @param options the execution options * @return the entity */ @Override @@ -102,7 +101,7 @@ public String header(String name) { */ public Map headers() { Map headers = new HashMap(); - for(String k : response.getHeaders().keySet()) { + for (String k : response.getHeaders().keySet()) { headers.put(k, response.getHeaderString(k)); } return headers; @@ -117,7 +116,7 @@ public T readEntity(Class typeToReadAs) { public void close() throws IOException { // Jersey handles this automatically in all cases - no-op } - + @Override public String getContentType() { return header(ClientConstants.HEADER_CONTENT_TYPE); diff --git a/connectors/okhttp/pom.xml b/connectors/okhttp/pom.xml index bf188bdb2..c1d1ac11a 100644 --- a/connectors/okhttp/pom.xml +++ b/connectors/okhttp/pom.xml @@ -1,4 +1,5 @@ - + org.pacesys.openstack4j.connectors openstack4j-connectors diff --git a/connectors/okhttp/src/all.xml b/connectors/okhttp/src/all.xml index c190e1c84..2096ec8f9 100644 --- a/connectors/okhttp/src/all.xml +++ b/connectors/okhttp/src/all.xml @@ -1,9 +1,9 @@ - + - - - - - + + + + + \ No newline at end of file diff --git a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpCommand.java b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpCommand.java index 8bdbe2e5d..d5cb6ecb2 100644 --- a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpCommand.java +++ b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpCommand.java @@ -1,5 +1,14 @@ package org.openstack4j.connectors.okhttp; +import com.google.common.io.ByteStreams; +import okhttp3.*; +import okhttp3.internal.Util; +import org.openstack4j.core.transport.*; +import org.openstack4j.core.transport.functions.EndpointURIFromRequestFunction; +import org.openstack4j.core.transport.internal.HttpLoggingFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; @@ -11,28 +20,6 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -import okhttp3.Call; -import okhttp3.ConnectionPool; -import okhttp3.Interceptor; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.internal.Util; -import org.openstack4j.core.transport.ClientConstants; -import org.openstack4j.core.transport.Config; -import org.openstack4j.core.transport.HttpMethod; -import org.openstack4j.core.transport.HttpRequest; -import org.openstack4j.core.transport.ObjectMapperSingleton; -import org.openstack4j.core.transport.UntrustedSSL; -import org.openstack4j.core.transport.functions.EndpointURIFromRequestFunction; -import org.openstack4j.core.transport.internal.HttpLoggingFilter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.io.ByteStreams; - /** * HttpCommand is responsible for executing the actual request driven by the HttpExecutor. * @@ -53,6 +40,7 @@ private HttpCommand(HttpRequest request) { /** * Creates a new HttpCommand from the given request + * * @param request the request * @return the command */ @@ -77,8 +65,7 @@ private void initialize() { if (config.getReadTimeout() > 0) okHttpClientBuilder.readTimeout(config.getReadTimeout(), TimeUnit.MILLISECONDS); - if (config.isIgnoreSSLVerification()) - { + if (config.isIgnoreSSLVerification()) { okHttpClientBuilder.hostnameVerifier(UntrustedSSL.getHostnameVerifier()); okHttpClientBuilder.sslSocketFactory(UntrustedSSL.getSSLContext().getSocketFactory()); } @@ -122,19 +109,18 @@ public Response execute() throws Exception { RequestBody body = null; if (request.getEntity() != null) { if (InputStream.class.isAssignableFrom(request.getEntity().getClass())) { - byte[] content = ByteStreams.toByteArray((InputStream)request.getEntity()); + byte[] content = ByteStreams.toByteArray((InputStream) request.getEntity()); body = RequestBody.create(MediaType.parse(request.getContentType()), content); } else { String content = ObjectMapperSingleton.getContext(request.getEntity().getClass()).writer().writeValueAsString(request.getEntity()); body = RequestBody.create(MediaType.parse(request.getContentType()), content); } - } - else if(request.hasJson()) { + } else if (request.hasJson()) { body = RequestBody.create(MediaType.parse(ClientConstants.CONTENT_TYPE_JSON), request.getJson()); } //Added to address https://github.com/square/okhttp/issues/751 //Set body as empty byte array if request is POST or PUT and body is sent as null - if((request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.PUT) && body == null){ + if ((request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.PUT) && body == null) { body = RequestBody.create(null, Util.EMPTY_BYTE_ARRAY); } clientReq.method(request.getMethod().name(), body); @@ -169,27 +155,24 @@ public HttpRequest getRequest() { return request; } - private void populateQueryParams(HttpRequest request) { + private void populateQueryParams(HttpRequest request) { StringBuilder url = new StringBuilder(); url.append(new EndpointURIFromRequestFunction().apply(request)); - if (!request.hasQueryParams()) - { + if (!request.hasQueryParams()) { clientReq.url(url.toString()); return; } url.append("?"); - for(Map.Entry > entry : request.getQueryParams().entrySet()) { + for (Map.Entry> entry : request.getQueryParams().entrySet()) { for (Object o : entry.getValue()) { - try - { + try { url.append(URLEncoder.encode(entry.getKey(), "UTF-8")).append("=").append(URLEncoder.encode(String.valueOf(o), "UTF-8")); url.append("&"); - } - catch (UnsupportedEncodingException e) { + } catch (UnsupportedEncodingException e) { LOG.error(e.getMessage(), e); } } @@ -204,13 +187,14 @@ private void populateHeaders(HttpRequest request) { if (!request.hasHeaders()) return; - for(Map.Entry h : request.getHeaders().entrySet()) { + for (Map.Entry h : request.getHeaders().entrySet()) { clientReq.addHeader(h.getKey(), String.valueOf(h.getValue())); } } static class LoggingInterceptor implements Interceptor { - @Override public Response intercept(Chain chain) throws IOException { + @Override + public Response intercept(Chain chain) throws IOException { Request request = chain.request(); long t1 = System.nanoTime(); diff --git a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpExecutorServiceImpl.java b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpExecutorServiceImpl.java index 040f3f605..9f231fa9f 100644 --- a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpExecutorServiceImpl.java +++ b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpExecutorServiceImpl.java @@ -2,7 +2,6 @@ import okhttp3.Response; import org.openstack4j.api.exceptions.ConnectionException; -import org.openstack4j.api.exceptions.ResponseException; import org.openstack4j.core.transport.ClientConstants; import org.openstack4j.core.transport.HttpExecutorService; import org.openstack4j.core.transport.HttpRequest; @@ -14,13 +13,13 @@ /** * HttpExecutor is the default implementation for HttpExecutorService which is responsible for interfacing with OKHttp and mapping common status codes, requests and responses * back to the common API - * + * * @author Jeremy Unruh */ public class HttpExecutorServiceImpl implements HttpExecutorService { private static final String NAME = "OKHttp Connector"; - + /** * {@inheritDoc} */ @@ -28,11 +27,9 @@ public class HttpExecutorServiceImpl implements HttpExecutorService { public HttpResponse execute(HttpRequest request) { try { return invoke(request); - } - catch (RuntimeException e) { + } catch (RuntimeException e) { throw e; - } - catch (Exception e) { + } catch (Exception e) { throw new RuntimeException(e); } } @@ -40,7 +37,7 @@ public HttpResponse execute(HttpRequest request) { /** * Invokes the given request * - * @param the return type + * @param the return type * @param request the request to invoke * @return the response * @throws Exception the exception @@ -58,8 +55,7 @@ private HttpResponse invoke(HttpRequest request) throws Exception { private HttpResponse invokeRequest(HttpCommand command) throws Exception { Response response = command.execute(); - if (command.getRetries() == 0 && response.code() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) - { + if (command.getRetries() == 0 && response.code() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) { OSAuthenticator.reAuthenticate(); command.getRequest().getHeaders().put(ClientConstants.HEADER_X_AUTH_TOKEN, OSClientSession.getCurrent().getTokenId()); return invokeRequest(command.incrementRetriesAndReturn()); diff --git a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java index 2a000c3fb..af7206828 100644 --- a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java +++ b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java @@ -1,21 +1,17 @@ package org.openstack4j.connectors.okhttp; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - import okhttp3.Headers; import okhttp3.Response; import org.openstack4j.api.exceptions.ClientResponseException; -import org.openstack4j.core.transport.ClientConstants; -import org.openstack4j.core.transport.ExecutionOptions; -import org.openstack4j.core.transport.HttpEntityHandler; -import org.openstack4j.core.transport.HttpResponse; -import org.openstack4j.core.transport.ObjectMapperSingleton; +import org.openstack4j.core.transport.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + public class HttpResponseImpl implements HttpResponse { @@ -48,7 +44,7 @@ public Response unwrap() { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type * @return the entity */ @@ -59,9 +55,9 @@ public T getEntity(Class returnType) { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type - * @param options the execution options + * @param options the execution options * @return the entity */ @Override @@ -108,7 +104,7 @@ public String header(String name) { */ public Map headers() { Map retHeaders = new HashMap(); - Headers headers = response.headers(); + Headers headers = response.headers(); for (String name : headers.names()) { retHeaders.put(name, headers.get(name)); diff --git a/connectors/pom.xml b/connectors/pom.xml index b8776fbd9..ae10b599d 100644 --- a/connectors/pom.xml +++ b/connectors/pom.xml @@ -1,4 +1,5 @@ - + org.pacesys openstack4j-parent @@ -55,7 +56,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.18.1 + 2.18.1 ../../core-test/src/main/resources/all.xml @@ -97,7 +98,7 @@ - + diff --git a/connectors/resteasy/pom.xml b/connectors/resteasy/pom.xml index 81c7052fd..012fea2ec 100644 --- a/connectors/resteasy/pom.xml +++ b/connectors/resteasy/pom.xml @@ -1,82 +1,83 @@ - - - org.pacesys.openstack4j.connectors - openstack4j-connectors - 3.2.1-SNAPSHOT - - 4.0.0 - openstack4j-resteasy - OpenStack4j RestEasy Connector - http://github.com/ContainX/openstack4j/ - jar + + + org.pacesys.openstack4j.connectors + openstack4j-connectors + 3.2.1-SNAPSHOT + + 4.0.0 + openstack4j-resteasy + OpenStack4j RestEasy Connector + http://github.com/ContainX/openstack4j/ + jar - - 3.1.4.Final - + + 3.1.4.Final + - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} + + + org.jboss.resteasy + resteasy-client + ${resteasy-version} httpclient org.apache.httpcomponents - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson.version} - - - commons-logging - commons-logging - 1.2 - - - org.apache.httpcomponents - httpclient - 4.5.3 - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - - org.openstack4j.connectors.resteasy, - org.openstack4j.connectors.resteasy.executors - - - !org.openstack4j.connectors.resteasy, - !org.openstack4j.connectors.resteasy.executors, - * - - - - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" - - - osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService - - - - - - + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson.version} + + + commons-logging + commons-logging + 1.2 + + + org.apache.httpcomponents + httpclient + 4.5.3 + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.name} + + org.openstack4j.connectors.resteasy, + org.openstack4j.connectors.resteasy.executors + + + !org.openstack4j.connectors.resteasy, + !org.openstack4j.connectors.resteasy.executors, + * + + + + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + + osgi.serviceloader; osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService + + + + + + diff --git a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpCommand.java b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpCommand.java index 1e02e7485..f78fd3745 100644 --- a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpCommand.java +++ b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpCommand.java @@ -24,7 +24,7 @@ public final class HttpCommand { private HttpRequest request; private ResteasyWebTarget resteasyWebTarget; private int retries; - private Invocation.Builder resteasyRequest ; + private Invocation.Builder resteasyRequest; private HttpCommand(HttpRequest request) { this.request = request; @@ -32,6 +32,7 @@ private HttpCommand(HttpRequest request) { /** * Creates a new HttpCommand from the given request + * * @param request the request * @return the command */ @@ -43,7 +44,7 @@ public static HttpCommand create(HttpRequest request) { private void initialize() { - resteasyWebTarget = new ResteasyClientBuilder().httpEngine(ApacheHttpClientEngine.create(request.getConfig())) + resteasyWebTarget = new ResteasyClientBuilder().httpEngine(ApacheHttpClientEngine.create(request.getConfig())) .providerFactory(ResteasyClientFactory.getInstance()).build() .target(UriBuilder.fromUri(new EndpointURIFromRequestFunction().apply(request))); @@ -57,14 +58,14 @@ private void initialize() { * * @return the response */ - public Response execute(){ + public Response execute() { Invocation webRequest; if (request.getEntity() != null) { webRequest = resteasyRequest.build(request.getMethod().name(), Entity.entity(request.getEntity(), request.getContentType())); } else if (request.hasJson()) { - webRequest= resteasyRequest.build(request.getMethod().name() , Entity.entity(request.getJson(),ClientConstants.CONTENT_TYPE_JSON)); - }else{ + webRequest = resteasyRequest.build(request.getMethod().name(), Entity.entity(request.getJson(), ClientConstants.CONTENT_TYPE_JSON)); + } else { webRequest = resteasyRequest.build(request.getMethod().name()); } diff --git a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpExecutorServiceImpl.java b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpExecutorServiceImpl.java index 59b5f1b30..c0d52d9ee 100644 --- a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpExecutorServiceImpl.java +++ b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpExecutorServiceImpl.java @@ -14,14 +14,14 @@ /** * HttpExecutor is the default implementation for HttpExecutorService which is responsible for interfacing with Resteasy and mapping common status codes, requests and responses * back to the common API - * + * * @author Jeremy Unruh */ public class HttpExecutorServiceImpl implements HttpExecutorService { private static final String NAME = "Resteasy Connector"; - + /** * {@inheritDoc} */ @@ -29,11 +29,9 @@ public class HttpExecutorServiceImpl implements HttpExecutorService { public HttpResponse execute(HttpRequest request) { try { return invoke(request); - } - catch (ResponseException re) { + } catch (ResponseException re) { throw re; - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return null; } @@ -42,7 +40,7 @@ public HttpResponse execute(HttpRequest request) { /** * Invokes the given request * - * @param the return type + * @param the return type * @param request the request to invoke * @return the response * @throws Exception the exception @@ -60,8 +58,7 @@ private HttpResponse invoke(HttpRequest request) throws Exception { private HttpResponse invokeRequest(HttpCommand command) throws Exception { Response response = command.execute(); - if (command.getRetries() == 0 && response.getStatus() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) - { + if (command.getRetries() == 0 && response.getStatus() == 401 && !command.getRequest().getHeaders().containsKey(ClientConstants.HEADER_OS4J_AUTH)) { OSAuthenticator.reAuthenticate(); command.getRequest().getHeaders().put(ClientConstants.HEADER_X_AUTH_TOKEN, OSClientSession.getCurrent().getTokenId()); return invokeRequest(command.incrementRetriesAndReturn()); diff --git a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpResponseImpl.java b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpResponseImpl.java index c523e56b5..a2e3d5e10 100644 --- a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpResponseImpl.java +++ b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/HttpResponseImpl.java @@ -1,18 +1,17 @@ package org.openstack4j.connectors.resteasy; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - import org.openstack4j.core.transport.ClientConstants; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.HttpEntityHandler; import org.openstack4j.core.transport.HttpResponse; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + public class HttpResponseImpl implements HttpResponse { private final Response response; @@ -43,7 +42,7 @@ public Response unwrap() { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type * @return the entity */ @@ -54,9 +53,9 @@ public T getEntity(Class returnType) { /** * Gets the entity and Maps any errors which will result in a ResponseException * - * @param the generic type + * @param the generic type * @param returnType the return type - * @param options execution based options + * @param options execution based options * @return the entity */ @Override @@ -122,7 +121,7 @@ public T readEntity(Class typeToReadAs) { public void close() throws IOException { response.close(); } - + @Override public String getContentType() { return header(ClientConstants.HEADER_CONTENT_TYPE); diff --git a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/ResteasyClientFactory.java b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/ResteasyClientFactory.java index d7168e218..826c63c15 100644 --- a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/ResteasyClientFactory.java +++ b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/ResteasyClientFactory.java @@ -1,17 +1,16 @@ package org.openstack4j.connectors.resteasy; -import javax.ws.rs.ext.ContextResolver; - +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import org.jboss.resteasy.plugins.providers.InputStreamProvider; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.openstack4j.core.transport.ObjectMapperSingleton; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +import javax.ws.rs.ext.ContextResolver; /** * Rest Easy provider setup to play nice with Jackson - * + * * @author Jeremy Unruh */ public class ResteasyClientFactory extends ResteasyProviderFactory { @@ -23,9 +22,9 @@ public class ResteasyClientFactory extends ResteasyProviderFactory { public ResteasyClientFactory() { super(); - + addContextResolver(new CustomContextResolver()); - + jsonProvider = new JacksonJsonProvider(); addMessageBodyReader(jsonProvider); addMessageBodyWriter(jsonProvider); @@ -38,7 +37,7 @@ public ResteasyClientFactory() { public static ResteasyClientFactory getInstance() { return INSTANCE; } - + private static final class CustomContextResolver implements ContextResolver { diff --git a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java index 4a87a92c3..e310b7f11 100644 --- a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java +++ b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java @@ -26,6 +26,7 @@ public class ApacheHttpClientEngine extends ApacheHttpClient4Engine { ApacheHttpClientEngine(HttpClient client) { super(client); } + private static final Logger LOGGER = LoggerFactory.getLogger(ApacheHttpClientEngine.class); public static ApacheHttpClientEngine create(Config config) { @@ -63,15 +64,14 @@ public static ApacheHttpClientEngine create(Config config) { HttpHost proxy = new HttpHost(url.getHost(), config.getProxy().getPort(), url.getProtocol()); requestConfigBuilder.setProxy(proxy); } catch (MalformedURLException e) { - LOGGER.error("Invalid proxy Url :%s",config.getProxy(),e); + LOGGER.error("Invalid proxy Url :%s", config.getProxy(), e); } } httpClientBuilder.setDefaultRequestConfig(requestConfigBuilder.build()); httpClientBuilder.setRedirectStrategy(new DefaultRedirectStrategy() { @Override - protected boolean isRedirectable(String method) - { + protected boolean isRedirectable(String method) { return true; } }); diff --git a/core-integration-test/it-httpclient/pom.xml b/core-integration-test/it-httpclient/pom.xml index f9eb369f9..29d408ecc 100644 --- a/core-integration-test/it-httpclient/pom.xml +++ b/core-integration-test/it-httpclient/pom.xml @@ -1,54 +1,54 @@ - 4.0.0 - - org.pacesys - openstack4j-core-integration-test - 3.2.1-SNAPSHOT - - it-httpclient - OpenStack4j IntegrationTest Apache HttpClient - - false - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.pacesys + openstack4j-core-integration-test + 3.2.1-SNAPSHOT + + it-httpclient + OpenStack4j IntegrationTest Apache HttpClient + + false + - - - org.pacesys.openstack4j.connectors - openstack4j-httpclient - ${project.version} - test - - - org.pacesys - openstack4j-core-integration-test - ${project.version} - test-jar - test - - + + + org.pacesys.openstack4j.connectors + openstack4j-httpclient + ${project.version} + test + + + org.pacesys + openstack4j-core-integration-test + ${project.version} + test-jar + test + + - - - - maven-surefire-plugin - 2.19 - - - it-httpclient - integration-test - - test - - false - - - org.pacesys:openstack4j-core-integration-test - - - - - - - + + + + maven-surefire-plugin + 2.19 + + + it-httpclient + integration-test + + test + + false + + + org.pacesys:openstack4j-core-integration-test + + + + + + + \ No newline at end of file diff --git a/core-integration-test/it-jersey2/pom.xml b/core-integration-test/it-jersey2/pom.xml index 70c02b2e3..83b966e55 100644 --- a/core-integration-test/it-jersey2/pom.xml +++ b/core-integration-test/it-jersey2/pom.xml @@ -1,54 +1,54 @@ - 4.0.0 - - org.pacesys - openstack4j-core-integration-test - 3.2.1-SNAPSHOT - - it-jersey2 - OpenStack4j IntegrationTest Jersey2 Connector - - false - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.pacesys + openstack4j-core-integration-test + 3.2.1-SNAPSHOT + + it-jersey2 + OpenStack4j IntegrationTest Jersey2 Connector + + false + - - - org.pacesys.openstack4j.connectors - openstack4j-jersey2 - ${project.version} - test - - - org.pacesys - openstack4j-core-integration-test - ${project.version} - test-jar - test - - + + + org.pacesys.openstack4j.connectors + openstack4j-jersey2 + ${project.version} + test + + + org.pacesys + openstack4j-core-integration-test + ${project.version} + test-jar + test + + - - - - maven-surefire-plugin - 2.19 - - - integrationtest - integration-test - - test - - false - - - org.pacesys:openstack4j-core-integration-test - - - - - - - + + + + maven-surefire-plugin + 2.19 + + + integrationtest + integration-test + + test + + false + + + org.pacesys:openstack4j-core-integration-test + + + + + + + \ No newline at end of file diff --git a/core-integration-test/it-okhttp/pom.xml b/core-integration-test/it-okhttp/pom.xml index 1ec720e7e..6fb1142a9 100644 --- a/core-integration-test/it-okhttp/pom.xml +++ b/core-integration-test/it-okhttp/pom.xml @@ -1,54 +1,54 @@ - 4.0.0 - - org.pacesys - openstack4j-core-integration-test - 3.2.1-SNAPSHOT - - it-okhttp - OpenStack4j IntegrationTest OKHttp Connector - - false - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.pacesys + openstack4j-core-integration-test + 3.2.1-SNAPSHOT + + it-okhttp + OpenStack4j IntegrationTest OKHttp Connector + + false + - - - org.pacesys.openstack4j.connectors - openstack4j-okhttp - ${project.version} - test - - - org.pacesys - openstack4j-core-integration-test - ${project.version} - test-jar - test - - + + + org.pacesys.openstack4j.connectors + openstack4j-okhttp + ${project.version} + test + + + org.pacesys + openstack4j-core-integration-test + ${project.version} + test-jar + test + + - - - - maven-surefire-plugin - 2.19 - - - it-okhttp - integration-test - - test - - false - - - org.pacesys:openstack4j-core-integration-test - - - - - - - + + + + maven-surefire-plugin + 2.19 + + + it-okhttp + integration-test + + test + + false + + + org.pacesys:openstack4j-core-integration-test + + + + + + + \ No newline at end of file diff --git a/core-integration-test/it-resteasy/pom.xml b/core-integration-test/it-resteasy/pom.xml index 86abc71c6..d7964c114 100644 --- a/core-integration-test/it-resteasy/pom.xml +++ b/core-integration-test/it-resteasy/pom.xml @@ -1,54 +1,54 @@ - 4.0.0 - - org.pacesys - openstack4j-core-integration-test - 3.2.1-SNAPSHOT - - it-resteasy - OpenStack4j IntegrationTest RestEasy Connector - - false - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.pacesys + openstack4j-core-integration-test + 3.2.1-SNAPSHOT + + it-resteasy + OpenStack4j IntegrationTest RestEasy Connector + + false + - - - org.pacesys.openstack4j.connectors - openstack4j-resteasy - ${project.version} - test - - - org.pacesys - openstack4j-core-integration-test - ${project.version} - test-jar - test - - + + + org.pacesys.openstack4j.connectors + openstack4j-resteasy + ${project.version} + test + + + org.pacesys + openstack4j-core-integration-test + ${project.version} + test-jar + test + + - - - - maven-surefire-plugin - 2.19 - - - integrationtest - integration-test - - test - - false - - - org.pacesys:openstack4j-core-integration-test - - - - - - - + + + + maven-surefire-plugin + 2.19 + + + integrationtest + integration-test + + test + + false + + + org.pacesys:openstack4j-core-integration-test + + + + + + + \ No newline at end of file diff --git a/core-integration-test/pom.xml b/core-integration-test/pom.xml index e0bf6be7a..83338c189 100644 --- a/core-integration-test/pom.xml +++ b/core-integration-test/pom.xml @@ -1,133 +1,134 @@ - - - org.pacesys - openstack4j-parent - 3.2.1-SNAPSHOT - - 4.0.0 - openstack4j-core-integration-test - OpenStack4j Integration test Cases - http://github.com/ContainX/openstack4j/ - pom - - false - - 2.1.0-20160705.041750-6 - 2.1.0-SNAPSHOT - + + + org.pacesys + openstack4j-parent + 3.2.1-SNAPSHOT + + 4.0.0 + openstack4j-core-integration-test + OpenStack4j Integration test Cases + http://github.com/ContainX/openstack4j/ + pom + + false + + 2.1.0-20160705.041750-6 + 2.1.0-SNAPSHOT + - - - it-jersey2 - it-resteasy - it-okhttp - it-httpclient - + + + it-jersey2 + it-resteasy + it-okhttp + it-httpclient + - - - org.pacesys - openstack4j - ${project.version} - - - org.pacesys.openstack4j.connectors - openstack4j-resteasy - - - - - junit - junit - 4.12 - provided - - - org.spockframework - spock-core - 1.0-groovy-2.4 - provided - - - org.codehaus.groovy - groovy-all - 2.4.5 - provided - - - software.betamax - betamax-junit - ${betamax.junit.version} - provided - - - software.betamax - betamax-core - ${betamax.core.version} - provided - - - org.slf4j - slf4j-simple - ${slf4j.version} - - + + + org.pacesys + openstack4j + ${project.version} + + + org.pacesys.openstack4j.connectors + openstack4j-resteasy + + + + + junit + junit + 4.12 + provided + + + org.spockframework + spock-core + 1.0-groovy-2.4 + provided + + + org.codehaus.groovy + groovy-all + 2.4.5 + provided + + + software.betamax + betamax-junit + ${betamax.junit.version} + provided + + + software.betamax + betamax-core + ${betamax.core.version} + provided + + + org.slf4j + slf4j-simple + ${slf4j.version} + + - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - true - - - + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + true + + + - - - - org.codehaus.gmavenplus - gmavenplus-plugin - 1.5 - - - - compile - testCompile - - - - - - maven-surefire-plugin - 2.19 - - false - - - **/*Spec.java - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${maven.jar.plugin.version} - - - - test-jar - - test-compile - - - - ${basedir}\target - - - - + + + + org.codehaus.gmavenplus + gmavenplus-plugin + 1.5 + + + + compile + testCompile + + + + + + maven-surefire-plugin + 2.19 + + false + + + **/*Spec.java + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven.jar.plugin.version} + + + + test-jar + + test-compile + + + + ${basedir}\target + + + + diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/BuilderSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/BuilderSpec.groovy index 616fc3d0f..b04b3b8cb 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/BuilderSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/BuilderSpec.groovy @@ -2,22 +2,20 @@ package org.openstack4j.api import com.google.common.collect.ImmutableMap import groovy.util.logging.Slf4j - -import org.junit.Rule; -import org.junit.rules.TestName; +import org.junit.Rule +import org.junit.rules.TestName import org.openstack4j.api.Builders -import org.openstack4j.model.identity.v3.* +import org.openstack4j.model.compute.Flavor import org.openstack4j.model.identity.v2.Tenant +import org.openstack4j.model.identity.v3.User import org.openstack4j.model.manila.Share import org.openstack4j.model.manila.Share.Protocol import org.openstack4j.model.manila.ShareCreate +import org.openstack4j.model.sahara.Cluster import org.openstack4j.model.storage.block.Volume -import org.openstack4j.model.compute.Flavor import org.openstack4j.openstack.heat.domain.HeatStackCreate -import org.openstack4j.model.sahara.Cluster import spock.lang.Specification - @Slf4j class BuilderSpec extends Specification { @@ -356,5 +354,4 @@ class BuilderSpec extends Specification { } - } diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneAuthenticationSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneAuthenticationSpec.groovy index a16ba24cf..893f1a856 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneAuthenticationSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneAuthenticationSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.OSClient.OSClientV3 import org.openstack4j.api.exceptions.RegionEndpointNotFoundException @@ -12,20 +11,20 @@ import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.AuthVersion import org.openstack4j.model.identity.v3.User import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneAuthenticationSpec extends AbstractSpec { - @Rule TestName KeystoneAuthenticationTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneAuthenticationTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) @@ -36,29 +35,28 @@ class KeystoneAuthenticationSpec extends AbstractSpec { // skipTest will evaluate to true if not all mandatory attributes are set causing the project to build without running the tests. static { - if( + if ( USER_ID == null || - USER_NAME == null || - USER_DOMAIN_ID == null || - AUTH_URL == null || - PASSWORD == null || - PROJECT_ID == null || - PROJECT_NAME == null || - PROJECT_DOMAIN_ID == null || - DOMAIN_ID == null || - DOMAIN_NAME == null || - REGION_ONE == null ) { + USER_NAME == null || + USER_DOMAIN_ID == null || + AUTH_URL == null || + PASSWORD == null || + PROJECT_ID == null || + PROJECT_NAME == null || + PROJECT_DOMAIN_ID == null || + DOMAIN_ID == null || + DOMAIN_NAME == null || + REGION_ONE == null) { skipTest = true - } - else{ + } else { skipTest = false } } def setupSpec() { - if( skipTest != true ) { + if (skipTest != true) { log.info("USER_ID: " + USER_ID) log.info("USER_NAME: " + USER_NAME) log.info("USER_DOMAIN_ID: " + USER_DOMAIN_ID) @@ -70,8 +68,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { log.info("DOMAIN_ID: " + DOMAIN_ID) log.info("DOMAIN_NAME: " + DOMAIN_NAME) log.info("REGION_ONE: " + REGION_ONE) - } - else { + } else { log.warn("Skipping integration-test cases because not all mandatory attributes are set."); } } @@ -81,11 +78,10 @@ class KeystoneAuthenticationSpec extends AbstractSpec { } - // ------------ Authentification Tests ------------ @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userId_password_projectId") + @Betamax(tape = "authenticate_v3_userId_password_projectId") def "authenticate with userId, password and scope projectId"() { given: "authenticate using credentials and projectId-scope to get a valid, scoped token" @@ -104,7 +100,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { } @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userId_password_projectName_projectDomainId") + @Betamax(tape = "authenticate_v3_userId_password_projectName_projectDomainId") def "authenticate with userId, password and scope projectName, projectDomainId"() { given: "authenticate with using credentials and scope given by projectName and the projects domain to get a valid, scoped token" @@ -124,7 +120,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { } @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userName_password_userDomainId_projectId") + @Betamax(tape = "authenticate_v3_userName_password_userDomainId_projectId") def "authenticate with userName, password, userDomainId and scope projectId"() { given: @@ -142,7 +138,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { } @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userId_password_domainId") + @Betamax(tape = "authenticate_v3_userId_password_domainId") def "authenticate with userId, password, and scope domainId"() { given: @@ -161,7 +157,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { } @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userName_password_domainId") + @Betamax(tape = "authenticate_v3_userName_password_domainId") def "authenticate with userName, password, domainId and scope domainId"() { given: @@ -213,7 +209,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { // proxyServer.stop() // @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_token.tape") + @Betamax(tape = "authenticate_v3_token.tape") def "authenticate with userId, password, scope projectId and use that token to re-authenticate"() { given: "authenticate with credentials and project scope to get a valid token" @@ -260,7 +256,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { // Therefore the tokenId's are identical when we verify, because we only check one http interaction. // Need to manually configure when to start and stop the recording. @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userId_password_unscoped_reauth") + @Betamax(tape = "authenticate_v3_userId_password_unscoped_reauth") def "authenticate with userId, password to get an unscoped token and then reauthenticate with it to get a scoped token"() { given: "authenticate with credentials but no scope to get a valid, unscoped token" @@ -290,7 +286,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { // Therefore the tokenId's are identical when we verify, because we only check one http interaction. // Need to manually configure when to start and stop the recording. @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userId_password_unscopedTokenToScopedToken") + @Betamax(tape = "authenticate_v3_userId_password_unscopedTokenToScopedToken") def "authenticate with userId, password to get and unscoped token used to get scoped token"() { given: @@ -320,7 +316,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { } @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userId_password_domainId_regionValid") + @Betamax(tape = "authenticate_v3_userId_password_domainId_regionValid") def "authenticate with userId, password and scope domainId and get a list of users in a valid region"() { given: "authenticate with credentials and scope specified by domainId to get a valid, scoped token" @@ -344,7 +340,7 @@ class KeystoneAuthenticationSpec extends AbstractSpec { } @IgnoreIf({ skipTest }) - @Betamax(tape="authenticate_v3_userId_password_domainId_regionInvalid") + @Betamax(tape = "authenticate_v3_userId_password_domainId_regionInvalid") def "authenticating with userId, password and scope domainId in an non-existend region should throw an RegionEndpointNotFoundException"() { given: "authenticate with credentials and scope specified by domainId to get a valid, scoped token" diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneCredentialServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneCredentialServiceSpec.groovy index 3b71061ff..d7fb56066 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneCredentialServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneCredentialServiceSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.OSClient.OSClientV3 import org.openstack4j.model.common.ActionResponse @@ -11,20 +10,20 @@ import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Credential import org.openstack4j.model.identity.v3.User import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneCredentialServiceSpec extends AbstractSpec { - @Rule TestName KeystoneCredentialServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneCredentialServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneDomainServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneDomainServiceSpec.groovy index 7b96009f0..00d828196 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneDomainServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneDomainServiceSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.Builders import org.openstack4j.api.OSClient.OSClientV3 @@ -11,20 +10,20 @@ import org.openstack4j.model.common.ActionResponse import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Domain import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneDomainServiceSpec extends AbstractSpec { - @Rule TestName KeystoneDomainServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneDomainServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) @@ -39,15 +38,14 @@ class KeystoneDomainServiceSpec extends AbstractSpec { static final boolean skipTest static { - if( + if ( USER_ID == null || - AUTH_URL == null || - PASSWORD == null || - DOMAIN_ID == null ) { + AUTH_URL == null || + PASSWORD == null || + DOMAIN_ID == null) { skipTest = true - } - else{ + } else { skipTest = false } } @@ -56,13 +54,12 @@ class KeystoneDomainServiceSpec extends AbstractSpec { // run before the first feature method; similar to JUnit's @BeforeClass def setupSpec() { - if( skipTest != true ) { + if (skipTest != true) { log.info("USER_ID: " + USER_ID) log.info("AUTH_URL: " + AUTH_URL) log.info("PASSWORD: " + PASSWORD) log.info("DOMAIN_ID: " + DOMAIN_ID) - } - else { + } else { log.warn("Skipping integration-test cases because not all mandatory attributes are set."); } } @@ -75,7 +72,7 @@ class KeystoneDomainServiceSpec extends AbstractSpec { // ------------ DomainService Tests ------------ @IgnoreIf({ skipTest }) - @Betamax(tape="domainService_crud.tape") + @Betamax(tape = "domainService_crud.tape") def "create, read, update, delete domain service test cases"() { given: "an authenticated OSClient" diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneGroupServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneGroupServiceSpec.groovy index 68e55df5f..e39cdc887 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneGroupServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneGroupServiceSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.Builders import org.openstack4j.api.OSClient.OSClientV3 @@ -12,20 +11,20 @@ import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Group import org.openstack4j.model.identity.v3.User import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneGroupServiceSpec extends AbstractSpec { - @Rule TestName KeystoneGroupServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneGroupServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystonePolicyServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystonePolicyServiceSpec.groovy index 07ff743f9..df04b9b09 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystonePolicyServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystonePolicyServiceSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.OSClient.OSClientV3 import org.openstack4j.model.common.ActionResponse @@ -11,20 +10,20 @@ import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Policy import org.openstack4j.model.identity.v3.User import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystonePolicyServiceSpec extends AbstractSpec { - @Rule TestName KeystonePolicyServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystonePolicyServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) @@ -41,30 +40,28 @@ class KeystonePolicyServiceSpec extends AbstractSpec { static final boolean skipTest static { - if( + if ( USER_ID == null || - AUTH_URL == null || - PASSWORD == null || - DOMAIN_ID == null || - PROJECT_ID == null ) { + AUTH_URL == null || + PASSWORD == null || + DOMAIN_ID == null || + PROJECT_ID == null) { skipTest = true - } - else{ + } else { skipTest = false } } def setupSpec() { - if( skipTest != true ) { + if (skipTest != true) { log.info("USER_ID: " + USER_ID) log.info("AUTH_URL: " + AUTH_URL) log.info("PASSWORD: " + PASSWORD) log.info("DOMAIN_ID: " + DOMAIN_ID) log.info("PROJECT_ID: " + PROJECT_ID) - } - else { + } else { log.warn("Skipping integration-test cases because not all mandatory attributes are set.") } } @@ -77,7 +74,7 @@ class KeystonePolicyServiceSpec extends AbstractSpec { // ------------ PolicyService Tests ------------ @IgnoreIf({ skipTest }) - @Betamax(tape="policyService_all.tape") + @Betamax(tape = "policyService_all.tape") def "policy service CRUD test cases"() { given: "authenticated v3 OSClient" @@ -114,7 +111,7 @@ class KeystonePolicyServiceSpec extends AbstractSpec { then: "this list should contain at least the recently created policy" policyList.isEmpty() == false - policyList.find { it.getId() == POLICY_CRUD_ID} + policyList.find { it.getId() == POLICY_CRUD_ID } when: "get details on a policy by id" Policy policy_byId = os.identity().policies().get(POLICY_CRUD_ID) diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneProjectServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneProjectServiceSpec.groovy index 993684cb1..e9be52d30 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneProjectServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneProjectServiceSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.Builders import org.openstack4j.api.OSClient.OSClientV3 @@ -11,20 +10,20 @@ import org.openstack4j.model.common.ActionResponse import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Project import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneProjectServiceSpec extends AbstractSpec { - @Rule TestName KeystoneProjectServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneProjectServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) @@ -39,15 +38,14 @@ class KeystoneProjectServiceSpec extends AbstractSpec { static final boolean skipTest static { - if( + if ( USER_ID == null || - AUTH_URL == null || - PASSWORD == null || - DOMAIN_ID == null ) { + AUTH_URL == null || + PASSWORD == null || + DOMAIN_ID == null) { skipTest = true - } - else{ + } else { skipTest = false } } @@ -56,13 +54,12 @@ class KeystoneProjectServiceSpec extends AbstractSpec { // run before the first feature method; similar to JUnit's @BeforeClass def setupSpec() { - if( skipTest != true ) { + if (skipTest != true) { log.info("USER_ID: " + USER_ID) log.info("AUTH_URL: " + AUTH_URL) log.info("PASSWORD: " + PASSWORD) log.info("DOMAIN_ID: " + DOMAIN_ID) - } - else { + } else { log.warn("Skipping integration-test cases because not all mandatory attributes are set."); } } @@ -75,7 +72,7 @@ class KeystoneProjectServiceSpec extends AbstractSpec { // ------------ ProjectService Tests ------------ @IgnoreIf({ skipTest }) - @Betamax(tape="projectService_crud.tape") + @Betamax(tape = "projectService_crud.tape") def "create, read, update, delete project service test cases"() { given: "an authenticated OSClient" @@ -178,7 +175,7 @@ class KeystoneProjectServiceSpec extends AbstractSpec { Project nonExistentProject_ByName = os.identity().projects().getByName("nonExistentProject", PROJECT_DOMAIN_ID) then: "this should return null" - nonExistentProject_ByName == null + nonExistentProject_ByName == null } diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRegionServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRegionServiceSpec.groovy index 92bb58e00..f1c228b84 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRegionServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRegionServiceSpec.groovy @@ -3,32 +3,31 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.OSClient.OSClientV3 import org.openstack4j.model.common.ActionResponse import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Region import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneRegionServiceSpec extends AbstractSpec { - @Rule TestName KeystoneRegionServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneRegionServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) .defaultMode(TapeMode.READ_WRITE) - .build());; + .build()); ; // additional attributes for region tests def static String REGION_CRUD_ID = "Region_CRUD" @@ -39,29 +38,27 @@ class KeystoneRegionServiceSpec extends AbstractSpec { static final boolean skipTest static { - if( + if ( USER_ID == null || - AUTH_URL == null || - PASSWORD == null || - DOMAIN_ID == null ) { + AUTH_URL == null || + PASSWORD == null || + DOMAIN_ID == null) { skipTest = true - } - else{ + } else { skipTest = false } } def setupSpec() { - if( skipTest != true ) { + if (skipTest != true) { log.info("USER_ID: " + USER_ID) log.info("AUTH_URL: " + AUTH_URL) log.info("PASSWORD: " + PASSWORD) log.info("DOMAIN_ID: " + DOMAIN_ID) log.info("PROJECT_ID: " + PROJECT_ID) - } - else { + } else { log.warn("Skipping integration-test cases because not all mandatory attributes are set.") } } @@ -74,7 +71,7 @@ class KeystoneRegionServiceSpec extends AbstractSpec { // ------------ RegionService Tests ------------ @IgnoreIf({ skipTest }) - @Betamax(tape="regionService_all.tape") + @Betamax(tape = "regionService_all.tape") def "region service CRUD test cases"() { given: "authenticated v3 OSClient" diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRoleServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRoleServiceSpec.groovy index 8bb6aa288..d0732094e 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRoleServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneRoleServiceSpec.groovy @@ -3,28 +3,27 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.OSClient.OSClientV3 import org.openstack4j.model.common.ActionResponse import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Role import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf import spock.lang.Shared @Slf4j class KeystoneRoleServiceSpec extends AbstractSpec { - @Rule TestName KeystoneRoleServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneRoleServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) @@ -34,7 +33,8 @@ class KeystoneRoleServiceSpec extends AbstractSpec { // additional attributes for role tests def static String ROLE_CRUD_NAME = "Role_CRUD" def static String ROLE_EMPTY_NAME = "roleNotFound" - @Shared String ROLE_CRUD_ID, ROLE_CRUD_USER_ID, ROLE_CRUD_GROUP_ID, ROLE_CRUD_ANOTHER_ROLE_ID + @Shared + String ROLE_CRUD_ID, ROLE_CRUD_USER_ID, ROLE_CRUD_GROUP_ID, ROLE_CRUD_ANOTHER_ROLE_ID static final boolean skipTest diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceSpec.groovy index 21ecc3bec..b92e88cec 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.Builders import org.openstack4j.api.OSClient.OSClientV3 @@ -13,20 +12,20 @@ import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Endpoint import org.openstack4j.model.identity.v3.Service import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneServiceEndpointServiceSpec extends AbstractSpec { - @Rule TestName KeystoneServiceEndpointServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneServiceEndpointServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) @@ -39,8 +38,8 @@ class KeystoneServiceEndpointServiceSpec extends AbstractSpec { def static final String SERVICE_CRUD_DESCRIPTION = "A service used for tests." def static final String SERVICE_CRUD_DESCRIPTION_UPDATE = "A updated service used for tests." def static final String ENDPOINT_CRUD_NAME = "Endpoint_CRUD" - def static final URL ENDPOINT_CRUD_URL = new URL( "http", "devstack.openstack.stack", 5000, "/v3") - def static final URL ENDPOINT_CRUD_URL_UPDATE = new URL( "http", "stack.openstack.devstack", 5000, "/v3"); + def static final URL ENDPOINT_CRUD_URL = new URL("http", "devstack.openstack.stack", 5000, "/v3") + def static final URL ENDPOINT_CRUD_URL_UPDATE = new URL("http", "stack.openstack.devstack", 5000, "/v3"); def static final Facing ENDPOINT_CRUD_IFACE = Facing.ADMIN def static final String ENDPOINT_CRUD_REGIONID = "RegionOne" def String SERVICE_CRUD_ID @@ -49,30 +48,28 @@ class KeystoneServiceEndpointServiceSpec extends AbstractSpec { static final boolean skipTest static { - if( + if ( USER_ID == null || - AUTH_URL == null || - PASSWORD == null || - DOMAIN_ID == null || - PROJECT_ID == null ) { + AUTH_URL == null || + PASSWORD == null || + DOMAIN_ID == null || + PROJECT_ID == null) { skipTest = true - } - else{ + } else { skipTest = false } } def setupSpec() { - if( skipTest != true ) { + if (skipTest != true) { log.info("USER_ID: " + USER_ID) log.info("AUTH_URL: " + AUTH_URL) log.info("PASSWORD: " + PASSWORD) log.info("DOMAIN_ID: " + DOMAIN_ID) log.info("PROJECT_ID: " + PROJECT_ID) - } - else { + } else { log.warn("Skipping integration-test cases because not all mandatory attributes are set.") } } @@ -85,7 +82,7 @@ class KeystoneServiceEndpointServiceSpec extends AbstractSpec { // ------------ ServiceEndpointService Tests ------------ @IgnoreIf({ skipTest }) - @Betamax(tape="serviceEndpoints_all.tape") + @Betamax(tape = "serviceEndpoints_all.tape") def "service manager service test cases"() { given: "authenticated v3 OSClient" @@ -121,7 +118,7 @@ class KeystoneServiceEndpointServiceSpec extends AbstractSpec { then: "the list should contain at least the recently created service" serviceList.isEmpty() == false - serviceList.find { it.getId() == SERVICE_CRUD_ID} + serviceList.find { it.getId() == SERVICE_CRUD_ID } when: "we get the recently created service by id" Service service_byId = os.identity().serviceEndpoints().get(SERVICE_CRUD_ID) @@ -167,7 +164,7 @@ class KeystoneServiceEndpointServiceSpec extends AbstractSpec { then: "the list should contain at least one endpoint" endpointList.isEmpty() == false - endpointList.find { it.getId() == ENDPOINT_CRUD_ID} + endpointList.find { it.getId() == ENDPOINT_CRUD_ID } when: "get details on the recently created endpoint specified by id" Endpoint endpoint_byId = os.identity().serviceEndpoints().getEndpoint(ENDPOINT_CRUD_ID) diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneTokenServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneTokenServiceSpec.groovy index df9c248af..660c965d3 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneTokenServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneTokenServiceSpec.groovy @@ -3,10 +3,8 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.OSClient.OSClientV3 -import org.openstack4j.api.types.ServiceType import org.openstack4j.model.common.ActionResponse import org.openstack4j.model.common.Identifier import org.openstack4j.model.identity.v3.Domain @@ -14,23 +12,24 @@ import org.openstack4j.model.identity.v3.Project import org.openstack4j.model.identity.v3.Service import org.openstack4j.model.identity.v3.Token import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf import spock.lang.Shared import spock.lang.Stepwise @Slf4j -@Stepwise // Needs to be stepwise to ensure USER_TOKEN_ID is acquired first +@Stepwise +// Needs to be stepwise to ensure USER_TOKEN_ID is acquired first class KeystoneTokenServiceSpec extends AbstractSpec { - @Rule TestName KeystoneTokenServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneTokenServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) @@ -38,18 +37,19 @@ class KeystoneTokenServiceSpec extends AbstractSpec { .build()); // additional attributes for token service tests - @Shared String USER_TOKEN_ID + @Shared + String USER_TOKEN_ID def String ADMIN_TOKEN_ID static final boolean skipTest static { if ( - USER_ID == null || - AUTH_URL == null || - PASSWORD == null || - DOMAIN_ID == null || - PROJECT_ID == null) { + USER_ID == null || + AUTH_URL == null || + PASSWORD == null || + DOMAIN_ID == null || + PROJECT_ID == null) { skipTest = true } else { skipTest = false @@ -128,7 +128,7 @@ class KeystoneTokenServiceSpec extends AbstractSpec { then: "this should contain at least contain one service" serviceCatalog.isEmpty() == false - serviceCatalog.find{ it.getName() == "keystone" } + serviceCatalog.find { it.getName() == "keystone" } when: "getting available project scopes" List availableProjectScopes = os.identity().tokens().getProjectScopes(USER_TOKEN_ID); diff --git a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneUserServiceSpec.groovy b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneUserServiceSpec.groovy index d3d71440f..69df20c75 100644 --- a/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneUserServiceSpec.groovy +++ b/core-integration-test/src/test/groovy/org/openstack4j/api/identity/v3/KeystoneUserServiceSpec.groovy @@ -3,7 +3,6 @@ package org.openstack4j.api.identity.v3 import groovy.util.logging.Slf4j import org.junit.Rule import org.junit.rules.TestName - import org.openstack4j.api.AbstractSpec import org.openstack4j.api.OSClient.OSClientV3 import org.openstack4j.model.common.ActionResponse @@ -12,20 +11,20 @@ import org.openstack4j.model.identity.v3.Group import org.openstack4j.model.identity.v3.Role import org.openstack4j.model.identity.v3.User import org.openstack4j.openstack.OSFactory - import software.betamax.Configuration import software.betamax.MatchRules import software.betamax.TapeMode import software.betamax.junit.Betamax import software.betamax.junit.RecorderRule - import spock.lang.IgnoreIf @Slf4j class KeystoneUserServiceSpec extends AbstractSpec { - @Rule TestName KeystoneUserServiceTest - @Rule public RecorderRule recorderRule = new RecorderRule( + @Rule + TestName KeystoneUserServiceTest + @Rule + public RecorderRule recorderRule = new RecorderRule( Configuration.builder() .tapeRoot(new File(TAPEROOT + "identity.v3")) .defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams) diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_token_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_token_tape.yaml index 1faf04dc9..8a11a4f04 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_token_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_token_tape.yaml @@ -1,49 +1,49 @@ !tape name: authenticate_v3_token.tape interactions: -- recorded: 2016-01-15T16:52:54.501Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '353' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-15T16:52:54.501Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '353' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "project" : { + "id" : "194dfdddb6bc43e09701035b52edb0d9" } }, - "methods" : [ "password" ] - }, - "scope" : { - "project" : { - "id" : "194dfdddb6bc43e09701035b52edb0d9" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:54 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Betamax: PLAY - X-Subject-Token: 5ea410ca9cb945f29674bcda7c2080db - x-openstack-request-id: req-83611568-0568-47ba-adc1-78073dadf775 - body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:54.476906Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:54 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Betamax: PLAY + X-Subject-Token: 5ea410ca9cb945f29674bcda7c2080db + x-openstack-request-id: req-83611568-0568-47ba-adc1-78073dadf775 + body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:54.476906Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "16fd2c85ec774496b2cbf27147a23d11"}, @@ -66,26 +66,26 @@ interactions: "name": "novav21"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["Y6l7BMQUTqyzsDagpayWUg"], "issued_at": "2016-01-15T16:52:54.476934Z"}}' -- recorded: 2016-01-15T16:52:54.620Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 5ea410ca9cb945f29674bcda7c2080db - response: - status: 200 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:54 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Betamax: PLAY - x-openstack-request-id: req-48448083-6951-467b-8634-4e2c13db5272 - body: '{"users": [{"name": "nova", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/415bae4bb22a463a910641260ebae794"}, "domain_id": "default", "enabled": true, "email": null, "id": "415bae4bb22a463a910641260ebae794"}, {"name": "demo", "links": {"self": + - recorded: 2016-01-15T16:52:54.620Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 5ea410ca9cb945f29674bcda7c2080db + response: + status: 200 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:54 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Betamax: PLAY + x-openstack-request-id: req-48448083-6951-467b-8634-4e2c13db5272 + body: '{"users": [{"name": "nova", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/415bae4bb22a463a910641260ebae794"}, "domain_id": "default", "enabled": true, "email": null, "id": "415bae4bb22a463a910641260ebae794"}, {"name": "demo", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/7174b49851d64276b72601c67ce347e2"}, "domain_id": "default", "enabled": true, "email": "demo@example.com", "id": "7174b49851d64276b72601c67ce347e2"}, {"domain_id": "default", "name": "admin", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "enabled": true, "email": null, "default_project_id": "194dfdddb6bc43e09701035b52edb0d9"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/72267f82e55144e1bb672491628b0ab5"}, "domain_id": "default", "enabled": true, "email": null, "id": "72267f82e55144e1bb672491628b0ab5"}, {"name": "neutron", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/9e60d839513b4631b11992458cdb75ff"}, "domain_id": "default", "enabled": true, "email": null, "id": diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId.yaml index fc01b0544..57e7e6e44 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId.yaml @@ -1,48 +1,48 @@ !tape name: authenticate_v3_userId_password_domainId interactions: -- recorded: 2016-01-15T16:52:52.468Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-15T16:52:52.468Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:52 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: d03ccb5dc4f0440f87fc48ccf5c5346f - x-openstack-request-id: req-5e550492-6c57-45d8-ba87-660fe11dcc2d - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:52.441449Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:52 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: d03ccb5dc4f0440f87fc48ccf5c5346f + x-openstack-request-id: req-5e550492-6c57-45d8-ba87-660fe11dcc2d + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:52.441449Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionInvalid.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionInvalid.yaml index 60e6b87f4..1169b6f29 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionInvalid.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionInvalid.yaml @@ -1,48 +1,48 @@ !tape name: authenticate_v3_userId_password_domainId_regionInvalid interactions: -- recorded: 2016-01-15T16:52:57.485Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-15T16:52:57.485Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:57 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 62e8cf6068ab4a5ab26ca9eb4313c992 - x-openstack-request-id: req-958f5658-c792-42fa-8d78-9fb2e44e8ee8 - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:57.462068Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:57 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 62e8cf6068ab4a5ab26ca9eb4313c992 + x-openstack-request-id: req-958f5658-c792-42fa-8d78-9fb2e44e8ee8 + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:57.462068Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionValid.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionValid.yaml index 7f322fbc8..819fdc3f6 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionValid.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainId_regionValid.yaml @@ -1,48 +1,48 @@ !tape name: authenticate_v3_userId_password_domainId_regionValid interactions: -- recorded: 2016-01-15T16:52:56.730Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-15T16:52:56.730Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:56 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 098163599aaf4589ace2e898176161dc - x-openstack-request-id: req-69b74e15-3d78-4f15-8b6b-6111cc3b00a2 - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-08T13:58:35.269465Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:56 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 098163599aaf4589ace2e898176161dc + x-openstack-request-id: req-69b74e15-3d78-4f15-8b6b-6111cc3b00a2 + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-08T13:58:35.269465Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -58,25 +58,25 @@ interactions: "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["hlKqNDdIQNOOKVD7dDJ8zA"], "issued_at": "2016-01-15T16:52:56.702720Z"}}' -- recorded: 2016-01-15T16:52:56.792Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 098163599aaf4589ace2e898176161dc - response: - status: 200 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:56 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-bdcc3dcf-6a25-4704-aaea-cc157b583512 - body: '{"users": [{"name": "nova", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/415bae4bb22a463a910641260ebae794"}, "domain_id": "default", "enabled": true, "email": null, "id": "415bae4bb22a463a910641260ebae794"}, {"name": "demo", "links": {"self": + - recorded: 2016-01-15T16:52:56.792Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 098163599aaf4589ace2e898176161dc + response: + status: 200 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:56 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-bdcc3dcf-6a25-4704-aaea-cc157b583512 + body: '{"users": [{"name": "nova", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/415bae4bb22a463a910641260ebae794"}, "domain_id": "default", "enabled": true, "email": null, "id": "415bae4bb22a463a910641260ebae794"}, {"name": "demo", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/7174b49851d64276b72601c67ce347e2"}, "domain_id": "default", "enabled": true, "email": "demo@example.com", "id": "7174b49851d64276b72601c67ce347e2"}, {"domain_id": "default", "name": "admin", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "enabled": true, "email": null, "default_project_id": "194dfdddb6bc43e09701035b52edb0d9"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/72267f82e55144e1bb672491628b0ab5"}, "domain_id": "default", "enabled": true, "email": null, "id": "72267f82e55144e1bb672491628b0ab5"}, {"name": "neutron", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/9e60d839513b4631b11992458cdb75ff"}, "domain_id": "default", "enabled": true, "email": null, "id": diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainName.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainName.yaml index f07444f4e..65c9e44a0 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainName.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_domainName.yaml @@ -1,48 +1,48 @@ !tape name: authenticate_v3_userId_password_domainName interactions: -- recorded: 2016-01-15T16:52:53.828Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '329' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-15T16:52:53.828Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '329' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "name" : "Default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "name" : "Default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:53 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 83f4bc0737b949c5ac61d3b575b677c0 - x-openstack-request-id: req-cc3859ed-c267-4cc1-84f5-c706c97dd2f7 - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:53.802970Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:53 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 83f4bc0737b949c5ac61d3b575b677c0 + x-openstack-request-id: req-cc3859ed-c267-4cc1-84f5-c706c97dd2f7 + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:53.802970Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectId.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectId.yaml index 2a765f444..41be70410 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectId.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectId.yaml @@ -1,48 +1,48 @@ !tape name: authenticate_v3_userId_password_projectId interactions: -- recorded: 2016-01-15T16:52:50.186Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '353' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-15T16:52:50.186Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '353' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "project" : { + "id" : "194dfdddb6bc43e09701035b52edb0d9" } }, - "methods" : [ "password" ] - }, - "scope" : { - "project" : { - "id" : "194dfdddb6bc43e09701035b52edb0d9" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:49 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 12e4f18d658040e6aca7463619014edc - x-openstack-request-id: req-b2f0d384-b3d1-4224-b309-12d2af5688bc - body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:50.042400Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:49 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 12e4f18d658040e6aca7463619014edc + x-openstack-request-id: req-b2f0d384-b3d1-4224-b309-12d2af5688bc + body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:50.042400Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "16fd2c85ec774496b2cbf27147a23d11"}, diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectName_projectDomainId.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectName_projectDomainId.yaml index ec0c8f167..4ce74bc5a 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectName_projectDomainId.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_projectName_projectDomainId.yaml @@ -1,51 +1,51 @@ !tape name: authenticate_v3_userId_password_projectName_projectDomainId interactions: -- recorded: 2016-01-15T16:52:51.379Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '387' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-01-15T16:52:51.379Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '387' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "scope" : { - "project" : { - "name" : "admin", - "domain" : { - "id" : "default" + "scope" : { + "project" : { + "name" : "admin", + "domain" : { + "id" : "default" + } } - } - }, - "type" : "CREDENTIALS" + }, + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:51 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: bc095a41a52d4fa49f9fced32f2ba96f - x-openstack-request-id: req-b6f50ef2-202d-48e8-9c2a-11c8568f47f8 - body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:51.351905Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:51 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: bc095a41a52d4fa49f9fced32f2ba96f + x-openstack-request-id: req-b6f50ef2-202d-48e8-9c2a-11c8568f47f8 + body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:51.351905Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "16fd2c85ec774496b2cbf27147a23d11"}, diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscopedTokenToScopedToken.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscopedTokenToScopedToken.yaml index 56ba08e78..9422fd905 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscopedTokenToScopedToken.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscopedTokenToScopedToken.yaml @@ -1,44 +1,44 @@ !tape name: authenticate_v3_userId_password_unscopedTokenToScopedToken interactions: -- recorded: 2016-01-15T16:52:56.046Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '252' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-01-15T16:52:56.046Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '252' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:55 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Betamax: PLAY - X-Subject-Token: 0b3dbe84db4f498198ef935b66c52538 - x-openstack-request-id: req-498ce89c-1b88-43a7-a7d0-36f88cd0b3c8 - body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:56.022416Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:55 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Betamax: PLAY + X-Subject-Token: 0b3dbe84db4f498198ef935b66c52538 + x-openstack-request-id: req-498ce89c-1b88-43a7-a7d0-36f88cd0b3c8 + body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:56.022416Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "16fd2c85ec774496b2cbf27147a23d11"}, diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscoped_reauth.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscoped_reauth.yaml index 6c3a650d0..ea041a2cc 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscoped_reauth.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userId_password_unscoped_reauth.yaml @@ -1,44 +1,44 @@ !tape name: authenticate_v3_userId_password_unscoped_reauth interactions: -- recorded: 2016-01-15T16:52:55.360Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '252' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-01-15T16:52:55.360Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '252' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:55 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Betamax: PLAY - X-Subject-Token: 63bf8305ffb6477891da977f9e49d2eb - x-openstack-request-id: req-e7dca231-8ac8-4011-90cd-aba8df78d88a - body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:55.334411Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:55 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Betamax: PLAY + X-Subject-Token: 63bf8305ffb6477891da977f9e49d2eb + x-openstack-request-id: req-e7dca231-8ac8-4011-90cd-aba8df78d88a + body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:55.334411Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "16fd2c85ec774496b2cbf27147a23d11"}, diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_domainId.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_domainId.yaml index aa463b9b7..9bce8a81a 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_domainId.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_domainId.yaml @@ -1,51 +1,51 @@ !tape name: authenticate_v3_userName_password_domainId interactions: -- recorded: 2016-01-15T16:52:53.150Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '367' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "name" : "admin", - "domain" : { - "id" : "default" - }, - "password" : "devstack" + - recorded: 2016-01-15T16:52:53.150Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '367' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "name" : "admin", + "domain" : { + "id" : "default" + }, + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:53 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 920796ec42094fb69c14725584a4e1ff - x-openstack-request-id: req-1a16fcf4-2c4f-47ab-843e-43e8fcb9883a - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:53.126134Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:53 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 920796ec42094fb69c14725584a4e1ff + x-openstack-request-id: req-1a16fcf4-2c4f-47ab-843e-43e8fcb9883a + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:53.126134Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_userDomainId_projectId.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_userDomainId_projectId.yaml index 60dae0701..3bab9bfc8 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_userDomainId_projectId.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/authenticate_v3_userName_password_userDomainId_projectId.yaml @@ -1,51 +1,51 @@ !tape name: authenticate_v3_userName_password_userDomainId_projectId interactions: -- recorded: 2016-01-15T16:52:51.753Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '393' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "name" : "admin", - "domain" : { - "id" : "default" - }, - "password" : "devstack" + - recorded: 2016-01-15T16:52:51.753Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '393' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "name" : "admin", + "domain" : { + "id" : "default" + }, + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "project" : { + "id" : "194dfdddb6bc43e09701035b52edb0d9" } }, - "methods" : [ "password" ] - }, - "scope" : { - "project" : { - "id" : "194dfdddb6bc43e09701035b52edb0d9" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Fri, 15 Jan 2016 16:52:51 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 48a1f240730e4095ba34733c6f228a4a - x-openstack-request-id: req-c8394986-7c91-4dd2-a7cc-873529be8632 - body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:51.726072Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Fri, 15 Jan 2016 16:52:51 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 48a1f240730e4095ba34733c6f228a4a + x-openstack-request-id: req-c8394986-7c91-4dd2-a7cc-873529be8632 + body: '{"token": {"methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-15T17:52:51.726072Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "16fd2c85ec774496b2cbf27147a23d11"}, diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/credentialService_all_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/credentialService_all_tape.yaml index 664c66bac..764653ff0 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/credentialService_all_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/credentialService_all_tape.yaml @@ -1,47 +1,47 @@ !tape name: credentialService_all.tape interactions: -- recorded: 2016-05-05T12:38:44.859Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '299' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-05-05T12:38:44.859Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '299' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" + "scope" : { + "domain" : { + "id" : "default" + } } } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Thu, 05 May 2016 12:38:41 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 64fba294f11140f6be7f80e835d283b8 - x-openstack-request-id: req-9c8f982c-7663-482a-bd91-75a86eb0a03d - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-05-05T13:38:41.972340Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Thu, 05 May 2016 12:38:41 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 64fba294f11140f6be7f80e835d283b8 + x-openstack-request-id: req-9c8f982c-7663-482a-bd91-75a86eb0a03d + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-05-05T13:38:41.972340Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -55,179 +55,179 @@ interactions: "name": "novav21"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["u2Hf2mstT9aPUc06s8fx-w"], "issued_at": "2016-05-05T12:38:41.972393Z"}}' -- recorded: 2016-05-05T12:38:45.162Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Content-Length: '176' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - body: |- - { - "user" : { - "name" : "Credential_CRUD_USER", - "email" : "user@example.com", - "password" : "secretPassword", - "enabled" : true, - "domain_id" : "default" + - recorded: 2016-05-05T12:38:45.162Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Content-Length: '176' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + body: |- + { + "user" : { + "name" : "Credential_CRUD_USER", + "email" : "user@example.com", + "password" : "secretPassword", + "enabled" : true, + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-183df59c-e004-49b1-8d38-f9b8c56df154 - body: '{"user": {"name": "Credential_CRUD_USER", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/a2185491c25b4516be0b438f8f41512a"}, "domain_id": "default", "enabled": true, "email": "user@example.com", "id": "a2185491c25b4516be0b438f8f41512a"}}' -- recorded: 2016-05-05T12:38:45.262Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/credentials - headers: - Accept: application/json - Content-Length: '217' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - body: |- - { - "credential" : { - "type" : "ec2", - "blob" : "{\"access\":\"181920\",\"secret\":\"secretKey\"}", - "user_id" : "a2185491c25b4516be0b438f8f41512a", - "project_id" : "194dfdddb6bc43e09701035b52edb0d9" + response: + status: 201 + headers: + Content-Type: application/json + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-183df59c-e004-49b1-8d38-f9b8c56df154 + body: '{"user": {"name": "Credential_CRUD_USER", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/a2185491c25b4516be0b438f8f41512a"}, "domain_id": "default", "enabled": true, "email": "user@example.com", "id": "a2185491c25b4516be0b438f8f41512a"}}' + - recorded: 2016-05-05T12:38:45.262Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/credentials + headers: + Accept: application/json + Content-Length: '217' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + body: |- + { + "credential" : { + "type" : "ec2", + "blob" : "{\"access\":\"181920\",\"secret\":\"secretKey\"}", + "user_id" : "a2185491c25b4516be0b438f8f41512a", + "project_id" : "194dfdddb6bc43e09701035b52edb0d9" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-25b95cba-a7df-45e0-ae3d-30a5072d256f - body: '{"credential": {"user_id": "a2185491c25b4516be0b438f8f41512a", "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}, "blob": "{\"access\":\"181920\",\"secret\":\"secretKey\"}", + response: + status: 201 + headers: + Content-Type: application/json + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-25b95cba-a7df-45e0-ae3d-30a5072d256f + body: '{"credential": {"user_id": "a2185491c25b4516be0b438f8f41512a", "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}, "blob": "{\"access\":\"181920\",\"secret\":\"secretKey\"}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "ec2", "id": "3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}}' -- recorded: 2016-05-05T12:38:45.336Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/credentials - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - response: - status: 200 - headers: - Content-Type: application/json - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-d67088d4-4656-46a4-a706-3024830c268a - body: '{"credentials": [{"user_id": "a2185491c25b4516be0b438f8f41512a", "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}, "blob": "{\"access\":\"181920\",\"secret\":\"secretKey\"}", + - recorded: 2016-05-05T12:38:45.336Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/credentials + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + response: + status: 200 + headers: + Content-Type: application/json + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-d67088d4-4656-46a4-a706-3024830c268a + body: '{"credentials": [{"user_id": "a2185491c25b4516be0b438f8f41512a", "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}, "blob": "{\"access\":\"181920\",\"secret\":\"secretKey\"}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "ec2", "id": "3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}, {"user_id": "71a7dcb0d60a43088a6c8e9b69a39e69", "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials/4f7747032aa1df328be714b31036dbd8f8ef586606269fdbad9ca44e818ef4ca"}, "blob": "{\"access\": \"52fc4ce6ef534b74887fc77be6c17c02\", \"secret\": \"e31b3ebd94cb4d7eb92b1393ecd98152\", \"trust_id\": null}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "ec2", "id": "4f7747032aa1df328be714b31036dbd8f8ef586606269fdbad9ca44e818ef4ca"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials", "previous": null, "next": null}}' -- recorded: 2016-05-05T12:38:45.407Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - response: - status: 200 - headers: - Content-Type: application/json - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-9467e67f-72c6-4be8-b3ae-b658b50af536 - body: '{"credential": {"user_id": "a2185491c25b4516be0b438f8f41512a", "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}, "blob": "{\"access\":\"181920\",\"secret\":\"secretKey\"}", + - recorded: 2016-05-05T12:38:45.407Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + response: + status: 200 + headers: + Content-Type: application/json + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-9467e67f-72c6-4be8-b3ae-b658b50af536 + body: '{"credential": {"user_id": "a2185491c25b4516be0b438f8f41512a", "links": {"self": "http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}, "blob": "{\"access\":\"181920\",\"secret\":\"secretKey\"}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "ec2", "id": "3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510"}}' -- recorded: 2016-05-05T12:38:45.470Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/credentials/bogusId - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - response: - status: 404 - headers: - Content-Type: application/json - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-e602a427-e703-4ca8-af92-afde6f32981a - body: '{"error": {"message": "Could not find credential: bogusId", "code": 404, "title": "Not Found"}}' -- recorded: 2016-05-05T12:38:45.547Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - response: - status: 204 - headers: - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-a92e3ff9-035f-4605-8cb1-89ba20e143a7 -- recorded: 2016-05-05T12:38:45.611Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/credentials/invalidId - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - response: - status: 404 - headers: - Content-Type: application/json - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-cc1f85f5-5e9b-43cc-95d0-e587d560a0d4 - body: '{"error": {"message": "Could not find credential: invalidId", "code": 404, "title": "Not Found"}}' -- recorded: 2016-05-05T12:38:45.807Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/users/a2185491c25b4516be0b438f8f41512a - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 - response: - status: 204 - headers: - Date: Thu, 05 May 2016 12:38:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-10abdb95-e585-41c2-bda6-196cb2d3a5c8 + - recorded: 2016-05-05T12:38:45.470Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/credentials/bogusId + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + response: + status: 404 + headers: + Content-Type: application/json + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-e602a427-e703-4ca8-af92-afde6f32981a + body: '{"error": {"message": "Could not find credential: bogusId", "code": 404, "title": "Not Found"}}' + - recorded: 2016-05-05T12:38:45.547Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + response: + status: 204 + headers: + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-a92e3ff9-035f-4605-8cb1-89ba20e143a7 + - recorded: 2016-05-05T12:38:45.611Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/credentials/invalidId + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + response: + status: 404 + headers: + Content-Type: application/json + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-cc1f85f5-5e9b-43cc-95d0-e587d560a0d4 + body: '{"error": {"message": "Could not find credential: invalidId", "code": 404, "title": "Not Found"}}' + - recorded: 2016-05-05T12:38:45.807Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/users/a2185491c25b4516be0b438f8f41512a + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 64fba294f11140f6be7f80e835d283b8 + response: + status: 204 + headers: + Date: Thu, 05 May 2016 12:38:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-10abdb95-e585-41c2-bda6-196cb2d3a5c8 diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/domainService_crud_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/domainService_crud_tape.yaml index fea494b86..19efc1286 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/domainService_crud_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/domainService_crud_tape.yaml @@ -1,48 +1,48 @@ !tape name: domainService_crud.tape interactions: -- recorded: 2016-01-12T14:27:02.924Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-12T14:27:02.924Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 14:27:02 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 53e44e3c1a0f433188615da8b95168ec - x-openstack-request-id: req-afe7e566-c9fe-41ce-bb06-41ccf38eb830 - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-12T15:27:02.907852Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 14:27:02 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 53e44e3c1a0f433188615da8b95168ec + x-openstack-request-id: req-afe7e566-c9fe-41ce-bb06-41ccf38eb830 + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-12T15:27:02.907852Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -56,110 +56,110 @@ interactions: "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["ueh1ZBy1Sre2my_TKmwz3w"], "issued_at": "2016-01-12T14:27:02.907881Z"}}' -- recorded: 2016-01-12T14:27:03.035Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/domains - headers: - Accept: application/json - Content-Length: '122' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec - body: |- - { - "domain" : { - "name" : "Domain_CRUD", - "description" : "Domain used for CRUD tests", - "enabled" : false + - recorded: 2016-01-12T14:27:03.035Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/domains + headers: + Accept: application/json + Content-Length: '122' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec + body: |- + { + "domain" : { + "name" : "Domain_CRUD", + "description" : "Domain used for CRUD tests", + "enabled" : false + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 14:27:02 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-492056c0-029f-4a97-914a-a35e8afff981 - body: '{"domain": {"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}}' -- recorded: 2016-01-12T14:27:03.096Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/domains?name=Domain_CRUD - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 14:27:03 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-0921123a-3e84-48ea-b99e-73ca81f0ca6a - body: '{"domains": [{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}], "links": {"self": + response: + status: 201 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 14:27:02 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-492056c0-029f-4a97-914a-a35e8afff981 + body: '{"domain": {"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}}' + - recorded: 2016-01-12T14:27:03.096Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/domains?name=Domain_CRUD + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 14:27:03 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-0921123a-3e84-48ea-b99e-73ca81f0ca6a + body: '{"domains": [{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/domains?name=Domain_CRUD", "previous": null, "next": null}}' -- recorded: 2016-01-12T14:27:03.160Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 14:27:03 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-3fd97a17-e56c-49b0-9246-c721afce0055 - body: '{"domain": {"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}}' -- recorded: 2016-01-12T14:27:03.220Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/domains - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 14:27:03 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-e4e17dd9-667e-4f73-999b-c7ab82e5de2b - body: '{"domains": [{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}, {"links": {"self": + - recorded: 2016-01-12T14:27:03.160Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 14:27:03 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-3fd97a17-e56c-49b0-9246-c721afce0055 + body: '{"domain": {"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}}' + - recorded: 2016-01-12T14:27:03.220Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/domains + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 14:27:03 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-e4e17dd9-667e-4f73-999b-c7ab82e5de2b + body: '{"domains": [{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa"}, "enabled": false, "description": "Domain used for CRUD tests", "name": "Domain_CRUD", "id": "0a031b4cf0ae4ba9a84f549e14b590aa"}, {"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/2f50c6cd704443b7b54ed70a59723ab4"}, "enabled": true, "description": "test domain", "name": "MyDomain", "id": "2f50c6cd704443b7b54ed70a59723ab4"}, {"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/default"}, "enabled": true, "description": "Owns users and tenants (i.e. projects) available on Identity API v2.", "name": "Default", "id": "default"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/domains", "previous": null, "next": null}}' -- recorded: 2016-01-12T14:27:03.302Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec - response: - status: 204 - headers: - Date: Tue, 12 Jan 2016 14:27:03 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Betamax: PLAY - x-openstack-request-id: req-aaaf3dea-0c0f-40ef-827b-141be2756eec + - recorded: 2016-01-12T14:27:03.302Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/domains/0a031b4cf0ae4ba9a84f549e14b590aa + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 53e44e3c1a0f433188615da8b95168ec + response: + status: 204 + headers: + Date: Tue, 12 Jan 2016 14:27:03 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Betamax: PLAY + x-openstack-request-id: req-aaaf3dea-0c0f-40ef-827b-141be2756eec diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/groupService_group_crud_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/groupService_group_crud_tape.yaml index e324a2a7a..5acb5a671 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/groupService_group_crud_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/groupService_group_crud_tape.yaml @@ -1,48 +1,48 @@ !tape name: groupService_group_crud.tape interactions: -- recorded: 2016-02-17T18:17:42.671Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-02-17T18:17:42.671Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 1fe0b81eedd74086b2012e190579ac9e - x-openstack-request-id: req-2433c66b-62ec-460b-8929-1062001719de - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-02-17T19:17:42.640445Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 1fe0b81eedd74086b2012e190579ac9e + x-openstack-request-id: req-2433c66b-62ec-460b-8929-1062001719de + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-02-17T19:17:42.640445Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -56,269 +56,269 @@ interactions: "name": "novav21"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["jMD6bipMQMyuhRbpdlprNw"], "issued_at": "2016-02-17T18:17:42.640485Z"}}' -- recorded: 2016-02-17T18:17:42.826Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Content-Length: '165' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - body: |- - { - "user" : { - "name" : "Group_CRUD_foobar", - "email" : "mail@example.com", - "password" : "secret", - "enabled" : true, - "domain_id" : "default" + - recorded: 2016-02-17T18:17:42.826Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Content-Length: '165' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + body: |- + { + "user" : { + "name" : "Group_CRUD_foobar", + "email" : "mail@example.com", + "password" : "secret", + "enabled" : true, + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-edad2501-0750-4814-b442-d60dfc8de1d8 - body: '{"user": {"name": "Group_CRUD_foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/d599b83141fc47bc9c25e89267aa27c4"}, "domain_id": "default", "enabled": true, "email": "mail@example.com", "id": "d599b83141fc47bc9c25e89267aa27c4"}}' -- recorded: 2016-02-17T18:17:42.905Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/groups - headers: - Accept: application/json - Content-Length: '120' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - body: |- - { - "group" : { - "name" : "GROUP_GRUD", - "description" : "Group for CRUD tests", - "domain_id" : "default" + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-edad2501-0750-4814-b442-d60dfc8de1d8 + body: '{"user": {"name": "Group_CRUD_foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/d599b83141fc47bc9c25e89267aa27c4"}, "domain_id": "default", "enabled": true, "email": "mail@example.com", "id": "d599b83141fc47bc9c25e89267aa27c4"}}' + - recorded: 2016-02-17T18:17:42.905Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/groups + headers: + Accept: application/json + Content-Length: '120' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + body: |- + { + "group" : { + "name" : "GROUP_GRUD", + "description" : "Group for CRUD tests", + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-74af3e6a-ca20-42ee-808a-ba16104ac66c - body: '{"group": {"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, "name": "GROUP_GRUD"}}' -- recorded: 2016-02-17T18:17:42.971Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/groups - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-afc2a71a-c0da-4d4b-8be9-93669eac9ece - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "openstack admin group", "id": "7261c982051c4080a69a52117a861d64", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/7261c982051c4080a69a52117a861d64"}, + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-74af3e6a-ca20-42ee-808a-ba16104ac66c + body: '{"group": {"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, "name": "GROUP_GRUD"}}' + - recorded: 2016-02-17T18:17:42.971Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/groups + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-afc2a71a-c0da-4d4b-8be9-93669eac9ece + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "openstack admin group", "id": "7261c982051c4080a69a52117a861d64", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/7261c982051c4080a69a52117a861d64"}, "name": "admins"}, {"domain_id": "default", "description": "non-admin group", "id": "8030dabf0cb843509602f0b3fa49adc2", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/8030dabf0cb843509602f0b3fa49adc2"}, "name": "nonadmins"}, {"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, "name": "GROUP_GRUD"}, {"domain_id": "default", "description": "group used in KeystoneRoleServiceSpec", "id": "8ffc0b29008b436b92e114ab27df0288", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/8ffc0b29008b436b92e114ab27df0288"}, "name": "role_crud_group"}, {"domain_id": "default", "description": "for integrationtest", "id": "d26804e7813b4dcd9712781832f1fac1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/d26804e7813b4dcd9712781832f1fac1"}, "name": "anotherGroups"}]}' -- recorded: 2016-02-17T18:17:43.039Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:42 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-5b9b20d1-cfce-4973-9ea2-d59a9568731f - body: '{"group": {"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, "name": "GROUP_GRUD"}}' -- recorded: 2016-02-17T18:17:43.101Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/groups?name=GROUP_GRUD - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-ef879cd8-4c0f-4c8b-be8d-a61702618119 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups?name=GROUP_GRUD", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, + - recorded: 2016-02-17T18:17:43.039Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:42 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-5b9b20d1-cfce-4973-9ea2-d59a9568731f + body: '{"group": {"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, "name": "GROUP_GRUD"}}' + - recorded: 2016-02-17T18:17:43.101Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/groups?name=GROUP_GRUD + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-ef879cd8-4c0f-4c8b-be8d-a61702618119 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups?name=GROUP_GRUD", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, "name": "GROUP_GRUD"}]}' -- recorded: 2016-02-17T18:17:43.166Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/groups?name=GROUP_GRUD&domain_id=default - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-c613bb18-3df6-4e02-ae5a-019b3d4fbb87 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups?domain_id=default&name=GROUP_GRUD", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": + - recorded: 2016-02-17T18:17:43.166Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/groups?name=GROUP_GRUD&domain_id=default + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-c613bb18-3df6-4e02-ae5a-019b3d4fbb87 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups?domain_id=default&name=GROUP_GRUD", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "Group for CRUD tests", "id": "851398fccda34f208e1839ebbc1251d1", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1"}, "name": "GROUP_GRUD"}]}' -- recorded: 2016-02-17T18:17:43.243Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 204 - headers: - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-d1524fa5-4265-4ae8-bad9-d705b9766835 -- recorded: 2016-02-17T18:17:43.315Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-98e885e1-ee7b-49ad-80a6-8d626da3d414 - body: '{"users": [{"name": "Group_CRUD_foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/d599b83141fc47bc9c25e89267aa27c4"}, "domain_id": "default", "enabled": true, "email": "mail@example.com", "id": "d599b83141fc47bc9c25e89267aa27c4"}], "links": + - recorded: 2016-02-17T18:17:43.243Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 204 + headers: + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-d1524fa5-4265-4ae8-bad9-d705b9766835 + - recorded: 2016-02-17T18:17:43.315Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-98e885e1-ee7b-49ad-80a6-8d626da3d414 + body: '{"users": [{"name": "Group_CRUD_foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/d599b83141fc47bc9c25e89267aa27c4"}, "domain_id": "default", "enabled": true, "email": "mail@example.com", "id": "d599b83141fc47bc9c25e89267aa27c4"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users", "previous": null, "next": null}}' -- recorded: 2016-02-17T18:17:43.389Z - request: - method: HEAD - uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 204 - headers: - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-76920b81-66dd-4b88-92d6-2ef9168b9397 -- recorded: 2016-02-17T18:17:43.519Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 204 - headers: - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-ba2c6bde-a6da-40ba-9ac2-1980b623344b -- recorded: 2016-02-17T18:17:43.599Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 204 - headers: - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-bf13fc70-8a3d-41ff-881a-880bc8a59f4d -- recorded: 2016-04-08T15:57:45.354Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/groups?name=nonExistentGroup&domain_id=default - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 200 - headers: - Content-Type: application/json - Date: Fri, 08 Apr 2016 16:02:52 GMT - Vary: X-Auth-Token - X-Distribution: Ubuntu - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups", "previous": null, "next": null}, "groups": []}' + - recorded: 2016-02-17T18:17:43.389Z + request: + method: HEAD + uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 204 + headers: + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-76920b81-66dd-4b88-92d6-2ef9168b9397 + - recorded: 2016-02-17T18:17:43.519Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 204 + headers: + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-ba2c6bde-a6da-40ba-9ac2-1980b623344b + - recorded: 2016-02-17T18:17:43.599Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/groups/851398fccda34f208e1839ebbc1251d1 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 204 + headers: + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-bf13fc70-8a3d-41ff-881a-880bc8a59f4d + - recorded: 2016-04-08T15:57:45.354Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/groups?name=nonExistentGroup&domain_id=default + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 200 + headers: + Content-Type: application/json + Date: Fri, 08 Apr 2016 16:02:52 GMT + Vary: X-Auth-Token + X-Distribution: Ubuntu + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/groups", "previous": null, "next": null}, "groups": []}' -- recorded: 2016-02-17T18:17:43.695Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/users/d599b83141fc47bc9c25e89267aa27c4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e - response: - status: 204 - headers: - Date: Wed, 17 Feb 2016 18:17:43 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-9b3943f8-85ca-4d32-86db-c64af4200b1b + - recorded: 2016-02-17T18:17:43.695Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/users/d599b83141fc47bc9c25e89267aa27c4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 1fe0b81eedd74086b2012e190579ac9e + response: + status: 204 + headers: + Date: Wed, 17 Feb 2016 18:17:43 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-9b3943f8-85ca-4d32-86db-c64af4200b1b diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/policyService_all_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/policyService_all_tape.yaml index 6674d3f85..f66e7e1b7 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/policyService_all_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/policyService_all_tape.yaml @@ -1,48 +1,48 @@ !tape name: policyService_all.tape interactions: -- recorded: 2016-03-02T16:11:24.403Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-03-02T16:11:24.403Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 4c2c0892266c4649afc814e126f48d5d - x-openstack-request-id: req-a5299b33-a5b2-441f-9d0d-59cadce326fb - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-03-02T17:11:24.342907Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 4c2c0892266c4649afc814e126f48d5d + x-openstack-request-id: req-a5299b33-a5b2-441f-9d0d-59cadce326fb + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-03-02T17:11:24.342907Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -56,159 +56,159 @@ interactions: "name": "novav21"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["CTgkoBSWSCu1Tq0ayALPbQ"], "issued_at": "2016-03-02T16:11:24.342944Z"}}' -- recorded: 2016-03-02T16:11:24.506Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Content-Length: '169' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d - body: |- - { - "user" : { - "name" : "PolicyCrudUser", - "email" : "user@policyCRUDtest.com", - "password" : "secret", - "enabled" : true, - "domain_id" : "default" + - recorded: 2016-03-02T16:11:24.506Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Content-Length: '169' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d + body: |- + { + "user" : { + "name" : "PolicyCrudUser", + "email" : "user@policyCRUDtest.com", + "password" : "secret", + "enabled" : true, + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-708fcf58-be49-4136-a63c-541f1f434c14 - body: '{"user": {"name": "PolicyCrudUser", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/f5864544234e4b16ab5944a4dabfc6df"}, "domain_id": "default", "enabled": true, "email": "user@policyCRUDtest.com", "id": "f5864544234e4b16ab5944a4dabfc6df"}}' -- recorded: 2016-03-02T16:11:24.557Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/policies - headers: - Accept: application/json - Content-Length: '216' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d - body: |- - { - "policy" : { - "type" : "application/json", - "blob" : "{'PolicyCrudUser' : 'role:admin-user'}", - "project_id" : "194dfdddb6bc43e09701035b52edb0d9", - "user_id" : "f5864544234e4b16ab5944a4dabfc6df" + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-708fcf58-be49-4136-a63c-541f1f434c14 + body: '{"user": {"name": "PolicyCrudUser", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/f5864544234e4b16ab5944a4dabfc6df"}, "domain_id": "default", "enabled": true, "email": "user@policyCRUDtest.com", "id": "f5864544234e4b16ab5944a4dabfc6df"}}' + - recorded: 2016-03-02T16:11:24.557Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/policies + headers: + Accept: application/json + Content-Length: '216' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d + body: |- + { + "policy" : { + "type" : "application/json", + "blob" : "{'PolicyCrudUser' : 'role:admin-user'}", + "project_id" : "194dfdddb6bc43e09701035b52edb0d9", + "user_id" : "f5864544234e4b16ab5944a4dabfc6df" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-23cd1b99-e72d-4c26-9203-31a24c30ad33 - body: '{"policy": {"user_id": "f5864544234e4b16ab5944a4dabfc6df", "links": {"self": "http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d"}, "blob": "{''PolicyCrudUser'' : ''role:admin-user''}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-23cd1b99-e72d-4c26-9203-31a24c30ad33 + body: '{"policy": {"user_id": "f5864544234e4b16ab5944a4dabfc6df", "links": {"self": "http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d"}, "blob": "{''PolicyCrudUser'' : ''role:admin-user''}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "application/json", "id": "45358c249b5c4229a3afdbfe8d4e2a0d"}}' -- recorded: 2016-03-02T16:11:24.597Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/policies - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-9a7e5938-8da9-4412-b7a7-774f7e17c679 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/policies", "previous": null, "next": null}, "policies": [{"user_id": "f5864544234e4b16ab5944a4dabfc6df", "links": {"self": "http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d"}, "blob": + - recorded: 2016-03-02T16:11:24.597Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/policies + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-9a7e5938-8da9-4412-b7a7-774f7e17c679 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/policies", "previous": null, "next": null}, "policies": [{"user_id": "f5864544234e4b16ab5944a4dabfc6df", "links": {"self": "http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d"}, "blob": "{''PolicyCrudUser'' : ''role:admin-user''}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "application/json", "id": "45358c249b5c4229a3afdbfe8d4e2a0d"}, {"user_id": "f359bd9ea5c84f47a79d5aa9c71edaf9", "links": {"self": "http://devstack.openstack.stack:5000/v3/policies/c88aa403f9744995adc5e1432db38734"}, "blob": "{''PolicyCrudUser'' : ''role:admin-user''}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "application/json", "id": "c88aa403f9744995adc5e1432db38734"}]}' -- recorded: 2016-03-02T16:11:24.641Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-312a93b4-1b4f-4a3f-bb5e-cc346e863ce3 - body: '{"policy": {"user_id": "f5864544234e4b16ab5944a4dabfc6df", "links": {"self": "http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d"}, "blob": "{''PolicyCrudUser'' : ''role:admin-user''}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", + - recorded: 2016-03-02T16:11:24.641Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-312a93b4-1b4f-4a3f-bb5e-cc346e863ce3 + body: '{"policy": {"user_id": "f5864544234e4b16ab5944a4dabfc6df", "links": {"self": "http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d"}, "blob": "{''PolicyCrudUser'' : ''role:admin-user''}", "project_id": "194dfdddb6bc43e09701035b52edb0d9", "type": "application/json", "id": "45358c249b5c4229a3afdbfe8d4e2a0d"}}' -- recorded: 2016-03-02T16:11:24.690Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d - response: - status: 204 - headers: - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-00403dab-5e8d-4457-8edd-312ec10b2b51 -- recorded: 2016-03-02T16:11:24.731Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/policies/nonExistentPolicy_ID - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d - response: - status: 404 - headers: - Content-Type: application/json - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-73055109-edac-4b8e-a2e0-dea144ac9c98 - body: '{"error": {"message": "Could not find policy: nonExistentPolicy_ID", "code": 404, "title": "Not Found"}}' -- recorded: 2016-03-02T16:11:24.819Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/users/f5864544234e4b16ab5944a4dabfc6df - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d - response: - status: 204 - headers: - Date: Wed, 02 Mar 2016 16:11:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-912c1204-a4db-4928-9005-fd0a1d1048c3 + - recorded: 2016-03-02T16:11:24.690Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/policies/45358c249b5c4229a3afdbfe8d4e2a0d + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d + response: + status: 204 + headers: + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-00403dab-5e8d-4457-8edd-312ec10b2b51 + - recorded: 2016-03-02T16:11:24.731Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/policies/nonExistentPolicy_ID + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d + response: + status: 404 + headers: + Content-Type: application/json + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-73055109-edac-4b8e-a2e0-dea144ac9c98 + body: '{"error": {"message": "Could not find policy: nonExistentPolicy_ID", "code": 404, "title": "Not Found"}}' + - recorded: 2016-03-02T16:11:24.819Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/users/f5864544234e4b16ab5944a4dabfc6df + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 4c2c0892266c4649afc814e126f48d5d + response: + status: 204 + headers: + Date: Wed, 02 Mar 2016 16:11:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-912c1204-a4db-4928-9005-fd0a1d1048c3 diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/projectService_crud_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/projectService_crud_tape.yaml index 280e73d47..ba7c35ecf 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/projectService_crud_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/projectService_crud_tape.yaml @@ -1,48 +1,48 @@ !tape name: projectService_crud.tape interactions: -- recorded: 2016-01-12T13:10:45.817Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-01-12T13:10:45.817Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_60) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:45 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 3448430442e0476d80633888dca404ca - x-openstack-request-id: req-c337c47e-4c05-4d71-92a2-67bb3eeaa36c - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-12T14:10:45.800787Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:45 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 3448430442e0476d80633888dca404ca + x-openstack-request-id: req-c337c47e-4c05-4d71-92a2-67bb3eeaa36c + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-01-12T14:10:45.800787Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -56,175 +56,175 @@ interactions: "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["TxxgkNs6QQq6uzi89SUvxg"], "issued_at": "2016-01-12T13:10:45.800814Z"}}' -- recorded: 2016-01-12T13:10:45.926Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/projects - headers: - Accept: application/json - Content-Length: '153' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - body: |- - { - "project" : { - "name" : "Project_CRUD", - "description" : "Project used for CRUD tests", - "enabled" : true, - "domain_id" : "default" + - recorded: 2016-01-12T13:10:45.926Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/projects + headers: + Accept: application/json + Content-Length: '153' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + body: |- + { + "project" : { + "name" : "Project_CRUD", + "description" : "Project used for CRUD tests", + "enabled" : true, + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:45 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-28432148-429b-4a09-9779-90a46bdf3d81 - body: '{"project": {"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, "enabled": true, "id": "791279b796654f56b449bfd955935421", "parent_id": null, "domain_id": "default", + response: + status: 201 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:45 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-28432148-429b-4a09-9779-90a46bdf3d81 + body: '{"project": {"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, "enabled": true, "id": "791279b796654f56b449bfd955935421", "parent_id": null, "domain_id": "default", "name": "Project_CRUD"}}' -- recorded: 2016-01-12T13:10:45.982Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/projects?name=Project_CRUD&domain_id=default - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:45 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-d5b358d5-5071-4307-a24d-7fdab96d260b - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?domain_id=default&name=Project_CRUD", "previous": null, "next": null}, "projects": [{"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, + - recorded: 2016-01-12T13:10:45.982Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/projects?name=Project_CRUD&domain_id=default + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:45 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-d5b358d5-5071-4307-a24d-7fdab96d260b + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?domain_id=default&name=Project_CRUD", "previous": null, "next": null}, "projects": [{"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, "enabled": true, "id": "791279b796654f56b449bfd955935421", "parent_id": null, "domain_id": "default", "name": "Project_CRUD"}]}' -- recorded: 2016-01-12T13:10:46.041Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/projects?name=Project_CRUD - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:46 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-4020e008-a501-4654-b475-d4fec8e39a50 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?name=Project_CRUD", "previous": null, "next": null}, "projects": [{"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, + - recorded: 2016-01-12T13:10:46.041Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/projects?name=Project_CRUD + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:46 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-4020e008-a501-4654-b475-d4fec8e39a50 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?name=Project_CRUD", "previous": null, "next": null}, "projects": [{"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, "enabled": true, "id": "791279b796654f56b449bfd955935421", "parent_id": null, "domain_id": "default", "name": "Project_CRUD"}]}' -- recorded: 2016-01-12T13:10:46.098Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:46 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-2728a122-ef32-4ce2-8401-8b71f9827f35 - body: '{"project": {"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, "enabled": true, "id": "791279b796654f56b449bfd955935421", "parent_id": null, "domain_id": "default", + - recorded: 2016-01-12T13:10:46.098Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:46 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-2728a122-ef32-4ce2-8401-8b71f9827f35 + body: '{"project": {"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, "enabled": true, "id": "791279b796654f56b449bfd955935421", "parent_id": null, "domain_id": "default", "name": "Project_CRUD"}}' -- recorded: 2016-01-12T13:10:46.151Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/projects - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:46 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-af6202dd-d7ee-44e5-bdbb-6f094c16440f - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects", "previous": null, "next": null}, "projects": [{"description": null, "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/0eb22fba419143a790fc2c1d322e480b"}, "enabled": true, "id": "0eb22fba419143a790fc2c1d322e480b", + - recorded: 2016-01-12T13:10:46.151Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/projects + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:46 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-af6202dd-d7ee-44e5-bdbb-6f094c16440f + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects", "previous": null, "next": null}, "projects": [{"description": null, "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/0eb22fba419143a790fc2c1d322e480b"}, "enabled": true, "id": "0eb22fba419143a790fc2c1d322e480b", "parent_id": null, "domain_id": "default", "name": "invisible_to_admin"}, {"description": "", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9"}, "enabled": true, "id": "194dfdddb6bc43e09701035b52edb0d9", "parent_id": null, "domain_id": "default", "name": "admin"}, {"domainId": "default", "description": "demo_description", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/32472181ba1f4afd8aa53b1fb217f847"}, "enabled": true, "id": "32472181ba1f4afd8aa53b1fb217f847", "parent_id": null, "domain_id": "default", "name": "demo"}, {"description": null, "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/6edceb3fa0f2407285b3c523f473dbd7"}, "enabled": true, "id": "6edceb3fa0f2407285b3c523f473dbd7", "parent_id": null, "domain_id": "default", "name": "service"}, {"description": "Project used for CRUD tests", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421"}, "enabled": true, "id": "791279b796654f56b449bfd955935421", "parent_id": null, "domain_id": "default", "name": "Project_CRUD"}, {"description": "", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/9e6aa6c98ce540898a6cea3c71336b32"}, "enabled": true, "id": "9e6aa6c98ce540898a6cea3c71336b32", "parent_id": null, "domain_id": "2f50c6cd704443b7b54ed70a59723ab4", "name": "demo"}]}' -- recorded: 2016-01-12T13:10:46.263Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - response: - status: 204 - headers: - Date: Tue, 12 Jan 2016 13:10:46 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Betamax: PLAY - x-openstack-request-id: req-12195f68-de21-437a-bd17-271f4c223973 -- recorded: 2016-01-12T13:10:46.322Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/projects?name=nonExistentProject - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:46 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-87216ef1-2476-4123-a2e2-0c16e057a597 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?name=nonExistentProject", "previous": null, "next": null}, "projects": []}' -- recorded: 2016-01-12T13:10:46.377Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/projects?name=nonExistentProject&domain_id=default - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 3448430442e0476d80633888dca404ca - response: - status: 200 - headers: - Content-Type: application/json - Date: Tue, 12 Jan 2016 13:10:46 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-090317f5-6aec-4b90-966e-af9168d4f2e4 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?domain_id=default&name=nonExistentProject", "previous": null, "next": null}, "projects": []}' + - recorded: 2016-01-12T13:10:46.263Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/projects/791279b796654f56b449bfd955935421 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + response: + status: 204 + headers: + Date: Tue, 12 Jan 2016 13:10:46 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Betamax: PLAY + x-openstack-request-id: req-12195f68-de21-437a-bd17-271f4c223973 + - recorded: 2016-01-12T13:10:46.322Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/projects?name=nonExistentProject + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:46 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-87216ef1-2476-4123-a2e2-0c16e057a597 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?name=nonExistentProject", "previous": null, "next": null}, "projects": []}' + - recorded: 2016-01-12T13:10:46.377Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/projects?name=nonExistentProject&domain_id=default + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 3448430442e0476d80633888dca404ca + response: + status: 200 + headers: + Content-Type: application/json + Date: Tue, 12 Jan 2016 13:10:46 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-090317f5-6aec-4b90-966e-af9168d4f2e4 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects?domain_id=default&name=nonExistentProject", "previous": null, "next": null}, "projects": []}' diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/regionService_all_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/regionService_all_tape.yaml index 93bc66633..f7015fb38 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/regionService_all_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/regionService_all_tape.yaml @@ -1,48 +1,48 @@ !tape name: regionService_all.tape interactions: -- recorded: 2016-03-16T15:01:58.697Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-03-16T15:01:58.697Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 16 Mar 2016 15:01:58 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 - x-openstack-request-id: req-738a6b5b-63e1-44d7-b403-e65d48a1146e - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-03-16T16:01:58.702118Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 16 Mar 2016 15:01:58 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 + x-openstack-request-id: req-738a6b5b-63e1-44d7-b403-e65d48a1146e + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-03-16T16:01:58.702118Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -56,108 +56,108 @@ interactions: "name": "novav21"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["Elio305lTtScId4Hwv_yUw"], "issued_at": "2016-03-16T15:01:58.702154Z"}}' -- recorded: 2016-03-16T15:01:58.769Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/regions - headers: - Accept: application/json - Content-Length: '138' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 - body: |- - { - "region" : { - "id" : "Region_CRUD", - "description" : "A region used for CRUD tests.", - "parent_region_id" : "RegionOne" + - recorded: 2016-03-16T15:01:58.769Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/regions + headers: + Accept: application/json + Content-Length: '138' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 + body: |- + { + "region" : { + "id" : "Region_CRUD", + "description" : "A region used for CRUD tests.", + "parent_region_id" : "RegionOne" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Wed, 16 Mar 2016 15:01:58 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-a1da88e9-da83-43d0-9207-08df1129e8af - body: '{"region": {"parent_region_id": "RegionOne", "id": "Region_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/Region_CRUD"}, "description": "A region used for CRUD tests."}}' -- recorded: 2016-03-16T15:01:58.815Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/regions - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 16 Mar 2016 15:01:58 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Betamax: PLAY - x-openstack-request-id: req-3bda5b96-7a40-4125-a82c-0362e08af1e9 - body: '{"regions": [{"parent_region_id": null, "id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/RegionOne"}, "description": ""}, {"parent_region_id": "RegionOne", "id": "Region_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/Region_CRUD"}, + response: + status: 201 + headers: + Content-Type: application/json + Date: Wed, 16 Mar 2016 15:01:58 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-a1da88e9-da83-43d0-9207-08df1129e8af + body: '{"region": {"parent_region_id": "RegionOne", "id": "Region_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/Region_CRUD"}, "description": "A region used for CRUD tests."}}' + - recorded: 2016-03-16T15:01:58.815Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/regions + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 16 Mar 2016 15:01:58 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Betamax: PLAY + x-openstack-request-id: req-3bda5b96-7a40-4125-a82c-0362e08af1e9 + body: '{"regions": [{"parent_region_id": null, "id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/RegionOne"}, "description": ""}, {"parent_region_id": "RegionOne", "id": "Region_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/Region_CRUD"}, "description": "A region used for CRUD tests."}], "links": {"self": "http://devstack.openstack.stack:5000/v3/regions", "previous": null, "next": null}}' -- recorded: 2016-03-16T15:01:58.861Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/regions/Region_CRUD - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 - response: - status: 200 - headers: - Content-Type: application/json - Date: Wed, 16 Mar 2016 15:01:58 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-326f3280-e9f7-468a-9e7d-6e11833e1c2e - body: '{"region": {"parent_region_id": "RegionOne", "id": "Region_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/Region_CRUD"}, "description": "A region used for CRUD tests."}}' -- recorded: 2016-03-16T15:01:58.917Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/regions/Region_CRUD - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 - response: - status: 204 - headers: - Date: Wed, 16 Mar 2016 15:01:58 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-d428e41d-104e-4d70-ba47-0878e914b200 -- recorded: 2016-03-16T15:01:58.961Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/regions/nonExistentRegionId - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 - response: - status: 404 - headers: - Content-Type: application/json - Date: Wed, 16 Mar 2016 15:01:58 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-9699ed7f-05d3-4e0c-86e9-09f2744f7362 - body: '{"error": {"message": "Could not find region: nonExistentRegionId", "code": 404, "title": "Not Found"}}' + - recorded: 2016-03-16T15:01:58.861Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/regions/Region_CRUD + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 + response: + status: 200 + headers: + Content-Type: application/json + Date: Wed, 16 Mar 2016 15:01:58 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-326f3280-e9f7-468a-9e7d-6e11833e1c2e + body: '{"region": {"parent_region_id": "RegionOne", "id": "Region_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/regions/Region_CRUD"}, "description": "A region used for CRUD tests."}}' + - recorded: 2016-03-16T15:01:58.917Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/regions/Region_CRUD + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 + response: + status: 204 + headers: + Date: Wed, 16 Mar 2016 15:01:58 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-d428e41d-104e-4d70-ba47-0878e914b200 + - recorded: 2016-03-16T15:01:58.961Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/regions/nonExistentRegionId + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 2cbb0e8b0b9e471a8ddf9ca588e9af67 + response: + status: 404 + headers: + Content-Type: application/json + Date: Wed, 16 Mar 2016 15:01:58 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-9699ed7f-05d3-4e0c-86e9-09f2744f7362 + body: '{"error": {"message": "Could not find region: nonExistentRegionId", "code": 404, "title": "Not Found"}}' diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/roleService_all_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/roleService_all_tape.yaml index f483f3fc2..c45eb09c2 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/roleService_all_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/roleService_all_tape.yaml @@ -1,46 +1,46 @@ !tape name: roleService_all.tape interactions: -- recorded: 2016-10-10T20:01:20.204Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-10-10T20:01:20.204Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" + "scope" : { + "domain" : { + "id" : "default" + } } } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: abece075934c4ef8abd7c66b3873fdd5 - x-openstack-request-id: req-2313046d-61b6-4190-bf85-7af7d7cb94c7 - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T21:01:20.167727Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: abece075934c4ef8abd7c66b3873fdd5 + x-openstack-request-id: req-2313046d-61b6-4190-bf85-7af7d7cb94c7 + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T21:01:20.167727Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "a22c5fb9dc5e4e009fc120264742b4b2"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "ddb07575d31c4c158e1cf9c243d03388"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "f6f6ca8e72a24d45adc1afed4d104a97"}], "type": "network", "id": "1f5a058073e045e58a11706b538d9201", "name": "neutron"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9292", "region": "RegionOne", "interface": "admin", "id": "483c914d91e44d598d3e8b98b54852b5"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9292", "region": "RegionOne", "interface": "internal", "id": @@ -50,478 +50,478 @@ interactions: "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "public", "id": "f4eca07c52814e39b43e8106a8f06df9"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "internal", "id": "f845e3338ce94fc684233659c7274bee"}], "type": "identity", "id": "dc2a2f1ea51047508cadf4b7fde71dfb", "name": "keystone"}, {"endpoints": [], "type": "compute", "id": "f48f4f5b299440d09400e0e4094aefa3", "name": "nova"}], "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["unq4gT_tTaGtdiPtNT9npQ"], "issued_at": "2016-10-10T20:01:20.167771Z"}}' -- recorded: 2016-10-10T20:01:20.494Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - body: |- - { - "user" : { - "name" : "anotherUserForRoleTest", - "email" : "user@example.org", - "password" : "secret", - "enabled" : true, - "domain_id" : "default" + - recorded: 2016-10-10T20:01:20.494Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + body: |- + { + "user" : { + "name" : "anotherUserForRoleTest", + "email" : "user@example.org", + "password" : "secret", + "enabled" : true, + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-ecdf7725-1284-4b12-b458-a032bc96c709 - body: '{"user": {"name": "anotherUserForRoleTest", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/c31212d0abdf423a8d8fc3fb384d4b58"}, "domain_id": "default", "enabled": true, "email": "user@example.org", "id": "c31212d0abdf423a8d8fc3fb384d4b58"}}' -- recorded: 2016-10-10T20:01:20.573Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/groups - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - body: |- - { - "group" : { - "name" : "anotherGroupForRoleServiceTest", - "description" : "group used for role service integration test", - "domain_id" : "default" + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-ecdf7725-1284-4b12-b458-a032bc96c709 + body: '{"user": {"name": "anotherUserForRoleTest", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/c31212d0abdf423a8d8fc3fb384d4b58"}, "domain_id": "default", "enabled": true, "email": "user@example.org", "id": "c31212d0abdf423a8d8fc3fb384d4b58"}}' + - recorded: 2016-10-10T20:01:20.573Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/groups + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + body: |- + { + "group" : { + "name" : "anotherGroupForRoleServiceTest", + "description" : "group used for role service integration test", + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-dfe50cd9-3d1f-4263-b1a7-efc5e21314ad - body: '{"group": {"domain_id": "default", "description": "group used for role service integration test", "id": "79606ba669d34561aa64a5243dae2c92", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/79606ba669d34561aa64a5243dae2c92"}, "name": "anotherGroupForRoleServiceTest"}}' -- recorded: 2016-10-10T20:01:20.656Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/roles - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - body: |- - { - "role" : { - "name" : "Role_CRUD" + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-dfe50cd9-3d1f-4263-b1a7-efc5e21314ad + body: '{"group": {"domain_id": "default", "description": "group used for role service integration test", "id": "79606ba669d34561aa64a5243dae2c92", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/79606ba669d34561aa64a5243dae2c92"}, "name": "anotherGroupForRoleServiceTest"}}' + - recorded: 2016-10-10T20:01:20.656Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/roles + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + body: |- + { + "role" : { + "name" : "Role_CRUD" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-12c47434-13d2-4955-bc7c-5d9ebfff11de - body: '{"role": {"domain_id": null, "id": "f61a65d8353044a8a8b7b95674d7c3a4", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4"}, "name": "Role_CRUD"}}' -- recorded: 2016-10-10T20:01:20.778Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/roles?name=roleNotFound - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-64d302e2-e853-47ca-ae49-81d634c12fe9 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/roles?name=roleNotFound", "previous": null, "next": null}, "roles": []}' -- recorded: 2016-10-10T20:01:20.854Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/roles?name=Role_CRUD - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-ce600579-bc79-4d45-be49-00bb7d747174 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/roles?name=Role_CRUD", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "f61a65d8353044a8a8b7b95674d7c3a4", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4"}, + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-12c47434-13d2-4955-bc7c-5d9ebfff11de + body: '{"role": {"domain_id": null, "id": "f61a65d8353044a8a8b7b95674d7c3a4", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4"}, "name": "Role_CRUD"}}' + - recorded: 2016-10-10T20:01:20.778Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/roles?name=roleNotFound + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-64d302e2-e853-47ca-ae49-81d634c12fe9 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/roles?name=roleNotFound", "previous": null, "next": null}, "roles": []}' + - recorded: 2016-10-10T20:01:20.854Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/roles?name=Role_CRUD + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-ce600579-bc79-4d45-be49-00bb7d747174 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/roles?name=Role_CRUD", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "f61a65d8353044a8a8b7b95674d7c3a4", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4"}, "name": "Role_CRUD"}]}' -- recorded: 2016-10-10T20:01:20.922Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/roles - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-36158869-52ee-4c83-8df0-de50340f4caa - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/roles", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "2e18ac09cfda45059969efffaba6adf8", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/2e18ac09cfda45059969efffaba6adf8"}, + - recorded: 2016-10-10T20:01:20.922Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/roles + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-36158869-52ee-4c83-8df0-de50340f4caa + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/roles", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "2e18ac09cfda45059969efffaba6adf8", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/2e18ac09cfda45059969efffaba6adf8"}, "name": "admin"}, {"domain_id": null, "id": "589b98dbc3f04c7aad678363987a465d", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/589b98dbc3f04c7aad678363987a465d"}, "name": "ResellerAdmin"}, {"domain_id": null, "id": "80ba01d6dbc0425bb07094dbc795f5bc", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/80ba01d6dbc0425bb07094dbc795f5bc"}, "name": "Member"}, {"domain_id": null, "id": "dabaf70819d3426cb9ff36cc6ddab35e", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/dabaf70819d3426cb9ff36cc6ddab35e"}, "name": "service"}, {"domain_id": null, "id": "f61a65d8353044a8a8b7b95674d7c3a4", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4"}, "name": "Role_CRUD"}]}' -- recorded: 2016-10-10T20:01:20.990Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:20 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-77f1f874-f976-4287-826e-a5788d33d5e8 - body: '{"role": {"id": "f61a65d8353044a8a8b7b95674d7c3a4", "domain_id": null, "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4"}, "name": "Role_CRUD"}}' -- recorded: 2016-10-10T20:01:21.082Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-b27c7581-3512-47f7-9b27-339fcdda8e67 -- recorded: 2016-10-10T20:01:21.152Z - request: - method: HEAD - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-52cb83fd-8687-436a-bcae-500578812a78 -- recorded: 2016-10-10T20:01:21.267Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-d87dfd8f-e76f-4e69-9c65-120664d3707d -- recorded: 2016-10-10T20:01:21.344Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/nonExistingRoleId - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 404 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-08b5a782-4c47-4328-af23-2bc67cf01356 - body: '{"error": {"message": "Could not find role: nonExistingRoleId", "code": 404, "title": "Not Found"}}' -- recorded: 2016-10-10T20:01:21.471Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-d1fefadf-9ee0-4253-b607-b5b61111a164 -- recorded: 2016-10-10T20:01:21.541Z - request: - method: HEAD - uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-0f969915-9a25-461a-b329-e143ac368347 -- recorded: 2016-10-10T20:01:21.634Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-bfc69681-ff85-4411-95c5-c5c312bfaa4c -- recorded: 2016-10-10T20:01:21.708Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/nonExistingRoleId - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 404 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-8e7a14eb-b278-4766-90d8-74734e4f1a92 - body: '{"error": {"message": "Could not find role: nonExistingRoleId", "code": 404, "title": "Not Found"}}' -- recorded: 2016-10-10T20:01:21.845Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-7213d70b-921b-4944-99cf-69dbbcd3bd6e -- recorded: 2016-10-10T20:01:21.922Z - request: - method: HEAD - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-ccc0560c-9b54-4be4-8b13-56a93b40a81e -- recorded: 2016-10-10T20:01:22.024Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:21 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-c2f83d3e-ceb3-42b7-8686-5e206f1a62b1 -- recorded: 2016-10-10T20:01:22.113Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/domains/default/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-2800a83d-1917-49e2-b420-581b5d9de514 -- recorded: 2016-10-10T20:01:22.182Z - request: - method: HEAD - uri: http://devstack.openstack.stack:5000/v3/domains/default/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-706ee67c-502f-4f83-a3bc-73282cab4bd6 -- recorded: 2016-10-10T20:01:22.291Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/domains/default/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-3135ff49-9fef-41ef-8898-01fc133e55c3 -- recorded: 2016-10-10T20:01:22.391Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-faf91ca8-b2a0-49e8-89fd-e1dc68eada8e -- recorded: 2016-10-10T20:01:22.531Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/users/c31212d0abdf423a8d8fc3fb384d4b58 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-ad498755-4a87-4097-915a-61f1832829da -- recorded: 2016-10-10T20:01:22.630Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/groups/79606ba669d34561aa64a5243dae2c92 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:01:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-0f4002c7-46b1-4329-8025-07f2093f0aef -- recorded: 2016-10-10T20:01:22.703Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/roles/79606ba669d34561aa64a5243dae2c92 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 - response: - status: 204 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:01:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-baf11eb1-35c9-431e-8654-88986738a4ab + - recorded: 2016-10-10T20:01:20.990Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:20 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-77f1f874-f976-4287-826e-a5788d33d5e8 + body: '{"role": {"id": "f61a65d8353044a8a8b7b95674d7c3a4", "domain_id": null, "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4"}, "name": "Role_CRUD"}}' + - recorded: 2016-10-10T20:01:21.082Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-b27c7581-3512-47f7-9b27-339fcdda8e67 + - recorded: 2016-10-10T20:01:21.152Z + request: + method: HEAD + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-52cb83fd-8687-436a-bcae-500578812a78 + - recorded: 2016-10-10T20:01:21.267Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-d87dfd8f-e76f-4e69-9c65-120664d3707d + - recorded: 2016-10-10T20:01:21.344Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/nonExistingRoleId + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 404 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-08b5a782-4c47-4328-af23-2bc67cf01356 + body: '{"error": {"message": "Could not find role: nonExistingRoleId", "code": 404, "title": "Not Found"}}' + - recorded: 2016-10-10T20:01:21.471Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-d1fefadf-9ee0-4253-b607-b5b61111a164 + - recorded: 2016-10-10T20:01:21.541Z + request: + method: HEAD + uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-0f969915-9a25-461a-b329-e143ac368347 + - recorded: 2016-10-10T20:01:21.634Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-bfc69681-ff85-4411-95c5-c5c312bfaa4c + - recorded: 2016-10-10T20:01:21.708Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/domains/default/users/c31212d0abdf423a8d8fc3fb384d4b58/roles/nonExistingRoleId + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 404 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-8e7a14eb-b278-4766-90d8-74734e4f1a92 + body: '{"error": {"message": "Could not find role: nonExistingRoleId", "code": 404, "title": "Not Found"}}' + - recorded: 2016-10-10T20:01:21.845Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-7213d70b-921b-4944-99cf-69dbbcd3bd6e + - recorded: 2016-10-10T20:01:21.922Z + request: + method: HEAD + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-ccc0560c-9b54-4be4-8b13-56a93b40a81e + - recorded: 2016-10-10T20:01:22.024Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:21 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-c2f83d3e-ceb3-42b7-8686-5e206f1a62b1 + - recorded: 2016-10-10T20:01:22.113Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/domains/default/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-2800a83d-1917-49e2-b420-581b5d9de514 + - recorded: 2016-10-10T20:01:22.182Z + request: + method: HEAD + uri: http://devstack.openstack.stack:5000/v3/domains/default/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-706ee67c-502f-4f83-a3bc-73282cab4bd6 + - recorded: 2016-10-10T20:01:22.291Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/domains/default/groups/79606ba669d34561aa64a5243dae2c92/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-3135ff49-9fef-41ef-8898-01fc133e55c3 + - recorded: 2016-10-10T20:01:22.391Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/roles/f61a65d8353044a8a8b7b95674d7c3a4 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-faf91ca8-b2a0-49e8-89fd-e1dc68eada8e + - recorded: 2016-10-10T20:01:22.531Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/users/c31212d0abdf423a8d8fc3fb384d4b58 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-ad498755-4a87-4097-915a-61f1832829da + - recorded: 2016-10-10T20:01:22.630Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/groups/79606ba669d34561aa64a5243dae2c92 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:01:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-0f4002c7-46b1-4329-8025-07f2093f0aef + - recorded: 2016-10-10T20:01:22.703Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/roles/79606ba669d34561aa64a5243dae2c92 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: abece075934c4ef8abd7c66b3873fdd5 + response: + status: 204 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:01:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-baf11eb1-35c9-431e-8654-88986738a4ab diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/serviceEndpoints_all_tape.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/serviceEndpoints_all_tape.yaml index 6f7273d65..5b8997cb3 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/serviceEndpoints_all_tape.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/serviceEndpoints_all_tape.yaml @@ -1,49 +1,49 @@ !tape name: serviceEndpoints_all.tape interactions: -- recorded: 2016-03-03T13:59:22.584Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Connection: close - Content-Length: '327' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" + - recorded: 2016-03-03T13:59:22.584Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Connection: close + Content-Length: '327' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] + }, + "scope" : { + "domain" : { + "id" : "default" } }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" - } - }, - "type" : "CREDENTIALS" + "type" : "CREDENTIALS" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: b6b3f962ddcc4e308175554489e17cd1 - x-openstack-request-id: req-4390f19c-a74c-4f73-aedd-8839266ac88e - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-03-03T14:59:22.593355Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: b6b3f962ddcc4e308175554489e17cd1 + x-openstack-request-id: req-4390f19c-a74c-4f73-aedd-8839266ac88e + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "aae88952465d4c32b0a1140a76601b68", "name": "admin"}], "expires_at": "2016-03-03T14:59:22.593355Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [], "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "admin", "id": "3dc90fc97a944ea8abad75fced928309"}, {"region_id": "RegionOne", @@ -57,55 +57,55 @@ interactions: "name": "novav21"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["jrhcVv9JSA-kwD7G9ORF_Q"], "issued_at": "2016-03-03T13:59:22.593400Z"}}' -- recorded: 2016-03-03T13:59:22.649Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/services - headers: - Accept: application/json - Content-Length: '147' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - body: |- - { - "service" : { - "name" : "Service_CRUD", - "type" : "identity", - "description" : "A service used for tests.", - "enabled" : true + - recorded: 2016-03-03T13:59:22.649Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/services + headers: + Accept: application/json + Content-Length: '147' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + body: |- + { + "service" : { + "name" : "Service_CRUD", + "type" : "identity", + "description" : "A service used for tests.", + "enabled" : true + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-27872726-57c8-4b03-a9c8-f0aade51abbc - body: '{"service": {"name": "Service_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19"}, "enabled": true, "type": "identity", "id": "da6ac6f124e84c7ea82bb2991df3fa19", "description": "A service used for tests."}}' -- recorded: 2016-03-03T13:59:22.689Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/services - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - response: - status: 200 - headers: - Content-Type: application/json - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-525a3009-ba72-4cd0-9fc1-894aebea311c - body: '{"services": [{"name": "ec2", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/057b697545694c22b3d20bfe95a2cd7d"}, "enabled": true, "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "description": "EC2 Compatibility Layer"}, {"name": + response: + status: 201 + headers: + Content-Type: application/json + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-27872726-57c8-4b03-a9c8-f0aade51abbc + body: '{"service": {"name": "Service_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19"}, "enabled": true, "type": "identity", "id": "da6ac6f124e84c7ea82bb2991df3fa19", "description": "A service used for tests."}}' + - recorded: 2016-03-03T13:59:22.689Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/services + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + response: + status: 200 + headers: + Content-Type: application/json + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-525a3009-ba72-4cd0-9fc1-894aebea311c + body: '{"services": [{"name": "ec2", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/057b697545694c22b3d20bfe95a2cd7d"}, "enabled": true, "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "description": "EC2 Compatibility Layer"}, {"name": "nova", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/110b628369654c83bb58c573df7f88c6"}, "enabled": true, "type": "compute", "id": "110b628369654c83bb58c573df7f88c6", "description": "Nova Compute Service"}, {"enabled": true, "type": "identityv3", "name": "identity v3", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/1b565419e6db4407a3f28f5f851db660"}, "id": "1b565419e6db4407a3f28f5f851db660"}, {"name": "cinder", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/2fb3cbed8edc490788c0c1506e8b0df9"}, "enabled": true, "type": "volume", "id": "2fb3cbed8edc490788c0c1506e8b0df9", "description": "Cinder Volume Service"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/35815a28b22e48f9bdaadd7df6224a08"}, "enabled": true, "type": @@ -116,77 +116,77 @@ interactions: "links": {"self": "http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19"}, "enabled": true, "type": "identity", "id": "da6ac6f124e84c7ea82bb2991df3fa19", "description": "A service used for tests."}, {"name": "neutron", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/f6028c7a65c14663946bfeb37c5477ca"}, "enabled": true, "type": "network", "id": "f6028c7a65c14663946bfeb37c5477ca", "description": "Neutron Service"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/services", "previous": null, "next": null}}' -- recorded: 2016-03-03T13:59:22.732Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - response: - status: 200 - headers: - Content-Type: application/json - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-4c078447-e275-4d15-971a-bc3d6ccc87c4 - body: '{"service": {"name": "Service_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19"}, "enabled": true, "type": "identity", "id": "da6ac6f124e84c7ea82bb2991df3fa19", "description": "A service used for tests."}}' -- recorded: 2016-03-03T13:59:22.782Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/endpoints - headers: - Accept: application/json - Content-Length: '243' - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - body: |- - { - "endpoint" : { - "name" : "Endpoint_CRUD", - "url" : "http://devstack.openstack.stack:5000/v3", - "enabled" : true, - "interface" : "admin", - "service_id" : "da6ac6f124e84c7ea82bb2991df3fa19", - "region_id" : "RegionOne" + - recorded: 2016-03-03T13:59:22.732Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + response: + status: 200 + headers: + Content-Type: application/json + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-4c078447-e275-4d15-971a-bc3d6ccc87c4 + body: '{"service": {"name": "Service_CRUD", "links": {"self": "http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19"}, "enabled": true, "type": "identity", "id": "da6ac6f124e84c7ea82bb2991df3fa19", "description": "A service used for tests."}}' + - recorded: 2016-03-03T13:59:22.782Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/endpoints + headers: + Accept: application/json + Content-Length: '243' + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + body: |- + { + "endpoint" : { + "name" : "Endpoint_CRUD", + "url" : "http://devstack.openstack.stack:5000/v3", + "enabled" : true, + "interface" : "admin", + "service_id" : "da6ac6f124e84c7ea82bb2991df3fa19", + "region_id" : "RegionOne" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-ba823951-8cb7-4742-9bb5-918c8b009b5f - body: '{"endpoint": {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683"}, "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "enabled": true, "interface": "admin", "service_id": + response: + status: 201 + headers: + Content-Type: application/json + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-ba823951-8cb7-4742-9bb5-918c8b009b5f + body: '{"endpoint": {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683"}, "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "enabled": true, "interface": "admin", "service_id": "da6ac6f124e84c7ea82bb2991df3fa19", "id": "76acf122487e41769029e5dac01c1683", "name": "Endpoint_CRUD"}}' -- recorded: 2016-03-03T13:59:22.828Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/endpoints - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - response: - status: 200 - headers: - Content-Type: application/json - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-90dd3e4a-6907-4d7c-8434-03336eb5402a - body: '{"endpoints": [{"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/0af60b8c25bb43a3900e3965b22f7458"}, "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "enabled": true, "interface": "public", "service_id": "f6028c7a65c14663946bfeb37c5477ca", + - recorded: 2016-03-03T13:59:22.828Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/endpoints + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + response: + status: 200 + headers: + Content-Type: application/json + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-90dd3e4a-6907-4d7c-8434-03336eb5402a + body: '{"endpoints": [{"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/0af60b8c25bb43a3900e3965b22f7458"}, "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "enabled": true, "interface": "public", "service_id": "f6028c7a65c14663946bfeb37c5477ca", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/16fd2c85ec774496b2cbf27147a23d11"}, "url": "http://devstack.openstack.stack:8774/v2/$(tenant_id)s", "region": "RegionOne", "enabled": true, "interface": "internal", "service_id": "110b628369654c83bb58c573df7f88c6", "id": "16fd2c85ec774496b2cbf27147a23d11"}, {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/1986b6750b784f88a0f1f1e83e511df8"}, "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "enabled": true, "interface": "internal", "service_id": "057b697545694c22b3d20bfe95a2cd7d", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/2703ae0363924936b1266dbdb311c582"}, @@ -218,57 +218,57 @@ interactions: "id": "eb3e556f4e2c446e907524447cbb8a5d"}, {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/eb838a26461649b5bff11fe6b1c24408"}, "url": "http://devstack.openstack.stack:8774/v2/$(tenant_id)s", "region": "RegionOne", "enabled": true, "interface": "public", "service_id": "110b628369654c83bb58c573df7f88c6", "id": "eb838a26461649b5bff11fe6b1c24408"}, {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/fbdef86a98b14a038503bd5f40ab3ec7"}, "url": "http://devstack.openstack.stack:8776/v1/$(tenant_id)s", "region": "RegionOne", "enabled": true, "interface": "internal", "service_id": "2fb3cbed8edc490788c0c1506e8b0df9", "id": "fbdef86a98b14a038503bd5f40ab3ec7"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints", "previous": null, "next": null}}' -- recorded: 2016-03-03T13:59:22.869Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - response: - status: 200 - headers: - Content-Type: application/json - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-7a52196b-03bd-4871-b977-3273faa2564e - body: '{"endpoint": {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683"}, "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "enabled": true, "interface": "admin", "service_id": + - recorded: 2016-03-03T13:59:22.869Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + response: + status: 200 + headers: + Content-Type: application/json + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-7a52196b-03bd-4871-b977-3273faa2564e + body: '{"endpoint": {"region_id": "RegionOne", "links": {"self": "http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683"}, "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "enabled": true, "interface": "admin", "service_id": "da6ac6f124e84c7ea82bb2991df3fa19", "id": "76acf122487e41769029e5dac01c1683", "name": "Endpoint_CRUD"}}' -- recorded: 2016-03-03T13:59:22.924Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - response: - status: 204 - headers: - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-c28dabbb-e5a9-49d4-892d-ad763c444ceb -- recorded: 2016-03-03T13:59:22.984Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 - response: - status: 204 - headers: - Date: Thu, 03 Mar 2016 13:59:22 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-77644fcf-3cb8-41ce-ae2a-72979a323c5b + - recorded: 2016-03-03T13:59:22.924Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/endpoints/76acf122487e41769029e5dac01c1683 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + response: + status: 204 + headers: + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-c28dabbb-e5a9-49d4-892d-ad763c444ceb + - recorded: 2016-03-03T13:59:22.984Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/services/da6ac6f124e84c7ea82bb2991df3fa19 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: b6b3f962ddcc4e308175554489e17cd1 + response: + status: 204 + headers: + Date: Thu, 03 Mar 2016 13:59:22 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-77644fcf-3cb8-41ce-ae2a-72979a323c5b diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_crud.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_crud.yaml index f23b6267b..d9bc509ba 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_crud.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_crud.yaml @@ -1,46 +1,46 @@ !tape name: tokenService_crud interactions: -- recorded: 2016-10-10T14:16:18.017Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-10-10T14:16:18.017Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "scope" : { - "project" : { - "id" : "194dfdddb6bc43e09701035b52edb0d9" + "scope" : { + "project" : { + "id" : "194dfdddb6bc43e09701035b52edb0d9" + } } } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 14:16:17 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 0a068742da5947f081690dd5f9d9102e - x-openstack-request-id: req-36daf3f1-8f56-4b94-a475-163ce85449ae - body: '{"token": {"methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T15:16:18.040139Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 14:16:17 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 0a068742da5947f081690dd5f9d9102e + x-openstack-request-id: req-36daf3f1-8f56-4b94-a475-163ce85449ae + body: '{"token": {"methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T15:16:18.040139Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "a22c5fb9dc5e4e009fc120264742b4b2"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "ddb07575d31c4c158e1cf9c243d03388"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "f6f6ca8e72a24d45adc1afed4d104a97"}], "type": "network", "id": "1f5a058073e045e58a11706b538d9201", "name": "neutron"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9292", "region": "RegionOne", "interface": "admin", "id": "483c914d91e44d598d3e8b98b54852b5"}, {"region_id": @@ -59,27 +59,27 @@ interactions: {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2.1/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "6a4fef2b87a24f7eb64eafb95b9925dc"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2.1/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "public", "id": "a86786aefb764345a928baf4f8f5e771"}], "type": "compute", "id": "f48f4f5b299440d09400e0e4094aefa3", "name": "nova"}], "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["NjNNnY-RQrOOuax5aG42hg"], "issued_at": "2016-10-10T14:16:18.040188Z"}}' -- recorded: 2016-10-10T14:34:41.313Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 0a068742da5947f081690dd5f9d9102e - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 14:34:41 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - x-openstack-request-id: req-3785e316-5be1-4fa7-b7e7-f406949a0409 - body: '{"token": {"methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T15:16:15.301967Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + - recorded: 2016-10-10T14:34:41.313Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 0a068742da5947f081690dd5f9d9102e + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 14:34:41 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + x-openstack-request-id: req-3785e316-5be1-4fa7-b7e7-f406949a0409 + body: '{"token": {"methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T15:16:15.301967Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:9696/", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "a22c5fb9dc5e4e009fc120264742b4b2"}, {"url": "http://devstack.openstack.stack:9696/", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "ddb07575d31c4c158e1cf9c243d03388"}, {"url": "http://devstack.openstack.stack:9696/", "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "f6f6ca8e72a24d45adc1afed4d104a97"}], "type": "network", "id": "1f5a058073e045e58a11706b538d9201", "name": "neutron"}, {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "483c914d91e44d598d3e8b98b54852b5"}, {"url": "http://devstack.openstack.stack:9292", @@ -98,46 +98,46 @@ interactions: "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "6a4fef2b87a24f7eb64eafb95b9925dc"}, {"url": "http://devstack.openstack.stack:8774/v2.1/194dfdddb6bc43e09701035b52edb0d9", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "a86786aefb764345a928baf4f8f5e771"}], "type": "compute", "id": "f48f4f5b299440d09400e0e4094aefa3", "name": "nova"}], "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["eIAx8329R9CrpZv-ggtUeg"], "issued_at": "2016-10-10T14:16:15.302012Z"}}' -- recorded: 2016-10-10T14:34:41.392Z - request: - method: HEAD - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 0a068742da5947f081690dd5f9d9102e - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 14:34:41 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - x-openstack-request-id: req-41b8490c-4c99-40a2-9c6f-d826cd35a115 -- recorded: 2016-10-13T14:52:29.408Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/auth/catalog - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 0a068742da5947f081690dd5f9d9102e - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - response: - status: 200 - headers: - Content-Type: application/json - Date: Thu, 13 Oct 2016 14:52:37 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-d2b87c4c-10d6-4ab4-bfd4-3cb6d63b2c13 - body: '{"catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": + - recorded: 2016-10-10T14:34:41.392Z + request: + method: HEAD + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 0a068742da5947f081690dd5f9d9102e + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 14:34:41 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + x-openstack-request-id: req-41b8490c-4c99-40a2-9c6f-d826cd35a115 + - recorded: 2016-10-13T14:52:29.408Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/auth/catalog + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 0a068742da5947f081690dd5f9d9102e + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + response: + status: 200 + headers: + Content-Type: application/json + Date: Thu, 13 Oct 2016 14:52:37 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-d2b87c4c-10d6-4ab4-bfd4-3cb6d63b2c13 + body: '{"catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "internal", "id": "1986b6750b784f88a0f1f1e83e511df8"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "admin", "id": "64afe603967b4fd5880792840c659a4d"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8773/", "region": "RegionOne", "interface": "public", "id": "eb3e556f4e2c446e907524447cbb8a5d"}], "type": "ec2", "id": "057b697545694c22b3d20bfe95a2cd7d", "name": "ec2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "internal", "id": "16fd2c85ec774496b2cbf27147a23d11"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "admin", "id": "ab57757659744aa696567a591aaff2fd"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2/194dfdddb6bc43e09701035b52edb0d9", "region": @@ -158,67 +158,67 @@ interactions: {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:8774/v2.1/194dfdddb6bc43e09701035b52edb0d9", "region": "RegionOne", "interface": "admin", "id": "d75d78babccf4ee0a2ac5e02dcffcdda"}], "type": "computev21", "id": "c7ab57ad5cca470893bad70a4d5bf3ee", "name": "novav21"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "0af60b8c25bb43a3900e3965b22f7458"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "523f2db6ab7542ad8d0cfb67a4a45c1e"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "c86b9137fe3a49d58ad027581f7005a7"}], "type": "network", "id": - "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/auth/catalog"}}' -- recorded: 2016-10-10T14:34:41.532Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/auth/projects - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 0a068742da5947f081690dd5f9d9102e - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 14:34:41 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-55c2a8b2-4d7d-44c5-8ff5-b59168289a68 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/auth/projects", "previous": null, "next": null}, "projects": [{"is_domain": false, "description": "Bootstrap project for initializing the cloud.", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9"}, + "f6028c7a65c14663946bfeb37c5477ca", "name": "neutron"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/auth/catalog"}}' + - recorded: 2016-10-10T14:34:41.532Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/auth/projects + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 0a068742da5947f081690dd5f9d9102e + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 14:34:41 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-55c2a8b2-4d7d-44c5-8ff5-b59168289a68 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/auth/projects", "previous": null, "next": null}, "projects": [{"is_domain": false, "description": "Bootstrap project for initializing the cloud.", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9"}, "enabled": true, "id": "194dfdddb6bc43e09701035b52edb0d9", "parent_id": "default", "domain_id": "default", "name": "admin"}, {"is_domain": false, "description": "", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/2988f03c96ba4aac8eef70ba757c5a89"}, "enabled": true, "id": "2988f03c96ba4aac8eef70ba757c5a89", "parent_id": "default", "domain_id": "default", "name": "service"}, {"is_domain": false, "description": "", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/b1fe8f4d2e624566bd1b339c28265674"}, "enabled": true, "id": "b1fe8f4d2e624566bd1b339c28265674", "parent_id": "default", "domain_id": "default", "name": "alt_demo"}, {"is_domain": false, "description": "", "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/d6bbd4eb9b924afd8185d19029dbf659"}, "enabled": true, "id": "d6bbd4eb9b924afd8185d19029dbf659", "parent_id": "default", "domain_id": "default", "name": "demo"}]}' -- recorded: 2016-10-10T14:34:41.662Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/auth/domains - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 0a068742da5947f081690dd5f9d9102e - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 14:34:41 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-07510a6e-db7e-483a-b6bd-7f7ad8eb4fb5 - body: '{"domains": [{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/default"}, "description": "The default domain", "name": "Default", "enabled": true, "id": "default"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/auth/domains", "previous": + - recorded: 2016-10-10T14:34:41.662Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/auth/domains + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 0a068742da5947f081690dd5f9d9102e + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 14:34:41 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-07510a6e-db7e-483a-b6bd-7f7ad8eb4fb5 + body: '{"domains": [{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/default"}, "description": "The default domain", "name": "Default", "enabled": true, "id": "default"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/auth/domains", "previous": null, "next": null}}' -- recorded: 2016-10-10T14:34:41.772Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: 0a068742da5947f081690dd5f9d9102e - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 14:34:41 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-13176a0f-8458-4cbc-b6c0-2d2f331b0352 + - recorded: 2016-10-10T14:34:41.772Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: 0a068742da5947f081690dd5f9d9102e + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 14:34:41 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-13176a0f-8458-4cbc-b6c0-2d2f331b0352 diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_getUserToken.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_getUserToken.yaml index d0c63c06f..9f400cf8d 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_getUserToken.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/tokenService_getUserToken.yaml @@ -1,46 +1,46 @@ !tape name: tokenService_getUserToken interactions: -- recorded: 2016-10-10T14:16:15.283Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-10-10T14:16:15.283Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "scope" : { - "project" : { - "id" : "194dfdddb6bc43e09701035b52edb0d9" + "scope" : { + "project" : { + "id" : "194dfdddb6bc43e09701035b52edb0d9" + } } } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 14:16:15 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: 32f3521f26304e2da699b79e36894905 - x-openstack-request-id: req-8da3dd23-df1f-43b9-8bf3-337f34fce0a7 - body: '{"token": {"methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T15:16:15.301967Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 14:16:15 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: 32f3521f26304e2da699b79e36894905 + x-openstack-request-id: req-8da3dd23-df1f-43b9-8bf3-337f34fce0a7 + body: '{"token": {"methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T15:16:15.301967Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "194dfdddb6bc43e09701035b52edb0d9", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "a22c5fb9dc5e4e009fc120264742b4b2"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "ddb07575d31c4c158e1cf9c243d03388"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "f6f6ca8e72a24d45adc1afed4d104a97"}], "type": "network", "id": "1f5a058073e045e58a11706b538d9201", "name": "neutron"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9292", "region": "RegionOne", "interface": "admin", "id": "483c914d91e44d598d3e8b98b54852b5"}, {"region_id": diff --git a/core-integration-test/src/test/resources/tapes/identity.v3/userService_user_crud.yaml b/core-integration-test/src/test/resources/tapes/identity.v3/userService_user_crud.yaml index d389d1f3a..2d3e629fd 100644 --- a/core-integration-test/src/test/resources/tapes/identity.v3/userService_user_crud.yaml +++ b/core-integration-test/src/test/resources/tapes/identity.v3/userService_user_crud.yaml @@ -1,46 +1,46 @@ !tape name: userService_user_crud.tape interactions: -- recorded: 2016-10-10T20:40:23.236Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/auth/tokens - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - OS4J-Auth-Command: Tokens - Proxy-Connection: keep-alive - User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) - body: |- - { - "auth" : { - "identity" : { - "password" : { - "user" : { - "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", - "password" : "devstack" - } + - recorded: 2016-10-10T20:40:23.236Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + OS4J-Auth-Command: Tokens + Proxy-Connection: keep-alive + User-Agent: Jersey/2.22.1 (HttpUrlConnection 1.8.0_66) + body: |- + { + "auth" : { + "identity" : { + "password" : { + "user" : { + "id" : "71a7dcb0d60a43088a6c8e9b69a39e69", + "password" : "devstack" + } + }, + "methods" : [ "password" ] }, - "methods" : [ "password" ] - }, - "scope" : { - "domain" : { - "id" : "default" + "scope" : { + "domain" : { + "id" : "default" + } } } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - X-Subject-Token: c9445f4c4a58496f942a377928d6ef00 - x-openstack-request-id: req-66a777a4-6d2d-4d6b-9ff8-8765edf3fbf4 - body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T21:40:23.207628Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + X-Subject-Token: c9445f4c4a58496f942a377928d6ef00 + x-openstack-request-id: req-66a777a4-6d2d-4d6b-9ff8-8765edf3fbf4 + body: '{"token": {"domain": {"id": "default", "name": "Default"}, "methods": ["password"], "roles": [{"id": "2e18ac09cfda45059969efffaba6adf8", "name": "admin"}], "expires_at": "2016-10-10T21:40:23.207628Z", "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "admin", "id": "a22c5fb9dc5e4e009fc120264742b4b2"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "public", "id": "ddb07575d31c4c158e1cf9c243d03388"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9696/", "region": "RegionOne", "interface": "internal", "id": "f6f6ca8e72a24d45adc1afed4d104a97"}], "type": "network", "id": "1f5a058073e045e58a11706b538d9201", "name": "neutron"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9292", "region": "RegionOne", "interface": "admin", "id": "483c914d91e44d598d3e8b98b54852b5"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:9292", "region": "RegionOne", "interface": "internal", "id": @@ -50,349 +50,349 @@ interactions: "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "public", "id": "f4eca07c52814e39b43e8106a8f06df9"}, {"region_id": "RegionOne", "url": "http://devstack.openstack.stack:5000/v3", "region": "RegionOne", "interface": "internal", "id": "f845e3338ce94fc684233659c7274bee"}], "type": "identity", "id": "dc2a2f1ea51047508cadf4b7fde71dfb", "name": "keystone"}, {"endpoints": [], "type": "compute", "id": "f48f4f5b299440d09400e0e4094aefa3", "name": "nova"}], "user": {"domain": {"id": "default", "name": "Default"}, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "name": "admin"}, "audit_ids": ["m7Z4uGQdRmi8bGGlNytsLA"], "issued_at": "2016-10-10T20:40:23.207692Z"}}' -- recorded: 2016-10-10T20:40:23.505Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/groups - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - body: |- - { - "group" : { - "name" : "anotherGroupForUserServiceTest", - "description" : "group used for user service integration test", - "domain_id" : "default" + - recorded: 2016-10-10T20:40:23.505Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/groups + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + body: |- + { + "group" : { + "name" : "anotherGroupForUserServiceTest", + "description" : "group used for user service integration test", + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-388417c5-7569-4419-88d8-3f0c95e99525 - body: '{"group": {"domain_id": "default", "description": "group used for user service integration test", "id": "76f08693dc124bb88c90939e6c3b8ae6", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6"}, "name": "anotherGroupForUserServiceTest"}}' -- recorded: 2016-10-10T20:40:23.604Z - request: - method: POST - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Content-Type: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - body: |- - { - "user" : { - "name" : "foobar", - "email" : "foobar@example.com", - "password" : "secret", - "enabled" : true, - "domain_id" : "default" + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-388417c5-7569-4419-88d8-3f0c95e99525 + body: '{"group": {"domain_id": "default", "description": "group used for user service integration test", "id": "76f08693dc124bb88c90939e6c3b8ae6", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6"}, "name": "anotherGroupForUserServiceTest"}}' + - recorded: 2016-10-10T20:40:23.604Z + request: + method: POST + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Content-Type: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + body: |- + { + "user" : { + "name" : "foobar", + "email" : "foobar@example.com", + "password" : "secret", + "enabled" : true, + "domain_id" : "default" + } } - } - response: - status: 201 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-76904744-5344-447f-9635-b5749724fa10 - body: '{"user": {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}}' -- recorded: 2016-10-10T20:40:23.696Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-a19c5eb6-40e5-4a50-8054-40ec6ed6dc47 - body: '{"users": [{"name": "admin", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69"}, "enabled": true, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "domain_id": "default"}, {"name": "demo", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/1e464f5161c341618bec952775e83748"}, + response: + status: 201 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-76904744-5344-447f-9635-b5749724fa10 + body: '{"user": {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}}' + - recorded: 2016-10-10T20:40:23.696Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-a19c5eb6-40e5-4a50-8054-40ec6ed6dc47 + body: '{"users": [{"name": "admin", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69"}, "enabled": true, "id": "71a7dcb0d60a43088a6c8e9b69a39e69", "domain_id": "default"}, {"name": "demo", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/1e464f5161c341618bec952775e83748"}, "domain_id": "default", "enabled": true, "email": "demo@example.com", "id": "1e464f5161c341618bec952775e83748"}, {"name": "alt_demo", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/67b304c4d4db4ee9a55985010ddb6efe"}, "domain_id": "default", "enabled": true, "email": "alt_demo@example.com", "id": "67b304c4d4db4ee9a55985010ddb6efe"}, {"name": "nova", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0f5f36de578e4080b375e8da368c4782"}, "enabled": true, "id": "0f5f36de578e4080b375e8da368c4782", "domain_id": "default"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/8170dfc8911642e3b52633349fd300e1"}, "enabled": true, "id": "8170dfc8911642e3b52633349fd300e1", "domain_id": "default"}, {"name": "cinder", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/9de45d08af8746ab8c35a4673a3e23b9"}, "enabled": true, "id": "9de45d08af8746ab8c35a4673a3e23b9", "domain_id": "default"}, {"name": "neutron", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/f90bc956012e40338adefb3b1ffe08e2"}, "enabled": true, "id": "f90bc956012e40338adefb3b1ffe08e2", "domain_id": "default"}, {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/users", "previous": null, "next": null}}' -- recorded: 2016-10-10T20:40:23.781Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=foobar - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-2ca53ded-c270-4d96-bf6c-91a808432032 - body: '{"users": [{"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}], "links": {"self": + - recorded: 2016-10-10T20:40:23.781Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=foobar + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-2ca53ded-c270-4d96-bf6c-91a808432032 + body: '{"users": [{"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=foobar", "previous": null, "next": null}}' -- recorded: 2016-10-10T20:40:23.864Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users?name=foobar - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-f89c8354-394f-43a0-ad8e-3a12349f3f5d - body: '{"users": [{"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}], "links": {"self": + - recorded: 2016-10-10T20:40:23.864Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users?name=foobar + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-f89c8354-394f-43a0-ad8e-3a12349f3f5d + body: '{"users": [{"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}], "links": {"self": "http://devstack.openstack.stack:5000/v3/users?name=foobar", "previous": null, "next": null}}' -- recorded: 2016-10-10T20:40:23.950Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-91db7759-7ff1-40fd-8f46-f618a85dde9a - body: '{"user": {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}}' -- recorded: 2016-10-10T20:40:24.024Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users/nonExistentUserId - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 404 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:23 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-2a49afa2-c5fe-4fb1-93e3-2891862e871d - body: '{"error": {"message": "Could not find user: nonExistentUserId", "code": 404, "title": "Not Found"}}' -- recorded: 2016-10-10T20:40:24.139Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=nonExistentUserName - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-69efe86e-786a-4917-a3cf-62b1f9182bb3 - body: '{"users": [], "links": {"self": "http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=nonExistentUserName", "previous": null, "next": null}}' -- recorded: 2016-10-10T20:40:24.212Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/domains/default/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-dfd11bad-a807-452c-b18e-e5f9282a235b - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/default/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "2e18ac09cfda45059969efffaba6adf8", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/2e18ac09cfda45059969efffaba6adf8"}, + - recorded: 2016-10-10T20:40:23.950Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-91db7759-7ff1-40fd-8f46-f618a85dde9a + body: '{"user": {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859"}, "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": "0836af5c5d174e8f87cabbf2062cf859"}}' + - recorded: 2016-10-10T20:40:24.024Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users/nonExistentUserId + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 404 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:23 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-2a49afa2-c5fe-4fb1-93e3-2891862e871d + body: '{"error": {"message": "Could not find user: nonExistentUserId", "code": 404, "title": "Not Found"}}' + - recorded: 2016-10-10T20:40:24.139Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=nonExistentUserName + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-69efe86e-786a-4917-a3cf-62b1f9182bb3 + body: '{"users": [], "links": {"self": "http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=nonExistentUserName", "previous": null, "next": null}}' + - recorded: 2016-10-10T20:40:24.212Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/domains/default/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-dfd11bad-a807-452c-b18e-e5f9282a235b + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/domains/default/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "2e18ac09cfda45059969efffaba6adf8", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/2e18ac09cfda45059969efffaba6adf8"}, "name": "admin"}]}' -- recorded: 2016-10-10T20:40:24.286Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-1c3424d0-f1c6-4871-bfd4-8c9c61e49b31 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "2e18ac09cfda45059969efffaba6adf8", "links": + - recorded: 2016-10-10T20:40:24.286Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-1c3424d0-f1c6-4871-bfd4-8c9c61e49b31 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/projects/194dfdddb6bc43e09701035b52edb0d9/users/71a7dcb0d60a43088a6c8e9b69a39e69/roles", "previous": null, "next": null}, "roles": [{"domain_id": null, "id": "2e18ac09cfda45059969efffaba6adf8", "links": {"self": "http://devstack.openstack.stack:5000/v3/roles/2e18ac09cfda45059969efffaba6adf8"}, "name": "admin"}]}' -- recorded: 2016-10-10T20:40:24.386Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6/users/0836af5c5d174e8f87cabbf2062cf859 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-26080fb8-7897-44d1-9caa-6aa431e456d8 -- recorded: 2016-10-10T20:40:24.475Z - request: - method: GET - uri: http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69/groups - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 200 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-60b72227-6bd6-4aa3-a5f6-818d1dce4b24 - body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69/groups", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "openstack admin group", "id": "f9ee0d204fa647d983715f217a79db6b", + - recorded: 2016-10-10T20:40:24.386Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6/users/0836af5c5d174e8f87cabbf2062cf859 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-26080fb8-7897-44d1-9caa-6aa431e456d8 + - recorded: 2016-10-10T20:40:24.475Z + request: + method: GET + uri: http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69/groups + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 200 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-60b72227-6bd6-4aa3-a5f6-818d1dce4b24 + body: '{"links": {"self": "http://devstack.openstack.stack:5000/v3/users/71a7dcb0d60a43088a6c8e9b69a39e69/groups", "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": "openstack admin group", "id": "f9ee0d204fa647d983715f217a79db6b", "links": {"self": "http://devstack.openstack.stack:5000/v3/groups/f9ee0d204fa647d983715f217a79db6b"}, "name": "admins"}]}' -- recorded: 2016-10-10T20:40:24.583Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6/users/0836af5c5d174e8f87cabbf2062cf859 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-e8f45df5-c6e0-4e9a-aa62-97a73a14b48f -- recorded: 2016-10-10T20:40:24.661Z - request: - method: PUT - uri: http://devstack.openstack.stack:5000/v3/groups/nonExistingGroupId/users/0836af5c5d174e8f87cabbf2062cf859 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 404 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-40d955d4-819b-4c51-9d6b-36015349ee4c - body: '{"error": {"message": "Could not find group: nonExistingGroupId", "code": 404, "title": "Not Found"}}' -- recorded: 2016-10-10T20:40:24.789Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-60c2d01d-57e3-4968-9925-7bd780b9a88b -- recorded: 2016-10-10T20:40:24.871Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/users/nonExistentUser_Id - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 404 - headers: - Content-Type: application/json - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-f0f84bd6-4391-48c5-af6e-0afdedab5c96 - body: '{"error": {"message": "Could not find user: nonExistentUser_Id", "code": 404, "title": "Not Found"}}' -- recorded: 2016-10-10T20:40:24.966Z - request: - method: DELETE - uri: http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6 - headers: - Accept: application/json - Host: devstack.openstack.stack:5000 - Proxy-Connection: keep-alive - User-Agent: OpenStack4j / OpenStack Client - X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 - response: - status: 204 - headers: - Date: Mon, 10 Oct 2016 20:40:24 GMT - Server: Apache/2.4.7 (Ubuntu) - Vary: X-Auth-Token - x-openstack-request-id: req-95e19a36-adbe-47a7-9d90-1ce6af6ae93b + - recorded: 2016-10-10T20:40:24.583Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6/users/0836af5c5d174e8f87cabbf2062cf859 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-e8f45df5-c6e0-4e9a-aa62-97a73a14b48f + - recorded: 2016-10-10T20:40:24.661Z + request: + method: PUT + uri: http://devstack.openstack.stack:5000/v3/groups/nonExistingGroupId/users/0836af5c5d174e8f87cabbf2062cf859 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 404 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-40d955d4-819b-4c51-9d6b-36015349ee4c + body: '{"error": {"message": "Could not find group: nonExistingGroupId", "code": 404, "title": "Not Found"}}' + - recorded: 2016-10-10T20:40:24.789Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/users/0836af5c5d174e8f87cabbf2062cf859 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-60c2d01d-57e3-4968-9925-7bd780b9a88b + - recorded: 2016-10-10T20:40:24.871Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/users/nonExistentUser_Id + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 404 + headers: + Content-Type: application/json + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-f0f84bd6-4391-48c5-af6e-0afdedab5c96 + body: '{"error": {"message": "Could not find user: nonExistentUser_Id", "code": 404, "title": "Not Found"}}' + - recorded: 2016-10-10T20:40:24.966Z + request: + method: DELETE + uri: http://devstack.openstack.stack:5000/v3/groups/76f08693dc124bb88c90939e6c3b8ae6 + headers: + Accept: application/json + Host: devstack.openstack.stack:5000 + Proxy-Connection: keep-alive + User-Agent: OpenStack4j / OpenStack Client + X-Auth-Token: c9445f4c4a58496f942a377928d6ef00 + response: + status: 204 + headers: + Date: Mon, 10 Oct 2016 20:40:24 GMT + Server: Apache/2.4.7 (Ubuntu) + Vary: X-Auth-Token + x-openstack-request-id: req-95e19a36-adbe-47a7-9d90-1ce6af6ae93b diff --git a/core-test/pom.xml b/core-test/pom.xml index 529915ee3..fb9ce40ba 100644 --- a/core-test/pom.xml +++ b/core-test/pom.xml @@ -1,47 +1,48 @@ - - - org.pacesys - openstack4j-parent - 3.2.1-SNAPSHOT - - 4.0.0 - openstack4j-core-test - OpenStack4j Test Cases - http://github.com/ContainX/openstack4j/ - jar - - true - - - - org.pacesys - openstack4j-core - ${project.version} - - - com.squareup.okhttp3 - mockwebserver - 3.2.0 - provided - - - org.mockito - mockito-core - 1.9.0 - provided - - - org.testng - testng - 6.8 - provided - - - junit - junit - - - - + + + org.pacesys + openstack4j-parent + 3.2.1-SNAPSHOT + + 4.0.0 + openstack4j-core-test + OpenStack4j Test Cases + http://github.com/ContainX/openstack4j/ + jar + + true + + + + org.pacesys + openstack4j-core + ${project.version} + + + com.squareup.okhttp3 + mockwebserver + 3.2.0 + provided + + + org.mockito + mockito-core + 1.9.0 + provided + + + org.testng + testng + 6.8 + provided + + + junit + junit + + + + diff --git a/core-test/src/main/java/org/openstack4j/api/SkipTest.java b/core-test/src/main/java/org/openstack4j/api/SkipTest.java index 2c18dd72e..e3340a1df 100644 --- a/core-test/src/main/java/org/openstack4j/api/SkipTest.java +++ b/core-test/src/main/java/org/openstack4j/api/SkipTest.java @@ -1,4 +1,3 @@ - package org.openstack4j.api; import java.lang.annotation.ElementType; @@ -8,31 +7,31 @@ /** * Annotation allowing TestNG to skip test for a specific connector - * + * * @author Bruno Semperlotti */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface SkipTest { - + /** * A regex identifying the targeted HTTP connector name - * + * *

Examples: * - * "Jersey 2 Connector", ".*" + * "Jersey 2 Connector", ".*" * *

- * + * * @see org.openstack4j.core.transport.internal.HttpExecutor#getExecutorName */ public String connector(); - + /** * The GitHub issue identifier (optional) */ public int issue() default -1; - + /** * A message describing the reason of test skip (optional) */ diff --git a/core-test/src/main/java/org/openstack4j/api/SkipTestListener.java b/core-test/src/main/java/org/openstack4j/api/SkipTestListener.java index aa3335100..26dd32777 100644 --- a/core-test/src/main/java/org/openstack4j/api/SkipTestListener.java +++ b/core-test/src/main/java/org/openstack4j/api/SkipTestListener.java @@ -1,22 +1,22 @@ package org.openstack4j.api; -import java.lang.reflect.Method; -import java.util.logging.Logger; - import org.openstack4j.core.transport.internal.HttpExecutor; import org.testng.IInvokedMethod; import org.testng.IInvokedMethodListener; import org.testng.ITestResult; import org.testng.SkipException; +import java.lang.reflect.Method; +import java.util.logging.Logger; + /** - * A TestNG listener checking test methods for the presence of {@code @SkipTest} + * A TestNG listener checking test methods for the presence of {@code @SkipTest} * annotation - * + * *

If annotation is present on test method and current HTTP connector matches * the HTTP connector specified by {@code @SkipTest}, the listener will skip the test * by throwing TestNG {@code SkipException}.

- * + * * @author Bruno Semperlotti */ public class SkipTestListener implements IInvokedMethodListener { diff --git a/core-test/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactTests.java b/core-test/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactTests.java index e1c9ab7d2..7e9373470 100644 --- a/core-test/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactTests.java +++ b/core-test/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactTests.java @@ -7,11 +7,8 @@ import org.openstack4j.model.artifact.ToscaTemplatesArtifacts; import org.openstack4j.model.artifact.builder.ArtifactUpdateBuilder; import org.openstack4j.model.artifact.builder.ToscaTemplatesArtifactBuilder; -import org.openstack4j.model.common.ActionResponse; import org.testng.annotations.Test; -import java.io.File; -import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -76,7 +73,7 @@ public void updateArtifact() throws Exception { builder.path("/template_format"); builder.value("yaml"); List updates = new ArrayList<>(); - ToscaTemplatesArtifact toscaTemplatesArtifact = osv3().artifact().toscaTemplatesArtifact().update("b8f88696-80e7-4f89-abbc-1975991ba879",updates); + ToscaTemplatesArtifact toscaTemplatesArtifact = osv3().artifact().toscaTemplatesArtifact().update("b8f88696-80e7-4f89-abbc-1975991ba879", updates); assertEquals(toscaTemplatesArtifact.getName(), "sample"); assertEquals(toscaTemplatesArtifact.getTemplateFormat(), "yaml"); assertEquals(toscaTemplatesArtifact.getStatus(), "drafted"); diff --git a/core-test/src/main/java/org/openstack4j/api/barbican/ContainerTests.java b/core-test/src/main/java/org/openstack4j/api/barbican/ContainerTests.java index c7ab3e34a..4704826ba 100644 --- a/core-test/src/main/java/org/openstack4j/api/barbican/ContainerTests.java +++ b/core-test/src/main/java/org/openstack4j/api/barbican/ContainerTests.java @@ -13,11 +13,9 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; -@Test(suiteName="Barbican/Containers", enabled = true) +@Test(suiteName = "Barbican/Containers", enabled = true) public class ContainerTests extends AbstractTest { private static final String CONTAINER_JSON = "/barbican/container.json"; private static final String CONTAINER_CREATE_JSON = "/barbican/container_create.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/compute/ExtensionTests.java b/core-test/src/main/java/org/openstack4j/api/compute/ExtensionTests.java index 40e9283d0..5f3565c0e 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/ExtensionTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/ExtensionTests.java @@ -17,7 +17,7 @@ * * @author Jeremy Unruh */ -@Test(suiteName="ExtensionList") +@Test(suiteName = "ExtensionList") public class ExtensionTests extends AbstractTest { private static final String JSON_EXTENSIONS = "/compute/extensions.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/compute/FlavorTests.java b/core-test/src/main/java/org/openstack4j/api/compute/FlavorTests.java index 7e70ac91a..bcb1aabed 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/FlavorTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/FlavorTests.java @@ -1,95 +1,95 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.AssertJUnit.assertFalse; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.api.Builders; +import org.openstack4j.model.compute.Flavor; +import org.testng.annotations.Test; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openstack4j.api.AbstractTest; -import org.openstack4j.api.Builders; -import org.openstack4j.model.compute.Flavor; -import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; +import static org.testng.AssertJUnit.assertFalse; /** * Tests the Compute -> Flavors API against the mock webserver and spec based json responses - * + * * @author Jeremy Unruh * @author Qin An */ -@Test(suiteName="Compute") +@Test(suiteName = "Compute") public class FlavorTests extends AbstractTest { - private static final String JSON_FLAVOR = "/compute/flavor.json"; - private static final String JSON_FLAVORS = "/compute/flavors.json"; - private static final String JSON_FLAVORS_DETAILED = "/compute/flavors_detailed.json"; - private static final String JSON_FLAVOR_CREATE = "/compute/flavor_create.json"; - - public void getFlavor() throws Exception { - respondWith(JSON_FLAVOR); - Flavor f = osv3().compute().flavors().get("1"); - assertEquals(1, f.getDisk()); - assertEquals("m1.tiny", f.getName()); - assertEquals(512, f.getRam()); - assertTrue(f.isPublic()); - assertEquals(0, f.getEphemeral()); - assertFalse(f.isDisabled()); - assertEquals(2.0f, f.getRxtxFactor()); - assertEquals(1, f.getVcpus()); - } - - - public void listDetailedAllFlavors() throws Exception { - respondWith(JSON_FLAVORS_DETAILED); - List flavors = osv3().compute().flavors().list(); - assertEquals(2, flavors.size()); - } - - public void listDetailedParamFlavors() throws Exception { - respondWith(JSON_FLAVORS_DETAILED); - Map map = new HashMap(); - map.put("sort_key", "name"); - map.put("sort_dir", "asc"); - List flavors = osv3().compute().flavors().list(map); - assertEquals(2, flavors.size()); - } - - public void listSimpleAllFlavors() throws Exception { - respondWith(JSON_FLAVORS); - List flavors = osv3().compute().flavors().list(false); - assertEquals(5, flavors.size()); - } - - public void listComplexFlavors() throws Exception { - respondWith(JSON_FLAVORS_DETAILED); - Map map = new HashMap(); - map.put("sort_key", "name"); - map.put("sort_dir", "asc"); - List flavors = osv3().compute().flavors().list(true, map); - assertEquals(2, flavors.size()); - } - - public void createFlavor() throws IOException { - respondWith(JSON_FLAVOR_CREATE); - Flavor builtF = Builders.flavor().name("safe_to_delete_flavor").vcpus(1).disk(2) - .isPublic(true).rxtxFactor(2).ephemeral(1).ram(128).id("delete_1").swap(1).build(); - Flavor f = osv3().compute().flavors().create(builtF); - assertEquals(1, f.getVcpus()); - assertEquals(2, f.getDisk()); - assertEquals("m1.tiny", f.getName()); - assertTrue(f.isPublic()); - assertEquals(2.0f, f.getRxtxFactor()); - assertEquals(1, f.getEphemeral()); - assertEquals(128, f.getRam()); - assertEquals("1", f.getId()); - assertEquals(1, f.getSwap()); - } - - @Override - protected Service service() { - return Service.COMPUTE; - } + private static final String JSON_FLAVOR = "/compute/flavor.json"; + private static final String JSON_FLAVORS = "/compute/flavors.json"; + private static final String JSON_FLAVORS_DETAILED = "/compute/flavors_detailed.json"; + private static final String JSON_FLAVOR_CREATE = "/compute/flavor_create.json"; + + public void getFlavor() throws Exception { + respondWith(JSON_FLAVOR); + Flavor f = osv3().compute().flavors().get("1"); + assertEquals(1, f.getDisk()); + assertEquals("m1.tiny", f.getName()); + assertEquals(512, f.getRam()); + assertTrue(f.isPublic()); + assertEquals(0, f.getEphemeral()); + assertFalse(f.isDisabled()); + assertEquals(2.0f, f.getRxtxFactor()); + assertEquals(1, f.getVcpus()); + } + + + public void listDetailedAllFlavors() throws Exception { + respondWith(JSON_FLAVORS_DETAILED); + List flavors = osv3().compute().flavors().list(); + assertEquals(2, flavors.size()); + } + + public void listDetailedParamFlavors() throws Exception { + respondWith(JSON_FLAVORS_DETAILED); + Map map = new HashMap(); + map.put("sort_key", "name"); + map.put("sort_dir", "asc"); + List flavors = osv3().compute().flavors().list(map); + assertEquals(2, flavors.size()); + } + + public void listSimpleAllFlavors() throws Exception { + respondWith(JSON_FLAVORS); + List flavors = osv3().compute().flavors().list(false); + assertEquals(5, flavors.size()); + } + + public void listComplexFlavors() throws Exception { + respondWith(JSON_FLAVORS_DETAILED); + Map map = new HashMap(); + map.put("sort_key", "name"); + map.put("sort_dir", "asc"); + List flavors = osv3().compute().flavors().list(true, map); + assertEquals(2, flavors.size()); + } + + public void createFlavor() throws IOException { + respondWith(JSON_FLAVOR_CREATE); + Flavor builtF = Builders.flavor().name("safe_to_delete_flavor").vcpus(1).disk(2) + .isPublic(true).rxtxFactor(2).ephemeral(1).ram(128).id("delete_1").swap(1).build(); + Flavor f = osv3().compute().flavors().create(builtF); + assertEquals(1, f.getVcpus()); + assertEquals(2, f.getDisk()); + assertEquals("m1.tiny", f.getName()); + assertTrue(f.isPublic()); + assertEquals(2.0f, f.getRxtxFactor()); + assertEquals(1, f.getEphemeral()); + assertEquals(128, f.getRam()); + assertEquals("1", f.getId()); + assertEquals(1, f.getSwap()); + } + + @Override + protected Service service() { + return Service.COMPUTE; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/compute/FloatingIPTests.java b/core-test/src/main/java/org/openstack4j/api/compute/FloatingIPTests.java index d47844a0c..b23da0ba5 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/FloatingIPTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/FloatingIPTests.java @@ -1,16 +1,5 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.List; -import java.util.UUID; - import org.openstack4j.api.AbstractTest; import org.openstack4j.core.transport.internal.HttpExecutor; import org.openstack4j.model.common.ActionResponse; @@ -19,6 +8,13 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.io.IOException; +import java.lang.reflect.Method; +import java.util.List; +import java.util.UUID; + +import static org.testng.Assert.*; + @Test(suiteName = "Compute") public class FloatingIPTests extends AbstractTest { @@ -95,8 +91,8 @@ public void deallocateFloatingIP(String ip) { assertTrue(successResponse.isSuccess()); String jsonResponse = String.format("{\"itemNotFound\": {" - + "\"message\": \"Floating ip not found for id %s\", " - + "\"code\": 404}}", + + "\"message\": \"Floating ip not found for id %s\", " + + "\"code\": 404}}", ip); // Test deallocate error @@ -107,10 +103,10 @@ public void deallocateFloatingIP(String ip) { assertFalse(failureResponse.isSuccess()); assertEquals(failureResponse.getCode(), 404); } - + @Test(dataProvider = "floatingIPs") public void removeFloatingIP(String ip) { - String serverId = "255b83fd-1193-44a8-aba5-9887b347a41d" ; + String serverId = "255b83fd-1193-44a8-aba5-9887b347a41d"; // Test remove floatingIP success respondWith(202); @@ -120,18 +116,18 @@ public void removeFloatingIP(String ip) { // Test remove floatingIP fail -- Floating ip existed but not bind to server or server instance not existed String jsonResponse = String.format("{\"itemNotFound\": {" - + "\"message\": \"Floating ip %s is not associated with instance %s.\", " - + "\"code\": 409}}", + + "\"message\": \"Floating ip %s is not associated with instance %s.\", " + + "\"code\": 409}}", ip, serverId); - + respondWith(409, jsonResponse); ActionResponse failureResponse = osv3().compute().floatingIps().removeFloatingIP(serverId, ip); assertNotNull(failureResponse); assertFalse(failureResponse.isSuccess()); assertEquals(failureResponse.getCode(), 409); - - + + // Test remove floatingIP fail -- floatingIP not existed String jsonResponse2 = String.format("{\"itemNotFound\": {" + "\"message\": \"floating ip not found\", " @@ -144,21 +140,21 @@ public void removeFloatingIP(String ip) { assertFalse(failureResponse2.isSuccess()); assertEquals(failureResponse2.getCode(), 404); } - + @Test(dataProvider = "floatingIPs") - public void addFloatingIP( String ip) { - String serverId = "255b83fd-1193-44a8-aba5-9887b347a41d" ; + public void addFloatingIP(String ip) { + String serverId = "255b83fd-1193-44a8-aba5-9887b347a41d"; // Test add floatingIP success respondWith(202); ActionResponse successResponse = osv3().compute().floatingIps().addFloatingIP(serverId, ip); assertNotNull(successResponse); assertTrue(successResponse.isSuccess()); - + // Test add floatingIP fail -- server instance not existed String jsonResponse = String.format("{\"itemNotFound\": {" - + "\"message\": \"Instance %s could not be found.\", " - + "\"code\": 404}}", + + "\"message\": \"Instance %s could not be found.\", " + + "\"code\": 404}}", serverId); respondWith(404, jsonResponse); @@ -167,13 +163,13 @@ public void addFloatingIP( String ip) { assertNotNull(failureResponse); assertFalse(failureResponse.isSuccess()); assertEquals(failureResponse.getCode(), 404); - - // Test add floatingIP fail -- floatingIP not existed + + // Test add floatingIP fail -- floatingIP not existed String jsonResponse2 = String.format("{\"itemNotFound\": {" + "\"message\": \"floating ip not found\", " + "\"code\": 404}}"); - + respondWith(404, jsonResponse2); ActionResponse failureResponse2 = osv3().compute().floatingIps().addFloatingIP(serverId, ip); diff --git a/core-test/src/main/java/org/openstack4j/api/compute/HostAggregateTests.java b/core-test/src/main/java/org/openstack4j/api/compute/HostAggregateTests.java index d50cd4cad..3391ed55b 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/HostAggregateTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/HostAggregateTests.java @@ -1,52 +1,52 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.compute.HostAggregate; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Host Aggregate Tests - * @author chenyan * + * @author chenyan */ @Test(suiteName = "HostAggregate") public class HostAggregateTests extends AbstractTest { - - private static final String JSON_HOST_AGGREGATES = "/compute/aggregates.json"; - private static final String JSON_HOST_AGGREGATE_CREATE = "/compute/aggregate_create.json"; - - @Test - public void serviceListingTest() throws Exception { + + private static final String JSON_HOST_AGGREGATES = "/compute/aggregates.json"; + private static final String JSON_HOST_AGGREGATE_CREATE = "/compute/aggregate_create.json"; + + @Test + public void serviceListingTest() throws Exception { respondWith(JSON_HOST_AGGREGATES); List hostAggregateList = osv3().compute().hostAggregates().list(); - assertEquals(hostAggregateList.size(),2); + assertEquals(hostAggregateList.size(), 2); HostAggregate aggregate = hostAggregateList.get(0); - assertEquals(aggregate.getAvailabilityZone(),"uec_zone_1"); - assertEquals(aggregate.getId(),"8"); - assertEquals(aggregate.getName(),"aggregate_zl_test"); + assertEquals(aggregate.getAvailabilityZone(), "uec_zone_1"); + assertEquals(aggregate.getId(), "8"); + assertEquals(aggregate.getName(), "aggregate_zl_test"); + } + + @Test + public void createTest() throws Exception { + respondWith(JSON_HOST_AGGREGATE_CREATE); + + String name = "testAggregate01"; + String availabilityZone = "nova"; + HostAggregate hostAggregate = osv3().compute().hostAggregates().create(name, availabilityZone); + assertEquals(null != hostAggregate, true); + assertEquals(hostAggregate.getName(), name); + assertEquals(hostAggregate.getAvailabilityZone(), availabilityZone); + } + + @Override + protected Service service() { + return Service.COMPUTE; } - - @Test - public void createTest() throws Exception { - respondWith(JSON_HOST_AGGREGATE_CREATE); - - String name = "testAggregate01"; - String availabilityZone = "nova"; - HostAggregate hostAggregate = osv3().compute().hostAggregates().create(name, availabilityZone); - assertEquals(null != hostAggregate, true); - assertEquals(hostAggregate.getName(),name); - assertEquals(hostAggregate.getAvailabilityZone(),availabilityZone); - } - - @Override - protected Service service() { - return Service.COMPUTE; - } } diff --git a/core-test/src/main/java/org/openstack4j/api/compute/ImageTests.java b/core-test/src/main/java/org/openstack4j/api/compute/ImageTests.java index a636b8edc..847fc79c9 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/ImageTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/ImageTests.java @@ -1,31 +1,31 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.compute.Image; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Test cases for Compute Images - * + * * @author Jeremy Unruh */ -@Test(suiteName="Images") +@Test(suiteName = "Images") public class ImageTests extends AbstractTest { private static final String JSON_IMAGES = "/compute/images.json"; public void serverListingTest() throws Exception { respondWith(JSON_IMAGES); - + List images = osv3().compute().images().list(); assertEquals(7, images.size()); } - + @Override protected Service service() { return Service.COMPUTE; diff --git a/core-test/src/main/java/org/openstack4j/api/compute/MigrationTests.java b/core-test/src/main/java/org/openstack4j/api/compute/MigrationTests.java index 86695b317..0f7360200 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/MigrationTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/MigrationTests.java @@ -1,20 +1,20 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.compute.ext.Migration; import org.openstack4j.model.compute.ext.Migration.Status; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Migrations based Test Cases - * + * * @author Jeremy Unruh */ -@Test(suiteName="Migrations", enabled=true) +@Test(suiteName = "Migrations", enabled = true) public class MigrationTests extends AbstractTest { private static final String JSON_MIGRATIONS = "/compute/migrations.json"; @@ -22,11 +22,11 @@ public class MigrationTests extends AbstractTest { public void listMigrations() throws Exception { respondWith(JSON_MIGRATIONS); List migrations = osv3().compute().migrations().list(); - + assertEquals(2, migrations.size()); assertEquals(Status.DONE, migrations.get(0).getStatus()); } - + @Override protected Service service() { return Service.COMPUTE; diff --git a/core-test/src/main/java/org/openstack4j/api/compute/NovaHostTests.java b/core-test/src/main/java/org/openstack4j/api/compute/NovaHostTests.java index 6b5df06d0..740b265fa 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/NovaHostTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/NovaHostTests.java @@ -1,43 +1,43 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.compute.HostResource; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Test case for Nova Host Describe - * + * * @author Qin An */ @Test(suiteName = "NovaHost") public class NovaHostTests extends AbstractTest { - private static final String OS_HOST_DESCRIBE = "/compute/host_describe.json"; - private static final String HOST_NAME = "testHost"; + private static final String OS_HOST_DESCRIBE = "/compute/host_describe.json"; + private static final String HOST_NAME = "testHost"; @Override protected Service service() { return Service.COMPUTE; } - public void hostDescribe() throws Exception { + public void hostDescribe() throws Exception { respondWith(OS_HOST_DESCRIBE); - List resources = osv3().compute().host().hostDescribe(HOST_NAME); - assertEquals(resources.size(), 3, "The size of resources is not correct"); - HostResource resource1 = resources.get(0); - assertEquals(resource1.getDiskInGb(), 1028); - assertEquals(resource1.getCpu(), 1); - - HostResource resource2 = resources.get(1); - assertEquals(resource2.getHost(), "c1a7de0ac9d94e4baceae031d05caae3"); - assertEquals(resource2.getMemoryInMb(), 512); - - HostResource resource3 = resources.get(2); - assertEquals(resource3.getProject(), "(used_max)"); + List resources = osv3().compute().host().hostDescribe(HOST_NAME); + assertEquals(resources.size(), 3, "The size of resources is not correct"); + HostResource resource1 = resources.get(0); + assertEquals(resource1.getDiskInGb(), 1028); + assertEquals(resource1.getCpu(), 1); + + HostResource resource2 = resources.get(1); + assertEquals(resource2.getHost(), "c1a7de0ac9d94e4baceae031d05caae3"); + assertEquals(resource2.getMemoryInMb(), 512); + + HostResource resource3 = resources.get(2); + assertEquals(resource3.getProject(), "(used_max)"); } } diff --git a/core-test/src/main/java/org/openstack4j/api/compute/ServerTagTests.java b/core-test/src/main/java/org/openstack4j/api/compute/ServerTagTests.java index c1e1abbdc..761f642f7 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/ServerTagTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/ServerTagTests.java @@ -1,21 +1,21 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.openstack.compute.domain.NovaServerTag; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + /** * Test cases for Server Tag based Services - * + * * @author whaon */ -@Test(suiteName="ServerTags") +@Test(suiteName = "ServerTags") public class ServerTagTests extends AbstractTest { private static final String JSON_SERVER_TAGS = "/compute/tags.json"; @@ -28,48 +28,48 @@ public void listTags() throws Exception { assertEquals(2, tags.size()); assertEquals("tag1", tags.get(0)); } - + @Test public void replaceTags() { - String jsonResponse = "{\"tags\": [\"new1\", \"new2\"]}"; + String jsonResponse = "{\"tags\": [\"new1\", \"new2\"]}"; respondWith(200, jsonResponse); NovaServerTag novaTags = new NovaServerTag(); novaTags.addTag("new1"); novaTags.addTag("new2"); NovaServerTag newTags = osv3().compute().serverTags().replace("1", novaTags); - + assertEquals(novaTags.getTags(), newTags.getTags()); } - + @Test public void deleteAllTags() { - respondWith(204); - ActionResponse delete = osv3().compute().serverTags().deleteAll("1"); - System.out.println(delete.getCode()); - assertTrue(delete.isSuccess()); + respondWith(204); + ActionResponse delete = osv3().compute().serverTags().deleteAll("1"); + System.out.println(delete.getCode()); + assertTrue(delete.isSuccess()); } - + @Test public void checkTag() { - respondWith(204); - ActionResponse check = osv3().compute().serverTags().check("1", "tag1"); - assertTrue(check.isSuccess()); + respondWith(204); + ActionResponse check = osv3().compute().serverTags().check("1", "tag1"); + assertTrue(check.isSuccess()); } - + @Test public void addTag() { - respondWith(204); - ActionResponse check = osv3().compute().serverTags().addSingle("1", "tag"); - assertTrue(check.isSuccess()); + respondWith(204); + ActionResponse check = osv3().compute().serverTags().addSingle("1", "tag"); + assertTrue(check.isSuccess()); } - + @Test public void deleteTag() { - respondWith(204); - ActionResponse delete = osv3().compute().serverTags().delete("1", "tag1"); - assertTrue(delete.isSuccess()); + respondWith(204); + ActionResponse delete = osv3().compute().serverTags().delete("1", "tag1"); + assertTrue(delete.isSuccess()); } - + @Override protected Service service() { return Service.COMPUTE; diff --git a/core-test/src/main/java/org/openstack4j/api/compute/ServerTests.java b/core-test/src/main/java/org/openstack4j/api/compute/ServerTests.java index 7a2633fd5..f27853a7f 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/ServerTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/ServerTests.java @@ -1,15 +1,6 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import okhttp3.mockwebserver.RecordedRequest; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.api.exceptions.ServerResponseException; @@ -20,37 +11,41 @@ import org.testng.Assert; import org.testng.annotations.Test; -import okhttp3.mockwebserver.RecordedRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.testng.Assert.*; /** * Test cases for Server based Services - * + * * @author Jeremy Unruh */ -@Test(suiteName="Servers") +@Test(suiteName = "Servers") public class ServerTests extends AbstractTest { private static final String JSON_SERVERS = "/compute/servers.json"; private static final String JSON_SERVER_CREATE = "/compute/server_create.json"; private static final String JSON_SERVER_EVACUATE = "/compute/server_evacuate.json"; - private static final String JSON_SERVER_CONSOLE_OUTPUT = "/compute/server_console_output.json"; + private static final String JSON_SERVER_CONSOLE_OUTPUT = "/compute/server_console_output.json"; @Test public void listServer() throws Exception { respondWith(JSON_SERVERS); - + List servers = osv3().compute().servers().list(); assertEquals(1, servers.size()); - + takeRequest(); - + Server s = servers.get(0); assertEquals(1, s.getAddresses().getAddresses("private").size()); assertEquals("192.168.0.3", s.getAddresses().getAddresses("private").get(0).getAddr()); assertEquals(Status.ACTIVE, s.getStatus()); assertEquals("new-server-test", s.getName()); } - + @Test(expectedExceptions = ServerResponseException.class, invocationCount = 10) public void serverError() throws Exception { String jsonResponse = "{\"computeFault\": {" @@ -60,32 +55,32 @@ public void serverError() throws Exception { respondWith(500, jsonResponse); osv3().compute().servers().get("05184ba3-00ba-4fbc-b7a2-03b62b884931"); Assert.fail("Exception should have been thrown."); - + takeRequest(); } - + @Test public void createServer() throws Exception { respondWith(JSON_SERVER_CREATE); - + Server server = osv3().compute().servers().boot(Builders.server().name("server-test-1").build()); assertEquals("server-test-1", server.getName()); - + takeRequest(); } - + @Override protected Service service() { return Service.COMPUTE; } - + @Test public void evacuateServer() throws Exception { respondWith(JSON_SERVER_EVACUATE); - - ServerPassword password = osv3().compute().servers().evacuate("e565cbdb-8e74-4044-ba6e-0155500b2c46", EvacuateOptions.create().host("server-test-1").onSharedStorage(false)); + + ServerPassword password = osv3().compute().servers().evacuate("e565cbdb-8e74-4044-ba6e-0155500b2c46", EvacuateOptions.create().host("server-test-1").onSharedStorage(false)); assertEquals(password.getPassword(), "MySecretPass"); - + takeRequest(); } @@ -96,7 +91,9 @@ public void createServerSnapshotWithNoMetadata() throws Exception { @Test public void createServerSnapshotWithMetadata() throws Exception { - Map metadata = new HashMap() {{ put("image_type", "image"); }}; + Map metadata = new HashMap() {{ + put("image_type", "image"); + }}; createServerSnapshot(metadata); } @@ -116,43 +113,43 @@ private void createServerSnapshot(Map metadata) throws Exception } @Test - public void getServerConsoleOutput() throws Exception { + public void getServerConsoleOutput() throws Exception { // Get console output with explicit length int length = 50; respondWith(JSON_SERVER_CONSOLE_OUTPUT); String console = osv3().compute().servers().getConsoleOutput("existing-uuid", length); - + // Check that the request is the one we expect - RecordedRequest request = server.takeRequest(); - + RecordedRequest request = server.takeRequest(); + assertNotNull(console); assertTrue(console.length() > 0); - + String requestBody = request.getBody().readUtf8(); assertTrue(requestBody.contains("\"os-getConsoleOutput\" : {")); assertTrue(requestBody.contains("\"length\" : " + length)); - + // Get full console output respondWith(JSON_SERVER_CONSOLE_OUTPUT); console = osv3().compute().servers().getConsoleOutput("existing-uuid", 0); - + // Check that the request is the one we expect - request = takeRequest(); - + request = takeRequest(); + assertNotNull(console); assertTrue(console.length() > 0); - + requestBody = request.getBody().readUtf8(); assertFalse(requestBody.contains("\"length\"")); } - + @Test public void getServerConsoleOutputNonExistingServer() throws Exception { respondWith(404); - + String console = osv3().compute().servers().getConsoleOutput("non-existing-uuid", 0); assertNull(console); - + takeRequest(); } diff --git a/core-test/src/main/java/org/openstack4j/api/compute/ServiceTests.java b/core-test/src/main/java/org/openstack4j/api/compute/ServiceTests.java index e15a265ad..e3ce395f2 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/ServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/ServiceTests.java @@ -1,67 +1,67 @@ package org.openstack4j.api.compute; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.compute.ext.Service.State; import org.openstack4j.model.compute.ext.Service.Status; import org.openstack4j.openstack.compute.domain.ext.ExtService; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; + /** * Test cases for Nova Services function - * + * * @author Yin Zhang */ @Test(suiteName = "Services") public class ServiceTests extends AbstractTest { - private static final String JSON_SERVICES = "/compute/services.json"; - private static final String JSON_SERVICE_ENABLE = "/compute/service_enable.json"; - private static final String JSON_SERVICE_DISABLE = "/compute/service_disable.json"; + private static final String JSON_SERVICES = "/compute/services.json"; + private static final String JSON_SERVICE_ENABLE = "/compute/service_enable.json"; + private static final String JSON_SERVICE_DISABLE = "/compute/service_disable.json"; - @Test - public void serviceListingTest() throws Exception { - respondWith(JSON_SERVICES); + @Test + public void serviceListingTest() throws Exception { + respondWith(JSON_SERVICES); - List services = osv3().compute().services().list(); - assertEquals(4, services.size()); + List services = osv3().compute().services().list(); + assertEquals(4, services.size()); - org.openstack4j.model.compute.ext.Service s = services.get(0); - assertEquals("nova-scheduler", s.getBinary()); - assertEquals("host1", s.getHost()); - assertEquals(Status.DISABLED, s.getStatus()); - assertEquals(State.UP, s.getState()); - assertEquals("internal", s.getZone()); - assertEquals("test1", s.getDisabledReason()); - } + org.openstack4j.model.compute.ext.Service s = services.get(0); + assertEquals("nova-scheduler", s.getBinary()); + assertEquals("host1", s.getHost()); + assertEquals(Status.DISABLED, s.getStatus()); + assertEquals(State.UP, s.getState()); + assertEquals("internal", s.getZone()); + assertEquals("test1", s.getDisabledReason()); + } - @Test - public void serviceEnableTest() throws Exception { - respondWith(JSON_SERVICE_ENABLE); - ExtService s = osv3().compute().services().enableService("nova-compute", "some_host"); - assertNotNull(s); - assertEquals("nova-compute", s.getBinary()); - assertEquals("some_host", s.getHost()); - assertEquals(Status.ENABLED, s.getStatus()); - } + @Test + public void serviceEnableTest() throws Exception { + respondWith(JSON_SERVICE_ENABLE); + ExtService s = osv3().compute().services().enableService("nova-compute", "some_host"); + assertNotNull(s); + assertEquals("nova-compute", s.getBinary()); + assertEquals("some_host", s.getHost()); + assertEquals(Status.ENABLED, s.getStatus()); + } - @Test - public void serviceDisableTest() throws Exception { - respondWith(JSON_SERVICE_DISABLE); - ExtService s = osv3().compute().services().disableService("nova-compute", "some_host"); - assertNotNull(s); - assertEquals("nova-compute", s.getBinary()); - assertEquals("some_host", s.getHost()); - assertEquals(Status.DISABLED, s.getStatus()); - } + @Test + public void serviceDisableTest() throws Exception { + respondWith(JSON_SERVICE_DISABLE); + ExtService s = osv3().compute().services().disableService("nova-compute", "some_host"); + assertNotNull(s); + assertEquals("nova-compute", s.getBinary()); + assertEquals("some_host", s.getHost()); + assertEquals(Status.DISABLED, s.getStatus()); + } - @Override - protected Service service() { - return Service.COMPUTE; - } + @Override + protected Service service() { + return Service.COMPUTE; + } } \ No newline at end of file diff --git a/core-test/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsTests.java b/core-test/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsTests.java index 602f03a72..d600bb64b 100644 --- a/core-test/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsTests.java +++ b/core-test/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsTests.java @@ -1,16 +1,16 @@ package org.openstack4j.api.compute.ext; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.compute.InstanceAction; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Tests the os-instance-actions Compute API extension. - * + * * @author Christian Banse */ @Test(suiteName = "Compute") diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/ExternalPolicyServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/ExternalPolicyServiceTest.java index 96bf0c3d4..48c55c283 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/ExternalPolicyServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/ExternalPolicyServiceTest.java @@ -1,12 +1,6 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -14,49 +8,54 @@ import org.testng.annotations.Test; import org.testng.collections.Lists; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for External policies on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/external_policies") +@Test(suiteName = "grouppolicy/external_policies") public class ExternalPolicyServiceTest extends AbstractTest { - private static final String EXTERNAL_POLICIES="/network/gbp/external_policies.json"; - private static final String EXTERNAL_POLICY="/network/gbp/external_policy.json"; - private static final String EXTERNAL_POLICY_UPDATE="/network/gbp/external_policy_update.json"; + private static final String EXTERNAL_POLICIES = "/network/gbp/external_policies.json"; + private static final String EXTERNAL_POLICY = "/network/gbp/external_policy.json"; + private static final String EXTERNAL_POLICY_UPDATE = "/network/gbp/external_policy_update.json"; + @Override protected Service service() { return Service.NETWORK; } @Test - public void testListExternalPolicy() throws Exception{ + public void testListExternalPolicy() throws Exception { respondWith(EXTERNAL_POLICIES); List externalPolicyList = osv2().gbp().externalPolicy().list(); assertEquals(2, externalPolicyList.size()); Preconditions.checkNotNull(externalPolicyList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Policyfrom List : "+externalPolicyList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Policyfrom List : " + externalPolicyList.get(0)); assertEquals(externalPolicyList.get(0).getId(), "6294837a-8f35-4071-b766-3a4ff3d8afbb"); } - + @Test - public void testGetExternalPolicy() throws Exception{ + public void testGetExternalPolicy() throws Exception { respondWith(EXTERNAL_POLICY); String id = "8d14b663-c67d-4fa7-b23f-0732cb9aa292"; ExternalPolicy externalPolicy = osv2().gbp().externalPolicy().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Policy by ID : "+externalPolicy); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Policy by ID : " + externalPolicy); assertNotNull(externalPolicy); assertEquals(id, externalPolicy.getId()); } - + @Test - public void testCreateExternalPolicy() throws Exception{ + public void testCreateExternalPolicy() throws Exception { respondWith(EXTERNAL_POLICY); List externalSegmentIds = Lists.newArrayList(); externalSegmentIds.add("f062e3b9-a668-4265-95d0-239c2061ca12"); - List consumedPolicyRuleSet= Lists.newArrayList(); + List consumedPolicyRuleSet = Lists.newArrayList(); consumedPolicyRuleSet.add("1bbc10a8-aeb2-4e53-ab31-a1fed18763f4"); consumedPolicyRuleSet.add("ec0b5a7d-f963-45de-b4e4-864d59dc8c0b"); consumedPolicyRuleSet.add("c3207474-19ee-4241-81e5-9e20995f2065"); @@ -66,7 +65,7 @@ public void testCreateExternalPolicy() throws Exception{ consumedPolicyRuleSet.add("408a5153-efc5-4bea-a3ef-2c838e330254"); consumedPolicyRuleSet.add("de829eb3-4867-442f-bac7-c59906c610b0"); - List providedPolicyRuleSet= Lists.newArrayList(); + List providedPolicyRuleSet = Lists.newArrayList(); providedPolicyRuleSet.add("1bbc10a8-aeb2-4e53-ab31-a1fed18763f4"); providedPolicyRuleSet.add("ec0b5a7d-f963-45de-b4e4-864d59dc8c0b"); providedPolicyRuleSet.add("c3207474-19ee-4241-81e5-9e20995f2065"); @@ -75,21 +74,23 @@ public void testCreateExternalPolicy() throws Exception{ providedPolicyRuleSet.add("b8a116d4-d674-438c-9fc6-973f2d6f5019"); providedPolicyRuleSet.add("408a5153-efc5-4bea-a3ef-2c838e330254"); providedPolicyRuleSet.add("de829eb3-4867-442f-bac7-c59906c610b0"); - - ExternalPolicy externalPolicy = osv2().gbp().externalPolicy().create(Builders.externalPolicy().consumedPolicyRuleSets(consumedPolicyRuleSet).providedPolicyRuleSets(providedPolicyRuleSet).externalSegments(externalSegmentIds ).name("test-ext-policy").description("test-ext-policy-desc").build()); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created External Policy : "+externalPolicy); + + ExternalPolicy externalPolicy = osv2().gbp().externalPolicy().create(Builders.externalPolicy().consumedPolicyRuleSets(consumedPolicyRuleSet).providedPolicyRuleSets(providedPolicyRuleSet).externalSegments(externalSegmentIds).name("test-ext-policy").description("test-ext-policy-desc").build()); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created External Policy : " + externalPolicy); assertEquals("test-ext-policy", externalPolicy.getName()); assertEquals(8, externalPolicy.getConsumedPolicyRuleSets().size()); assertEquals(8, externalPolicy.getProvidedPolicyRuleSets().size()); } + @Test - public void testUpdateExternalPolicy() throws Exception{ + public void testUpdateExternalPolicy() throws Exception { respondWith(EXTERNAL_POLICY_UPDATE); String id = "8d14b663-c67d-4fa7-b23f-0732cb9aa292"; - ExternalPolicy externalPolicy =osv2().gbp().externalPolicy().update(id, Builders.externalPolicy().name("test-ext-policy-update").description("test-ext-policy-desc-update").build()); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated External Policy : "+externalPolicy); + ExternalPolicy externalPolicy = osv2().gbp().externalPolicy().update(id, Builders.externalPolicy().name("test-ext-policy-update").description("test-ext-policy-desc-update").build()); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated External Policy : " + externalPolicy); assertEquals("test-ext-policy-desc-update", externalPolicy.getDescription()); } + @Test public void testDeleteExternalPolicy() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/ExternalSegmentServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/ExternalSegmentServiceTest.java index e621335f1..e20829af1 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/ExternalSegmentServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/ExternalSegmentServiceTest.java @@ -1,70 +1,74 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.ExternalSegment; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for External segments on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/external_segments") +@Test(suiteName = "grouppolicy/external_segments") public class ExternalSegmentServiceTest extends AbstractTest { - private static final String EXTERNAL_SEGMENTS="/network/gbp/external_segments.json"; - private static final String EXTERNAL_SEGMENT="/network/gbp/external_segment.json"; - private static final String EXTERNAL_SEGMENT_UPDATE="/network/gbp/external_segment_update.json"; + private static final String EXTERNAL_SEGMENTS = "/network/gbp/external_segments.json"; + private static final String EXTERNAL_SEGMENT = "/network/gbp/external_segment.json"; + private static final String EXTERNAL_SEGMENT_UPDATE = "/network/gbp/external_segment_update.json"; + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListExternalSegment() throws Exception{ + public void testListExternalSegment() throws Exception { respondWith(EXTERNAL_SEGMENTS); List externalSegList = osv2().gbp().externalSegment().list(); assertEquals(2, externalSegList.size()); Preconditions.checkNotNull(externalSegList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Segment from List : "+externalSegList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Segment from List : " + externalSegList.get(0)); assertEquals(externalSegList.get(0).getId(), "fff89eb8-8f9d-49a2-b66c-ad75d9a95287"); } + @Test - public void testGetExternalSegment() throws Exception{ + public void testGetExternalSegment() throws Exception { respondWith(EXTERNAL_SEGMENT); String id = "df9e5238-084e-4053-8871-81b63167e2f4"; ExternalSegment externalSegment = osv2().gbp().externalSegment().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Segment by ID : "+externalSegment); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : External Segment by ID : " + externalSegment); assertNotNull(externalSegment); assertEquals(id, externalSegment.getId()); } + @Test - public void testCreateExternalSegment() throws Exception{ + public void testCreateExternalSegment() throws Exception { respondWith(EXTERNAL_SEGMENT); ExternalSegment externalSegment = osv2().gbp().externalSegment().create(Builders.externalSegment().ipVersion(4).cidr("172.16.0.0/12").name("extSeg01").description("extSeg01-desc").build()); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created External Policy : "+externalSegment); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created External Policy : " + externalSegment); assertEquals("extSeg01", externalSegment.getName()); assertEquals(4, externalSegment.getIpVersion()); assertEquals("172.16.0.0/12", externalSegment.getCidr()); } + @Test - public void testUpdateExternalSegment() throws Exception{ + public void testUpdateExternalSegment() throws Exception { respondWith(EXTERNAL_SEGMENT_UPDATE); String id = "fff89eb8-8f9d-49a2-b66c-ad75d9a95287"; - ExternalSegment externalSegment =osv2().gbp().externalSegment().update(id, Builders.externalSegment().name("extSeg01-update").description("extSeg01-desc-update").build()); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated External Segment : "+externalSegment); + ExternalSegment externalSegment = osv2().gbp().externalSegment().update(id, Builders.externalSegment().name("extSeg01-update").description("extSeg01-desc-update").build()); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated External Segment : " + externalSegment); assertEquals("extSeg01-desc-update", externalSegment.getDescription()); } + @Test public void testDeleteExternalSegment() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/GroupServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/GroupServiceTest.java index a342b6cdc..bcb416ffd 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/GroupServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/GroupServiceTest.java @@ -1,12 +1,6 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -14,61 +8,70 @@ import org.openstack4j.model.gbp.PolicyTargetGroupCreate; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for policy target group on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/policy_target_groups") +@Test(suiteName = "grouppolicy/policy_target_groups") public class GroupServiceTest extends AbstractTest { - private static final String POLICY_TARGET_GROUPS="/network/gbp/policy_target_groups.json"; - private static final String POLICY_TARGET_GROUP="/network/gbp/policy_target_group.json"; - private static final String POLICY_TARGET_GROUP_UPDATE="/network/gbp/policy_target_group_update.json"; - + private static final String POLICY_TARGET_GROUPS = "/network/gbp/policy_target_groups.json"; + private static final String POLICY_TARGET_GROUP = "/network/gbp/policy_target_group.json"; + private static final String POLICY_TARGET_GROUP_UPDATE = "/network/gbp/policy_target_group_update.json"; + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListPolicyTargetGroup() throws Exception{ + public void testListPolicyTargetGroup() throws Exception { respondWith(POLICY_TARGET_GROUPS); List policytargetGroupList = osv2().gbp().group().list(); assertEquals(8, policytargetGroupList.size()); Preconditions.checkNotNull(policytargetGroupList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target group from List : "+policytargetGroupList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target group from List : " + policytargetGroupList.get(0)); assertEquals(policytargetGroupList.get(0).getId(), "1fb00129-06cf-48e5-8282-d15dbf4be60b"); } + @Test - public void testGetPolicyTargetGroup() throws Exception{ + public void testGetPolicyTargetGroup() throws Exception { respondWith(POLICY_TARGET_GROUP); String id = "61073812-3994-40c2-96f0-6bff03804e47"; PolicyTargetGroup policyTargetGroup = osv2().gbp().group().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target Group by ID : "+policyTargetGroup); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target Group by ID : " + policyTargetGroup); assertNotNull(policyTargetGroup); assertEquals(id, policyTargetGroup.getId()); } + @Test - public void testCreatePolicyTargetGroup() throws Exception{ + public void testCreatePolicyTargetGroup() throws Exception { respondWith(POLICY_TARGET_GROUP); - PolicyTargetGroupCreate policyTargetGroupCreate= Builders.policyTargetGroup().name("test-policy-target-group").description("test-policy-target-group-desc").build(); + PolicyTargetGroupCreate policyTargetGroupCreate = Builders.policyTargetGroup().name("test-policy-target-group").description("test-policy-target-group-desc").build(); PolicyTargetGroup policyTargetGroup = osv2().gbp().group().create(policyTargetGroupCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Policy Target group : "+policyTargetGroup); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Policy Target group : " + policyTargetGroup); assertEquals("test-policy-target-group", policyTargetGroup.getName()); assertEquals(8, policyTargetGroup.getConsumedPolicyRuleSets().size()); assertEquals(8, policyTargetGroup.getProvidedPolicyRuleSets().size()); } + @Test - public void testUpdatePolicyTargetGroup() throws Exception{ + public void testUpdatePolicyTargetGroup() throws Exception { respondWith(POLICY_TARGET_GROUP_UPDATE); String id = "61073812-3994-40c2-96f0-6bff03804e47"; - PolicyTargetGroupCreate policyTargetGroupCreate= Builders.policyTargetGroup().name("test-policy-target-group-update").description("test-policy-target-group-desc-update").build(); - PolicyTargetGroup policyTargetGroup =osv2().gbp().group().update(id, policyTargetGroupCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Policy Target group : "+policyTargetGroup); + PolicyTargetGroupCreate policyTargetGroupCreate = Builders.policyTargetGroup().name("test-policy-target-group-update").description("test-policy-target-group-desc-update").build(); + PolicyTargetGroup policyTargetGroup = osv2().gbp().group().update(id, policyTargetGroupCreate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Policy Target group : " + policyTargetGroup); assertEquals("test-policy-target-group-desc-update", policyTargetGroup.getDescription()); } + @Test public void testDeletePolicyTargetGroup() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/L2policyServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/L2policyServiceTest.java index 7bc1976cb..fede7e4b3 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/L2policyServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/L2policyServiceTest.java @@ -1,72 +1,75 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.L2Policy; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for l2 policies on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/l2_policies") +@Test(suiteName = "grouppolicy/l2_policies") public class L2policyServiceTest extends AbstractTest { - private static final String L2_POLICIES="/network/gbp/l2_policies.json"; - private static final String L2_POLICY="/network/gbp/l2_policy.json"; - private static final String L2_POLICY_UPDATE="/network/gbp/l2_policy_update.json"; - + private static final String L2_POLICIES = "/network/gbp/l2_policies.json"; + private static final String L2_POLICY = "/network/gbp/l2_policy.json"; + private static final String L2_POLICY_UPDATE = "/network/gbp/l2_policy_update.json"; + @Override - protected Service service() { + protected Service service() { return Service.NETWORK; } + @Test - public void testListl2Policy() throws Exception{ + public void testListl2Policy() throws Exception { respondWith(L2_POLICIES); List l2policyList = osv2().gbp().l2Policy().list(); - assertEquals(10, l2policyList.size()); + assertEquals(10, l2policyList.size()); Preconditions.checkNotNull(l2policyList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L2 Policy from List : "+l2policyList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L2 Policy from List : " + l2policyList.get(0)); assertEquals(l2policyList.get(0).getId(), "08c1c093-6337-4383-938e-2d9c6cac531a"); } + @Test - public void testGetl2Policy() throws Exception{ + public void testGetl2Policy() throws Exception { respondWith(L2_POLICY); String id = "08c1c093-6337-4383-938e-2d9c6cac531a"; L2Policy l2policy = osv2().gbp().l2Policy().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L2 Policy by ID : "+l2policy); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L2 Policy by ID : " + l2policy); assertNotNull(l2policy); assertEquals(id, l2policy.getId()); } + @Test - public void testCreatel2Policy() throws Exception{ + public void testCreatel2Policy() throws Exception { respondWith(L2_POLICY); - L2Policy l2PolicyCreate= Builders.l2Policy().name("test-policy-target-group").description("Implicitly created L2 policy").build(); + L2Policy l2PolicyCreate = Builders.l2Policy().name("test-policy-target-group").description("Implicitly created L2 policy").build(); L2Policy l2Policy = osv2().gbp().l2Policy().create(l2PolicyCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created L2 Policy : "+l2Policy); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created L2 Policy : " + l2Policy); assertEquals("test-policy-target-group", l2Policy.getName()); assertEquals("f9c1f545-6ea6-4b05-99d5-50f02ed3c640", l2Policy.getNetworkId()); } + @Test - public void testUpdatel2Policy() throws Exception{ + public void testUpdatel2Policy() throws Exception { respondWith(L2_POLICY_UPDATE); String id = "08c1c093-6337-4383-938e-2d9c6cac531a"; - L2Policy l2PolicyUpdate= Builders.l2Policy().name("test-policy-target-group-update").description("Implicitly created L2 policy-update").build(); - L2Policy l2Policy =osv2().gbp().l2Policy().update(id, l2PolicyUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated L2 Policy : "+l2Policy); + L2Policy l2PolicyUpdate = Builders.l2Policy().name("test-policy-target-group-update").description("Implicitly created L2 policy-update").build(); + L2Policy l2Policy = osv2().gbp().l2Policy().update(id, l2PolicyUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated L2 Policy : " + l2Policy); assertEquals("Implicitly created L2 policy-update", l2Policy.getDescription()); } + @Test public void testDeletel2Policy() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/L3policyServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/L3policyServiceTest.java index 01cecc191..e7098c2cb 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/L3policyServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/L3policyServiceTest.java @@ -1,72 +1,75 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.L3Policy; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for l3 policies on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/l3_policies") +@Test(suiteName = "grouppolicy/l3_policies") public class L3policyServiceTest extends AbstractTest { - private static final String L3_POLICIES="/network/gbp/l3_policies.json"; - private static final String L3_POLICY="/network/gbp/l3_policy.json"; - private static final String L3_POLICY_UPDATE="/network/gbp/l3_policy_update.json"; - + private static final String L3_POLICIES = "/network/gbp/l3_policies.json"; + private static final String L3_POLICY = "/network/gbp/l3_policy.json"; + private static final String L3_POLICY_UPDATE = "/network/gbp/l3_policy_update.json"; + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListl3Policy() throws Exception{ + public void testListl3Policy() throws Exception { respondWith(L3_POLICIES); List l3policyList = osv2().gbp().l3Policy().list(); - assertEquals(2, l3policyList.size()); + assertEquals(2, l3policyList.size()); Preconditions.checkNotNull(l3policyList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L3 Policy from List : "+l3policyList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L3 Policy from List : " + l3policyList.get(0)); assertEquals(l3policyList.get(0).getId(), "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d"); } + @Test - public void testGetl3Policy() throws Exception{ + public void testGetl3Policy() throws Exception { respondWith(L3_POLICY); String id = "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d"; L3Policy l3policy = osv2().gbp().l3Policy().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L3 Policy by ID : "+l3policy); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : L3 Policy by ID : " + l3policy); assertNotNull(l3policy); assertEquals(id, l3policy.getId()); } + @Test - public void testCreatel3Policy() throws Exception{ + public void testCreatel3Policy() throws Exception { respondWith(L3_POLICY); - L3Policy l3PolicyCreate= Builders.l3Policy().name("default").description("Implicitly created L3 policy").build(); + L3Policy l3PolicyCreate = Builders.l3Policy().name("default").description("Implicitly created L3 policy").build(); L3Policy l3Policy = osv2().gbp().l3Policy().create(l3PolicyCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created L3 Policy : "+l3Policy); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created L3 Policy : " + l3Policy); assertEquals("default", l3Policy.getName()); assertEquals("24", l3Policy.getSubnetPrefixLength()); } + @Test - public void testUpdatel3Policy() throws Exception{ + public void testUpdatel3Policy() throws Exception { respondWith(L3_POLICY_UPDATE); String id = "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d"; - L3Policy l3PolicyUpdate= Builders.l3Policy().name("default-update").description("Implicitly created L3 policy-update").build(); - L3Policy l3Policy =osv2().gbp().l3Policy().update(id, l3PolicyUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated L3 Policy : "+l3Policy); + L3Policy l3PolicyUpdate = Builders.l3Policy().name("default-update").description("Implicitly created L3 policy-update").build(); + L3Policy l3Policy = osv2().gbp().l3Policy().update(id, l3PolicyUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated L3 Policy : " + l3Policy); assertEquals("Implicitly created L3 policy-update", l3Policy.getDescription()); } + @Test public void testDeletel3Policy() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/NatPoolServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/NatPoolServiceTest.java index 34cadf88d..c19ef6385 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/NatPoolServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/NatPoolServiceTest.java @@ -1,71 +1,74 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.NatPool; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for nat pool on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/nat_pools") +@Test(suiteName = "grouppolicy/nat_pools") public class NatPoolServiceTest extends AbstractTest { - private static final String NAT_POOLS="/network/gbp/nat_pools.json"; - private static final String NAT_POOL="/network/gbp/nat_pool.json"; - private static final String NAT_POOL_UPDATE="/network/gbp/nat_pool_update.json"; - + private static final String NAT_POOLS = "/network/gbp/nat_pools.json"; + private static final String NAT_POOL = "/network/gbp/nat_pool.json"; + private static final String NAT_POOL_UPDATE = "/network/gbp/nat_pool_update.json"; + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListNatPool() throws Exception{ + public void testListNatPool() throws Exception { respondWith(NAT_POOLS); List natpoolList = osv2().gbp().natPool().list(); - assertEquals(2, natpoolList.size()); + assertEquals(2, natpoolList.size()); Preconditions.checkNotNull(natpoolList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Nat Pool from List : "+natpoolList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Nat Pool from List : " + natpoolList.get(0)); assertEquals(natpoolList.get(0).getId(), "f2e4fce7-4c55-497b-ac4c-290dd202c71a"); } + @Test - public void testGetNatPool() throws Exception{ + public void testGetNatPool() throws Exception { respondWith(NAT_POOL); String id = "e2d4fce7-4c55-497b-ac4c-290dd202c71a"; NatPool natPool = osv2().gbp().natPool().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Nat Pool by ID : "+natPool); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Nat Pool by ID : " + natPool); assertNotNull(natPool); assertEquals(id, natPool.getId()); } + @Test - public void testCreateNatPool() throws Exception{ + public void testCreateNatPool() throws Exception { respondWith(NAT_POOL); - NatPool natPool= Builders.natPool().name("ptg_nat_pool").build(); + NatPool natPool = Builders.natPool().name("ptg_nat_pool").build(); NatPool npool = osv2().gbp().natPool().create(natPool); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Nat Pool : "+npool); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Nat Pool : " + npool); assertEquals("ptg_nat_pool", npool.getName()); } + @Test - public void testUpdateNatPool() throws Exception{ + public void testUpdateNatPool() throws Exception { respondWith(NAT_POOL_UPDATE); String id = "e2d4fce7-4c55-497b-ac4c-290dd202c71a"; - NatPool natPoolUpdate= Builders.natPool().name("ptg_nat_pool-update").build(); - NatPool natPool =osv2().gbp().natPool().update(id, natPoolUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Nat Pool : "+natPool); + NatPool natPoolUpdate = Builders.natPool().name("ptg_nat_pool-update").build(); + NatPool natPool = osv2().gbp().natPool().update(id, natPoolUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Nat Pool : " + natPool); assertEquals("ptg_nat_pool-update", natPool.getName()); } + @Test public void testDeleteNatPool() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/NetworkPolicyServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/NetworkPolicyServiceTest.java index 7ae2c3521..364a7d0e1 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/NetworkPolicyServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/NetworkPolicyServiceTest.java @@ -18,12 +18,12 @@ * * @author sumit gandhi */ -@Test(suiteName="grouppolicy/network_service_policies") +@Test(suiteName = "grouppolicy/network_service_policies") public class NetworkPolicyServiceTest extends AbstractTest { - private static final String NETWORK_SERVICE_POLICIES="/network/gbp/network_service_policies.json"; - private static final String NETWORK_SERVICE_POLICY="/network/gbp/network_service_policy.json"; - private static final String NETWORK_SERVICE_POLICY_UPDATE="/network/gbp/network_service_policy_update.json"; + private static final String NETWORK_SERVICE_POLICIES = "/network/gbp/network_service_policies.json"; + private static final String NETWORK_SERVICE_POLICY = "/network/gbp/network_service_policy.json"; + private static final String NETWORK_SERVICE_POLICY_UPDATE = "/network/gbp/network_service_policy_update.json"; @Override protected Service service() { @@ -31,18 +31,18 @@ protected Service service() { } @Test - public void testListNetworkServicePolicy() throws Exception{ + public void testListNetworkServicePolicy() throws Exception { respondWith(NETWORK_SERVICE_POLICIES); List gbpServicePolicies = osv2().gbp().networkPolicyService().list(); assertEquals(2, gbpServicePolicies.size()); Preconditions.checkNotNull(gbpServicePolicies.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Nat Pool from List : "+gbpServicePolicies.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Nat Pool from List : " + gbpServicePolicies.get(0)); assertEquals(gbpServicePolicies.get(0).getId(), "d98e3cd5-3eb4-41ba-9069-6f5867ceb162"); assertEquals(gbpServicePolicies.get(1).getId(), "e252a688-2b09-4aab-ae4a-ad57fd9154f2"); } @Test - public void testGetNetworkServicePolicy() throws Exception{ + public void testGetNetworkServicePolicy() throws Exception { respondWith(NETWORK_SERVICE_POLICY); String id = "d98e3cd5-3eb4-41ba-9069-6f5867ceb162"; NetworkServicePolicy gbpServicePolicy = osv2().gbp().networkPolicyService().get(id); @@ -51,11 +51,11 @@ public void testGetNetworkServicePolicy() throws Exception{ } @Test - public void testCreateNetworkServicePolicy() throws Exception{ + public void testCreateNetworkServicePolicy() throws Exception { respondWith(NETWORK_SERVICE_POLICY); - NetworkServicePolicy gbpServicePolicy= Builders.networkServicePolicy().name("Test2").build(); + NetworkServicePolicy gbpServicePolicy = Builders.networkServicePolicy().name("Test2").build(); NetworkServicePolicy gbpServicePolicyOut = osv2().gbp().networkPolicyService().create(gbpServicePolicy); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Network Service Policy : "+gbpServicePolicyOut); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Network Service Policy : " + gbpServicePolicyOut); assertEquals("Test2", gbpServicePolicyOut.getName()); } @@ -68,12 +68,12 @@ public void testDeleteNetworkServicePolicy() { } @Test - public void testUpdateNatPool() throws Exception{ + public void testUpdateNatPool() throws Exception { respondWith(NETWORK_SERVICE_POLICY_UPDATE); String id = "d98e3cd5-3eb4-41ba-9069-6f5867ceb162"; NetworkServicePolicy gbpServicePolicyUpdate = Builders.networkServicePolicy().name("Test2").build(); - NetworkServicePolicy gbpNetworkServicePolicy =osv2().gbp().networkPolicyService().update(id, gbpServicePolicyUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Network Service Policy : "+gbpNetworkServicePolicy); + NetworkServicePolicy gbpNetworkServicePolicy = osv2().gbp().networkPolicyService().update(id, gbpServicePolicyUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Network Service Policy : " + gbpNetworkServicePolicy); assertEquals("TestUpdate", gbpNetworkServicePolicy.getName()); } diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyActionServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyActionServiceTest.java index cf0ca133e..321e48b72 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyActionServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyActionServiceTest.java @@ -1,12 +1,6 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -15,60 +9,69 @@ import org.openstack4j.model.gbp.PolicyActionUpdate; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for policy action on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/policy_actions") +@Test(suiteName = "grouppolicy/policy_actions") public class PolicyActionServiceTest extends AbstractTest { - private static final String POLICY_ACTIONS="/network/gbp/policy_actions.json"; - private static final String POLICY_ACTION="/network/gbp/policy_action.json"; - private static final String POLICY_ACTION_UPDATE="/network/gbp/policy_action_update.json"; - + private static final String POLICY_ACTIONS = "/network/gbp/policy_actions.json"; + private static final String POLICY_ACTION = "/network/gbp/policy_action.json"; + private static final String POLICY_ACTION_UPDATE = "/network/gbp/policy_action_update.json"; + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListPolicyAction() throws Exception{ + public void testListPolicyAction() throws Exception { respondWith(POLICY_ACTIONS); List policyActionList = osv2().gbp().policyAction().list(); - assertEquals(2, policyActionList.size()); + assertEquals(2, policyActionList.size()); Preconditions.checkNotNull(policyActionList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Action from List : "+policyActionList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Action from List : " + policyActionList.get(0)); assertEquals(policyActionList.get(0).getId(), "b25bbad7-224b-4810-ae1c-7d10fb4468b5"); - } + } + @Test - public void testGetPolicyAction() throws Exception{ + public void testGetPolicyAction() throws Exception { respondWith(POLICY_ACTION); String id = "b25bbad7-224b-4810-ae1c-7d10fb4468b5"; PolicyAction policyAction = osv2().gbp().policyAction().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Action by ID : "+policyAction); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Action by ID : " + policyAction); assertNotNull(policyAction); assertEquals(id, policyAction.getId()); } + @Test - public void testCreatePolicyAction() throws Exception{ + public void testCreatePolicyAction() throws Exception { respondWith(POLICY_ACTION); - PolicyAction policyActionCreate= Builders.policyAction().name("allow").actionType(PolicyActionProtocol.ALLOW).build(); + PolicyAction policyActionCreate = Builders.policyAction().name("allow").actionType(PolicyActionProtocol.ALLOW).build(); PolicyAction policyAction = osv2().gbp().policyAction().create(policyActionCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Action : "+policyAction); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Action : " + policyAction); assertEquals(PolicyActionProtocol.ALLOW.value(), policyAction.getActionType().value()); assertEquals("allow", policyAction.getName()); } + @Test - public void testUpdatePolicyAction() throws Exception{ + public void testUpdatePolicyAction() throws Exception { respondWith(POLICY_ACTION_UPDATE); String id = "b25bbad7-224b-4810-ae1c-7d10fb4468b5"; - PolicyActionUpdate policyActionUpdate= Builders.policyActionUpdate().name("redirect").build(); - PolicyAction policyAction =osv2().gbp().policyAction().update(id, policyActionUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Action : "+policyAction); + PolicyActionUpdate policyActionUpdate = Builders.policyActionUpdate().name("redirect").build(); + PolicyAction policyAction = osv2().gbp().policyAction().update(id, policyActionUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Action : " + policyAction); assertEquals("redirect", policyAction.getName()); } + @Test public void testDeletePolicyAction() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyClassifierServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyClassifierServiceTest.java index 90c0a9cc9..f8e5d3e80 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyClassifierServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyClassifierServiceTest.java @@ -1,12 +1,6 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -16,60 +10,69 @@ import org.openstack4j.model.gbp.Protocol; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for policy classifier on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/policy_classifiers") +@Test(suiteName = "grouppolicy/policy_classifiers") public class PolicyClassifierServiceTest extends AbstractTest { - private static final String POLICY_CLASSIFIERS="/network/gbp/policy_classifiers.json"; - private static final String POLICY_CLASSIFIER="/network/gbp/policy_classifier.json"; - private static final String POLICY_CLASSIFIER_UPDATE="/network/gbp/policy_classifier_update.json"; - - + private static final String POLICY_CLASSIFIERS = "/network/gbp/policy_classifiers.json"; + private static final String POLICY_CLASSIFIER = "/network/gbp/policy_classifier.json"; + private static final String POLICY_CLASSIFIER_UPDATE = "/network/gbp/policy_classifier_update.json"; + + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListPolicyClassifier() throws Exception{ + public void testListPolicyClassifier() throws Exception { respondWith(POLICY_CLASSIFIERS); List policyClasifierList = osv2().gbp().policyClassifier().list(); - assertEquals(2, policyClasifierList.size()); + assertEquals(2, policyClasifierList.size()); Preconditions.checkNotNull(policyClasifierList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Classifier from List : "+policyClasifierList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Classifier from List : " + policyClasifierList.get(0)); assertEquals(policyClasifierList.get(0).getId(), "36e41adb-0b9b-4a11-abd5-66e5386139d4"); } + @Test - public void testGetPolicyClassifier() throws Exception{ + public void testGetPolicyClassifier() throws Exception { respondWith(POLICY_CLASSIFIER); String id = "36e41adb-0b9b-4a11-abd5-66e5386139d4"; PolicyClassifier policyclassifier = osv2().gbp().policyClassifier().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Classifier by ID : "+policyclassifier); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Classifier by ID : " + policyclassifier); assertNotNull(policyclassifier); assertEquals(id, policyclassifier.getId()); } + @Test - public void testCreatePolicyClassifier() throws Exception{ + public void testCreatePolicyClassifier() throws Exception { respondWith(POLICY_CLASSIFIER); - PolicyClassifier policyClassifierCreate= Builders.policyClassifier().name("icmp").direction(Direction.BI).protocol(Protocol.ICMP).build(); + PolicyClassifier policyClassifierCreate = Builders.policyClassifier().name("icmp").direction(Direction.BI).protocol(Protocol.ICMP).build(); PolicyClassifier policyClassifier = osv2().gbp().policyClassifier().create(policyClassifierCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Classifier : "+policyClassifier); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Classifier : " + policyClassifier); assertEquals("icmp", policyClassifier.getName()); } + @Test - public void testUpdatePolicyClassifier() throws Exception{ + public void testUpdatePolicyClassifier() throws Exception { respondWith(POLICY_CLASSIFIER_UPDATE); String id = "36e41adb-0b9b-4a11-abd5-66e5386139d4"; - PolicyClassifierUpdate policyClassifierUpdate= Builders.policyClassifierUpdate().name("icmp").description("icmp-update").build(); - PolicyClassifier policyClassifier =osv2().gbp().policyClassifier().update(id, policyClassifierUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Action : "+policyClassifier); + PolicyClassifierUpdate policyClassifierUpdate = Builders.policyClassifierUpdate().name("icmp").description("icmp-update").build(); + PolicyClassifier policyClassifier = osv2().gbp().policyClassifier().update(id, policyClassifierUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Action : " + policyClassifier); assertEquals("icmp-update", policyClassifier.getDescription()); } + @Test public void testDeletePolicyClassifier() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleServiceTest.java index 98dda423c..922f55185 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleServiceTest.java @@ -1,73 +1,76 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyRule; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for policy rule on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/policy_rules") +@Test(suiteName = "grouppolicy/policy_rules") public class PolicyRuleServiceTest extends AbstractTest { - private static final String POLICY_RULES="/network/gbp/policy_rules.json"; - private static final String POLICY_RULE="/network/gbp/policy_rule.json"; - private static final String POLICY_RULE_UPDATE="/network/gbp/policy_rule_update.json"; - - + private static final String POLICY_RULES = "/network/gbp/policy_rules.json"; + private static final String POLICY_RULE = "/network/gbp/policy_rule.json"; + private static final String POLICY_RULE_UPDATE = "/network/gbp/policy_rule_update.json"; + + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListPolicyRule() throws Exception{ + public void testListPolicyRule() throws Exception { respondWith(POLICY_RULES); List policyRuleList = osv2().gbp().policyRule().list(); - assertEquals(10, policyRuleList.size()); + assertEquals(10, policyRuleList.size()); Preconditions.checkNotNull(policyRuleList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule from List : "+policyRuleList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule from List : " + policyRuleList.get(0)); assertEquals(policyRuleList.get(0).getId(), "059909d1-7f20-40cf-a78a-27c340a5aaac"); } + @Test - public void testGetPolicyRule() throws Exception{ + public void testGetPolicyRule() throws Exception { respondWith(POLICY_RULE); String id = "059909d1-7f20-40cf-a78a-27c340a5aaac"; PolicyRule policyrule = osv2().gbp().policyRule().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule by ID : "+policyrule); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule by ID : " + policyrule); assertNotNull(policyrule); assertEquals(id, policyrule.getId()); } + @Test - public void testCreatePolicyRule() throws Exception{ + public void testCreatePolicyRule() throws Exception { respondWith(POLICY_RULE); - PolicyRule policyRuleCreate= Builders.policyRule().name("icmp-rule").build(); + PolicyRule policyRuleCreate = Builders.policyRule().name("icmp-rule").build(); PolicyRule policyRule = osv2().gbp().policyRule().create(policyRuleCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Rule : "+policyRule); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Rule : " + policyRule); assertEquals("36e41adb-0b9b-4a11-abd5-66e5386139d4", policyRule.getPolicyClassifierId()); assertEquals("icmp-rule", policyRule.getName()); } + @Test - public void testUpdatePolicyRule() throws Exception{ + public void testUpdatePolicyRule() throws Exception { respondWith(POLICY_RULE_UPDATE); String id = "059909d1-7f20-40cf-a78a-27c340a5aaac"; - PolicyRule policyRuleUpdate= Builders.policyRule().name("icmp-rule-update").description("icmp-rule-desc-update").build(); - PolicyRule policyRule =osv2().gbp().policyRule().update(id, policyRuleUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Rule : "+policyRule); + PolicyRule policyRuleUpdate = Builders.policyRule().name("icmp-rule-update").description("icmp-rule-desc-update").build(); + PolicyRule policyRule = osv2().gbp().policyRule().update(id, policyRuleUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Rule : " + policyRule); assertEquals("icmp-rule-desc-update", policyRule.getDescription()); } + @Test public void testDeletePolicyRule() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetServiceTest.java index 43993b52e..2020a790b 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetServiceTest.java @@ -1,73 +1,76 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyRuleSet; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for policy rule set on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/policy_rule_set") +@Test(suiteName = "grouppolicy/policy_rule_set") public class PolicyRuleSetServiceTest extends AbstractTest { - private static final String POLICY_RULE_SETS="/network/gbp/policy_rule_sets.json"; - private static final String POLICY_RULE_SET="/network/gbp/policy_rule_set.json"; - private static final String POLICY_RULE_SET_UPDATE="/network/gbp/policy_rule_set_update.json"; - - + private static final String POLICY_RULE_SETS = "/network/gbp/policy_rule_sets.json"; + private static final String POLICY_RULE_SET = "/network/gbp/policy_rule_set.json"; + private static final String POLICY_RULE_SET_UPDATE = "/network/gbp/policy_rule_set_update.json"; + + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListPolicyRuleSet() throws Exception{ + public void testListPolicyRuleSet() throws Exception { respondWith(POLICY_RULE_SETS); List policyRuleSetList = osv2().gbp().policyRuleSet().list(); - assertEquals(10, policyRuleSetList.size()); + assertEquals(10, policyRuleSetList.size()); Preconditions.checkNotNull(policyRuleSetList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule Set from List : "+policyRuleSetList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule Set from List : " + policyRuleSetList.get(0)); assertEquals(policyRuleSetList.get(0).getId(), "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4"); } + @Test - public void testGetPolicyRuleSet() throws Exception{ + public void testGetPolicyRuleSet() throws Exception { respondWith(POLICY_RULE_SET); String id = "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4"; PolicyRuleSet policyruleSet = osv2().gbp().policyRuleSet().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule Set by ID : "+policyruleSet); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy Rule Set by ID : " + policyruleSet); assertNotNull(policyruleSet); assertEquals(id, policyruleSet.getId()); } + @Test - public void testCreatePolicyRuleSet() throws Exception{ + public void testCreatePolicyRuleSet() throws Exception { respondWith(POLICY_RULE_SET); - PolicyRuleSet policyRuleSetCreate= Builders.policyRuleSet().name("test-rule-set").description("test-rule-set-desc").build(); + PolicyRuleSet policyRuleSetCreate = Builders.policyRuleSet().name("test-rule-set").description("test-rule-set-desc").build(); PolicyRuleSet policyRuleSet = osv2().gbp().policyRuleSet().create(policyRuleSetCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Rule Set : "+policyRuleSet); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Create Policy Rule Set : " + policyRuleSet); assertEquals(0, policyRuleSet.getChildPolicyRuleSets().size()); assertEquals("test-rule-set", policyRuleSet.getName()); - } + } + @Test - public void testUpdatePolicyRuleSet() throws Exception{ + public void testUpdatePolicyRuleSet() throws Exception { respondWith(POLICY_RULE_SET_UPDATE); String id = "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4"; - PolicyRuleSet policyRuleSetUpdate= Builders.policyRuleSet().name("test-rule-set-update").description("test-rule-set-desc-update").build(); - PolicyRuleSet policyRuleSet =osv2().gbp().policyRuleSet().update(id, policyRuleSetUpdate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Rule Set : "+policyRuleSet); + PolicyRuleSet policyRuleSetUpdate = Builders.policyRuleSet().name("test-rule-set-update").description("test-rule-set-desc-update").build(); + PolicyRuleSet policyRuleSet = osv2().gbp().policyRuleSet().update(id, policyRuleSetUpdate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Upate Policy Rule Set : " + policyRuleSet); assertEquals("test-rule-set-desc-update", policyRuleSet.getDescription()); } + @Test public void testDeletePolicyRuleSet() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyTargetServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyTargetServiceTest.java index 2251d4ba2..b092360a9 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/PolicyTargetServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/PolicyTargetServiceTest.java @@ -1,74 +1,77 @@ package org.openstack4j.api.gbp; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyTarget; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; + /** * Test cases for policy target on GBP * * @author vinod borole */ -@Test(suiteName="grouppolicy/policy_targets") +@Test(suiteName = "grouppolicy/policy_targets") public class PolicyTargetServiceTest extends AbstractTest { - private static final String POLICY_TARGETS="/network/gbp/policy_targets.json"; - private static final String POLICY_TARGET="/network/gbp/policy_target.json"; - private static final String POLICY_TARGET_UPDATE="/network/gbp/policy_target_update.json"; - - + private static final String POLICY_TARGETS = "/network/gbp/policy_targets.json"; + private static final String POLICY_TARGET = "/network/gbp/policy_target.json"; + private static final String POLICY_TARGET_UPDATE = "/network/gbp/policy_target_update.json"; + + @Override protected Service service() { return Service.NETWORK; } + @Test - public void testListPolicyTarget() throws Exception{ + public void testListPolicyTarget() throws Exception { respondWith(POLICY_TARGETS); List policytargetList = osv2().gbp().policyTarget().list(); assertEquals(10, policytargetList.size()); Preconditions.checkNotNull(policytargetList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target from List : "+policytargetList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target from List : " + policytargetList.get(0)); assertEquals(policytargetList.get(0).getId(), "0d65eebe-4efe-456e-aec3-7856e4e839b4"); } + @Test - public void testGetPolicyTarget() throws Exception{ + public void testGetPolicyTarget() throws Exception { respondWith(POLICY_TARGET); String id = "0d65eebe-4efe-456e-aec3-7856e4e839b4"; PolicyTarget policyTarget = osv2().gbp().policyTarget().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target by ID : "+policyTarget); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy target by ID : " + policyTarget); assertNotNull(policyTarget); assertEquals(id, policyTarget.getId()); } + @Test - public void testCreatePolicyTarget() throws Exception{ + public void testCreatePolicyTarget() throws Exception { respondWith(POLICY_TARGET); - PolicyTarget policyTargetCreate= Builders.policyTarget().name("test-policytarget").description("test-policytarget-desc").build(); + PolicyTarget policyTargetCreate = Builders.policyTarget().name("test-policytarget").description("test-policytarget-desc").build(); PolicyTarget policyTarget = osv2().gbp().policyTarget().create(policyTargetCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Policy Target : "+policyTarget); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Policy Target : " + policyTarget); assertEquals("test-policytarget", policyTarget.getName()); assertEquals("36af8850-3514-4343-8293-9f9faae980d6", policyTarget.getPortId()); assertEquals("1fb00129-06cf-48e5-8282-d15dbf4be60b", policyTarget.getPolicyTargetGroupId()); } + @Test - public void testUpdatePolicyTarget() throws Exception{ + public void testUpdatePolicyTarget() throws Exception { respondWith(POLICY_TARGET_UPDATE); String id = "0d65eebe-4efe-456e-aec3-7856e4e839b4"; - PolicyTarget policyTargetCreate= Builders.policyTarget().name("test-policytarget-update").description("test-policytarget-desc-update").build(); - PolicyTarget policyTarget =osv2().gbp().policyTarget().update(id, policyTargetCreate); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Policy Target : "+policyTarget); + PolicyTarget policyTargetCreate = Builders.policyTarget().name("test-policytarget-update").description("test-policytarget-desc-update").build(); + PolicyTarget policyTarget = osv2().gbp().policyTarget().update(id, policyTargetCreate); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Policy Target : " + policyTarget); assertEquals("test-policytarget-desc-update", policyTarget.getDescription()); } + @Test public void testDeletePolicyTarget() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/ServiceProfileServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/ServiceProfileServiceTest.java index 8c7e28af4..b5ee0e5c2 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/ServiceProfileServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/ServiceProfileServiceTest.java @@ -1,6 +1,7 @@ package org.openstack4j.api.gbp; import org.openstack4j.api.AbstractTest; + /** * Test cases for service profile on GBP * diff --git a/core-test/src/main/java/org/openstack4j/api/gbp/ServicechainServiceTest.java b/core-test/src/main/java/org/openstack4j/api/gbp/ServicechainServiceTest.java index 340062129..074c72744 100644 --- a/core-test/src/main/java/org/openstack4j/api/gbp/ServicechainServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/gbp/ServicechainServiceTest.java @@ -1,6 +1,7 @@ package org.openstack4j.api.gbp; import org.openstack4j.api.AbstractTest; + /** * Test cases for service chain on GBP * diff --git a/core-test/src/main/java/org/openstack4j/api/heat/ResourcesTests.java b/core-test/src/main/java/org/openstack4j/api/heat/ResourcesTests.java index 31b5560c1..07fb1a36e 100644 --- a/core-test/src/main/java/org/openstack4j/api/heat/ResourcesTests.java +++ b/core-test/src/main/java/org/openstack4j/api/heat/ResourcesTests.java @@ -1,29 +1,31 @@ package org.openstack4j.api.heat; -import org.openstack4j.api.*; -import org.openstack4j.model.common.*; -import org.openstack4j.model.heat.*; -import org.testng.annotations.*; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.api.Builders; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.heat.ResourceHealth; +import org.testng.annotations.Test; -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.util.Map; -import static org.testng.Assert.*; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; -@Test(suiteName="heat/resources", enabled = true) +@Test(suiteName = "heat/resources", enabled = true) public class ResourcesTests extends AbstractTest { - private static final String METADATA="/heat/metadata.json"; + private static final String METADATA = "/heat/metadata.json"; @SuppressWarnings("unchecked") public void testGetResourceMetadata() throws IOException { respondWith(METADATA); Map metadata = osv3().heat().resources().getMetadata("name", "id", "resource"); assertEquals(metadata.size(), 1); - Map inner = (Map)metadata.get("metadata"); + Map inner = (Map) metadata.get("metadata"); assertEquals(inner.size(), 2); assertEquals(inner.get("scaling_in_progress"), false); - Map capacity = (Map)inner.get("cooldown"); + Map capacity = (Map) inner.get("cooldown"); assertEquals(capacity.get("2016-10-05T21:13:29.736841"), "ExactCapacity : 4"); } diff --git a/core-test/src/main/java/org/openstack4j/api/heat/StackServiceTests.java b/core-test/src/main/java/org/openstack4j/api/heat/StackServiceTests.java index dee607ab5..2a88bd8f5 100644 --- a/core-test/src/main/java/org/openstack4j/api/heat/StackServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/heat/StackServiceTests.java @@ -1,45 +1,47 @@ package org.openstack4j.api.heat; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; import org.openstack4j.api.AbstractTest; import org.openstack4j.model.heat.AdoptStackData; import org.openstack4j.model.heat.Stack; import org.openstack4j.openstack.heat.domain.HeatAdoptStackData; -import static org.testng.Assert.assertEquals; import org.testng.annotations.Test; +import java.util.HashMap; +import java.util.Map; + +import static org.testng.Assert.assertEquals; + /** * Test cases for Heat Stack Services function * * @author Ales Kemr */ -@Test(suiteName="heat/stacks", enabled = true) +@Test(suiteName = "heat/stacks", enabled = true) public class StackServiceTests extends AbstractTest { private static final String JSON_ABANDON = "/heat/abandon.json"; private static final String JSON_ADOPT = "/heat/adopt.json"; - + public void testAbandonStack() throws Exception { respondWith(JSON_ABANDON); - + AdoptStackData adoptStackData = osv3().heat().stacks().abandon("stack_123", "416c09e9-2022-4d43-854b-0292ddff3f5d"); takeRequest(); - + assertEquals(adoptStackData.getName(), "stack_123"); assertEquals(adoptStackData.getStatus(), "COMPLETE"); final Map portResource = adoptStackData.getResources().get("network_port"); assertEquals(portResource.get("type"), "OS::Neutron::Port"); } - + public void testAdoptStack() throws Exception { respondWith(JSON_ADOPT); - + AdoptStackData adoptStackData = new ObjectMapper().readValue(getResource(JSON_ABANDON), HeatAdoptStackData.class); Stack adoptedStack = osv3().heat().stacks().adopt(adoptStackData, new HashMap(), false, 30L, null); takeRequest(); - + assertEquals(adoptedStack.getId(), "79370050-6038-4ea2-baaa-3e4706d59e0e"); } diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v2/CustomEndpointURLResolverTest.java b/core-test/src/main/java/org/openstack4j/api/identity/v2/CustomEndpointURLResolverTest.java index 5070338f2..3ca636312 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v2/CustomEndpointURLResolverTest.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v2/CustomEndpointURLResolverTest.java @@ -1,12 +1,5 @@ package org.openstack4j.api.identity.v2; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.testng.Assert.assertEquals; - -import java.io.IOException; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.identity.EndpointURLResolver; import org.openstack4j.api.types.ServiceType; @@ -16,85 +9,92 @@ import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; +import java.io.IOException; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.testng.Assert.assertEquals; + /** * This test will validate that by default, the endpoint used is the one * provided in the token. If custom logic is provided by the * Config.withEndpointURLResolver, this logic should be used instead. - * + * * @author bcornelis */ @Test(suiteName = "Identity/Keystone_V2") public class CustomEndpointURLResolverTest extends AbstractTest { - private EndpointURLResolver mockEndpointUrlResolver; + private EndpointURLResolver mockEndpointUrlResolver; - @Override - protected Service service() { - return Service.IDENTITY; - } + @Override + protected Service service() { + return Service.IDENTITY; + } - /** - * This test verifies the default logic to retrieve the endpoint URL is - * still working. Internally it will generate the endpoint included in the - * security token. - * - * @throws IOException - */ - public void defaultImplementation_Test() throws IOException { - // create a default session containing the default Config object - final OSClientSessionV2 clientV2 = getDefaultSession(); + /** + * This test verifies the default logic to retrieve the endpoint URL is + * still working. Internally it will generate the endpoint included in the + * security token. + * + * @throws IOException + */ + public void defaultImplementation_Test() throws IOException { + // create a default session containing the default Config object + final OSClientSessionV2 clientV2 = getDefaultSession(); - // use default logic to generate the identity endpoint url - final String result = clientV2.getEndpoint(ServiceType.IDENTITY); + // use default logic to generate the identity endpoint url + final String result = clientV2.getEndpoint(ServiceType.IDENTITY); - // and make sure it's the default URL - assertEquals(result, "http://127.0.0.1:5000/v2.0", "the message"); - } + // and make sure it's the default URL + assertEquals(result, "http://127.0.0.1:5000/v2.0", "the message"); + } - /** - * This test validates the custom url endpoint resolver is used when it has - * been configured in the Config class. - * - * @throws IOException - */ - public void customImplementation_Test() throws IOException { - // create the default session - final OSClientSessionV2 customConfigSession = getCustomConfigSession(); + /** + * This test validates the custom url endpoint resolver is used when it has + * been configured in the Config class. + * + * @throws IOException + */ + public void customImplementation_Test() throws IOException { + // create the default session + final OSClientSessionV2 customConfigSession = getCustomConfigSession(); - // retrieve the default endpoint - final String result = customConfigSession.getEndpoint(ServiceType.IDENTITY); + // retrieve the default endpoint + final String result = customConfigSession.getEndpoint(ServiceType.IDENTITY); - // and make sure it's the default URL - assertEquals(result, "customUrl", "the message"); - } + // and make sure it's the default URL + assertEquals(result, "customUrl", "the message"); + } - @BeforeTest - public void setup() { - mockEndpointUrlResolver = mock(EndpointURLResolver.class); - when(mockEndpointUrlResolver.findURLV2(any(URLResolverParams.class))).thenReturn("customUrl"); - } + @BeforeTest + public void setup() { + mockEndpointUrlResolver = mock(EndpointURLResolver.class); + when(mockEndpointUrlResolver.findURLV2(any(URLResolverParams.class))).thenReturn("customUrl"); + } - /** - * Creates a V3 client using the default testing methods. - * - * @return - * @throws IOException - */ - private OSClientSessionV2 getDefaultSession() throws IOException { - respondWith(JSON_ACCESS); - return (OSClientSessionV2) osv2(); - } + /** + * Creates a V3 client using the default testing methods. + * + * @return + * @throws IOException + */ + private OSClientSessionV2 getDefaultSession() throws IOException { + respondWith(JSON_ACCESS); + return (OSClientSessionV2) osv2(); + } - /** - * Creates a custom V3 client based on the default logic, but customizing - * the Config by explicitely specifying the endpoint URL to use - * - * @return - * @throws IOException - */ - private OSClientSessionV2 getCustomConfigSession() throws IOException { - final OSClientSessionV2 origSession = getDefaultSession(); - return OSClientSessionV2.createSession(origSession.getAccess(), origSession.getPerspective(), - origSession.getProvider(), Config.newConfig().withEndpointURLResolver(mockEndpointUrlResolver)); - } + /** + * Creates a custom V3 client based on the default logic, but customizing + * the Config by explicitely specifying the endpoint URL to use + * + * @return + * @throws IOException + */ + private OSClientSessionV2 getCustomConfigSession() throws IOException { + final OSClientSessionV2 origSession = getDefaultSession(); + return OSClientSessionV2.createSession(origSession.getAccess(), origSession.getPerspective(), + origSession.getProvider(), Config.newConfig().withEndpointURLResolver(mockEndpointUrlResolver)); + } } diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v2/KeystoneTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v2/KeystoneTests.java index 4fd5d3a83..ed091f868 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v2/KeystoneTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v2/KeystoneTests.java @@ -1,27 +1,23 @@ package org.openstack4j.api.identity.v2; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.api.exceptions.RegionEndpointNotFoundException; +import org.openstack4j.model.common.Extension; +import org.openstack4j.model.identity.v2.*; +import org.openstack4j.openstack.OSFactory; +import org.testng.annotations.Test; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.List; -import org.openstack4j.api.AbstractTest; -import org.openstack4j.api.exceptions.RegionEndpointNotFoundException; -import org.openstack4j.model.common.Extension; -import org.openstack4j.model.identity.v2.Role; -import org.openstack4j.model.identity.v2.Tenant; -import org.openstack4j.model.identity.v2.TenantUser; -import org.openstack4j.model.identity.v2.TokenV2; -import org.openstack4j.model.identity.v2.User; -import org.openstack4j.openstack.OSFactory; -import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; /** * Tests the Identity/Keystone API - * + * * @author Jeremy Unruh */ @Test(suiteName = "Identity/Keystone_V2") @@ -130,7 +126,7 @@ public void testRegionTwo() throws Exception { * * @throws Exception */ - @Test(expectedExceptions = { RegionEndpointNotFoundException.class }) + @Test(expectedExceptions = {RegionEndpointNotFoundException.class}) public void testInvalidRegion() throws Exception { osv2().useRegion("RegionInvalid"); try { diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v2/ServiceVersionTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v2/ServiceVersionTests.java index d0b77de49..a249fe27a 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v2/ServiceVersionTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v2/ServiceVersionTests.java @@ -1,7 +1,5 @@ package org.openstack4j.api.identity.v2; -import static org.testng.Assert.assertTrue; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.types.ServiceType; import org.openstack4j.core.transport.Config; @@ -9,6 +7,8 @@ import org.openstack4j.openstack.internal.OSClientSession.OSClientSessionV2; import org.testng.annotations.Test; +import static org.testng.Assert.assertTrue; + @Test(suiteName = "Identity/ServiceVersions") public class ServiceVersionTests extends AbstractTest { diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/CustomEndpointURLResolverTest.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/CustomEndpointURLResolverTest.java index 4e5d7db55..ab890ef9a 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/CustomEndpointURLResolverTest.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/CustomEndpointURLResolverTest.java @@ -1,12 +1,5 @@ package org.openstack4j.api.identity.v3; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.testng.Assert.assertEquals; - -import java.io.IOException; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.identity.EndpointURLResolver; import org.openstack4j.api.types.ServiceType; @@ -16,87 +9,94 @@ import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; +import java.io.IOException; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.testng.Assert.assertEquals; + /** * This test will validate that by default, the endpoint used is the one * provided in the token. If custom logic is provided by the * Config.withEndpointURLResolver, this logic should be used instead. - * + * * @author bcornelis */ @Test(groups = "idV3", suiteName = "Identity/V3/Keystone") public class CustomEndpointURLResolverTest extends AbstractTest { - private static final String JSON_AUTH_PROJECT = "/identity/v3/authv3_project.json"; - - private EndpointURLResolver mockEndpointUrlResolver; - - @Override - protected Service service() { - return Service.IDENTITY; - } - - /** - * This test verifies the default logic to retrieve the endpoint URL is - * still working. Internally it will generate the endpoint included in the - * security token. - * - * @throws IOException - */ - public void defaultImplementation_Test() throws IOException { - // create a default session containing the default Config object - final OSClientSessionV3 clientV3 = getDefaultSession(); - - // use default logic to generate the identity endpoint url - final String result = clientV3.getEndpoint(ServiceType.IDENTITY); - - // and make sure it's the default URL - assertEquals(result, "http://127.0.0.1:5000/v3", "the message"); - } - - /** - * This test validates the custom url endpoint resolver is used when it has - * been configured in the Config class. - * - * @throws IOException - */ - public void customImplementation_Test() throws IOException { - // create the default session - final OSClientSessionV3 customConfigSession = getCustomConfigSession(); - - // retrieve the default endpoint - final String result = customConfigSession.getEndpoint(ServiceType.IDENTITY); - - // and make sure it's the default URL - assertEquals(result, "customUrl", "the message"); - } - - @BeforeTest - public void setup() { - mockEndpointUrlResolver = mock(EndpointURLResolver.class); - when(mockEndpointUrlResolver.findURLV3(any(URLResolverParams.class))).thenReturn("customUrl"); - } - - /** - * Creates a V3 client using the default testing methods. - * - * @return - * @throws IOException - */ - private OSClientSessionV3 getDefaultSession() throws IOException { - respondWith(JSON_AUTH_PROJECT); - return (OSClientSessionV3) osv3(); - } - - /** - * Creates a custom V3 client based on the default logic, but customizing - * the Config by explicitely specifying the endpoint URL to use - * - * @return - * @throws IOException - */ - private OSClientSessionV3 getCustomConfigSession() throws IOException { - final OSClientSessionV3 origSession = getDefaultSession(); - return OSClientSessionV3.createSession(origSession.getToken(), origSession.getPerspective(), - origSession.getProvider(), Config.newConfig().withEndpointURLResolver(mockEndpointUrlResolver)); - } + private static final String JSON_AUTH_PROJECT = "/identity/v3/authv3_project.json"; + + private EndpointURLResolver mockEndpointUrlResolver; + + @Override + protected Service service() { + return Service.IDENTITY; + } + + /** + * This test verifies the default logic to retrieve the endpoint URL is + * still working. Internally it will generate the endpoint included in the + * security token. + * + * @throws IOException + */ + public void defaultImplementation_Test() throws IOException { + // create a default session containing the default Config object + final OSClientSessionV3 clientV3 = getDefaultSession(); + + // use default logic to generate the identity endpoint url + final String result = clientV3.getEndpoint(ServiceType.IDENTITY); + + // and make sure it's the default URL + assertEquals(result, "http://127.0.0.1:5000/v3", "the message"); + } + + /** + * This test validates the custom url endpoint resolver is used when it has + * been configured in the Config class. + * + * @throws IOException + */ + public void customImplementation_Test() throws IOException { + // create the default session + final OSClientSessionV3 customConfigSession = getCustomConfigSession(); + + // retrieve the default endpoint + final String result = customConfigSession.getEndpoint(ServiceType.IDENTITY); + + // and make sure it's the default URL + assertEquals(result, "customUrl", "the message"); + } + + @BeforeTest + public void setup() { + mockEndpointUrlResolver = mock(EndpointURLResolver.class); + when(mockEndpointUrlResolver.findURLV3(any(URLResolverParams.class))).thenReturn("customUrl"); + } + + /** + * Creates a V3 client using the default testing methods. + * + * @return + * @throws IOException + */ + private OSClientSessionV3 getDefaultSession() throws IOException { + respondWith(JSON_AUTH_PROJECT); + return (OSClientSessionV3) osv3(); + } + + /** + * Creates a custom V3 client based on the default logic, but customizing + * the Config by explicitely specifying the endpoint URL to use + * + * @return + * @throws IOException + */ + private OSClientSessionV3 getCustomConfigSession() throws IOException { + final OSClientSessionV3 origSession = getDefaultSession(); + return OSClientSessionV3.createSession(origSession.getToken(), origSession.getPerspective(), + origSession.getProvider(), Config.newConfig().withEndpointURLResolver(mockEndpointUrlResolver)); + } } diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneAuthenticationTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneAuthenticationTests.java index ef7518926..df09a3ab5 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneAuthenticationTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneAuthenticationTests.java @@ -1,11 +1,6 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.List; - +import com.google.common.collect.ImmutableMap; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.OSClient.OSClientV3; import org.openstack4j.api.exceptions.RegionEndpointNotFoundException; @@ -15,7 +10,9 @@ import org.openstack4j.openstack.OSFactory; import org.testng.annotations.Test; -import com.google.common.collect.ImmutableMap; +import java.util.List; + +import static org.testng.Assert.*; /** * Tests the Identity/Keystone API version 3 Authentication @@ -223,32 +220,32 @@ public void authenticate_userId_password_unscoped_reauthenticate_Test() throws E respondWithHeaderAndResource(HEADER_AUTH_PROJECT_RESPONSE, 201, JSON_AUTH_UNSCOPED); OSClientV3 osclient_unscoped = OSFactory.builderV3() - .endpoint(authURL("/v3")) - .credentials(USER_ID, PASSWORD) - .authenticate(); + .endpoint(authURL("/v3")) + .credentials(USER_ID, PASSWORD) + .authenticate(); - String tokenId_unscoped = osclient_unscoped.getToken().getId(); + String tokenId_unscoped = osclient_unscoped.getToken().getId(); - respondWithHeaderAndResource(HEADER_AUTH_TOKEN_RESPONSE, 200, JSON_AUTH_PROJECT); + respondWithHeaderAndResource(HEADER_AUTH_TOKEN_RESPONSE, 200, JSON_AUTH_PROJECT); - OSClientV3 osclient_scoped = (OSFactory.builderV3() - .endpoint(authURL("/v3")) - .token(tokenId_unscoped) - .scopeToProject(Identifier.byId(PROJECT_ID)) - .authenticate()); + OSClientV3 osclient_scoped = (OSFactory.builderV3() + .endpoint(authURL("/v3")) + .token(tokenId_unscoped) + .scopeToProject(Identifier.byId(PROJECT_ID)) + .authenticate()); - String tokenId_scoped = osclient_scoped.getToken().getId(); + String tokenId_scoped = osclient_scoped.getToken().getId(); - respondWithHeaderAndResource(HEADER_REAUTH_TOKEN_RESPONSE, 200, JSON_AUTH_PROJECT); + respondWithHeaderAndResource(HEADER_REAUTH_TOKEN_RESPONSE, 200, JSON_AUTH_PROJECT); - associateClientV3(OSFactory.builderV3() - .endpoint(authURL("/v3")) - .token(tokenId_scoped) - .scopeToProject(Identifier.byId(PROJECT_ID)) - .authenticate()); + associateClientV3(OSFactory.builderV3() + .endpoint(authURL("/v3")) + .token(tokenId_scoped) + .scopeToProject(Identifier.byId(PROJECT_ID)) + .authenticate()); - assertEquals(osv3.getToken().getUser().getId(), USER_ID); - assertEquals(osv3.getToken().getProject().getId(), PROJECT_ID); + assertEquals(osv3.getToken().getUser().getId(), USER_ID); + assertEquals(osv3.getToken().getProject().getId(), PROJECT_ID); } @@ -262,19 +259,19 @@ public void authenticate_userId_password_unscopedTokenToScopedToken_Test() throw respondWithHeaderAndResource(HEADER_AUTH_TOKEN_RESPONSE, 201, JSON_AUTH_UNSCOPED); OSClientV3 osclient_unscoped = OSFactory.builderV3() - .endpoint(authURL("/v3")) - .credentials(USER_ID, PASSWORD) - .authenticate(); + .endpoint(authURL("/v3")) + .credentials(USER_ID, PASSWORD) + .authenticate(); String tokenUnscopedId = osclient_unscoped.getToken().getId(); respondWithHeaderAndResource(HEADER_AUTH_PROJECT_RESPONSE, 200, JSON_AUTH_PROJECT); OSClientV3 osclient_scoped = OSFactory.builderV3() - .endpoint(authURL("/v3")) - .token(tokenUnscopedId) - .scopeToProject(Identifier.byId(PROJECT_ID)) - .authenticate(); + .endpoint(authURL("/v3")) + .token(tokenUnscopedId) + .scopeToProject(Identifier.byId(PROJECT_ID)) + .authenticate(); String tokenScopedId = osclient_scoped.getToken().getId(); @@ -287,7 +284,7 @@ public void authenticate_userId_password_unscopedTokenToScopedToken_Test() throw * * @throws Exception */ - @Test(priority=-1) + @Test(priority = -1) public void authenticate_userId_password_domain_region_Test() throws Exception { try { @@ -297,8 +294,7 @@ public void authenticate_userId_password_domain_region_Test() throws Exception { respondWith(JSON_USERS); List userList = osv3().identity().users().list(); assertNotNull(userList); - } - finally { + } finally { osv3().removeRegion(); } } @@ -308,15 +304,14 @@ public void authenticate_userId_password_domain_region_Test() throws Exception { * * @throws Exception */ - @Test(expectedExceptions= {RegionEndpointNotFoundException.class}) + @Test(expectedExceptions = {RegionEndpointNotFoundException.class}) public void authenticate_userId_password_domain_regionInvalid_Test() throws Exception { try { osv3().useRegion("regionInvalid"); osv3().identity().users().list(); - } - finally { + } finally { osv3().removeRegion(); } @@ -361,11 +356,11 @@ public void authenticate_token_unscoped() throws Exception { respondWithHeaderAndResource(HEADER_AUTH_TOKEN_RESPONSE, 201, JSON_AUTH_TOKEN_UNSCOPED); OSClientV3 osclient_token_unscoped = (OSFactory.builderV3() - .endpoint(authURL("/v3")) - .token(TOKEN_UNSCOPED_ID) - .authenticate()); + .endpoint(authURL("/v3")) + .token(TOKEN_UNSCOPED_ID) + .authenticate()); - assertEquals(osclient_token_unscoped.getToken().getId(),TOKEN_UNSCOPED_ID); + assertEquals(osclient_token_unscoped.getToken().getId(), TOKEN_UNSCOPED_ID); } diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneCredentialServiceTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneCredentialServiceTests.java index 1bae0219d..6f7768495 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneCredentialServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneCredentialServiceTests.java @@ -1,12 +1,12 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.identity.v3.Credential; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + /** * Tests the Identity/Keystone API version 3 CredentialService */ diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneDomainServiceTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneDomainServiceTests.java index 134b6194f..819a30a85 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneDomainServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneDomainServiceTests.java @@ -1,12 +1,12 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.identity.v3.Domain; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + /** * Tests the Identity/Keystone API version 3 DomainService */ diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneGroupServiceTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneGroupServiceTests.java index 67b4c6bdd..40c0323b6 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneGroupServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneGroupServiceTests.java @@ -1,13 +1,13 @@ package org.openstack4j.api.identity.v3; -import static org.testng.AssertJUnit.assertNull; -import static org.testng.Assert.assertEquals; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.identity.v3.Group; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.AssertJUnit.assertNull; + /** * Tests the Identity/Keystone API version 3 GroupService */ @@ -67,13 +67,13 @@ public void group_crud_test() throws Exception { assertEquals(updatedGroup.getDescription(), GROUP_DESCRIPTION_UPDATE); } - - - public void group_get_byName_byDomainId_NotExist_Test() throws Exception { - respondWith(JSON_GROUPS_EMPTY_LIST); - Group group = osv3().identity().groups().getByName(GROUP_NAME, GROUP_DOMAIN_ID); - assertNull(group); - + + + public void group_get_byName_byDomainId_NotExist_Test() throws Exception { + respondWith(JSON_GROUPS_EMPTY_LIST); + Group group = osv3().identity().groups().getByName(GROUP_NAME, GROUP_DOMAIN_ID); + assertNull(group); + } } diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystonePolicyServiceTest.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystonePolicyServiceTest.java index 68c06bb2d..3bb38dd24 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystonePolicyServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystonePolicyServiceTest.java @@ -1,11 +1,11 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.identity.v3.Policy; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + /** * Tests the Identity/Keystone API version 3 PolicyService */ diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneProjectServiceTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneProjectServiceTests.java index 80de55e8a..f9bb41886 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneProjectServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneProjectServiceTests.java @@ -1,16 +1,16 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; -import static org.testng.AssertJUnit.assertNull; - -import java.util.Arrays; -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.identity.v3.Project; import org.testng.annotations.Test; +import java.util.Arrays; +import java.util.List; + +import static org.testng.Assert.assertEquals; +import static org.testng.AssertJUnit.assertNull; + /** * Tests the Identity/Keystone API version 3 ProjectService */ @@ -85,12 +85,12 @@ public void projects_crud_test() throws Exception { assertEquals(updatedProject.getExtra(PROJECT_EXTRA_KEY_1), PROJECT_EXTRA_VALUE_1); assertEquals(updatedProject.getExtra(PROJECT_EXTRA_KEY_2), PROJECT_EXTRA_VALUE_2); } - + public void projects_getByName_not_exist_test() throws Exception { respondWith(JSON_PROJECTS_GET_BY_NAME_EMPTY); Project project = osv3().identity().projects().getByName(PROJECT_NAME, PROJECT_DOMAIN_ID); assertNull(project); - + } } diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRegionServiceTest.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRegionServiceTest.java index 4c8708109..557c86a32 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRegionServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRegionServiceTest.java @@ -1,11 +1,11 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.identity.v3.Region; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + /** * Tests the Identity/Keystone API version 3 RegionService */ diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRoleServiceTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRoleServiceTests.java index eedef720c..2105db478 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRoleServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneRoleServiceTests.java @@ -1,17 +1,15 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Role; import org.openstack4j.model.identity.v3.RoleAssignment; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.*; + /** * Tests the Identity/Keystone API version 3 RoleService */ @@ -56,7 +54,7 @@ public void roles_one_entry_in_list_when_one_returned() throws Exception { respondWith(JSON_ROLES_ONE_ENTRY); List list = osv3().identity().roles().getByName(ROLE_NAME); assertTrue(list.size() == 1); - assertEquals(list.get(0).getId(),ROLE_ID); + assertEquals(list.get(0).getId(), ROLE_ID); assertEquals(list.get(0).getName(), ROLE_NAME); assertEquals(list.get(0).getDomainId(), USER_DOMAIN_ID); } @@ -109,6 +107,7 @@ public void checkProjectUserRole_success_Test() throws Exception { // TODO: this test is disabled due to a malformed response returned by // OpenStack as described in issue #530 + /** * checks if a user has a role in domain context * @@ -190,6 +189,7 @@ public void checkDomainUserRole_success_Test() throws Exception { // TODO: this test is disabled due to a malformed response returned by // OpenStack as described in issue #530 + /** * checks if a user has a role in domain context * @@ -235,7 +235,7 @@ public void grantDomainUserRole_fail_Test() throws Exception { respondWithCodeAndResource(404, JSON_ROLES_GRANTROLE_ERROR); - ActionResponse response_fail = osv3().identity().roles().grantDomainUserRole(USER_DOMAIN_ID, USER_ID,"nonExistingRoleId"); + ActionResponse response_fail = osv3().identity().roles().grantDomainUserRole(USER_DOMAIN_ID, USER_ID, "nonExistingRoleId"); assertFalse(response_fail.isSuccess()); diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceTest.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceTest.java index 3b7b1ab81..68550bcf4 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneServiceEndpointServiceTest.java @@ -1,10 +1,10 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; - import org.openstack4j.api.AbstractTest; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + /** * Tests the Identity/Keystone API version 3 ServiceEndpointsService */ diff --git a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneUserServiceTests.java b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneUserServiceTests.java index ddb87f39d..65aca934e 100644 --- a/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneUserServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/identity/v3/KeystoneUserServiceTests.java @@ -1,13 +1,5 @@ package org.openstack4j.api.identity.v3; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.AssertJUnit.assertNull; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Group; @@ -17,6 +9,11 @@ import org.openstack4j.openstack.identity.v3.domain.KeystoneUser; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.*; +import static org.testng.AssertJUnit.assertNull; + /** * Tests the Identity/Keystone API version 3 UserService */ @@ -43,7 +40,7 @@ public class KeystoneUserServiceTests extends AbstractTest { private static final String USER_ID = "aa9f25defa6d4cafb48466df83106065"; private static final String USER_DOMAIN_ID = "default"; private static final String PROJECT_ID = "123ac695d4db400a9001b91bb3b8aa46"; - + /** * @return the identity service @@ -116,7 +113,7 @@ public void getUser_byName_byDomainId_Test() throws Exception { assertEquals(user.getId(), USER_ID); assertEquals(user.getDomainId(), USER_DOMAIN_ID); } - + /** * returns null for an non-existing user when the user specified by name and domain. * @@ -166,12 +163,12 @@ public void crud_User_Test() throws Exception { respondWith(JSON_USER_UPDATE); User updatedUser = osv3().identity().users().update(KeystoneUser.builder() - .id(crudUserId) - .email("updatedFoobar@example.org") - .enabled(true) - .build()); + .id(crudUserId) + .email("updatedFoobar@example.org") + .enabled(true) + .build()); - assertEquals(updatedUser.getEmail(),"updatedFoobar@example.org"); + assertEquals(updatedUser.getEmail(), "updatedFoobar@example.org"); assertEquals(updatedUser.getName(), "foobar"); assertEquals(updatedUser.isEnabled(), true); assertEquals(updatedUser.getId(), crudUserId); @@ -248,21 +245,21 @@ public void listUserProjects_Test() throws Exception { List userProjectsList = osv3().identity().users().listUserProjects(USER_ID); assertEquals(userProjectsList.size(), 2); - } - + } + /** * Changes the password for a user * * @throws Exception */ public void changeUserPassword_Test() throws Exception { - - respondWith(204); + + respondWith(204); ActionResponse response_changeUserPassword = osv3().identity().users().changePassword("aa9f25defa6d4cafb48466df83106065", "originalPassword", "password"); assertTrue(response_changeUserPassword.isSuccess()); } - + /** * tries to change the password for an non existent user fails * diff --git a/core-test/src/main/java/org/openstack4j/api/image/v1/ImageV1Tests.java b/core-test/src/main/java/org/openstack4j/api/image/v1/ImageV1Tests.java index e5c4278f4..13b8a9afa 100644 --- a/core-test/src/main/java/org/openstack4j/api/image/v1/ImageV1Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/image/v1/ImageV1Tests.java @@ -16,7 +16,7 @@ /** * Created by esommar on 5/8/2017. */ -@Test(suiteName="Image/imagesv1", enabled=true) +@Test(suiteName = "Image/imagesv1", enabled = true) public class ImageV1Tests extends AbstractTest { private static final String CACHED_IMAGES_JSON = "/image/cachedImages.json"; @@ -38,8 +38,8 @@ public void testListCachedImages() throws IOException, InterruptedException { assertEquals(first.getHits().intValue(), 0); assertEquals(second.getHits().intValue(), 23); - Date firstDate = new Date((long)Double.parseDouble("1492607597169.914")); - Date secondDate = new Date((long)Double.parseDouble("1494248723169")); + Date firstDate = new Date((long) Double.parseDouble("1492607597169.914")); + Date secondDate = new Date((long) Double.parseDouble("1494248723169")); assertEquals(first.getLastAccessed().equals(firstDate), true); assertEquals(second.getLastAccessed().equals(secondDate), true); @@ -55,8 +55,8 @@ public void testEmptyCache() throws IOException { } public void testCacheNotEnabled() { - Map headers = new HashMap(); - headers.put("Content-Type","text/html"); + Map headers = new HashMap(); + headers.put("Content-Type", "text/html"); respondWith(headers, 404, ""); List list = osv3().images().listChachedImages(); assertNull(list); diff --git a/core-test/src/main/java/org/openstack4j/api/image/v2/ImageV2Tests.java b/core-test/src/main/java/org/openstack4j/api/image/v2/ImageV2Tests.java index abd6ad05b..69dc7f468 100644 --- a/core-test/src/main/java/org/openstack4j/api/image/v2/ImageV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/image/v2/ImageV2Tests.java @@ -1,9 +1,12 @@ package org.openstack4j.api.image.v2; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.api.Builders; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.common.Payload; +import org.openstack4j.model.common.Payloads; +import org.openstack4j.model.image.v2.*; +import org.testng.annotations.Test; import java.io.ByteArrayInputStream; import java.io.File; @@ -16,22 +19,12 @@ import java.util.List; import java.util.Map; -import org.openstack4j.api.AbstractTest; -import org.openstack4j.api.Builders; -import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.common.Payload; -import org.openstack4j.model.common.Payloads; -import org.openstack4j.model.image.v2.ContainerFormat; -import org.openstack4j.model.image.v2.DiskFormat; -import org.openstack4j.model.image.v2.Image; -import org.openstack4j.model.image.v2.Member; -import org.openstack4j.model.image.v2.Task; -import org.testng.annotations.Test; +import static org.testng.Assert.*; /** * @author emjburns */ -@Test(suiteName="Image/imagesv2", enabled=true) +@Test(suiteName = "Image/imagesv2", enabled = true) public class ImageV2Tests extends AbstractTest { private static final String IMAGES_JSON = "/image/v2/images.json"; private static final String IMAGE_JSON = "/image/v2/image.json"; @@ -45,9 +38,9 @@ public class ImageV2Tests extends AbstractTest { private static final String TASKS_FILTERED_JSON = "/image/v2/tasks-filtered.json"; private static final String BINARY_IMAGE_DATA = "943c 7b3c 3ef4 eac8 e906 b220 1efb f01f\n" + - "00b4 5b1b b4fa 0707 c2ac 378b e722 514d\n" + - "5fb9 e9a0 7f9f fa4c 645d 113c 0524 b380\n" + - "acee 6344 1f45 b58b 1eb2 8776 3e9b 9aef"; + "00b4 5b1b b4fa 0707 c2ac 378b e722 514d\n" + + "5fb9 e9a0 7f9f fa4c 645d 113c 0524 b380\n" + + "acee 6344 1f45 b58b 1eb2 8776 3e9b 9aef"; public void testListImages() throws IOException { respondWith(IMAGES_JSON); @@ -70,17 +63,17 @@ public void testGetImage() throws IOException { Image image = osv3().imagesV2().get(id); assertNotNull(image); assertNotNull(image.getId()); - assertEquals(image.getId(),id); + assertEquals(image.getId(), id); } - + public void testGetImageWithLocations() throws IOException { respondWith(IMAGE_WIHT_LOCATION_JSON); String id = "c73056d6-c583-4d6c-9f70-04f3bfd8dff4"; Image image = osv3().imagesV2().get(id); assertNotNull(image); assertNotNull(image.getId()); - assertEquals(image.getId(),id); - assertEquals(2,image.getLocations().size()); + assertEquals(image.getId(), id); + assertEquals(2, image.getLocations().size()); } public void testCreateImage() throws IOException { @@ -240,7 +233,7 @@ public void listTasks() throws IOException { public void listTaskWithParams() throws IOException { respondWith(TASKS_FILTERED_JSON); String id = "78925244-2951-462d-b979-773a49274d7f"; - Map params = new HashMap<>(); + Map params = new HashMap<>(); params.put("id", id); List list = osv3().imagesV2().tasks().list(params); assertNotNull(list); @@ -253,24 +246,24 @@ public void UploadImage() throws IOException { String imageId = "4b434528-032b-4467-946c-b5880ce15c06"; InputStream s = new ByteArrayInputStream(BINARY_IMAGE_DATA.getBytes(StandardCharsets.UTF_8)); Payload payload = Payloads.create(s); - ActionResponse upload = osv3().imagesV2().upload(imageId, payload, null); + ActionResponse upload = osv3().imagesV2().upload(imageId, payload, null); assertTrue(upload.isSuccess()); } - public void DownloadImage() throws IOException { - respondWith(200); - String imageId = "4b434528-032b-4467-946c-b5880ce15c06"; - URI uri = null; - try { - uri = new URI("file:////test.iso"); - }catch (URISyntaxException e) { - e.printStackTrace(); - } - File file = new File(uri); - ActionResponse download = osv3().imagesV2().download(imageId, file); - // Should fail to write to file - assertEquals(download.getCode(), 400); - } + public void DownloadImage() throws IOException { + respondWith(200); + String imageId = "4b434528-032b-4467-946c-b5880ce15c06"; + URI uri = null; + try { + uri = new URI("file:////test.iso"); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + File file = new File(uri); + ActionResponse download = osv3().imagesV2().download(imageId, file); + // Should fail to write to file + assertEquals(download.getCode(), 400); + } @Override protected Service service() { diff --git a/core-test/src/main/java/org/openstack4j/api/magnum/MagnumTests.java b/core-test/src/main/java/org/openstack4j/api/magnum/MagnumTests.java index 86ae9b90f..55331654d 100644 --- a/core-test/src/main/java/org/openstack4j/api/magnum/MagnumTests.java +++ b/core-test/src/main/java/org/openstack4j/api/magnum/MagnumTests.java @@ -1,20 +1,20 @@ package org.openstack4j.api.magnum; -import static org.testng.Assert.assertEquals; - -import java.io.IOException; -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.magnum.Baymodel; import org.openstack4j.model.magnum.Mservice; import org.testng.annotations.Test; +import java.io.IOException; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Test cases for Magnum Services - * + * * @author Sohan Sangwan */ @Test(suiteName = "magnum") @@ -22,24 +22,25 @@ public class MagnumTests extends AbstractTest { private static final String JSON_MSERVICES = "/magnum/mservices.json"; private static final String JSON_BAYMODEL_GETALL_RESPONSE = "/magnum/baymodel_get_all_resp.json"; private static final String JSON_BAYMODEL_CRUD_RESPONSE = "/magnum/baymodel_create_resp.json"; - + @Test public void magnum_mservice_list_test() throws IOException { respondWith(JSON_MSERVICES); List resp = osv3().magnum().listMservices(); assertEquals(resp.size(), 1); } - + @Test public void magnum_baymodel_list() throws IOException { respondWith(JSON_BAYMODEL_GETALL_RESPONSE); List resp = osv3().magnum().listBaymodels(); assertEquals(resp.size(), 1); - } + } + @Test public void magnum_baymodel_crud_test() throws IOException { - - + + Baymodel baymodel = Builders.baymodel() .name("k8s-bm2") .keypairId("magnum") @@ -55,15 +56,14 @@ public void magnum_baymodel_crud_test() throws IOException { .dnsNameserver("8.8.8.8") .uuid("085e1c4d-4f68-4bfd-8462-74b9e14e4f39") .build(); - + //Create a baymodel respondWith(JSON_BAYMODEL_CRUD_RESPONSE); Baymodel resp = osv3().magnum().createBaymodel(baymodel); - assertEquals(resp.getName(), baymodel.getName()); - + assertEquals(resp.getName(), baymodel.getName()); + } - - + @Override protected Service service() { diff --git a/core-test/src/main/java/org/openstack4j/api/manila/QuotaSetTests.java b/core-test/src/main/java/org/openstack4j/api/manila/QuotaSetTests.java index db426aab1..c164525c1 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/QuotaSetTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/QuotaSetTests.java @@ -14,7 +14,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="QuotaSet") +@Test(suiteName = "QuotaSet") public class QuotaSetTests extends AbstractTest { private static final String JSON_QUOTA_SET = "/manila/quota_set.json"; private static final String JSON_QUOTA_SET_UPDATE = "/manila/quota_set_update.json"; @@ -44,7 +44,6 @@ public void update() throws Exception { respondWith(JSON_QUOTA_SET_UPDATE); - QuotaSet quotaSet = osv3().share().quotaSets().update( "test_tenant", "test_user", diff --git a/core-test/src/main/java/org/openstack4j/api/manila/SchedulerStatsTests.java b/core-test/src/main/java/org/openstack4j/api/manila/SchedulerStatsTests.java index dcc0460cf..c8ed532ee 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/SchedulerStatsTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/SchedulerStatsTests.java @@ -14,7 +14,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="SchedulerStats") +@Test(suiteName = "SchedulerStats") public class SchedulerStatsTests extends AbstractTest { private static final String JSON_SCHEDULER_STATS = "/manila/scheduler-stats.json"; private static final String JSON_SCHEDULER_STATS_DETAIL = "/manila/scheduler-stats_detail.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/manila/SecurityServiceTests.java b/core-test/src/main/java/org/openstack4j/api/manila/SecurityServiceTests.java index dd028730a..fd2ac45b2 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/SecurityServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/SecurityServiceTests.java @@ -17,7 +17,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="SecurityService") +@Test(suiteName = "SecurityService") public class SecurityServiceTests extends AbstractTest { private static final String JSON_SECURITY_SERVICE = "/manila/security_service.json"; private static final String JSON_SECURITY_SERVICE_CREATE = "/manila/security_service_create.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/manila/ShareInstanceTests.java b/core-test/src/main/java/org/openstack4j/api/manila/ShareInstanceTests.java index b6aa9bb49..523ca1282 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/ShareInstanceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/ShareInstanceTests.java @@ -15,7 +15,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="ShareInstance") +@Test(suiteName = "ShareInstance") public class ShareInstanceTests extends AbstractTest { private static final String JSON_SHARE_INSTANCES = "/manila/share_instances.json"; private static final String JSON_SHARE_INSTANCE = "/manila/share_instance.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/manila/ShareNetworkTests.java b/core-test/src/main/java/org/openstack4j/api/manila/ShareNetworkTests.java index 105f39720..53ea1d40c 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/ShareNetworkTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/ShareNetworkTests.java @@ -17,7 +17,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="ShareNetwork") +@Test(suiteName = "ShareNetwork") public class ShareNetworkTests extends AbstractTest { private static final String JSON_SHARE_NETWORK = "/manila/share_network.json"; private static final String JSON_SHARE_NETWORK_CREATE = "/manila/share_network_create.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/manila/ShareServerTests.java b/core-test/src/main/java/org/openstack4j/api/manila/ShareServerTests.java index f1d6ef14e..81686490a 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/ShareServerTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/ShareServerTests.java @@ -15,7 +15,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="ShareServer") +@Test(suiteName = "ShareServer") public class ShareServerTests extends AbstractTest { private static final String JSON_SHARE_SERVERS = "/manila/share_servers.json"; private static final String JSON_SHARE_SERVER = "/manila/share_server.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/manila/ShareSnapshotTests.java b/core-test/src/main/java/org/openstack4j/api/manila/ShareSnapshotTests.java index 5b09ea3cc..da7e39ec2 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/ShareSnapshotTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/ShareSnapshotTests.java @@ -19,7 +19,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="ShareSnapshot") +@Test(suiteName = "ShareSnapshot") public class ShareSnapshotTests extends AbstractTest { private static final String JSON_SHARE_SNAPSHOT = "/manila/share_snapshot.json"; private static final String JSON_SHARE_SNAPSHOT_CREATE = "/manila/share_snapshot_create.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/manila/ShareTests.java b/core-test/src/main/java/org/openstack4j/api/manila/ShareTests.java index 155ba6655..9f954c7f2 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/ShareTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/ShareTests.java @@ -3,8 +3,8 @@ import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.core.transport.HttpMethod; -import org.openstack4j.model.common.Extension; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.common.Extension; import org.openstack4j.model.manila.*; import org.openstack4j.openstack.manila.domain.ManilaService; import org.testng.annotations.Test; @@ -20,7 +20,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="Share") +@Test(suiteName = "Share") public class ShareTests extends AbstractTest { private static final String JSON_EXTENSIONS = "/manila/extensions.json"; private static final String JSON_LIMITS = "/manila/limits.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/manila/ShareTypeTests.java b/core-test/src/main/java/org/openstack4j/api/manila/ShareTypeTests.java index 4d1c47203..bba75c449 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/ShareTypeTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/ShareTypeTests.java @@ -20,7 +20,7 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="ShareType") +@Test(suiteName = "ShareType") public class ShareTypeTests extends AbstractTest { private static final String JSON_EXTRA_SPECS_SET = "/manila/extra_specs_set.json"; private static final String JSON_EXTRA_SPECS = "/manila/extra_specs.json"; @@ -46,7 +46,7 @@ public void create() throws Exception { .build(); ShareType shareType = osv3().share().shareTypes().create(shareTypeCreate); - + assertTrue(shareType.getOsShareTypeAccessIsPublic()); assertEquals(shareType.getRequiredExtraSpecs().get("driver_handles_share_servers"), "true"); assertEquals(shareType.getExtraSpecs().get("snapshot_support"), "True"); diff --git a/core-test/src/main/java/org/openstack4j/api/manila/SharesTests.java b/core-test/src/main/java/org/openstack4j/api/manila/SharesTests.java index 37a4d4d85..0366797c8 100644 --- a/core-test/src/main/java/org/openstack4j/api/manila/SharesTests.java +++ b/core-test/src/main/java/org/openstack4j/api/manila/SharesTests.java @@ -22,8 +22,8 @@ * * @author Daniel Gonzalez Nothnagel */ -@Test(suiteName="Shares") -public class SharesTests extends AbstractTest{ +@Test(suiteName = "Shares") +public class SharesTests extends AbstractTest { private static final String JSON_SHARE = "/manila/share.json"; private static final String JSON_SHARE_CREATE = "/manila/share_create.json"; private static final String JSON_SHARE_UPDATE = "/manila/share_update.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/metering/AlarmTests.java b/core-test/src/main/java/org/openstack4j/api/metering/AlarmTests.java index cea758b72..4f90957a8 100644 --- a/core-test/src/main/java/org/openstack4j/api/metering/AlarmTests.java +++ b/core-test/src/main/java/org/openstack4j/api/metering/AlarmTests.java @@ -1,38 +1,38 @@ package org.openstack4j.api.metering; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.telemetry.Meter; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Test cases for Compute Images - * + * * @author Jeremy Unruh */ -@Test(suiteName="Alarms", enabled = false) +@Test(suiteName = "Alarms", enabled = false) public class AlarmTests extends AbstractTest { - private static final String JSON_ALARMS = "/metering/alarms.json"; + private static final String JSON_ALARMS = "/metering/alarms.json"; - public void meterListingTest() throws Exception { - System.out.println("METER LISTING TEST"); + public void meterListingTest() throws Exception { + System.out.println("METER LISTING TEST"); - respondWith(JSON_ALARMS); + respondWith(JSON_ALARMS); - List meterList = osv3().telemetry().meters().list(); - assertEquals(2, meterList.size()); + List meterList = osv3().telemetry().meters().list(); + assertEquals(2, meterList.size()); - throw new Exception("Alarm test failed by max"); + throw new Exception("Alarm test failed by max"); - } + } - @Override - protected Service service() { - return Service.METERING; - } + @Override + protected Service service() { + return Service.METERING; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/murano/v1/ActionTests.java b/core-test/src/main/java/org/openstack4j/api/murano/v1/ActionTests.java index ac90c9897..d9b3092f0 100644 --- a/core-test/src/main/java/org/openstack4j/api/murano/v1/ActionTests.java +++ b/core-test/src/main/java/org/openstack4j/api/murano/v1/ActionTests.java @@ -15,7 +15,7 @@ /** * @author nmakhotkin */ -@Test(suiteName="Murano/AppCatalog", enabled = true) +@Test(suiteName = "Murano/AppCatalog", enabled = true) public class ActionTests extends AbstractTest { private static final String ENVIRONMENT_JSON = "/murano/v1/environment.json"; private static final String ACTION_RESULT = "/murano/v1/action_result.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/murano/v1/DeploymentTests.java b/core-test/src/main/java/org/openstack4j/api/murano/v1/DeploymentTests.java index 28e0e6a77..81ef2aa96 100644 --- a/core-test/src/main/java/org/openstack4j/api/murano/v1/DeploymentTests.java +++ b/core-test/src/main/java/org/openstack4j/api/murano/v1/DeploymentTests.java @@ -9,14 +9,12 @@ import java.util.Collections; import java.util.List; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * @author nmakhotkin */ -@Test(suiteName="Murano/AppCatalog", enabled = true) +@Test(suiteName = "Murano/AppCatalog", enabled = true) public class DeploymentTests extends AbstractTest { private static final String DEPLOYMENTS_JSON = "/murano/v1/deployments.json"; private static final String REPORTS_JSON = "/murano/v1/reports.json"; @@ -46,9 +44,9 @@ public void testReports() throws IOException { public void testFilteredReports() throws IOException { respondWith(FILTERED_REPORTS_JSON); List reports = osv3().murano().deployments().reports( - envId, - deploymentId, - Collections.singletonList("5c2a7dae-097d-4a1c-85cb-e7db2ed62d90") + envId, + deploymentId, + Collections.singletonList("5c2a7dae-097d-4a1c-85cb-e7db2ed62d90") ); assertNotNull(reports); diff --git a/core-test/src/main/java/org/openstack4j/api/murano/v1/EnvironmentTests.java b/core-test/src/main/java/org/openstack4j/api/murano/v1/EnvironmentTests.java index 147b53376..8588bb5d0 100644 --- a/core-test/src/main/java/org/openstack4j/api/murano/v1/EnvironmentTests.java +++ b/core-test/src/main/java/org/openstack4j/api/murano/v1/EnvironmentTests.java @@ -10,14 +10,12 @@ import java.io.IOException; import java.util.List; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * @author nmakhotkin */ -@Test(suiteName="Murano/AppCatalog", enabled = true) +@Test(suiteName = "Murano/AppCatalog", enabled = true) public class EnvironmentTests extends AbstractTest { private static final String ENVIRONMENTS_JSON = "/murano/v1/environments.json"; private static final String ENVIRONMENT_JSON = "/murano/v1/environment.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/murano/v1/ServicesTests.java b/core-test/src/main/java/org/openstack4j/api/murano/v1/ServicesTests.java index b08687f7d..8534e0fb7 100644 --- a/core-test/src/main/java/org/openstack4j/api/murano/v1/ServicesTests.java +++ b/core-test/src/main/java/org/openstack4j/api/murano/v1/ServicesTests.java @@ -14,14 +14,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * @author nmakhotkin */ -@Test(suiteName="Murano/AppCatalog", enabled = true) +@Test(suiteName = "Murano/AppCatalog", enabled = true) public class ServicesTests extends AbstractTest { private static final String SERVICE_JSON = "/murano/v1/service.json"; private static final String SERVICES_JSON = "/murano/v1/services.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/murano/v1/SessionTests.java b/core-test/src/main/java/org/openstack4j/api/murano/v1/SessionTests.java index fc5b9200a..f8eadf9fb 100644 --- a/core-test/src/main/java/org/openstack4j/api/murano/v1/SessionTests.java +++ b/core-test/src/main/java/org/openstack4j/api/murano/v1/SessionTests.java @@ -7,14 +7,12 @@ import java.io.IOException; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * @author nmakhotkin */ -@Test(suiteName="Murano/AppCatalog", enabled = true) +@Test(suiteName = "Murano/AppCatalog", enabled = true) public class SessionTests extends AbstractTest { private static final String SESSION_JSON = "/murano/v1/session.json"; private static final String envId = "e1c1b5a0b3284f188c5d91ab18bf0451"; diff --git a/core-test/src/main/java/org/openstack4j/api/network/AvailabilityZoneTests.java b/core-test/src/main/java/org/openstack4j/api/network/AvailabilityZoneTests.java index 78ee62d75..dc5a66b25 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/AvailabilityZoneTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/AvailabilityZoneTests.java @@ -1,41 +1,41 @@ package org.openstack4j.api.network; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.network.AvailabilityZone; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Tests the Neutron -> availability_zones API against the mock webserver and spec based * json responses - * - * @author Taemin + * + * @author Taemin */ @Test(suiteName = "availability_zones") public class AvailabilityZoneTests extends AbstractTest { - private static final String JSON_GET_SUBNET = "/network/availability_zones.json"; - private static final String STATE = "available"; - private static final String RESOURCE = "network"; - private static final String NAME = "nova"; - - @Test - public void getAvailabilityZones() throws Exception { - respondWith(JSON_GET_SUBNET); - List az = osv3().networking().availabilityzone().list(); - server.takeRequest(); - assertEquals(az.get(0).getState(), STATE); - assertEquals(az.get(0).getResource(), RESOURCE); - assertEquals(az.get(0).getName(), NAME); - - } + private static final String JSON_GET_SUBNET = "/network/availability_zones.json"; + private static final String STATE = "available"; + private static final String RESOURCE = "network"; + private static final String NAME = "nova"; + + @Test + public void getAvailabilityZones() throws Exception { + respondWith(JSON_GET_SUBNET); + List az = osv3().networking().availabilityzone().list(); + server.takeRequest(); + assertEquals(az.get(0).getState(), STATE); + assertEquals(az.get(0).getResource(), RESOURCE); + assertEquals(az.get(0).getName(), NAME); + + } @Override protected Service service() { return Service.NETWORK; } - + } diff --git a/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorTests.java b/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorTests.java index 595545c54..6b3ca7015 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorTests.java @@ -1,9 +1,5 @@ package org.openstack4j.api.network; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -13,219 +9,229 @@ import org.openstack4j.openstack.networking.domain.ext.HttpMethod; import org.testng.annotations.Test; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; + /** - * * @author liujunpeng - * */ -@Test(suiteName="Network/healthMonitor", enabled = false) -public class HealthMonitorTests extends AbstractTest{ - - - public void testListHealtMonitor(){ - List list = osv3().networking().loadbalancers().healthMonitor().list(); - System.out.println("test lb HealtMonitor List"+list); - assertEquals(4, list.size()); - } - public void testListHealtMonitorFilter(){ - Map map = new HashMap(); - map.put("type", "ping"); - List list = osv3().networking().loadbalancers().healthMonitor().list(map); - System.out.println("test lb HealtMonitor List filter"+list); - assertEquals(1, list.size()); - } - public void testGetHealtMonitor(){ - String id = "48de592b-aab4-4727-9c45-7c7587fde20d"; - HealthMonitor healthMonitor = osv3().networking().loadbalancers().healthMonitor().get(id); - System.out.println("test get a HealtMonitor"+healthMonitor); - assertEquals(id, healthMonitor.getId()); - - } - - /** - * ping - */ - public void testCreatePingMonitor(){ - Integer delay = 10; - Integer maxRetries = 3; - Integer timeout = 3; - HealthMonitorType type = HealthMonitorType.PING; - HealthMonitor monitor = Builders.healthMonitor() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .type(type) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - assertEquals(type, result.getType()); - - } - - public void testUpdatePingMonitor(){ - Integer delay = 5; - Integer maxRetries = 1; - Integer timeout = 1; - String monitorId = "998e8127-5905-45fe-b9ee-6e691611dda8"; - HealthMonitorUpdate update = Builders.healthMonitorUpdate() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId,update); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - } - /** - * tcp - */ - public void testCreateTcpMonitor(){ - Integer delay = 10; - Integer maxRetries = 3; - Integer timeout = 3; - HealthMonitorType type = HealthMonitorType.TCP; - HealthMonitor monitor = Builders.healthMonitor() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .type(type) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - assertEquals(type, result.getType()); - } - public void testUpdateTcpMonitor(){ - Integer delay = 5; - Integer maxRetries = 1; - Integer timeout = 1; - String monitorId = "8767284a-b542-4db6-8393-0a404a959c1d"; - HealthMonitorUpdate update = Builders.healthMonitorUpdate() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId,update); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - } - /** - * HTTP - */ - public void testCreateHttpMonitor(){ - Integer delay = 10; - Integer maxRetries = 3; - Integer timeout = 3; - String urlPath = "/"; - String expectedCodes = "200"; - HealthMonitorType type = HealthMonitorType.HTTP; - String httpMethod = HttpMethod.GET.toString(); - HealthMonitor monitor = Builders.healthMonitor() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .type(type) - .urlPath(urlPath) - .expectedCodes(expectedCodes) - .httpMethod(httpMethod) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - assertEquals(type, result.getType()); - assertEquals(expectedCodes, result.getExpectedCodes()); - } - - public void testUpdateHttpMonitor(){ - Integer delay = 6; - Integer maxRetries = 2; - Integer timeout = 2; - String urlPath = "/"; - String expectedCodes = "210"; - String httpMethod = HttpMethod.GET.toString(); - String monitorId = "764bd223-efaa-428d-892c-f32bcf2b6a41"; - HealthMonitorUpdate update = Builders.healthMonitorUpdate() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .urlPath(urlPath) - .expectedCodes(expectedCodes) - .httpMethod(httpMethod) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId,update); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - assertEquals(expectedCodes, result.getExpectedCodes()); - } - - /** - * HTTPS - */ - public void testCreateHttpsMonitor(){ - Integer delay = 10; - Integer maxRetries = 3; - Integer timeout = 3; - String urlPath = "/"; - String expectedCodes = "200"; - HealthMonitorType type = HealthMonitorType.HTTPS; - String httpMethod = HttpMethod.GET.toString(); - HealthMonitor monitor = Builders.healthMonitor() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .type(type) - .urlPath(urlPath) - .expectedCodes(expectedCodes) - .httpMethod(httpMethod) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - assertEquals(type, result.getType()); - assertEquals(expectedCodes, result.getExpectedCodes()); - } - - public void testUpdateHttpsMonitor(){ - Integer delay = 6; - Integer maxRetries = 2; - Integer timeout = 2; - String urlPath = "/"; - String expectedCodes = "210"; - String httpMethod = HttpMethod.GET.toString(); - String monitorId = "71dad2a4-876a-46f3-99d4-f5226463d864"; - HealthMonitorUpdate update = Builders.healthMonitorUpdate() - .delay(delay) - .maxRetries(maxRetries) - .timeout(timeout) - .urlPath(urlPath) - .expectedCodes(expectedCodes) - .httpMethod(httpMethod) - .build(); - HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId,update); - assertEquals(delay, result.getDelay()); - assertEquals(maxRetries, result.getMaxRetries()); - assertEquals(timeout, result.getTimeout()); - assertEquals(expectedCodes, result.getExpectedCodes()); - } - public void testDeleteHealtMonitor(){ - String id = "48de592b-aab4-4727-9c45-7c7587fde20d"; - ActionResponse result = osv3().networking().loadbalancers().healthMonitor().delete(id); - assertTrue(result.isSuccess()); - - } - @Override - protected Service service() { - return Service.NETWORK; - } +@Test(suiteName = "Network/healthMonitor", enabled = false) +public class HealthMonitorTests extends AbstractTest { + + + public void testListHealtMonitor() { + List list = osv3().networking().loadbalancers().healthMonitor().list(); + System.out.println("test lb HealtMonitor List" + list); + assertEquals(4, list.size()); + } + + public void testListHealtMonitorFilter() { + Map map = new HashMap(); + map.put("type", "ping"); + List list = osv3().networking().loadbalancers().healthMonitor().list(map); + System.out.println("test lb HealtMonitor List filter" + list); + assertEquals(1, list.size()); + } + + public void testGetHealtMonitor() { + String id = "48de592b-aab4-4727-9c45-7c7587fde20d"; + HealthMonitor healthMonitor = osv3().networking().loadbalancers().healthMonitor().get(id); + System.out.println("test get a HealtMonitor" + healthMonitor); + assertEquals(id, healthMonitor.getId()); + + } + + /** + * ping + */ + public void testCreatePingMonitor() { + Integer delay = 10; + Integer maxRetries = 3; + Integer timeout = 3; + HealthMonitorType type = HealthMonitorType.PING; + HealthMonitor monitor = Builders.healthMonitor() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .type(type) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + assertEquals(type, result.getType()); + + } + + public void testUpdatePingMonitor() { + Integer delay = 5; + Integer maxRetries = 1; + Integer timeout = 1; + String monitorId = "998e8127-5905-45fe-b9ee-6e691611dda8"; + HealthMonitorUpdate update = Builders.healthMonitorUpdate() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId, update); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + } + + /** + * tcp + */ + public void testCreateTcpMonitor() { + Integer delay = 10; + Integer maxRetries = 3; + Integer timeout = 3; + HealthMonitorType type = HealthMonitorType.TCP; + HealthMonitor monitor = Builders.healthMonitor() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .type(type) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + assertEquals(type, result.getType()); + } + + public void testUpdateTcpMonitor() { + Integer delay = 5; + Integer maxRetries = 1; + Integer timeout = 1; + String monitorId = "8767284a-b542-4db6-8393-0a404a959c1d"; + HealthMonitorUpdate update = Builders.healthMonitorUpdate() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId, update); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + } + + /** + * HTTP + */ + public void testCreateHttpMonitor() { + Integer delay = 10; + Integer maxRetries = 3; + Integer timeout = 3; + String urlPath = "/"; + String expectedCodes = "200"; + HealthMonitorType type = HealthMonitorType.HTTP; + String httpMethod = HttpMethod.GET.toString(); + HealthMonitor monitor = Builders.healthMonitor() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .type(type) + .urlPath(urlPath) + .expectedCodes(expectedCodes) + .httpMethod(httpMethod) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + assertEquals(type, result.getType()); + assertEquals(expectedCodes, result.getExpectedCodes()); + } + + public void testUpdateHttpMonitor() { + Integer delay = 6; + Integer maxRetries = 2; + Integer timeout = 2; + String urlPath = "/"; + String expectedCodes = "210"; + String httpMethod = HttpMethod.GET.toString(); + String monitorId = "764bd223-efaa-428d-892c-f32bcf2b6a41"; + HealthMonitorUpdate update = Builders.healthMonitorUpdate() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .urlPath(urlPath) + .expectedCodes(expectedCodes) + .httpMethod(httpMethod) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId, update); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + assertEquals(expectedCodes, result.getExpectedCodes()); + } + + /** + * HTTPS + */ + public void testCreateHttpsMonitor() { + Integer delay = 10; + Integer maxRetries = 3; + Integer timeout = 3; + String urlPath = "/"; + String expectedCodes = "200"; + HealthMonitorType type = HealthMonitorType.HTTPS; + String httpMethod = HttpMethod.GET.toString(); + HealthMonitor monitor = Builders.healthMonitor() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .type(type) + .urlPath(urlPath) + .expectedCodes(expectedCodes) + .httpMethod(httpMethod) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().create(monitor); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + assertEquals(type, result.getType()); + assertEquals(expectedCodes, result.getExpectedCodes()); + } + + public void testUpdateHttpsMonitor() { + Integer delay = 6; + Integer maxRetries = 2; + Integer timeout = 2; + String urlPath = "/"; + String expectedCodes = "210"; + String httpMethod = HttpMethod.GET.toString(); + String monitorId = "71dad2a4-876a-46f3-99d4-f5226463d864"; + HealthMonitorUpdate update = Builders.healthMonitorUpdate() + .delay(delay) + .maxRetries(maxRetries) + .timeout(timeout) + .urlPath(urlPath) + .expectedCodes(expectedCodes) + .httpMethod(httpMethod) + .build(); + HealthMonitor result = osv3().networking().loadbalancers().healthMonitor().update(monitorId, update); + assertEquals(delay, result.getDelay()); + assertEquals(maxRetries, result.getMaxRetries()); + assertEquals(timeout, result.getTimeout()); + assertEquals(expectedCodes, result.getExpectedCodes()); + } + + public void testDeleteHealtMonitor() { + String id = "48de592b-aab4-4727-9c45-7c7587fde20d"; + ActionResponse result = osv3().networking().loadbalancers().healthMonitor().delete(id); + assertTrue(result.isSuccess()); + + } + + @Override + protected Service service() { + return Service.NETWORK; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorV2Tests.java b/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorV2Tests.java index 88469c4d2..04ae416e8 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/HealthMonitorV2Tests.java @@ -13,16 +13,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** - * * @author ashleykasim - * */ -@Test(suiteName="Network/healthMonitor", enabled = true) +@Test(suiteName = "Network/healthMonitor", enabled = true) public class HealthMonitorV2Tests extends AbstractTest { private static final String HEALTHMONITORSV2_JSON = "/network/healthmonitorsv2.json"; private static final String HEALTHMONITORV2_JSON = "/network/healthmonitorv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/network/LbPoolTests.java b/core-test/src/main/java/org/openstack4j/api/network/LbPoolTests.java index 90ccd990d..4c0bff0b7 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/LbPoolTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/LbPoolTests.java @@ -1,113 +1,106 @@ package org.openstack4j.api.network; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.api.Builders; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.ext.*; +import org.testng.annotations.Test; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openstack4j.api.AbstractTest; -import org.openstack4j.api.Builders; -import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.network.ext.HealthMonitor; -import org.openstack4j.model.network.ext.HealthMonitorAssociate; -import org.openstack4j.model.network.ext.LbMethod; -import org.openstack4j.model.network.ext.LbPool; -import org.openstack4j.model.network.ext.LbPoolUpdate; -import org.openstack4j.model.network.ext.Protocol; -import org.testng.annotations.Test; +import static org.testng.Assert.*; -@Test(suiteName="Network/lbpool", enabled=true) +@Test(suiteName = "Network/lbpool", enabled = true) public class LbPoolTests extends AbstractTest { private static final String LBPOOLS_JSON = "/network/lbpools.json"; private static final String LBPOOL_JSON = "/network/lbpool.json"; private static final String LBPOOL_UPDATE_JSON = "/network/lbpool_update.json"; - - public void testListPool() throws IOException { - respondWith(LBPOOLS_JSON); - List list = osv3().networking().loadbalancers().lbPool().list(); - assertEquals(1, list.size()); - assertEquals(list.get(0).getSubnetId(), "8032909d-47a1-4715-90af-5153ffe39861"); - } - public void testListPoolFilter() throws IOException { - respondWith(LBPOOLS_JSON); - Map map = new HashMap(); - map.put("name", "pool"); - List list = osv3().networking().loadbalancers().lbPool().list(map); - assertEquals(1, list.size()); - } + public void testListPool() throws IOException { + respondWith(LBPOOLS_JSON); + List list = osv3().networking().loadbalancers().lbPool().list(); + assertEquals(1, list.size()); + assertEquals(list.get(0).getSubnetId(), "8032909d-47a1-4715-90af-5153ffe39861"); + } + + public void testListPoolFilter() throws IOException { + respondWith(LBPOOLS_JSON); + Map map = new HashMap(); + map.put("name", "pool"); + List list = osv3().networking().loadbalancers().lbPool().list(map); + assertEquals(1, list.size()); + } + + public void testGetPool() throws IOException { + respondWith(LBPOOL_JSON); + String id = "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5"; + LbPool pool = osv3().networking().loadbalancers().lbPool().get(id); + assertNotNull(pool); + assertEquals(id, pool.getId()); + } + + public void testCreatePool() throws IOException { + respondWith(LBPOOL_JSON); + String name = "pool1"; + Protocol protocol = Protocol.HTTP; + LbPool create = Builders.lbPool().adminStateUp(true) + .description("pool").lbMethod(LbMethod.ROUND_ROBIN) + .name(name).provider("haproxy") + .subnetId("7d1dab60-cf8a-4f75-af5c-44aab98b0c42") + .tenantId("d7fd03242ffa4933863bc528ed884fb6") + .protocol(protocol).build(); + LbPool result = osv3().networking().loadbalancers().lbPool().create(create); + assertEquals(name, result.getName()); + assertEquals(result.getLbMethod(), LbMethod.ROUND_ROBIN); + assertEquals(protocol, result.getProtocol()); + } + + public void testUpdatePool() throws IOException { + respondWith(LBPOOL_UPDATE_JSON); + String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; + String name = "update"; + LbPoolUpdate update = Builders.lbPoolUpdate().adminStateUp(false) + .description("update") + .lbMethod(LbMethod.LEAST_CONNECTIONS).name(name) + .build(); + LbPool result = osv3().networking().loadbalancers().lbPool().update(poolId, update); + assertEquals(name, result.getName()); + assertEquals(LbMethod.LEAST_CONNECTIONS, + result.getLbMethod()); + assertFalse(result.isAdminStateUp()); + } + + @Test(enabled = false) + public void testAssociateHealthMonitor() { + String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; + String healthId = "8767284a-b542-4db6-8393-0a404a959c1d"; + HealthMonitorAssociate associate = Builders.lbPoolAssociateHealthMonitor().id(healthId).build(); + HealthMonitor result = osv3().networking().loadbalancers().lbPool().associateHealthMonitor(poolId, associate); + assertTrue(result != null); + } - public void testGetPool() throws IOException { - respondWith(LBPOOL_JSON); - String id = "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5"; - LbPool pool = osv3().networking().loadbalancers().lbPool().get(id); - assertNotNull(pool); - assertEquals(id, pool.getId()); - } + @Test(enabled = false) + public void testDisAssociateHealthMonitor() { + String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; + String healthId = "8767284a-b542-4db6-8393-0a404a959c1d"; + ActionResponse result = osv3().networking().loadbalancers().lbPool() + .disAssociateHealthMonitor(poolId, healthId); + assertTrue(result.isSuccess()); + } - public void testCreatePool() throws IOException { - respondWith(LBPOOL_JSON); - String name = "pool1"; - Protocol protocol = Protocol.HTTP; - LbPool create = Builders.lbPool().adminStateUp(true) - .description("pool").lbMethod(LbMethod.ROUND_ROBIN) - .name(name).provider("haproxy") - .subnetId("7d1dab60-cf8a-4f75-af5c-44aab98b0c42") - .tenantId("d7fd03242ffa4933863bc528ed884fb6") - .protocol(protocol).build(); - LbPool result = osv3().networking().loadbalancers().lbPool().create(create); - assertEquals(name, result.getName()); - assertEquals(result.getLbMethod(), LbMethod.ROUND_ROBIN); - assertEquals(protocol, result.getProtocol()); - } - public void testUpdatePool() throws IOException { - respondWith(LBPOOL_UPDATE_JSON); - String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; - String name = "update"; - LbPoolUpdate update = Builders.lbPoolUpdate().adminStateUp(false) - .description("update") - .lbMethod(LbMethod.LEAST_CONNECTIONS).name(name) - .build(); - LbPool result = osv3().networking().loadbalancers().lbPool().update(poolId, update); - assertEquals(name, result.getName()); - assertEquals(LbMethod.LEAST_CONNECTIONS, - result.getLbMethod()); - assertFalse(result.isAdminStateUp()); - } + public void testDeletePool() { + respondWith(200); + ActionResponse result = osv3().networking().loadbalancers().lbPool().delete("02ae87ec-5502-469e-8c41-f2c57d185054"); + assertTrue(result.isSuccess()); + } - @Test(enabled=false) - public void testAssociateHealthMonitor() { - String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; - String healthId = "8767284a-b542-4db6-8393-0a404a959c1d"; - HealthMonitorAssociate associate = Builders.lbPoolAssociateHealthMonitor().id(healthId).build(); - HealthMonitor result = osv3().networking().loadbalancers().lbPool().associateHealthMonitor(poolId, associate); - assertTrue(result != null); - } - - @Test(enabled=false) - public void testDisAssociateHealthMonitor() { - String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; - String healthId = "8767284a-b542-4db6-8393-0a404a959c1d"; - ActionResponse result = osv3().networking().loadbalancers().lbPool() - .disAssociateHealthMonitor(poolId, healthId); - assertTrue(result.isSuccess()); - } - - public void testDeletePool() { - respondWith(200); - ActionResponse result = osv3().networking().loadbalancers().lbPool().delete("02ae87ec-5502-469e-8c41-f2c57d185054"); - assertTrue(result.isSuccess()); - } - - @Override - protected Service service() { - return Service.NETWORK; - } + @Override + protected Service service() { + return Service.NETWORK; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/LbPoolV2Tests.java b/core-test/src/main/java/org/openstack4j/api/network/LbPoolV2Tests.java index 677c1aa3e..07ff8372b 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/LbPoolV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/LbPoolV2Tests.java @@ -14,17 +14,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** - * * @author ashleykasim - * */ -@Test(suiteName="Network/lbpoolv2", enabled=true) +@Test(suiteName = "Network/lbpoolv2", enabled = true) public class LbPoolV2Tests extends AbstractTest { private static final String LBPOOLSV2_JSON = "/network/lbpoolsv2.json"; private static final String LBPOOLV2_JSON = "/network/lbpoolv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/network/ListenerV2Tests.java b/core-test/src/main/java/org/openstack4j/api/network/ListenerV2Tests.java index 00dcbf475..4ade4a70b 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/ListenerV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/ListenerV2Tests.java @@ -4,9 +4,9 @@ import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.ext.ListenerProtocol; import org.openstack4j.model.network.ext.ListenerV2; import org.openstack4j.model.network.ext.ListenerV2Update; -import org.openstack4j.model.network.ext.ListenerProtocol; import org.testng.annotations.Test; import java.io.IOException; @@ -14,17 +14,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** - * * @author ashleykasim - * */ -@Test(suiteName="Network/listener", enabled = true) +@Test(suiteName = "Network/listener", enabled = true) public class ListenerV2Tests extends AbstractTest { private static final String LISTENERSV2_JSON = "/network/listenersv2.json"; private static final String LISTENERV2_JSON = "/network/listenerv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/network/LoadBalancerV2Tests.java b/core-test/src/main/java/org/openstack4j/api/network/LoadBalancerV2Tests.java index c0ef91fa4..efd033dd6 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/LoadBalancerV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/LoadBalancerV2Tests.java @@ -15,17 +15,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertFalse; +import static org.testng.Assert.*; /** - * * @author ashleykasim - * */ -@Test(suiteName="Network/loadBalancerV2", enabled = true) +@Test(suiteName = "Network/loadBalancerV2", enabled = true) public class LoadBalancerV2Tests extends AbstractTest { private static final String LOADBALANCERSV2_JSON = "/network/loadbalancersv2.json"; private static final String LOADBALANCERV2_JSON = "/network/loadbalancerv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/network/MemberTests.java b/core-test/src/main/java/org/openstack4j/api/network/MemberTests.java index e1776de43..5a46bd7ec 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/MemberTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/MemberTests.java @@ -1,87 +1,90 @@ package org.openstack4j.api.network; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.Member; import org.openstack4j.model.network.ext.MemberUpdate; import org.testng.annotations.Test; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; + /** - * * @author liujunpeng - * */ -@Test(suiteName="Network/member", enabled=false) -public class MemberTests extends AbstractTest{ - public void testListMember(){ - List list = osv3().networking().loadbalancers().member().list(); - System.out.println("test lb member List"+list); - assertEquals(1, list.size()); - } - public void testListMemberFilter(){ - Map map = new HashMap(); - map.put("address", "100.2.12.32"); - List list = osv3().networking().loadbalancers().member().list(map); - System.out.println("test lb member List filter"+list); - assertEquals(1, list.size()); - } - public void testGetMember(){ - String id = "99a28283-97b7-4210-af5c-b2594628217b"; - Member member = osv3().networking().loadbalancers().member().get(id); - System.out.println("test get a member"+member); - assertEquals(id, member.getId()); +@Test(suiteName = "Network/member", enabled = false) +public class MemberTests extends AbstractTest { + public void testListMember() { + List list = osv3().networking().loadbalancers().member().list(); + System.out.println("test lb member List" + list); + assertEquals(1, list.size()); + } + + public void testListMemberFilter() { + Map map = new HashMap(); + map.put("address", "100.2.12.32"); + List list = osv3().networking().loadbalancers().member().list(map); + System.out.println("test lb member List filter" + list); + assertEquals(1, list.size()); + } + + public void testGetMember() { + String id = "99a28283-97b7-4210-af5c-b2594628217b"; + Member member = osv3().networking().loadbalancers().member().get(id); + System.out.println("test get a member" + member); + assertEquals(id, member.getId()); + + } + + public void testCreateMember() { + + String address = "100.2.12.32"; + String poolId = "60cf0dbf-6137-41b4-9145-24232104ea96"; + Integer weight = 100; + Member create = Builders.member() + .address(address) + .adminStateUp(true) + .protocolPort(80) + .weight(weight) + .poolId(poolId).build(); + Member result = osv3().networking().loadbalancers().member().create(create); + assertTrue(result.isAdminStateUp()); + assertEquals(weight, result.getWeight()); + assertEquals(address, result.getAddress()); + } + + public void testUpdateMember() { + + String address = "100.2.12.32"; + String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; + String memberId = "5ee6d8b7-79ae-48cc-bc92-31ffee79858a"; + Integer weight = 101; + MemberUpdate update = Builders.memberUpdate() + .adminStateUp(true) + .weight(weight) + .poolId(poolId).build(); + Member result = osv3().networking().loadbalancers().member().update(memberId, update); + assertTrue(result.isAdminStateUp()); + assertEquals(weight, result.getWeight()); + assertEquals(address, result.getAddress()); + } - } - - public void testCreateMember(){ - - String address = "100.2.12.32"; - String poolId = "60cf0dbf-6137-41b4-9145-24232104ea96"; - Integer weight = 100; - Member create = Builders.member() - .address(address) - .adminStateUp(true) - .protocolPort(80) - .weight(weight) - .poolId(poolId).build(); - Member result = osv3().networking().loadbalancers().member().create(create); - assertTrue(result.isAdminStateUp()); - assertEquals(weight, result.getWeight()); - assertEquals(address,result.getAddress()); - } - - public void testUpdateMember(){ - - String address = "100.2.12.32"; - String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; - String memberId = "5ee6d8b7-79ae-48cc-bc92-31ffee79858a"; - Integer weight = 101; - MemberUpdate update = Builders.memberUpdate() - .adminStateUp(true) - .weight(weight) - .poolId(poolId).build(); - Member result = osv3().networking().loadbalancers().member().update(memberId, update); - assertTrue(result.isAdminStateUp()); - assertEquals(weight, result.getWeight()); - assertEquals(address,result.getAddress()); - } - - public void testDeleteMember(){ - String id = "99a28283-97b7-4210-af5c-b2594628217b"; - ActionResponse result = osv3().networking().loadbalancers().member().delete(id); - System.out.println("test delete a member"+result); - assertTrue(result.isSuccess()); + public void testDeleteMember() { + String id = "99a28283-97b7-4210-af5c-b2594628217b"; + ActionResponse result = osv3().networking().loadbalancers().member().delete(id); + System.out.println("test delete a member" + result); + assertTrue(result.isSuccess()); - } + } - @Override - protected Service service() { - return Service.NETWORK; - } + @Override + protected Service service() { + return Service.NETWORK; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/MemberV2Tests.java b/core-test/src/main/java/org/openstack4j/api/network/MemberV2Tests.java index 46727de62..b8ebb47f1 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/MemberV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/MemberV2Tests.java @@ -1,4 +1,5 @@ package org.openstack4j.api.network; + import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -11,17 +12,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertFalse; +import static org.testng.Assert.*; /** - * * @author ashleykasim - * */ -@Test(suiteName="Network/memberV2", enabled = true) +@Test(suiteName = "Network/memberV2", enabled = true) public class MemberV2Tests extends AbstractTest { private static final String MEMBERSV2_JSON = "/network/membersv2.json"; private static final String MEMBERV2_JSON = "/network/memberv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/network/NetQuotaTest.java b/core-test/src/main/java/org/openstack4j/api/network/NetQuotaTest.java index bd0a886e3..867650639 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/NetQuotaTest.java +++ b/core-test/src/main/java/org/openstack4j/api/network/NetQuotaTest.java @@ -9,6 +9,7 @@ import static org.testng.Assert.assertEquals; /** + * */ @Test(suiteName = "Network/quota", enabled = true) public class NetQuotaTest extends AbstractTest { diff --git a/core-test/src/main/java/org/openstack4j/api/network/NetworkTests.java b/core-test/src/main/java/org/openstack4j/api/network/NetworkTests.java index 16ac9f72c..d6f19f7b8 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/NetworkTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/NetworkTests.java @@ -1,30 +1,27 @@ package org.openstack4j.api.network; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import okhttp3.mockwebserver.RecordedRequest; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.Agent; import org.openstack4j.model.network.Agent.Type; import org.openstack4j.model.network.Network; import org.openstack4j.model.network.NetworkType; import org.openstack4j.model.network.State; -import org.openstack4j.model.common.ActionResponse; import org.testng.annotations.Test; -import okhttp3.mockwebserver.RecordedRequest; +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.testng.Assert.*; /** * Tests the Compute -> Network API against the mock webserver and spec based * json responses - * + * * @author Yin Zhang * @author Qin An */ @@ -42,7 +39,7 @@ public class NetworkTests extends AbstractTest { public void getNetwork() throws Exception { respondWith(JSON_NETWORK); Network n = osv3().networking().network().get(NETWORK_ID); - server.takeRequest(); + server.takeRequest(); assertEquals(n.getName(), NETWORK_NAME); assertEquals(n.getStatus(), State.ACTIVE); assertEquals(n.isRouterExternal(), false); @@ -53,28 +50,28 @@ public void createNetwork() throws Exception { respondWith(JSON_NETWORK_EXTERNAL); Network n = osv3().networking().network() .create(Builders.network().name(NETWORK_NAME).isRouterExternal(true).adminStateUp(true).build()); - server.takeRequest(); + server.takeRequest(); assertEquals(n.getName(), NETWORK_NAME); assertEquals(n.getStatus(), State.ACTIVE); assertEquals(n.isRouterExternal(), true); } - + @Test public void createNetworkWithZone() throws Exception { respondWith(JSON_NETWORK_ZONE); Network n = osv3().networking().network() .create(Builders.network().name(NETWORK_NAME).isRouterExternal(true).adminStateUp(true).addAvailabilityZoneHints("nova").build()); - server.takeRequest(); + server.takeRequest(); assertEquals(n.getName(), NETWORK_NAME); assertEquals(n.getStatus(), State.ACTIVE); assertEquals(n.getAvailabilityZoneHints().get(0), "nova"); - } + } @Test public void agentList() throws Exception { respondWith(JSON_AGENTS); List agentList = osv3().networking().agent().list(); - server.takeRequest(); + server.takeRequest(); Agent agent = agentList.get(0); assertEquals(agentList.size(), 12); assertEquals(agent.getBinary(), "neutron-dhcp-agent"); @@ -83,7 +80,7 @@ public void agentList() throws Exception { assertEquals(agent.getAgentType(), Type.DHCP); assertEquals(agent.getHost(), "cic-0-3"); assertEquals(agent.getId(), "086d8a3d-ef23-4708-909b-0c459528e2a6"); - assertEquals(agent.getCreatedAt(), (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse("2015-03-18 20:28:02")); + assertEquals(agent.getCreatedAt(), (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse("2015-03-18 20:28:02")); assertEquals(agent.getAgentType(), Type.DHCP); assertEquals(agent.getAgentType(), Type.DHCP); } @@ -100,28 +97,28 @@ public void detachNetworkToDhcpAgent() throws Exception { protected Service service() { return Service.NETWORK; } - - @Test - public void listNetworkWithFilter() throws Exception { - - respondWith("/network/networks_filtered.json"); - - final String name = "netOK"; + + @Test + public void listNetworkWithFilter() throws Exception { + + respondWith("/network/networks_filtered.json"); + + final String name = "netOK"; Map filters = new HashMap(); filters.put("name", name); - - List networks = osv3().networking().network().list(filters); - assertEquals(networks.size(), 1); - - // Check that the list request is the one we expect - RecordedRequest listRequest = server.takeRequest(); - - assertNotNull(listRequest.getHeader("X-Auth-Token")); - assertTrue(listRequest.getPath().contains("/networks?name=" + name)); - - assertEquals(networks.get(0).getName(), name); - assertEquals(networks.get(0).getSubnets().get(0), "0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9" ); - assertEquals(networks.get(0).getId(), "73f6f1ac-5e58-4801-88c3-7e12c6ddfb39"); - assertEquals(networks.get(0).getNetworkType(), NetworkType.VXLAN); - } + + List networks = osv3().networking().network().list(filters); + assertEquals(networks.size(), 1); + + // Check that the list request is the one we expect + RecordedRequest listRequest = server.takeRequest(); + + assertNotNull(listRequest.getHeader("X-Auth-Token")); + assertTrue(listRequest.getPath().contains("/networks?name=" + name)); + + assertEquals(networks.get(0).getName(), name); + assertEquals(networks.get(0).getSubnets().get(0), "0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9"); + assertEquals(networks.get(0).getId(), "73f6f1ac-5e58-4801-88c3-7e12c6ddfb39"); + assertEquals(networks.get(0).getNetworkType(), NetworkType.VXLAN); + } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/PortTests.java b/core-test/src/main/java/org/openstack4j/api/network/PortTests.java index 2c61516ab..0495b41e5 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/PortTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/PortTests.java @@ -4,15 +4,14 @@ import org.openstack4j.api.Builders; import org.openstack4j.model.network.Port; import org.testng.annotations.Test; + import java.util.ArrayList; import java.util.List; import static org.testng.Assert.assertEquals; /** - * * @author Rizwan Qamar - * */ @Test(suiteName = "Port") public class PortTests extends AbstractTest { diff --git a/core-test/src/main/java/org/openstack4j/api/network/SecurityGroupTests.java b/core-test/src/main/java/org/openstack4j/api/network/SecurityGroupTests.java index 197b658ab..e3348941b 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/SecurityGroupTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/SecurityGroupTests.java @@ -12,7 +12,7 @@ /** * Tests the Compute -> Network API against the mock webserver and spec based * json responses - * + *

* Created by Ayberk CAL on 20.03.2017. */ @Test(suiteName = "SecurityGroup") diff --git a/core-test/src/main/java/org/openstack4j/api/network/ServiceFunctionChainTests.java b/core-test/src/main/java/org/openstack4j/api/network/ServiceFunctionChainTests.java index 8b80d165d..d561f09c3 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/ServiceFunctionChainTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/ServiceFunctionChainTests.java @@ -1,28 +1,21 @@ package org.openstack4j.api.network; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.InputStreamReader; -import java.util.List; - +import com.google.common.base.Objects; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.core.transport.ObjectMapperSingleton; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.network.ext.Ethertype; -import org.openstack4j.model.network.ext.FlowClassifier; -import org.openstack4j.model.network.ext.PortChain; -import org.openstack4j.model.network.ext.PortPair; -import org.openstack4j.model.network.ext.PortPairGroup; +import org.openstack4j.model.network.ext.*; import org.openstack4j.openstack.networking.domain.ext.NeutronFlowClassifier; import org.openstack4j.openstack.networking.domain.ext.NeutronPortChain; import org.openstack4j.openstack.networking.domain.ext.NeutronPortPair; import org.openstack4j.openstack.networking.domain.ext.NeutronPortPairGroup; import org.testng.annotations.Test; -import com.google.common.base.Objects; +import java.io.InputStreamReader; +import java.util.List; + +import static org.testng.Assert.*; @Test(suiteName = "ServiceFunctionChain") public class ServiceFunctionChainTests extends AbstractTest { @@ -74,7 +67,7 @@ public void testFlowClassifiersList() throws Exception { assertNotNull(flowClassifiers.get(1).getL7Parameters()); assertNotNull(flowClassifiers.get(1).getL7Parameters().get(PARAM_KEY_B)); assertEquals(flowClassifiers.get(1).getL7Parameters().get(PARAM_KEY_B), PARAM_VALUE_B); -} + } @Test public void testGetFlowClassifier() throws Exception { @@ -95,7 +88,7 @@ public void testGetFlowClassifier() throws Exception { public void testCreateFlowClassifier() throws Exception { FlowClassifier original = ObjectMapperSingleton.getContext(NeutronFlowClassifier.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_FLOW_CLASSIFIER)), - NeutronFlowClassifier.class); + NeutronFlowClassifier.class); respondWith(JSON_FLOW_CLASSIFIER); FlowClassifier returned = osv3().sfc().flowclassifiers().create(original); server.takeRequest(); @@ -107,7 +100,7 @@ public void testCreateFlowClassifier() throws Exception { public void testUpdateFlowClassifier() throws Exception { FlowClassifier original = ObjectMapperSingleton.getContext(NeutronFlowClassifier.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_FLOW_CLASSIFIER)), - NeutronFlowClassifier.class); + NeutronFlowClassifier.class); respondWith(JSON_FLOW_CLASSIFIER); FlowClassifier returned = osv3().sfc().flowclassifiers().update(FC_ID, original); server.takeRequest(); @@ -119,7 +112,7 @@ public void testUpdateFlowClassifier() throws Exception { public void testDeleteFlowClassifier() throws Exception { FlowClassifier original = ObjectMapperSingleton.getContext(NeutronFlowClassifier.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_FLOW_CLASSIFIER)), - NeutronFlowClassifier.class); + NeutronFlowClassifier.class); respondWith(200); ActionResponse response = osv3().sfc().flowclassifiers().delete(FC_ID); server.takeRequest(); @@ -163,7 +156,7 @@ public void testGetPortPair() throws Exception { public void testCreatePortPair() throws Exception { PortPair original = ObjectMapperSingleton.getContext(NeutronPortPair.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_PAIR)), - NeutronPortPair.class); + NeutronPortPair.class); respondWith(JSON_PORT_PAIR); PortPair returned = osv3().sfc().portpairs().create(original); server.takeRequest(); @@ -175,7 +168,7 @@ public void testCreatePortPair() throws Exception { public void testUpdatePortPair() throws Exception { PortPair original = ObjectMapperSingleton.getContext(NeutronPortPair.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_PAIR)), - NeutronPortPair.class); + NeutronPortPair.class); respondWith(JSON_PORT_PAIR); PortPair returned = osv3().sfc().portpairs().update(FC_ID, original); server.takeRequest(); @@ -215,7 +208,7 @@ public void testGetPortPairGroup() throws Exception { public void testCreatePortPairGroup() throws Exception { PortPairGroup original = ObjectMapperSingleton.getContext(NeutronPortPairGroup.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_PAIR_GROUP)), - NeutronPortPairGroup.class); + NeutronPortPairGroup.class); respondWith(JSON_PORT_PAIR_GROUP); PortPairGroup returned = osv3().sfc().portpairgroups().create(original); server.takeRequest(); @@ -227,7 +220,7 @@ public void testCreatePortPairGroup() throws Exception { public void testUpdatePortPairGroup() throws Exception { PortPairGroup original = ObjectMapperSingleton.getContext(NeutronPortPairGroup.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_PAIR_GROUP)), - NeutronPortPairGroup.class); + NeutronPortPairGroup.class); respondWith(JSON_PORT_PAIR_GROUP); PortPairGroup returned = osv3().sfc().portpairgroups().update(FC_ID, original); server.takeRequest(); @@ -297,7 +290,7 @@ public void testGetPortChain() throws Exception { public void testCreatePortChain() throws Exception { PortChain original = ObjectMapperSingleton.getContext(NeutronPortChain.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_CHAIN)), - NeutronPortChain.class); + NeutronPortChain.class); respondWith(JSON_PORT_CHAIN); PortChain returned = osv3().sfc().portchains().create(original); server.takeRequest(); @@ -309,7 +302,7 @@ public void testCreatePortChain() throws Exception { public void testUpdatePortChain() throws Exception { PortChain original = ObjectMapperSingleton.getContext(NeutronPortChain.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_CHAIN)), - NeutronPortChain.class); + NeutronPortChain.class); respondWith(JSON_PORT_CHAIN); PortChain returned = osv3().sfc().portchains().update(FC_ID, original); server.takeRequest(); @@ -329,7 +322,7 @@ public void testDeletePortChain() throws Exception { public void testPortChainBuilder() throws Exception { PortChain original = ObjectMapperSingleton.getContext(NeutronPortChain.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_CHAIN)), - NeutronPortChain.class); + NeutronPortChain.class); PortChain built = Builders.portChain() .id(original.getId()) .name(original.getName()) @@ -348,7 +341,7 @@ public void testPortChainBuilder() throws Exception { public void testPortPairGroupBuilder() throws Exception { PortPairGroup original = ObjectMapperSingleton.getContext(NeutronPortPairGroup.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_PAIR_GROUP)), - NeutronPortPairGroup.class); + NeutronPortPairGroup.class); PortPairGroup built = Builders.portPairGroup() .id(original.getId()) .name(original.getName()) @@ -365,7 +358,7 @@ public void testPortPairGroupBuilder() throws Exception { public void testPortPairBuilder() throws Exception { PortPair original = ObjectMapperSingleton.getContext(NeutronPortPair.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_PORT_PAIR)), - NeutronPortPair.class); + NeutronPortPair.class); PortPair built = Builders.portPair() .id(original.getId()) .name(original.getName()) @@ -383,7 +376,7 @@ public void testPortPairBuilder() throws Exception { public void testFlowClassifierBuilder() throws Exception { FlowClassifier original = ObjectMapperSingleton.getContext(NeutronFlowClassifier.class) .readValue(new InputStreamReader(getClass().getResourceAsStream(JSON_FLOW_CLASSIFIER)), - NeutronFlowClassifier.class); + NeutronFlowClassifier.class); FlowClassifier built = Builders.flowClassifier() .id(original.getId()) .name(original.getName()) diff --git a/core-test/src/main/java/org/openstack4j/api/network/SubnetTests.java b/core-test/src/main/java/org/openstack4j/api/network/SubnetTests.java index 3e183e75c..a4f21c1ce 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/SubnetTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/SubnetTests.java @@ -1,40 +1,40 @@ package org.openstack4j.api.network; -import static org.testng.Assert.assertEquals; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.network.Ipv6AddressMode; import org.openstack4j.model.network.Ipv6RaMode; import org.openstack4j.model.network.Subnet; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + /** * Tests the Neutron -> Subnet API against the mock webserver and spec based * json responses - * - * @author Taemin + * + * @author Taemin */ @Test(suiteName = "subnet") public class SubnetTests extends AbstractTest { - private static final String JSON_GET_SUBNET = "/network/subnet_ipv6.json"; - - private static final String SUBNET_NAME = "sub1"; - private static final String SUBNET_ID = "3b80198d-4f7b-4f77-9ef5-774d54e17126"; - - @Test - public void getSubnetIpV6() throws Exception { - respondWith(JSON_GET_SUBNET); - Subnet n = osv3().networking().subnet().get(SUBNET_ID); - server.takeRequest(); - assertEquals(n.getName(), SUBNET_NAME); - assertEquals(n.getIpv6AddressMode(), Ipv6AddressMode.DHCPV6_STATEFUL); - assertEquals(n.getIpv6RaMode(), Ipv6RaMode.DHCPV6_STATEFUL); - } + private static final String JSON_GET_SUBNET = "/network/subnet_ipv6.json"; + + private static final String SUBNET_NAME = "sub1"; + private static final String SUBNET_ID = "3b80198d-4f7b-4f77-9ef5-774d54e17126"; + + @Test + public void getSubnetIpV6() throws Exception { + respondWith(JSON_GET_SUBNET); + Subnet n = osv3().networking().subnet().get(SUBNET_ID); + server.takeRequest(); + assertEquals(n.getName(), SUBNET_NAME); + assertEquals(n.getIpv6AddressMode(), Ipv6AddressMode.DHCPV6_STATEFUL); + assertEquals(n.getIpv6RaMode(), Ipv6RaMode.DHCPV6_STATEFUL); + } @Override protected Service service() { return Service.NETWORK; } - + } diff --git a/core-test/src/main/java/org/openstack4j/api/network/VipTests.java b/core-test/src/main/java/org/openstack4j/api/network/VipTests.java index 65db080e6..84ea5ab92 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/VipTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/VipTests.java @@ -1,9 +1,5 @@ package org.openstack4j.api.network; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -13,101 +9,106 @@ import org.openstack4j.model.network.ext.VipUpdate; import org.testng.annotations.Test; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; /** - * * @author liujunpeng - * */ -@Test(suiteName="Network/vip", enabled=false) -public class VipTests extends AbstractTest{ - public void testListVip(){ - List list = osv3().networking().loadbalancers().vip().list(); - System.out.println("test lb vip List"+list); - assertEquals(1, list.size()); - } - public void testListVipFilter(){ - Map map = new HashMap(); - map.put("name", "vip"); - List list = osv3().networking().loadbalancers().vip().list(map); - System.out.println("test lb vip List filter"+list); - assertEquals(1, list.size()); - } - public void testGetVip(){ - String id = "dfc5c198-dceb-4f99-8ed7-5ebfdf46946d"; - Vip vip = osv3().networking().loadbalancers().vip().get(id); - System.out.println("test get a vip"+vip); - assertEquals(id, vip.getId()); +@Test(suiteName = "Network/vip", enabled = false) +public class VipTests extends AbstractTest { + public void testListVip() { + List list = osv3().networking().loadbalancers().vip().list(); + System.out.println("test lb vip List" + list); + assertEquals(1, list.size()); + } + + public void testListVipFilter() { + Map map = new HashMap(); + map.put("name", "vip"); + List list = osv3().networking().loadbalancers().vip().list(map); + System.out.println("test lb vip List filter" + list); + assertEquals(1, list.size()); + } + + public void testGetVip() { + String id = "dfc5c198-dceb-4f99-8ed7-5ebfdf46946d"; + Vip vip = osv3().networking().loadbalancers().vip().get(id); + System.out.println("test get a vip" + vip); + assertEquals(id, vip.getId()); + + } + + public void testCreateVip() { + String address = "100.2.12.48"; + String name = "createVip"; + String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; + String subnetId = "7d1dab60-cf8a-4f75-af5c-44aab98b0c42"; + String tenantId = "d7fd03242ffa4933863bc528ed884fb6"; + Integer port = 80; + Vip create = Builders.vip().address(address).adminStateUp(true) + .connectionLimit(100) + .description("vip") + .name(name) + .poolId(poolId) + .protocol(Protocol.HTTP) + .protocolPort(port) + .sessionPersistence(Builders + .sessionPersistence() + .cookieName("cookie") + .type(SessionPersistenceType.APP_COOKIE) + .build()) + .subnetId(subnetId) + .tenantId(tenantId) + .build(); + Vip result = osv3().networking().loadbalancers().vip().create(create); + System.out.println(result); + assertEquals(address, result.getAddress()); + assertEquals(name, result.getName()); + assertEquals(Protocol.HTTP, result.getProtocol()); + assertEquals(port, result.getProtocolPort()); + } + + public void testUpdateVip() { + String vipId = "cb1d7958-232d-4daa-a5f5-16ba91a6362b"; + String name = "updateVip"; + String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; + Integer connectionLimit = 101; + VipUpdate update = Builders.vipUpdate().adminStateUp(true) + .connectionLimit(connectionLimit) + .description("vip") + .name(name) + .poolId(poolId) + .sessionPersistence(Builders + .sessionPersistence() + .type(SessionPersistenceType.SOURCE_IP) + .build()) + .description("description update") + .build(); + Vip result = osv3().networking().loadbalancers().vip().update(vipId, update); + System.out.println(result); + assertEquals(poolId, result.getPoolId()); + assertEquals(connectionLimit, result.getConnectionLimit()); + assertEquals(name, result.getName()); + assertEquals(SessionPersistenceType.SOURCE_IP, result + .getSessionPersistence().getType()); + + } + + public void testDeleteVip() { + String id = "50cbd265-fe4f-4c9c-b25c-bb6c773d0366"; + ActionResponse result = osv3().networking().loadbalancers().vip().delete(id); + assertTrue(result.isSuccess()); + + } - } - - public void testCreateVip(){ - String address = "100.2.12.48"; - String name = "createVip"; - String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; - String subnetId = "7d1dab60-cf8a-4f75-af5c-44aab98b0c42"; - String tenantId = "d7fd03242ffa4933863bc528ed884fb6"; - Integer port = 80; - Vip create = Builders.vip().address(address).adminStateUp(true) - .connectionLimit(100) - .description("vip") - .name(name) - .poolId(poolId) - .protocol(Protocol.HTTP) - .protocolPort(port) - .sessionPersistence(Builders - .sessionPersistence() - .cookieName("cookie") - .type(SessionPersistenceType.APP_COOKIE) - .build()) - .subnetId(subnetId) - .tenantId(tenantId) - .build(); - Vip result = osv3().networking().loadbalancers().vip().create(create); - System.out.println(result); - assertEquals(address, result.getAddress()); - assertEquals(name, result.getName()); - assertEquals(Protocol.HTTP, result.getProtocol()); - assertEquals(port, result.getProtocolPort()); - } - - public void testUpdateVip(){ - String vipId = "cb1d7958-232d-4daa-a5f5-16ba91a6362b"; - String name = "updateVip"; - String poolId = "db083bf7-c455-4758-b1ad-203cf441a73a"; - Integer connectionLimit = 101; - VipUpdate update = Builders.vipUpdate().adminStateUp(true) - .connectionLimit(connectionLimit) - .description("vip") - .name(name) - .poolId(poolId) - .sessionPersistence(Builders - .sessionPersistence() - .type(SessionPersistenceType.SOURCE_IP) - .build()) - .description("description update") - .build(); - Vip result = osv3().networking().loadbalancers().vip().update(vipId, update); - System.out.println(result); - assertEquals(poolId, result.getPoolId()); - assertEquals(connectionLimit, result.getConnectionLimit()); - assertEquals(name, result.getName()); - assertEquals(SessionPersistenceType.SOURCE_IP, result - .getSessionPersistence().getType()); - - } - - public void testDeleteVip(){ - String id = "50cbd265-fe4f-4c9c-b25c-bb6c773d0366"; - ActionResponse result = osv3().networking().loadbalancers().vip().delete(id); - assertTrue(result.isSuccess()); - - } - @Override - protected Service service() { - return Service.NETWORK; - } + @Override + protected Service service() { + return Service.NETWORK; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallPolicyTests.java b/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallPolicyTests.java index 4a9e504d2..79825b27b 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallPolicyTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallPolicyTests.java @@ -1,14 +1,6 @@ package org.openstack4j.api.network.firewalls; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -17,102 +9,107 @@ import org.openstack4j.openstack.networking.domain.ext.FirewallRuleStrategy.RuleInsertStrategyType; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; /** * Test suite for FirewallPolicy As a Service : FirewallPolicy Policy {@link FirewallPolicy} (FwaaS) - * + * * @author Vishvesh Deshmukh */ -@Test(suiteName="Network/FirewallPolicy", enabled = false) +@Test(suiteName = "Network/FirewallPolicy", enabled = false) public class FirewallPolicyTests extends AbstractTest { - - private static final String FIREWALL_POLICY = "/network/firewalls/firewallpolicy.json"; - private static final String FIREWALL_POLICIES = "/network/firewalls/firewallpolicies.json"; - private static final String FIREWALL_POLICY_RULE = "/network/firewalls/firewallpolicyrule.json"; - private static final String FIREWALL_POLICY_UPDATE = "/network/firewalls/firewallpolicyupdate.json"; - - public void testListFirewallPolicies() throws IOException { - respondWith(FIREWALL_POLICIES); - List list = osv3().networking().firewalls().firewallpolicy().list(); - assertEquals(1, list.size()); - Preconditions.checkNotNull(list.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallPolicy from List : "+list.get(0)); - assertEquals(list.get(0).getId(), "c69933c1-b472-44f9-8226-30dc4ffd454c"); - } - - public void testGetFirewallPolicy() throws IOException { - respondWith(FIREWALL_POLICY); - String id = "c69933c1-b472-44f9-8226-30dc4ffd454c"; - FirewallPolicy firewallPolicy = osv3().networking().firewalls().firewallpolicy().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallPolicy by ID : "+firewallPolicy); - assertNotNull(firewallPolicy); - assertEquals(firewallPolicy.getId(), id); - - List firewallRules = firewallPolicy.getFirewallRuleIds(); - assertNotNull(firewallRules); - assertNotNull(firewallRules.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallRule from PolicyList : "+firewallRules.get(0)); - assertEquals(firewallRules.get(0), "8722e0e0-9cc9-4490-9660-8c9a5732fbb0"); - } - - public void testCreateFirewallPolicy() throws IOException { - respondWith(FIREWALL_POLICY); - FirewallPolicy create = Builders.firewallPolicy() - .name("Test-Firewall-Policy").description("Test-Firewall-Policy") - .shared(Boolean.TRUE).audited(Boolean.FALSE) - .tenantId("45977fa2dbd7482098dd68d0d8970117").build(); - FirewallPolicy result = osv3().networking().firewalls().firewallpolicy().create(create); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created FirewallPolicy : "+result); - - assertEquals(result.getName(), "Test-Firewall-Policy"); - assertEquals(result.getFirewallRuleIds().size(), 1); - } - - public void testUpdateFirewallPolicy() throws IOException { - respondWith(FIREWALL_POLICY_UPDATE); - FirewallPolicyUpdate update = Builders.firewallPolicyUpdate() - .name("Test-Firewall-Policy-Update").shared(Boolean.FALSE).audited(Boolean.FALSE) - .firewallRules(Arrays.asList("8722e0e0-9cc9-4490-9660-8c9a5732fbb0")) - .description("Test-Firewall-Policy-Update").build(); - - FirewallPolicy result = osv3().networking().firewalls().firewallpolicy().update("c69933c1-b472-44f9-8226-30dc4ffd454c", update); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated FirewallPolicy : "+result); - - assertEquals("Test-Firewall-Policy-Update", result.getDescription()); - } - - public void testInsertRuleInFirewallPolicy() throws IOException { - respondWith(FIREWALL_POLICY_RULE); - - FirewallPolicy result = osv3().networking().firewalls().firewallpolicy() - .insertFirewallRuleInPolicy( - "c69933c1-b472-44f9-8226-30dc4ffd454c", "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", - RuleInsertStrategyType.AFTER, "a08ef905-0ff6-4784-8374-175fffe7dade"); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Inserted Rule FirewallPolicy : "+result); - - assertEquals(result.getId(), "c69933c1-b472-44f9-8226-30dc4ffd454c"); - } - - public void testRemoveRuleFromFirewallPolicy() throws IOException { - respondWith(FIREWALL_POLICY_RULE); - - FirewallPolicy result = osv3().networking().firewalls().firewallpolicy() - .removeFirewallRuleFromPolicy("c69933c1-b472-44f9-8226-30dc4ffd454c", "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692"); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Rule Removed from FirewallPolicy : "+result); - - assertEquals(result.getId(), "c69933c1-b472-44f9-8226-30dc4ffd454c"); - } - - public void testDeleteFirewallPolicy() { - respondWith(200); - ActionResponse result = osv3().networking().firewalls().firewallpolicy().delete("c69933c1-b472-44f9-8226-30dc4ffd454c"); - assertTrue(result.isSuccess()); - } - - @Override - protected Service service() { - return Service.NETWORK; - } + + private static final String FIREWALL_POLICY = "/network/firewalls/firewallpolicy.json"; + private static final String FIREWALL_POLICIES = "/network/firewalls/firewallpolicies.json"; + private static final String FIREWALL_POLICY_RULE = "/network/firewalls/firewallpolicyrule.json"; + private static final String FIREWALL_POLICY_UPDATE = "/network/firewalls/firewallpolicyupdate.json"; + + public void testListFirewallPolicies() throws IOException { + respondWith(FIREWALL_POLICIES); + List list = osv3().networking().firewalls().firewallpolicy().list(); + assertEquals(1, list.size()); + Preconditions.checkNotNull(list.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallPolicy from List : " + list.get(0)); + assertEquals(list.get(0).getId(), "c69933c1-b472-44f9-8226-30dc4ffd454c"); + } + + public void testGetFirewallPolicy() throws IOException { + respondWith(FIREWALL_POLICY); + String id = "c69933c1-b472-44f9-8226-30dc4ffd454c"; + FirewallPolicy firewallPolicy = osv3().networking().firewalls().firewallpolicy().get(id); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallPolicy by ID : " + firewallPolicy); + assertNotNull(firewallPolicy); + assertEquals(firewallPolicy.getId(), id); + + List firewallRules = firewallPolicy.getFirewallRuleIds(); + assertNotNull(firewallRules); + assertNotNull(firewallRules.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallRule from PolicyList : " + firewallRules.get(0)); + assertEquals(firewallRules.get(0), "8722e0e0-9cc9-4490-9660-8c9a5732fbb0"); + } + + public void testCreateFirewallPolicy() throws IOException { + respondWith(FIREWALL_POLICY); + FirewallPolicy create = Builders.firewallPolicy() + .name("Test-Firewall-Policy").description("Test-Firewall-Policy") + .shared(Boolean.TRUE).audited(Boolean.FALSE) + .tenantId("45977fa2dbd7482098dd68d0d8970117").build(); + FirewallPolicy result = osv3().networking().firewalls().firewallpolicy().create(create); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created FirewallPolicy : " + result); + + assertEquals(result.getName(), "Test-Firewall-Policy"); + assertEquals(result.getFirewallRuleIds().size(), 1); + } + + public void testUpdateFirewallPolicy() throws IOException { + respondWith(FIREWALL_POLICY_UPDATE); + FirewallPolicyUpdate update = Builders.firewallPolicyUpdate() + .name("Test-Firewall-Policy-Update").shared(Boolean.FALSE).audited(Boolean.FALSE) + .firewallRules(Arrays.asList("8722e0e0-9cc9-4490-9660-8c9a5732fbb0")) + .description("Test-Firewall-Policy-Update").build(); + + FirewallPolicy result = osv3().networking().firewalls().firewallpolicy().update("c69933c1-b472-44f9-8226-30dc4ffd454c", update); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated FirewallPolicy : " + result); + + assertEquals("Test-Firewall-Policy-Update", result.getDescription()); + } + + public void testInsertRuleInFirewallPolicy() throws IOException { + respondWith(FIREWALL_POLICY_RULE); + + FirewallPolicy result = osv3().networking().firewalls().firewallpolicy() + .insertFirewallRuleInPolicy( + "c69933c1-b472-44f9-8226-30dc4ffd454c", "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", + RuleInsertStrategyType.AFTER, "a08ef905-0ff6-4784-8374-175fffe7dade"); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Inserted Rule FirewallPolicy : " + result); + + assertEquals(result.getId(), "c69933c1-b472-44f9-8226-30dc4ffd454c"); + } + + public void testRemoveRuleFromFirewallPolicy() throws IOException { + respondWith(FIREWALL_POLICY_RULE); + + FirewallPolicy result = osv3().networking().firewalls().firewallpolicy() + .removeFirewallRuleFromPolicy("c69933c1-b472-44f9-8226-30dc4ffd454c", "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692"); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Rule Removed from FirewallPolicy : " + result); + + assertEquals(result.getId(), "c69933c1-b472-44f9-8226-30dc4ffd454c"); + } + + public void testDeleteFirewallPolicy() { + respondWith(200); + ActionResponse result = osv3().networking().firewalls().firewallpolicy().delete("c69933c1-b472-44f9-8226-30dc4ffd454c"); + assertTrue(result.isSuccess()); + } + + @Override + protected Service service() { + return Service.NETWORK; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallRuleTests.java b/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallRuleTests.java index 4719a5311..4adac4df0 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallRuleTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallRuleTests.java @@ -1,13 +1,6 @@ package org.openstack4j.api.network.firewalls; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -19,77 +12,81 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronFirewallRule.IPProtocol; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; /** * Test suite for FirewallRule As a Service : FirewallRule Rule {@link FirewallRule} (FwaaS) - * + * * @author Vishvesh Deshmukh */ -@Test(suiteName="Network/FirewallRule", enabled = false) +@Test(suiteName = "Network/FirewallRule", enabled = false) public class FirewallRuleTests extends AbstractTest { - - private static final String FIREWALL_RULE = "/network/firewalls/firewallrule.json"; - private static final String FIREWALL_RULES = "/network/firewalls/firewallrules.json"; - private static final String FIREWALL_RULE_UPDATE = "/network/firewalls/firewallruleupdate.json"; - - public void testListFirewallRules() throws IOException { - respondWith(FIREWALL_RULES); - List list = osv3().networking().firewalls().firewallrule().list(); - assertEquals(1, list.size()); - Preconditions.checkNotNull(list.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallRule from List : "+list.get(0)); - assertEquals(list.get(0).getId(), "8722e0e0-9cc9-4490-9660-8c9a5732fbb0"); - } - - public void testGetFirewallRule() throws IOException { - respondWith(FIREWALL_RULE); - String id = "8722e0e0-9cc9-4490-9660-8c9a5732fbb0"; - FirewallRule firewallRule = osv3().networking().firewalls().firewallrule().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallRule by ID : "+firewallRule); - assertNotNull(firewallRule); - assertEquals(firewallRule.getId(), id); - assertEquals(firewallRule.getAction(), NeutronFirewallRule.FirewallRuleAction.ALLOW); - } - - public void testCreateFirewallRule() throws IOException { - respondWith(FIREWALL_RULE); - FirewallRule create = Builders.firewallRule() - .description("Sample-Description").name("Sample-Firewall-Rule-Create") - .shared(Boolean.TRUE).action(FirewallRuleAction.ALLOW) - .sourceIpAddress("50.0.0.5").destinationIpAddress("5.0.0.10") - .sourcePort("50").destinationPort("80").name("ALLOW_HTTP") - .enabled(Boolean.TRUE).protocol(IPProtocol.TCP).ipVersion(IPVersionType.V4) - .tenantId("45977fa2dbd7482098dd68d0d8970117").build(); - FirewallRule result = osv3().networking().firewalls().firewallrule().create(create); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created FirewallRule : "+result); - - assertEquals(result.getName(), "ALLOW_HTTP"); - assertEquals(result.getAction(), NeutronFirewallRule.FirewallRuleAction.ALLOW); - } - - public void testUpdateFirewallRule() throws IOException { - respondWith(FIREWALL_RULE_UPDATE); - FirewallRuleUpdate update = Builders.firewallRuleUpdate() - .shared(Boolean.FALSE).enabled(Boolean.FALSE) - .description("Test-Firewall-Update").build(); - - FirewallRule result = osv3().networking().firewalls().firewallrule().update("8722e0e0-9cc9-4490-9660-8c9a5732fbb0", update); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated FirewallRule : "+result); - - assertEquals("Sample-Firewall-Rule-Update", result.getDescription()); - assertEquals(result.getAction(), NeutronFirewallRule.FirewallRuleAction.DENY); - } - - public void testDeleteFirewallRule() { - respondWith(200); - ActionResponse result = osv3().networking().firewalls().firewallrule().delete("8722e0e0-9cc9-4490-9660-8c9a5732fbb0"); - assertTrue(result.isSuccess()); - } - @Override - protected Service service() { - return Service.NETWORK; - } + private static final String FIREWALL_RULE = "/network/firewalls/firewallrule.json"; + private static final String FIREWALL_RULES = "/network/firewalls/firewallrules.json"; + private static final String FIREWALL_RULE_UPDATE = "/network/firewalls/firewallruleupdate.json"; + + public void testListFirewallRules() throws IOException { + respondWith(FIREWALL_RULES); + List list = osv3().networking().firewalls().firewallrule().list(); + assertEquals(1, list.size()); + Preconditions.checkNotNull(list.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallRule from List : " + list.get(0)); + assertEquals(list.get(0).getId(), "8722e0e0-9cc9-4490-9660-8c9a5732fbb0"); + } + + public void testGetFirewallRule() throws IOException { + respondWith(FIREWALL_RULE); + String id = "8722e0e0-9cc9-4490-9660-8c9a5732fbb0"; + FirewallRule firewallRule = osv3().networking().firewalls().firewallrule().get(id); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : FirewallRule by ID : " + firewallRule); + assertNotNull(firewallRule); + assertEquals(firewallRule.getId(), id); + assertEquals(firewallRule.getAction(), NeutronFirewallRule.FirewallRuleAction.ALLOW); + } + + public void testCreateFirewallRule() throws IOException { + respondWith(FIREWALL_RULE); + FirewallRule create = Builders.firewallRule() + .description("Sample-Description").name("Sample-Firewall-Rule-Create") + .shared(Boolean.TRUE).action(FirewallRuleAction.ALLOW) + .sourceIpAddress("50.0.0.5").destinationIpAddress("5.0.0.10") + .sourcePort("50").destinationPort("80").name("ALLOW_HTTP") + .enabled(Boolean.TRUE).protocol(IPProtocol.TCP).ipVersion(IPVersionType.V4) + .tenantId("45977fa2dbd7482098dd68d0d8970117").build(); + FirewallRule result = osv3().networking().firewalls().firewallrule().create(create); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created FirewallRule : " + result); + + assertEquals(result.getName(), "ALLOW_HTTP"); + assertEquals(result.getAction(), NeutronFirewallRule.FirewallRuleAction.ALLOW); + } + + public void testUpdateFirewallRule() throws IOException { + respondWith(FIREWALL_RULE_UPDATE); + FirewallRuleUpdate update = Builders.firewallRuleUpdate() + .shared(Boolean.FALSE).enabled(Boolean.FALSE) + .description("Test-Firewall-Update").build(); + + FirewallRule result = osv3().networking().firewalls().firewallrule().update("8722e0e0-9cc9-4490-9660-8c9a5732fbb0", update); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated FirewallRule : " + result); + + assertEquals("Sample-Firewall-Rule-Update", result.getDescription()); + assertEquals(result.getAction(), NeutronFirewallRule.FirewallRuleAction.DENY); + } + + public void testDeleteFirewallRule() { + respondWith(200); + ActionResponse result = osv3().networking().firewalls().firewallrule().delete("8722e0e0-9cc9-4490-9660-8c9a5732fbb0"); + assertTrue(result.isSuccess()); + } + + @Override + protected Service service() { + return Service.NETWORK; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallTests.java b/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallTests.java index 1522c73ce..0a118bc9f 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/firewalls/FirewallTests.java @@ -1,14 +1,6 @@ package org.openstack4j.api.network.firewalls; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -17,73 +9,77 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronFirewall.FirewallStatus; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; /** * Test suite for Firewall As a Service : Firewall {@link Firewall} (FwaaS) - * + * * @author Vishvesh Deshmukh */ -@Test(suiteName="Network/Firewall", enabled = false) +@Test(suiteName = "Network/Firewall", enabled = false) public class FirewallTests extends AbstractTest { - - private static final String FIREWALL = "/network/firewalls/firewall.json"; - private static final String FIREWALLS = "/network/firewalls/firewalls.json"; - private static final String FIREWALL_UPDATE = "/network/firewalls/firewallupdate.json"; - - public void testListFirewalls() throws IOException { - respondWith(FIREWALLS); - List list = osv3().networking().firewalls().firewall().list(); - assertEquals(1, list.size()); - Preconditions.checkNotNull(list.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Firewall from List : "+list.get(0)); - assertEquals(list.get(0).getId(), "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977"); - } - - public void testGetFirewall() throws IOException { - respondWith(FIREWALL); - String id = "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977"; - Firewall firewall = osv3().networking().firewalls().firewall().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Firewall by ID : "+firewall); - assertNotNull(firewall); - assertEquals(id, firewall.getId()); - assertEquals(FirewallStatus.ACTIVE, firewall.getStatus()); - } - - public void testCreateFirewall() throws IOException { - respondWith(FIREWALL); - Firewall create = Builders.firewall().adminStateUp(true) - .description("Sample-Description").name("Sample-Firewall") - .policy("c69933c1-b472-44f9-8226-30dc4ffd454c").shared(true) - .tenantId("45977fa2dbd7482098dd68d0d8970117").build(); - Firewall result = osv3().networking().firewalls().firewall().create(create); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Firewall : "+result); - - assertEquals("Sample-Firewall", result.getName()); - assertEquals(Boolean.TRUE, result.isAdminStateUp()); - } - - public void testUpdateFirewall() throws IOException { - respondWith(FIREWALL_UPDATE); - FirewallUpdate update = Builders.firewallUpdate().adminStateUp(false) - .description("Test-Firewall-Update").build(); - - Firewall result = osv3().networking().firewalls().firewall().update("3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", update); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Firewall : "+result); - - assertEquals("Test-Firewall-Update", result.getDescription()); - assertFalse(result.isAdminStateUp()); - } - - public void testDeleteFirewall() { - respondWith(200); - ActionResponse result = osv3().networking().firewalls().firewall().delete("3b0ef8f4-82c7-44d4-a4fb-6177f9a21977"); - assertTrue(result.isSuccess()); - } - @Override - protected Service service() { - return Service.NETWORK; - } + private static final String FIREWALL = "/network/firewalls/firewall.json"; + private static final String FIREWALLS = "/network/firewalls/firewalls.json"; + private static final String FIREWALL_UPDATE = "/network/firewalls/firewallupdate.json"; + + public void testListFirewalls() throws IOException { + respondWith(FIREWALLS); + List list = osv3().networking().firewalls().firewall().list(); + assertEquals(1, list.size()); + Preconditions.checkNotNull(list.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Firewall from List : " + list.get(0)); + assertEquals(list.get(0).getId(), "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977"); + } + + public void testGetFirewall() throws IOException { + respondWith(FIREWALL); + String id = "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977"; + Firewall firewall = osv3().networking().firewalls().firewall().get(id); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Firewall by ID : " + firewall); + assertNotNull(firewall); + assertEquals(id, firewall.getId()); + assertEquals(FirewallStatus.ACTIVE, firewall.getStatus()); + } + + public void testCreateFirewall() throws IOException { + respondWith(FIREWALL); + Firewall create = Builders.firewall().adminStateUp(true) + .description("Sample-Description").name("Sample-Firewall") + .policy("c69933c1-b472-44f9-8226-30dc4ffd454c").shared(true) + .tenantId("45977fa2dbd7482098dd68d0d8970117").build(); + Firewall result = osv3().networking().firewalls().firewall().create(create); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Firewall : " + result); + + assertEquals("Sample-Firewall", result.getName()); + assertEquals(Boolean.TRUE, result.isAdminStateUp()); + } + + public void testUpdateFirewall() throws IOException { + respondWith(FIREWALL_UPDATE); + FirewallUpdate update = Builders.firewallUpdate().adminStateUp(false) + .description("Test-Firewall-Update").build(); + + Firewall result = osv3().networking().firewalls().firewall().update("3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", update); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Firewall : " + result); + + assertEquals("Test-Firewall-Update", result.getDescription()); + assertFalse(result.isAdminStateUp()); + } + + public void testDeleteFirewall() { + respondWith(200); + ActionResponse result = osv3().networking().firewalls().firewall().delete("3b0ef8f4-82c7-44d4-a4fb-6177f9a21977"); + assertTrue(result.isSuccess()); + } + + @Override + protected Service service() { + return Service.NETWORK; + } } diff --git a/core-test/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Tests.java b/core-test/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Tests.java index ccc0779f5..5ebbead61 100644 --- a/core-test/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Tests.java @@ -13,16 +13,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** - * * @author wei - * */ -@Test(suiteName="Octavia/healthMonitor", enabled = true) +@Test(suiteName = "Octavia/healthMonitor", enabled = true) public class HealthMonitorV2Tests extends AbstractTest { private static final String HEALTHMONITORSV2_JSON = "/octavia/healthmonitorsv2.json"; private static final String HEALTHMONITORV2_JSON = "/octavia/healthmonitorv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/octavia/LbPoolV2Tests.java b/core-test/src/main/java/org/openstack4j/api/octavia/LbPoolV2Tests.java index ef02bec2f..6840bf208 100644 --- a/core-test/src/main/java/org/openstack4j/api/octavia/LbPoolV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/octavia/LbPoolV2Tests.java @@ -14,17 +14,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** - * * @author wei - * */ -@Test(suiteName="Octavia/lbpoolv2", enabled=true) +@Test(suiteName = "Octavia/lbpoolv2", enabled = true) public class LbPoolV2Tests extends AbstractTest { private static final String LBPOOLSV2_JSON = "/octavia/lbpoolsv2.json"; private static final String LBPOOLV2_JSON = "/octavia/lbpoolv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/octavia/ListenerV2Tests.java b/core-test/src/main/java/org/openstack4j/api/octavia/ListenerV2Tests.java index 396a9181e..4b60d2c9e 100644 --- a/core-test/src/main/java/org/openstack4j/api/octavia/ListenerV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/octavia/ListenerV2Tests.java @@ -4,9 +4,9 @@ import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.octavia.ListenerProtocol; import org.openstack4j.model.octavia.ListenerV2; import org.openstack4j.model.octavia.ListenerV2Update; -import org.openstack4j.model.octavia.ListenerProtocol; import org.testng.annotations.Test; import java.io.IOException; @@ -14,17 +14,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** - * * @author wei - * */ -@Test(suiteName="Octavia/listener", enabled = true) +@Test(suiteName = "Octavia/listener", enabled = true) public class ListenerV2Tests extends AbstractTest { private static final String LISTENERSV2_JSON = "/octavia/listenersv2.json"; private static final String LISTENERV2_JSON = "/octavia/listenerv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Tests.java b/core-test/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Tests.java index bbd961d64..b8423cbf0 100644 --- a/core-test/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Tests.java @@ -15,17 +15,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertFalse; +import static org.testng.Assert.*; /** - * * @author wei - * */ -@Test(suiteName="Octavia/loadBalancerV2", enabled = true) +@Test(suiteName = "Octavia/loadBalancerV2", enabled = true) public class LoadBalancerV2Tests extends AbstractTest { private static final String LOADBALANCERSV2_JSON = "/octavia/loadbalancersv2.json"; private static final String LOADBALANCERV2_JSON = "/octavia/loadbalancerv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/octavia/MemberV2Tests.java b/core-test/src/main/java/org/openstack4j/api/octavia/MemberV2Tests.java index 6b3a451f9..a8e34140d 100644 --- a/core-test/src/main/java/org/openstack4j/api/octavia/MemberV2Tests.java +++ b/core-test/src/main/java/org/openstack4j/api/octavia/MemberV2Tests.java @@ -1,4 +1,5 @@ package org.openstack4j.api.octavia; + import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -11,17 +12,12 @@ import java.util.List; import java.util.Map; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertFalse; +import static org.testng.Assert.*; /** - * * @author wei - * */ -@Test(suiteName="Octavia/memberV2", enabled = true) +@Test(suiteName = "Octavia/memberV2", enabled = true) public class MemberV2Tests extends AbstractTest { private static final String MEMBERSV2_JSON = "/octavia/membersv2.json"; private static final String MEMBERV2_JSON = "/octavia/memberv2.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/sahara/ClusterTests.java b/core-test/src/main/java/org/openstack4j/api/sahara/ClusterTests.java index af2047186..ef871e3fc 100644 --- a/core-test/src/main/java/org/openstack4j/api/sahara/ClusterTests.java +++ b/core-test/src/main/java/org/openstack4j/api/sahara/ClusterTests.java @@ -1,25 +1,22 @@ package org.openstack4j.api.sahara; +import okhttp3.mockwebserver.RecordedRequest; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.api.Builders; import org.openstack4j.model.sahara.Cluster; import org.openstack4j.model.sahara.NodeGroup; import org.openstack4j.model.sahara.ServiceConfig; +import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; -import org.openstack4j.api.AbstractTest; -import org.openstack4j.api.Builders; -import org.testng.Assert; -import org.testng.annotations.Test; - -import okhttp3.mockwebserver.RecordedRequest; - /** * Test cases for Server based Services - * + * * @author Ekasit Kijsipongse */ -@Test(suiteName="Sahara/Cluster") +@Test(suiteName = "Sahara/Cluster") public class ClusterTests extends AbstractTest { private static final String JSON_CLUSTER_CREATE_REQUEST = "/sahara/cluster_create_req.json"; @@ -31,36 +28,36 @@ public void createCluster() throws Exception { // Create a new cluster from node group template NodeGroup workerGroup = Builders.nodeGroup().name("worker") - .count(2) - .flavor("ef7f4d7f-267f-4762-abe2-729fe350256c") - .nodeGroupTemplateId("f78dda4d-17e1-48cd-ab85-ee56261382ef") - .build(); + .count(2) + .flavor("ef7f4d7f-267f-4762-abe2-729fe350256c") + .nodeGroupTemplateId("f78dda4d-17e1-48cd-ab85-ee56261382ef") + .build(); NodeGroup masterGroup = Builders.nodeGroup().name("master") - .count(1) - .flavor("ef7f4d7f-267f-4762-abe2-729fe350256c") - .nodeGroupTemplateId("0febf422-98ee-47e6-a1c5-60f90f1f9c96") - .build(); + .count(1) + .flavor("ef7f4d7f-267f-4762-abe2-729fe350256c") + .nodeGroupTemplateId("0febf422-98ee-47e6-a1c5-60f90f1f9c96") + .build(); ServiceConfig hdfsConf = Builders.serviceConfig() - .set("dfs.replication",1) - .build(); + .set("dfs.replication", 1) + .build(); ServiceConfig sparkConf = Builders.serviceConfig() - .set("spark.executor.memory","1g") - .set("spark.executor.cores",2) - .build(); + .set("spark.executor.memory", "1g") + .set("spark.executor.cores", 2) + .build(); Cluster cluster = Builders.cluster().name("cluster-test-1") - .hadoopVersion("1.6.2") - .pluginName("spark") - .image("f56cc7c5-9588-49fa-8bcd-5c5d5eda5466") - .keypairName("tester") - .managementNetworkId("4c065f9c-ad1b-43c4-ba1e-893d330da079") - .addNodeGroup(workerGroup) - .addNodeGroup(masterGroup) - .addServiceConfig("HDFS",hdfsConf) - .addServiceConfig("Spark",sparkConf) - .build(); + .hadoopVersion("1.6.2") + .pluginName("spark") + .image("f56cc7c5-9588-49fa-8bcd-5c5d5eda5466") + .keypairName("tester") + .managementNetworkId("4c065f9c-ad1b-43c4-ba1e-893d330da079") + .addNodeGroup(workerGroup) + .addNodeGroup(masterGroup) + .addServiceConfig("HDFS", hdfsConf) + .addServiceConfig("Spark", sparkConf) + .build(); cluster = osv2().sahara().clusters().create(cluster); @@ -91,5 +88,4 @@ protected Service service() { } - } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ActionServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ActionServiceTest.java index 6bde62bdd..6e2d07c6c 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ActionServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ActionServiceTest.java @@ -16,31 +16,33 @@ * * @author lion */ -@Test(suiteName="senlin/action") +@Test(suiteName = "senlin/action") public class ActionServiceTest extends AbstractTest { - private static final String ACTIONS="/senlin/v1/actions.json"; - private static final String ACTION="/senlin/v1/action.json"; + private static final String ACTIONS = "/senlin/v1/actions.json"; + private static final String ACTION = "/senlin/v1/action.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListAction() throws Exception{ + public void testListAction() throws Exception { respondWith(ACTIONS); List actionList = osv3().senlin().action().list(); assertEquals(4, actionList.size()); Preconditions.checkNotNull(actionList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Action from List : "+ actionList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Action from List : " + actionList.get(0)); assertEquals(actionList.get(0).getId(), "1ac0a47b-06de-44cd-a014-79981f1dec19"); } + @Test - public void testGetAction() throws Exception{ + public void testGetAction() throws Exception { respondWith(ACTION); String actionID = "ffbb9175-d510-4bc1-b676-c6aba2a4ca81"; Action action = osv3().senlin().action().get(actionID); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Action by ID : "+ action); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Action by ID : " + action); assertNotNull(action); assertEquals(actionID, action.getId()); } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/BuildInfoServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/BuildInfoServiceTest.java index 77818291a..a5615baef 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/BuildInfoServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/BuildInfoServiceTest.java @@ -13,20 +13,21 @@ * * @author lion */ -@Test(suiteName="senlin/buildInfo") +@Test(suiteName = "senlin/buildInfo") public class BuildInfoServiceTest extends AbstractTest { - private static final String BUILDINFO="/senlin/v1/build_info.json"; + private static final String BUILDINFO = "/senlin/v1/build_info.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testGetAction() throws Exception{ + public void testGetAction() throws Exception { respondWith(BUILDINFO); BuildInfo buildInfo = osv3().senlin().buildInfo().get(); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : BuildInfo : "+ buildInfo); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : BuildInfo : " + buildInfo); assertNotNull(buildInfo); } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterPolicyServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterPolicyServiceTest.java index 008771a7d..c53c08e4d 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterPolicyServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterPolicyServiceTest.java @@ -16,32 +16,34 @@ * * @author lion */ -@Test(suiteName="senlin/clusterPolicy") +@Test(suiteName = "senlin/clusterPolicy") public class ClusterPolicyServiceTest extends AbstractTest { - private static final String CLUSTERPOLICYS="/senlin/v1/cluster_policies.json"; - private static final String CLUSTERPOLICY="/senlin/v1/cluster_policy.json"; + private static final String CLUSTERPOLICYS = "/senlin/v1/cluster_policies.json"; + private static final String CLUSTERPOLICY = "/senlin/v1/cluster_policy.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListClusterPolicy() throws Exception{ + public void testListClusterPolicy() throws Exception { respondWith(CLUSTERPOLICYS); List clusterPolicyList = osv3().senlin().clusterPolicy().list("7d85f602-a948-4a30-afd4-e84f47471c15"); assertEquals(2, clusterPolicyList.size()); Preconditions.checkNotNull(clusterPolicyList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ClusterPolicy from List : "+ clusterPolicyList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ClusterPolicy from List : " + clusterPolicyList.get(0)); assertEquals(clusterPolicyList.get(0).getId(), "06be3a1f-b238-4a96-a737-ceec5714087e"); } + @Test - public void testGetClusterPolicy() throws Exception{ + public void testGetClusterPolicy() throws Exception { respondWith(CLUSTERPOLICY); String clusterID = "7d85f602-a948-4a30-afd4-e84f47471c15"; String policyID = "714fe676-a08f-4196-b7af-61d52eeded15"; ClusterPolicy clusterPolicy = osv3().senlin().clusterPolicy().get(clusterID, policyID); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ClusterPolicy by ID : "+ clusterPolicy); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ClusterPolicy by ID : " + clusterPolicy); assertNotNull(clusterPolicy); assertEquals("06be3a1f-b238-4a96-a737-ceec5714087e", clusterPolicy.getId()); } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterServiceTest.java index 7219ee72c..f804b0b74 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ClusterServiceTest.java @@ -15,46 +15,47 @@ import java.util.List; import java.util.logging.Logger; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * Test cases for cluster on Senlin * * @author lion */ -@Test(suiteName="senlin/cluster") +@Test(suiteName = "senlin/cluster") public class ClusterServiceTest extends AbstractTest { - private static final String CLUSTERS="/senlin/v1/clusters.json"; - private static final String CLUSTER="/senlin/v1/cluster.json"; - private static final String RASPACTION="/senlin/v1/resp_action.json"; - private static final String ID="45edadcb-c73b-4920-87e1-518b2f29f54b"; + private static final String CLUSTERS = "/senlin/v1/clusters.json"; + private static final String CLUSTER = "/senlin/v1/cluster.json"; + private static final String RASPACTION = "/senlin/v1/resp_action.json"; + private static final String ID = "45edadcb-c73b-4920-87e1-518b2f29f54b"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListCluster() throws Exception{ + public void testListCluster() throws Exception { respondWith(CLUSTERS); List clusterList = osv3().senlin().cluster().list(); assertEquals(4, clusterList.size()); Preconditions.checkNotNull(clusterList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Cluster from List : "+clusterList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Cluster from List : " + clusterList.get(0)); assertEquals(clusterList.get(0).getId(), "7e0c9843-54bf-4823-b545-d2f6ffb4ed25"); } + @Test - public void testGetCluster() throws Exception{ + public void testGetCluster() throws Exception { respondWith(CLUSTER); Cluster cluster = osv3().senlin().cluster().get(ID); Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Cluster by ID : " + cluster); assertNotNull(cluster); assertEquals(ID, cluster.getId()); } + @Test - public void testCreateCluster() throws Exception{ + public void testCreateCluster() throws Exception { respondWith(CLUSTER); String clusterName = "test_cluster"; ClusterCreate newCluster = new SenlinClusterCreate(); @@ -64,8 +65,9 @@ public void testCreateCluster() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Cluster : " + cluster); assertEquals(clusterName, cluster.getName()); } + @Test - public void testUpdateCluster() throws Exception{ + public void testUpdateCluster() throws Exception { respondWith(CLUSTER); String clusterName = "test_cluster"; ClusterCreate newCluster = new SenlinClusterCreate(); @@ -77,14 +79,16 @@ public void testUpdateCluster() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Cluster : " + cluster); assertEquals(clusterName, cluster.getName()); } + @Test public void testDeleteCluster() { respondWith(200); ActionResponse result = osv3().senlin().cluster().delete(ID); assertTrue(result.isSuccess()); } + @Test - public void testNodeAction() throws Exception{ + public void testNodeAction() throws Exception { respondWith(RASPACTION); ClusterActionCreate newClusterAction = new SenlinClusterActionCreate(); newClusterAction.toBuilder().check(new HashMap()); diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/EventServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/EventServiceTest.java index ad9b78499..281e46ab9 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/EventServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/EventServiceTest.java @@ -16,31 +16,33 @@ * * @author lion */ -@Test(suiteName="senlin/event") +@Test(suiteName = "senlin/event") public class EventServiceTest extends AbstractTest { - private static final String EVENTS="/senlin/v1/events.json"; - private static final String EVENT="/senlin/v1/event.json"; + private static final String EVENTS = "/senlin/v1/events.json"; + private static final String EVENT = "/senlin/v1/event.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListEvent() throws Exception{ + public void testListEvent() throws Exception { respondWith(EVENTS); List eventList = osv3().senlin().event().list(); assertEquals(4, eventList.size()); Preconditions.checkNotNull(eventList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Event from List : "+ eventList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Event from List : " + eventList.get(0)); assertEquals(eventList.get(0).getId(), "b6d7b823-1811-492b-8a54-fb15a5a0bafe"); } + @Test - public void testGetEvent() throws Exception{ + public void testGetEvent() throws Exception { respondWith(EVENT); String enentID = "2d255b9c-8f36-41a2-a137-c0175ccc29c3"; Event event = osv3().senlin().event().get(enentID); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Event by ID : "+ event); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Event by ID : " + event); assertNotNull(event); assertEquals(enentID, event.getId()); } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/NodeServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/NodeServiceTest.java index d2fbc7b2c..872acc89b 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/NodeServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/NodeServiceTest.java @@ -15,46 +15,47 @@ import java.util.List; import java.util.logging.Logger; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * Test cases for node on Senlin * * @author lion */ -@Test(suiteName="senlin/node") +@Test(suiteName = "senlin/node") public class NodeServiceTest extends AbstractTest { - private static final String NODES="/senlin/v1/nodes.json"; - private static final String NODE="/senlin/v1/node.json"; - private static final String RASPACTION="/senlin/v1/resp_action.json"; - private static final String ID="d5779bb0-f0a0-49c9-88cc-6f078adb5a0b"; + private static final String NODES = "/senlin/v1/nodes.json"; + private static final String NODE = "/senlin/v1/node.json"; + private static final String RASPACTION = "/senlin/v1/resp_action.json"; + private static final String ID = "d5779bb0-f0a0-49c9-88cc-6f078adb5a0b"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListNode() throws Exception{ + public void testListNode() throws Exception { respondWith(NODES); List nodeList = osv3().senlin().node().list(); assertEquals(3, nodeList.size()); Preconditions.checkNotNull(nodeList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Node from List : "+nodeList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Node from List : " + nodeList.get(0)); assertEquals(nodeList.get(0).getId(), "d3451489-708b-4bd0-a147-a0c02dd9cb00"); } + @Test - public void testGetNode() throws Exception{ + public void testGetNode() throws Exception { respondWith(NODE); Node node = osv3().senlin().node().get(ID); Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Node by ID : " + node); assertNotNull(node); assertEquals(ID, node.getId()); } + @Test - public void testCreateNode() throws Exception{ + public void testCreateNode() throws Exception { respondWith(NODE); String nodeName = "node1"; NodeCreate newNode = new SenlinNodeCreate(); @@ -64,8 +65,9 @@ public void testCreateNode() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Node : " + node); assertEquals(nodeName, node.getName()); } + @Test - public void testUpdateNode() throws Exception{ + public void testUpdateNode() throws Exception { respondWith(NODE); String nodeName = "node1"; NodeCreate newNode = new SenlinNodeCreate(); @@ -75,14 +77,16 @@ public void testUpdateNode() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Node : " + node); assertEquals(nodeName, node.getName()); } + @Test public void testDeleteNode() { respondWith(200); ActionResponse result = osv3().senlin().node().delete(ID); assertTrue(result.isSuccess()); } + @Test - public void testNodeAction() throws Exception{ + public void testNodeAction() throws Exception { respondWith(RASPACTION); NodeActionCreate newNodeAction = new SenlinNodeActionCreate(); newNodeAction.toBuilder().check(new HashMap()); diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyServiceTest.java index 3a08e5c4d..eda734a13 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyServiceTest.java @@ -11,45 +11,46 @@ import java.util.List; import java.util.logging.Logger; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * Test cases for policy on Senlin * * @author lion */ -@Test(suiteName="senlin/policy") +@Test(suiteName = "senlin/policy") public class PolicyServiceTest extends AbstractTest { - private static final String POLICYS="/senlin/v1/policies.json"; - private static final String POLICY="/senlin/v1/policy.json"; - + private static final String POLICYS = "/senlin/v1/policies.json"; + private static final String POLICY = "/senlin/v1/policy.json"; + @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListPolicy() throws Exception{ + public void testListPolicy() throws Exception { respondWith(POLICYS); List policyList = osv3().senlin().policy().list(); assertEquals(9, policyList.size()); Preconditions.checkNotNull(policyList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy from List : "+policyList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy from List : " + policyList.get(0)); assertEquals(policyList.get(0).getId(), "be24729e-c60c-4f06-9ba4-2d3872c23199"); } + @Test - public void testGetPolicy() throws Exception{ + public void testGetPolicy() throws Exception { respondWith(POLICY); String id = "3ad6a92c-f969-4d69-8a83-0301f319fc78"; Policy policy = osv3().senlin().policy().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy by ID : "+ policy); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Policy by ID : " + policy); assertNotNull(policy); assertEquals(id, policy.getId()); } + @Test - public void testCreatePolicy() throws Exception{ + public void testCreatePolicy() throws Exception { respondWith(POLICY); String policyName = "lion-policy123"; PolicyCreate newPolicy = new SenlinPolicyCreate(); @@ -59,19 +60,21 @@ public void testCreatePolicy() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Policy : " + policy); assertEquals(policyName, policy.getName()); } + @Test - public void testUpdatePolicy() throws Exception{ + public void testUpdatePolicy() throws Exception { respondWith(POLICY); String id = "3ad6a92c-f969-4d69-8a83-0301f319fc78"; String policyName = "lion-policy123"; PolicyCreate newPolicy = new SenlinPolicyCreate(); newPolicy.toBuilder() .name(policyName); - Policy policy =osv3().senlin().policy().update(id, newPolicy); + Policy policy = osv3().senlin().policy().update(id, newPolicy); Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Policy : " + policy); assertEquals(policyName, policy.getName()); } + @Test public void testDeletePolicy() { respondWith(200); @@ -80,6 +83,5 @@ public void testDeletePolicy() { assertTrue(result.isSuccess()); } - } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyTypeServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyTypeServiceTest.java index 4d0122a09..974a58823 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyTypeServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/PolicyTypeServiceTest.java @@ -16,30 +16,32 @@ * * @author lion */ -@Test(suiteName="senlin/policyType") +@Test(suiteName = "senlin/policyType") public class PolicyTypeServiceTest extends AbstractTest { - private static final String POLICYTYPES="/senlin/v1/policy_types.json"; - private static final String POLICYTYPE="/senlin/v1/policy_type.json"; + private static final String POLICYTYPES = "/senlin/v1/policy_types.json"; + private static final String POLICYTYPE = "/senlin/v1/policy_type.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListPolicyType() throws Exception{ + public void testListPolicyType() throws Exception { respondWith(POLICYTYPES); List policyTypeList = osv3().senlin().policyType().list(); assertEquals(6, policyTypeList.size()); Preconditions.checkNotNull(policyTypeList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : PolicyType from List : "+ policyTypeList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : PolicyType from List : " + policyTypeList.get(0)); assertEquals(policyTypeList.get(0).getName(), "ScalingPolicy"); } + @Test - public void testGetPolicyType() throws Exception{ + public void testGetPolicyType() throws Exception { respondWith(POLICYTYPE); PolicyType policyType = osv3().senlin().policyType().get("senlin.policy.deletion"); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : PolicyType by name : "+ policyType); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : PolicyType by name : " + policyType); assertNotNull(policyType); assertEquals("senlin.policy.deletion", policyType.getName()); } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileServiceTest.java index 913ceee96..e7ed795f4 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileServiceTest.java @@ -11,45 +11,46 @@ import java.util.List; import java.util.logging.Logger; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * Test cases for profile on Senlin * * @author lion */ -@Test(suiteName="senlin/profile") +@Test(suiteName = "senlin/profile") public class ProfileServiceTest extends AbstractTest { - private static final String PROFILES="/senlin/v1/profiles.json"; - private static final String PROFILE="/senlin/v1/profile.json"; - private static final String ID="dc89e919-91f5-4733-81b0-91257c24bba1"; + private static final String PROFILES = "/senlin/v1/profiles.json"; + private static final String PROFILE = "/senlin/v1/profile.json"; + private static final String ID = "dc89e919-91f5-4733-81b0-91257c24bba1"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListProfile() throws Exception{ + public void testListProfile() throws Exception { respondWith(PROFILES); List profileList = osv3().senlin().profile().list(); assertEquals(4, profileList.size()); Preconditions.checkNotNull(profileList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Profile from List : "+profileList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Profile from List : " + profileList.get(0)); assertEquals(profileList.get(0).getId(), "ddf94acb-492a-41cb-a278-9ba7fbb31bb7"); } + @Test - public void testGetProfile() throws Exception{ + public void testGetProfile() throws Exception { respondWith(PROFILE); Profile profile = osv3().senlin().profile().get(ID); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Profile by ID : "+ profile); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Profile by ID : " + profile); assertNotNull(profile); assertEquals(ID, profile.getId()); } + @Test - public void testCreateProfile() throws Exception{ + public void testCreateProfile() throws Exception { respondWith(PROFILE); String profileName = "lion-test"; ProfileCreate newProfile = new SenlinProfileCreate(); @@ -59,18 +60,20 @@ public void testCreateProfile() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Profile : " + profile); assertEquals(profileName, profile.getName()); } + @Test - public void testUpdateProfile() throws Exception{ + public void testUpdateProfile() throws Exception { respondWith(PROFILE); String profileName = "lion-test"; ProfileCreate newProfile = new SenlinProfileCreate(); newProfile.toBuilder() .name(profileName); - Profile profile =osv3().senlin().profile().update(ID, newProfile); + Profile profile = osv3().senlin().profile().update(ID, newProfile); Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Updated Profile : " + profile); assertEquals(profileName, profile.getName()); } + @Test public void testDeleteProfile() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileTypeServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileTypeServiceTest.java index 2665e2241..4332fdc72 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileTypeServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ProfileTypeServiceTest.java @@ -16,30 +16,32 @@ * * @author lion */ -@Test(suiteName="senlin/profileType") +@Test(suiteName = "senlin/profileType") public class ProfileTypeServiceTest extends AbstractTest { - private static final String PROFILETYPES="/senlin/v1/profile_types.json"; - private static final String PROFILETYPE="/senlin/v1/profile_type.json"; + private static final String PROFILETYPES = "/senlin/v1/profile_types.json"; + private static final String PROFILETYPE = "/senlin/v1/profile_type.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListProfileType() throws Exception{ + public void testListProfileType() throws Exception { respondWith(PROFILETYPES); List profileTypeList = osv3().senlin().profileType().list(); assertEquals(3, profileTypeList.size()); Preconditions.checkNotNull(profileTypeList.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ProfileType from List : "+ profileTypeList.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ProfileType from List : " + profileTypeList.get(0)); assertEquals(profileTypeList.get(0).getName(), "os.heat.stack"); } + @Test - public void testGetProfileType() throws Exception{ + public void testGetProfileType() throws Exception { respondWith(PROFILETYPE); ProfileType profileType = osv3().senlin().profileType().get("os.heat.stack"); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ProfileType by name : "+ profileType); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : ProfileType by name : " + profileType); assertNotNull(profileType); assertEquals("os.heat.stack", profileType.getName()); } diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ReceiverServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ReceiverServiceTest.java index d2784d8b3..4a9333ce3 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/ReceiverServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/ReceiverServiceTest.java @@ -11,28 +11,27 @@ import java.util.List; import java.util.logging.Logger; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; /** * Test cases for receiver on Senlin * * @author lion */ -@Test(suiteName="senlin/receiver") +@Test(suiteName = "senlin/receiver") public class ReceiverServiceTest extends AbstractTest { - private static final String RECEIVERS="/senlin/v1/receivers.json"; - private static final String RECEIVER="/senlin/v1/receiver.json"; - private static final String ID="573aa1ba-bf45-49fd-907d-6b5d6e6adfd3"; + private static final String RECEIVERS = "/senlin/v1/receivers.json"; + private static final String RECEIVER = "/senlin/v1/receiver.json"; + private static final String ID = "573aa1ba-bf45-49fd-907d-6b5d6e6adfd3"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListReceiver() throws Exception{ + public void testListReceiver() throws Exception { respondWith(RECEIVERS); List receiverList = osv3().senlin().receiver().list(); assertEquals(5, receiverList.size()); @@ -40,16 +39,18 @@ public void testListReceiver() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Receiver from List : " + receiverList.get(0)); assertEquals(receiverList.get(0).getId(), "05f72ca7-d0cd-4e9c-9f84-caec408e7580"); } + @Test - public void testGetReceiver() throws Exception{ + public void testGetReceiver() throws Exception { respondWith(RECEIVER); Receiver receiver = osv3().senlin().receiver().get(ID); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Receiver by ID : "+ receiver); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Receiver by ID : " + receiver); assertNotNull(receiver); assertEquals(ID, receiver.getId()); } + @Test - public void testCreateReceiver() throws Exception{ + public void testCreateReceiver() throws Exception { respondWith(RECEIVER); String receiverName = "cluster_inflate"; ReceiverCreate newReceiver = new SenlinReceiverCreate(); @@ -59,6 +60,7 @@ public void testCreateReceiver() throws Exception{ Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Receiver : " + receiver); assertEquals(receiverName, receiver.getName()); } + @Test public void testDeleteReceiver() { respondWith(200); diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/VersionServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/VersionServiceTest.java index f53061a58..de03ca67b 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/VersionServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/VersionServiceTest.java @@ -15,17 +15,18 @@ * * @author lion */ -@Test(suiteName="senlin/version") +@Test(suiteName = "senlin/version") public class VersionServiceTest extends AbstractTest { - private static final String VERSIONS="/senlin/version.json"; + private static final String VERSIONS = "/senlin/version.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testListVersion() throws Exception{ + public void testListVersion() throws Exception { respondWith(VERSIONS); List versionList = osv3().senlin().version().list(); assertEquals(1, versionList.size()); diff --git a/core-test/src/main/java/org/openstack4j/api/senlin/v1/WebHookServiceTest.java b/core-test/src/main/java/org/openstack4j/api/senlin/v1/WebHookServiceTest.java index 6fdd1d723..069c0a723 100644 --- a/core-test/src/main/java/org/openstack4j/api/senlin/v1/WebHookServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/senlin/v1/WebHookServiceTest.java @@ -8,22 +8,24 @@ import java.util.logging.Logger; import static org.testng.Assert.assertEquals; + /** * Test cases for webhook on Senlin * * @author lion */ -@Test(suiteName="senlin/webhook") +@Test(suiteName = "senlin/webhook") public class WebHookServiceTest extends AbstractTest { - private static final String RASPACTION="/senlin/v1/resp_action.json"; + private static final String RASPACTION = "/senlin/v1/resp_action.json"; @Override protected Service service() { return Service.CLUSTERING; } + @Test - public void testWebHook() throws Exception{ + public void testWebHook() throws Exception { respondWith(RASPACTION); ActionID respAction = osv3().senlin().webHook().action("http://127.0.0.1:8778/v1/webhooks/51575fae-a83c-44ac-9214-337663dd04f9/trigger?V=1&count=1"); Preconditions.checkNotNull(respAction); diff --git a/core-test/src/main/java/org/openstack4j/api/storage/ObjectStorageTests.java b/core-test/src/main/java/org/openstack4j/api/storage/ObjectStorageTests.java index 1504022ed..526050fe7 100644 --- a/core-test/src/main/java/org/openstack4j/api/storage/ObjectStorageTests.java +++ b/core-test/src/main/java/org/openstack4j/api/storage/ObjectStorageTests.java @@ -1,28 +1,25 @@ package org.openstack4j.api.storage; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTAINER_METADATA_PREFIX; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTENT_LENGTH; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTENT_TYPE; -import static org.openstack4j.model.storage.object.SwiftHeaders.ETAG; -import static org.testng.Assert.*; - -import java.util.List; -import java.util.Map; - +import com.google.common.collect.Maps; import org.openstack4j.api.AbstractTest; import org.openstack4j.model.storage.object.SwiftContainer; import org.openstack4j.model.storage.object.SwiftObject; import org.testng.annotations.Test; -import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; + +import static org.openstack4j.model.storage.object.SwiftHeaders.*; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; -@Test(suiteName="Object Storage Tests") +@Test(suiteName = "Object Storage Tests") public class ObjectStorageTests extends AbstractTest { private static final String JSON_CONTAINERS = "/storage/containers.json"; private static final String NAME_BOOK = "Book"; private static final String NAME_YEAR = "Year"; - + @Override protected Service service() { return Service.OBJECT_STORAGE; @@ -30,27 +27,27 @@ protected Service service() { public void containerListingTest() throws Exception { respondWith(JSON_CONTAINERS); - + List containers = osv3().objectStorage().containers().list(); assertEquals(2, containers.size()); assertEquals(containers.get(0).getTotalSize(), 100); assertEquals(containers.get(0).getName(), "Test"); assertEquals(containers.get(1).getName(), "marktwain"); } - + public void containerMetadataTest() throws Exception { respondWith(generateContainerMetadataMap(), 204); - + Map metadata = osv3().objectStorage().containers().getMetadata("Test"); assertNotNull(metadata); assertEquals(metadata.get(NAME_YEAR), "2000"); assertEquals(metadata.get(NAME_BOOK), "TestBook"); } - + private Map generateContainerMetadataMap() { Map metadata = Maps.newHashMap(); - metadata.put(CONTAINER_METADATA_PREFIX+NAME_BOOK, "TestBook"); - metadata.put(CONTAINER_METADATA_PREFIX+NAME_YEAR, "2000"); + metadata.put(CONTAINER_METADATA_PREFIX + NAME_BOOK, "TestBook"); + metadata.put(CONTAINER_METADATA_PREFIX + NAME_YEAR, "2000"); return metadata; } diff --git a/core-test/src/main/java/org/openstack4j/api/storage/SchedulerStatsGetPoolTests.java b/core-test/src/main/java/org/openstack4j/api/storage/SchedulerStatsGetPoolTests.java index 083719607..711b8a3aa 100644 --- a/core-test/src/main/java/org/openstack4j/api/storage/SchedulerStatsGetPoolTests.java +++ b/core-test/src/main/java/org/openstack4j/api/storage/SchedulerStatsGetPoolTests.java @@ -6,7 +6,8 @@ import java.util.List; -import static org.testng.Assert.*; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertTrue; /** @@ -14,7 +15,7 @@ * * @author Chen guofeng gf.chen40@gmail.com */ -@Test(suiteName="SchedulerStatsGetPool") +@Test(suiteName = "SchedulerStatsGetPool") public class SchedulerStatsGetPoolTests extends AbstractTest { private static final String JSON_SCHEDULER_STATS = "/storage/v2/cinder_scheduler-stats.json"; private static final String JSON_SCHEDULER_STATS_DETAIL = "/storage/v2/cinder_scheduler-stats_detail.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/storage/ServiceTests.java b/core-test/src/main/java/org/openstack4j/api/storage/ServiceTests.java index 39195dd73..d849444b0 100644 --- a/core-test/src/main/java/org/openstack4j/api/storage/ServiceTests.java +++ b/core-test/src/main/java/org/openstack4j/api/storage/ServiceTests.java @@ -1,41 +1,41 @@ package org.openstack4j.api.storage; -import static org.testng.Assert.assertEquals; - -import java.util.List; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.storage.block.ext.Service.State; import org.openstack4j.model.storage.block.ext.Service.Status; import org.testng.annotations.Test; +import java.util.List; + +import static org.testng.Assert.assertEquals; + /** * Test cases for Block Storage Services function - * + * * @author Taemin */ @Test(suiteName = "BlockStorageService") public class ServiceTests extends AbstractTest { - private static final String JSON_SERVICES = "/storage/ext/services.json"; + private static final String JSON_SERVICES = "/storage/ext/services.json"; - public void serviceListingTest() throws Exception { - respondWith(JSON_SERVICES); + public void serviceListingTest() throws Exception { + respondWith(JSON_SERVICES); - List services = osv3().blockStorage().services() - .list(); + List services = osv3().blockStorage().services() + .list(); - org.openstack4j.model.storage.block.ext.Service s = services.get(0); - assertEquals("cinder-scheduler", s.getBinary()); - assertEquals("host1", s.getHost()); - assertEquals(Status.ENABLED, s.getStatus()); - assertEquals(State.UP, s.getState()); - } + org.openstack4j.model.storage.block.ext.Service s = services.get(0); + assertEquals("cinder-scheduler", s.getBinary()); + assertEquals("host1", s.getHost()); + assertEquals(Status.ENABLED, s.getStatus()); + assertEquals(State.UP, s.getState()); + } - @Override - protected Service service() { - return Service.BLOCK_STORAGE; - } + @Override + protected Service service() { + return Service.BLOCK_STORAGE; + } } \ No newline at end of file diff --git a/core-test/src/main/java/org/openstack4j/api/storage/VolumeBackupTests.java b/core-test/src/main/java/org/openstack4j/api/storage/VolumeBackupTests.java index 6b6ad5a8e..89d4d28fa 100644 --- a/core-test/src/main/java/org/openstack4j/api/storage/VolumeBackupTests.java +++ b/core-test/src/main/java/org/openstack4j/api/storage/VolumeBackupTests.java @@ -1,15 +1,6 @@ package org.openstack4j.api.storage; -import static org.junit.Assert.assertFalse; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import okio.Buffer; +import okhttp3.mockwebserver.RecordedRequest; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -18,188 +9,193 @@ import org.testng.Reporter; import org.testng.annotations.Test; -import okhttp3.mockwebserver.RecordedRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.assertFalse; +import static org.testng.Assert.*; @Test(suiteName = "Block Storage Tests") public class VolumeBackupTests extends AbstractTest { - @Override - protected Service service() { - return Service.BLOCK_STORAGE; - } - - - @Test - public void createVolumeBackupV1() throws Exception { - respondWith("/storage/v1/volumebackup_create_response.json"); - final String name = "backup1122"; - - VolumeBackupCreate create = Builders.volumeBackupCreate().volumeId("999b49ff-a813-45cc-aef3-3ec82f089490").container("container123") - .description("description123").name(name).incremental(false).build(); - VolumeBackup backup = osv3().blockStorage().backups().create(create); - - RecordedRequest request = server.takeRequest(); - assertNotNull(request.getHeader("X-Auth-Token")); - assertTrue(request.getPath().matches("/v[123]/\\p{XDigit}*/backups" )); - assertEquals( request.getMethod(), "POST"); - - String requestBody = request.getBody().readUtf8(); - assertTrue(requestBody.contains("\"volume_id\" : \"999b49ff-a813-45cc-aef3-3ec82f089490\"")); - - assertEquals(backup.getName(), name); - assertNotNull(backup.getId()); - assertEquals(backup.getId(), "7069c687-c85c-45ca-befa-aa78a971fdfe"); - } - - @Test - public void createVolumeBackupFromSnapshotV1() throws Exception { - respondWith("/storage/v1/volumebackup_create_response.json"); - final String name = "backup1122"; - - VolumeBackupCreate create = Builders.volumeBackupCreate().volumeId("999b49ff-a813-45cc-aef3-3ec82f089490").container("container123") - .description("description123").name(name).incremental(false).snapshotId("b4b3258d-555a-4fce-8f53-69cc2ae96d3c").build(); - VolumeBackup backup = osv3().blockStorage().backups().create(create); - - RecordedRequest request = server.takeRequest(); - assertNotNull(request.getHeader("X-Auth-Token")); - assertTrue(request.getPath().matches("/v[123]/\\p{XDigit}*/backups" )); - assertEquals( request.getMethod(), "POST"); - - String requestBody = request.getBody().readUtf8(); - assertTrue(requestBody.contains("\"volume_id\" : \"999b49ff-a813-45cc-aef3-3ec82f089490\"")); - assertTrue(requestBody.contains("\"snapshot_id\" : \"b4b3258d-555a-4fce-8f53-69cc2ae96d3c\"")); - - assertEquals(backup.getName(), name); - assertNotNull(backup.getId()); - assertEquals(backup.getId(), "7069c687-c85c-45ca-befa-aa78a971fdfe"); - } - - - @Test - public void deleteVolumeBackupV1() throws Exception { - respondWith(202); - String backupId = "1edd8704-a15a-4f44-8a70-49ffc3b1ec3a"; - ActionResponse response = osv3().blockStorage().backups().delete(backupId); - - RecordedRequest request = server.takeRequest(); - assertNotNull(request.getHeader("X-Auth-Token")); - assertTrue(request.getPath().matches("/v[123]/\\p{XDigit}*/backups/" + backupId )); - assertEquals( request.getMethod(), "DELETE"); - //Reporter.log( request.getPath() , true ); - - assertTrue(response.isSuccess()); - } - - - @Test - public void listVolumeBackupsV1() throws Exception { - // Check list volumes - respondWith("/storage/v1/volumebackups.json"); - List backups = osv3().blockStorage().backups().list(); - assertEquals(backups.size(), 3); - - // Check that the list request is the one we expect - RecordedRequest listRequest = server.takeRequest(); - assertNotNull(listRequest.getHeader("X-Auth-Token")); - - Reporter.log( listRequest.getPath() , true ); - assertTrue(listRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/detail")); - - assertEquals(backups.get(0).getContainer(), "container1122"); - assertEquals(backups.get(0).getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backups.get(0).getName(), "backup1122"); - assertEquals(backups.get(0).getStatus(), VolumeBackup.Status.AVAILABLE); - assertEquals(backups.get(0).getSize(), 1); - assertEquals(backups.get(0).getObjectCount(), 22); - assertEquals(backups.get(0).getZone(), "nova"); - assertNotNull(backups.get(0).getCreated()); - assertFalse(backups.get(0).hasDependent()); - assertFalse(backups.get(0).isIncremental()); - - } - - @Test - public void listVolumeBackupsV1WithFilter() throws Exception { - // Check list volumes - respondWith("/storage/v1/volumebackups_filtered.json"); - - final String backupName = "backup1122"; + @Override + protected Service service() { + return Service.BLOCK_STORAGE; + } + + + @Test + public void createVolumeBackupV1() throws Exception { + respondWith("/storage/v1/volumebackup_create_response.json"); + final String name = "backup1122"; + + VolumeBackupCreate create = Builders.volumeBackupCreate().volumeId("999b49ff-a813-45cc-aef3-3ec82f089490").container("container123") + .description("description123").name(name).incremental(false).build(); + VolumeBackup backup = osv3().blockStorage().backups().create(create); + + RecordedRequest request = server.takeRequest(); + assertNotNull(request.getHeader("X-Auth-Token")); + assertTrue(request.getPath().matches("/v[123]/\\p{XDigit}*/backups")); + assertEquals(request.getMethod(), "POST"); + + String requestBody = request.getBody().readUtf8(); + assertTrue(requestBody.contains("\"volume_id\" : \"999b49ff-a813-45cc-aef3-3ec82f089490\"")); + + assertEquals(backup.getName(), name); + assertNotNull(backup.getId()); + assertEquals(backup.getId(), "7069c687-c85c-45ca-befa-aa78a971fdfe"); + } + + @Test + public void createVolumeBackupFromSnapshotV1() throws Exception { + respondWith("/storage/v1/volumebackup_create_response.json"); + final String name = "backup1122"; + + VolumeBackupCreate create = Builders.volumeBackupCreate().volumeId("999b49ff-a813-45cc-aef3-3ec82f089490").container("container123") + .description("description123").name(name).incremental(false).snapshotId("b4b3258d-555a-4fce-8f53-69cc2ae96d3c").build(); + VolumeBackup backup = osv3().blockStorage().backups().create(create); + + RecordedRequest request = server.takeRequest(); + assertNotNull(request.getHeader("X-Auth-Token")); + assertTrue(request.getPath().matches("/v[123]/\\p{XDigit}*/backups")); + assertEquals(request.getMethod(), "POST"); + + String requestBody = request.getBody().readUtf8(); + assertTrue(requestBody.contains("\"volume_id\" : \"999b49ff-a813-45cc-aef3-3ec82f089490\"")); + assertTrue(requestBody.contains("\"snapshot_id\" : \"b4b3258d-555a-4fce-8f53-69cc2ae96d3c\"")); + + assertEquals(backup.getName(), name); + assertNotNull(backup.getId()); + assertEquals(backup.getId(), "7069c687-c85c-45ca-befa-aa78a971fdfe"); + } + + + @Test + public void deleteVolumeBackupV1() throws Exception { + respondWith(202); + String backupId = "1edd8704-a15a-4f44-8a70-49ffc3b1ec3a"; + ActionResponse response = osv3().blockStorage().backups().delete(backupId); + + RecordedRequest request = server.takeRequest(); + assertNotNull(request.getHeader("X-Auth-Token")); + assertTrue(request.getPath().matches("/v[123]/\\p{XDigit}*/backups/" + backupId)); + assertEquals(request.getMethod(), "DELETE"); + //Reporter.log( request.getPath() , true ); + + assertTrue(response.isSuccess()); + } + + + @Test + public void listVolumeBackupsV1() throws Exception { + // Check list volumes + respondWith("/storage/v1/volumebackups.json"); + List backups = osv3().blockStorage().backups().list(); + assertEquals(backups.size(), 3); + + // Check that the list request is the one we expect + RecordedRequest listRequest = server.takeRequest(); + assertNotNull(listRequest.getHeader("X-Auth-Token")); + + Reporter.log(listRequest.getPath(), true); + assertTrue(listRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/detail")); + + assertEquals(backups.get(0).getContainer(), "container1122"); + assertEquals(backups.get(0).getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backups.get(0).getName(), "backup1122"); + assertEquals(backups.get(0).getStatus(), VolumeBackup.Status.AVAILABLE); + assertEquals(backups.get(0).getSize(), 1); + assertEquals(backups.get(0).getObjectCount(), 22); + assertEquals(backups.get(0).getZone(), "nova"); + assertNotNull(backups.get(0).getCreated()); + assertFalse(backups.get(0).hasDependent()); + assertFalse(backups.get(0).isIncremental()); + + } + + @Test + public void listVolumeBackupsV1WithFilter() throws Exception { + // Check list volumes + respondWith("/storage/v1/volumebackups_filtered.json"); + + final String backupName = "backup1122"; Map filters = new HashMap(); filters.put("name", backupName); - - List backups = osv3().blockStorage().backups().list(filters); - assertEquals(backups.size(), 1); - - // Check that the list request is the one we expect - RecordedRequest listRequest = server.takeRequest(); - assertNotNull(listRequest.getHeader("X-Auth-Token")); - assertTrue(listRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/detail\\?name=" + backupName)); - - assertEquals(backups.get(0).getContainer(), "container1122"); - assertEquals(backups.get(0).getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backups.get(0).getName(), backupName); - assertEquals(backups.get(0).getStatus(), VolumeBackup.Status.AVAILABLE); - assertEquals(backups.get(0).getSize(), 1); - assertEquals(backups.get(0).getObjectCount(), 22); - assertEquals(backups.get(0).getZone(), "nova"); - assertNotNull(backups.get(0).getCreated()); - assertFalse(backups.get(0).hasDependent()); - assertFalse(backups.get(0).isIncremental()); - - } - - @Test - public void getVolumeBackupV1() throws Exception { - // Check get volume - respondWith("/storage/v1/volumebackup.json"); - String id="735359d5-9584-4046-94d3-5ffc47be84f5"; - VolumeBackup backup = osv3().blockStorage().backups().get(id); - - RecordedRequest getRequest = server.takeRequest(); - assertNotNull(getRequest.getHeader("X-Auth-Token")); - assertTrue(getRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/"+id)); - - assertEquals(backup.getId(), "735359d5-9584-4046-94d3-5ffc47be84f5"); - assertEquals(backup.getContainer(), "test999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backup.getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backup.getName(), "backup999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backup.getStatus(), VolumeBackup.Status.AVAILABLE); - assertEquals(backup.getSize(), 1); - assertEquals(backup.getObjectCount(), 22); - assertEquals(backup.getZone(), "nova"); - assertNotNull(backup.getCreated()); - assertEquals(backup.getDescription(), "by API999b49ff-a813-45cc-aef3-3ec82f089490"); - assertFalse(backup.hasDependent()); - assertFalse(backup.isIncremental()); - - } - - - @Test - public void getVolumeBackupFromSnapshotV1() throws Exception { - // Check get volume - respondWith("/storage/v1/volumebackup_from_snapshot.json"); - String id="735359d5-9584-4046-94d3-5ffc47be84f5"; - VolumeBackup backup = osv3().blockStorage().backups().get(id); - - RecordedRequest getRequest = server.takeRequest(); - assertNotNull(getRequest.getHeader("X-Auth-Token")); - assertTrue(getRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/"+id)); - - assertEquals(backup.getId(), "735359d5-9584-4046-94d3-5ffc47be84f5"); - assertEquals(backup.getContainer(), "test999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backup.getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backup.getName(), "backup999b49ff-a813-45cc-aef3-3ec82f089490"); - assertEquals(backup.getSnapshotId(), "b4b3258d-555a-4fce-8f53-69cc2ae96d3c"); - assertEquals(backup.getStatus(), VolumeBackup.Status.AVAILABLE); - assertEquals(backup.getSize(), 1); - assertEquals(backup.getObjectCount(), 22); - assertEquals(backup.getZone(), "nova"); - assertNotNull(backup.getCreated()); - assertEquals(backup.getDescription(), "by API999b49ff-a813-45cc-aef3-3ec82f089490"); - assertFalse(backup.hasDependent()); - assertFalse(backup.isIncremental()); - - } + + List backups = osv3().blockStorage().backups().list(filters); + assertEquals(backups.size(), 1); + + // Check that the list request is the one we expect + RecordedRequest listRequest = server.takeRequest(); + assertNotNull(listRequest.getHeader("X-Auth-Token")); + assertTrue(listRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/detail\\?name=" + backupName)); + + assertEquals(backups.get(0).getContainer(), "container1122"); + assertEquals(backups.get(0).getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backups.get(0).getName(), backupName); + assertEquals(backups.get(0).getStatus(), VolumeBackup.Status.AVAILABLE); + assertEquals(backups.get(0).getSize(), 1); + assertEquals(backups.get(0).getObjectCount(), 22); + assertEquals(backups.get(0).getZone(), "nova"); + assertNotNull(backups.get(0).getCreated()); + assertFalse(backups.get(0).hasDependent()); + assertFalse(backups.get(0).isIncremental()); + + } + + @Test + public void getVolumeBackupV1() throws Exception { + // Check get volume + respondWith("/storage/v1/volumebackup.json"); + String id = "735359d5-9584-4046-94d3-5ffc47be84f5"; + VolumeBackup backup = osv3().blockStorage().backups().get(id); + + RecordedRequest getRequest = server.takeRequest(); + assertNotNull(getRequest.getHeader("X-Auth-Token")); + assertTrue(getRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/" + id)); + + assertEquals(backup.getId(), "735359d5-9584-4046-94d3-5ffc47be84f5"); + assertEquals(backup.getContainer(), "test999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backup.getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backup.getName(), "backup999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backup.getStatus(), VolumeBackup.Status.AVAILABLE); + assertEquals(backup.getSize(), 1); + assertEquals(backup.getObjectCount(), 22); + assertEquals(backup.getZone(), "nova"); + assertNotNull(backup.getCreated()); + assertEquals(backup.getDescription(), "by API999b49ff-a813-45cc-aef3-3ec82f089490"); + assertFalse(backup.hasDependent()); + assertFalse(backup.isIncremental()); + + } + + + @Test + public void getVolumeBackupFromSnapshotV1() throws Exception { + // Check get volume + respondWith("/storage/v1/volumebackup_from_snapshot.json"); + String id = "735359d5-9584-4046-94d3-5ffc47be84f5"; + VolumeBackup backup = osv3().blockStorage().backups().get(id); + + RecordedRequest getRequest = server.takeRequest(); + assertNotNull(getRequest.getHeader("X-Auth-Token")); + assertTrue(getRequest.getPath().matches("/v[123]/\\p{XDigit}*/backups/" + id)); + + assertEquals(backup.getId(), "735359d5-9584-4046-94d3-5ffc47be84f5"); + assertEquals(backup.getContainer(), "test999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backup.getVolumeId(), "999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backup.getName(), "backup999b49ff-a813-45cc-aef3-3ec82f089490"); + assertEquals(backup.getSnapshotId(), "b4b3258d-555a-4fce-8f53-69cc2ae96d3c"); + assertEquals(backup.getStatus(), VolumeBackup.Status.AVAILABLE); + assertEquals(backup.getSize(), 1); + assertEquals(backup.getObjectCount(), 22); + assertEquals(backup.getZone(), "nova"); + assertNotNull(backup.getCreated()); + assertEquals(backup.getDescription(), "by API999b49ff-a813-45cc-aef3-3ec82f089490"); + assertFalse(backup.hasDependent()); + assertFalse(backup.isIncremental()); + + } } diff --git a/core-test/src/main/java/org/openstack4j/api/storage/VolumeSnapshotTests.java b/core-test/src/main/java/org/openstack4j/api/storage/VolumeSnapshotTests.java index 4e3621d15..424b2488a 100644 --- a/core-test/src/main/java/org/openstack4j/api/storage/VolumeSnapshotTests.java +++ b/core-test/src/main/java/org/openstack4j/api/storage/VolumeSnapshotTests.java @@ -1,39 +1,36 @@ package org.openstack4j.api.storage; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import okhttp3.mockwebserver.RecordedRequest; import org.openstack4j.api.AbstractTest; import org.openstack4j.model.storage.block.VolumeSnapshot; import org.testng.annotations.Test; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.testng.Assert.*; -@Test(suiteName="Block Storage Tests") +@Test(suiteName = "Block Storage Tests") public class VolumeSnapshotTests extends AbstractTest { @Override protected Service service() { return Service.BLOCK_STORAGE; } - + public void listVolumeSnaphotsV1() throws Exception { // Check list volumes respondWith("/storage/v1/volumesnapshots.json"); List volumes = osv3().blockStorage().snapshots().list(); assertEquals(volumes.size(), 2); - + // Check that the list request is the one we expect RecordedRequest listRequest = server.takeRequest(); assertNotNull(listRequest.getHeader("X-Auth-Token")); assertTrue(listRequest.getPath().matches("/v[12]/\\p{XDigit}*/snapshots")); - + // Check list volumes with filters respondWith("/storage/v1/volumesnapshots_filtered.json"); final String volName = "snap-vol-test-1"; @@ -41,11 +38,11 @@ public void listVolumeSnaphotsV1() throws Exception { filters.put("display_name", volName); List filteredVolumes = osv3().blockStorage().snapshots().list(filters); assertEquals(filteredVolumes.size(), 1); - + // Check that the list request is the one we expect RecordedRequest filteredListRequest = server.takeRequest(); assertNotNull(filteredListRequest.getHeader("X-Auth-Token")); assertTrue(filteredListRequest.getPath().matches("/v[12]/\\p{XDigit}*/snapshots\\?display_name=" + volName)); } - + } diff --git a/core-test/src/main/java/org/openstack4j/api/storage/VolumeTests.java b/core-test/src/main/java/org/openstack4j/api/storage/VolumeTests.java index 5596dcf24..2049bd587 100644 --- a/core-test/src/main/java/org/openstack4j/api/storage/VolumeTests.java +++ b/core-test/src/main/java/org/openstack4j/api/storage/VolumeTests.java @@ -1,32 +1,28 @@ package org.openstack4j.api.storage; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import okhttp3.mockwebserver.RecordedRequest; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; -import org.openstack4j.api.SkipTest; import org.openstack4j.model.storage.block.Volume; import org.openstack4j.model.storage.block.VolumeAttachment; import org.openstack4j.model.storage.block.builder.VolumeBuilder; import org.testng.annotations.Test; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.testng.Assert.*; -@Test(suiteName="Block Storage Tests") +@Test(suiteName = "Block Storage Tests") public class VolumeTests extends AbstractTest { @Override protected Service service() { return Service.BLOCK_STORAGE; } - + @Test public void listVolumesV1() throws Exception { // Check list volumes @@ -34,12 +30,12 @@ public void listVolumesV1() throws Exception { List volumes = osv3().blockStorage().volumes().list(); assertEquals(volumes.size(), 3); assertEquals(volumes.get(0).getTenantId(), "b0b5ed7ae06049688349fe43737796d4"); - + // Check that the list request is the one we expect RecordedRequest listRequest = server.takeRequest(); assertNotNull(listRequest.getHeader("X-Auth-Token")); assertTrue(listRequest.getPath().matches("/v[12]/\\p{XDigit}*/volumes/detail")); - + // Check list volumes with filters respondWith("/storage/v1/volumes_filtered.json"); final String volName = "vol-test-1"; @@ -47,23 +43,23 @@ public void listVolumesV1() throws Exception { filters.put("display_name", volName); List filteredVolumes = osv3().blockStorage().volumes().list(filters); assertEquals(filteredVolumes.size(), 2); - + // Check that the list request is the one we expect RecordedRequest filteredListRequest = server.takeRequest(); assertNotNull(filteredListRequest.getHeader("X-Auth-Token")); assertTrue(filteredListRequest.getPath().matches("/v[12]/\\p{XDigit}*/volumes/detail\\?display_name=" + volName)); } - + @SuppressWarnings("unchecked") @Test public void getVolumeV1() throws Exception { // Check get volume respondWith("/storage/v1/volume.json"); Volume volume = osv3().blockStorage().volumes().get("8a9287b7-4f4d-4213-8d75-63470f19f27c"); - + RecordedRequest getRequest = server.takeRequest(); assertTrue(getRequest.getPath().matches("/v[12]/\\p{XDigit}*/volumes/8a9287b7-4f4d-4213-8d75-63470f19f27c")); - + assertEquals(volume.getId(), "8a9287b7-4f4d-4213-8d75-63470f19f27c"); assertEquals(volume.getDisplayName(), "vol-test"); assertEquals(volume.getDisplayDescription(), "a description"); @@ -74,12 +70,12 @@ public void getVolumeV1() throws Exception { assertEquals(volume.getSnapshotId(), "22222222-2222-2222-2222-222222222222"); assertEquals(volume.getSourceVolid(), "11111111-1111-1111-1111-111111111111"); assertEquals(volume.getVolumeType(), "Gold"); - + assertNotNull(volume.getMetaData()); Map metadata = volume.getMetaData(); assertEquals(metadata.get("readonly"), "False"); assertEquals(metadata.get("attached_mode"), "rw"); - + assertNotNull(volume.getAttachments()); List attachments = (List) volume.getAttachments(); assertEquals(attachments.get(0).getDevice(), "/dev/vdd"); @@ -90,17 +86,17 @@ public void getVolumeV1() throws Exception { assertEquals(volume.getTenantId(), "b0b5ed7ae06049688349fe43737796d4"); } - + @SuppressWarnings("unchecked") @Test public void getVolumeV2() throws Exception { // Check get volume respondWith("/storage/v2/volume.json"); Volume volume = osv3().blockStorage().volumes().get("8a9287b7-4f4d-4213-8d75-63470f19f27c"); - + RecordedRequest getRequest = server.takeRequest(); assertTrue(getRequest.getPath().matches("/v[12]/\\p{XDigit}*/volumes/8a9287b7-4f4d-4213-8d75-63470f19f27c")); - + assertEquals(volume.getId(), "8a9287b7-4f4d-4213-8d75-63470f19f27c"); assertEquals(volume.getName(), "test-volume"); assertEquals(volume.getDescription(), "a description"); @@ -111,12 +107,12 @@ public void getVolumeV2() throws Exception { assertEquals(volume.getSnapshotId(), "22222222-2222-2222-2222-222222222222"); assertEquals(volume.getSourceVolid(), "11111111-1111-1111-1111-111111111111"); assertEquals(volume.getVolumeType(), "Gold"); - + assertNotNull(volume.getMetaData()); Map metadata = volume.getMetaData(); assertEquals(metadata.get("readonly"), "False"); assertEquals(metadata.get("attached_mode"), "rw"); - + assertNotNull(volume.getAttachments()); List attachments = (List) volume.getAttachments(); assertEquals(attachments.get(0).getDevice(), "/dev/vdd"); @@ -125,8 +121,8 @@ public void getVolumeV2() throws Exception { assertEquals(attachments.get(0).getServerId(), "eaa6a54d-35c1-40ce-831d-bb61f991e1a9"); assertEquals(attachments.get(0).getVolumeId(), "8a9287b7-4f4d-4213-8d75-63470f19f27c"); } - - + + @Test public void testVolumesWithBootableAndEncyrpted() throws Exception { // Check list volumes @@ -136,30 +132,30 @@ public void testVolumesWithBootableAndEncyrpted() throws Exception { assertEquals(volumes.get(0).getTenantId(), "b0b5ed7ae06049688349fe43737796d4"); assertEquals(volumes.get(0).bootable(), false); assertEquals(volumes.get(0).encrypted(), false); - + assertEquals(volumes.get(1).getTenantId(), "b0b5ed7ae06049688349fe43737796d4"); assertEquals(volumes.get(1).bootable(), true); assertEquals(volumes.get(1).encrypted(), true); - - + + } - - + + @Test public void CreateVolumeV2WithMultiattach() throws Exception { respondWith("/storage/v2/createVolume-muitiattach.json"); - + VolumeBuilder volumeBuilder = Builders.volume(); - volumeBuilder.size(10); - volumeBuilder.name("test_openstack4j"); - volumeBuilder.description("test"); - volumeBuilder.multiattach(true); - Volume volume = osv2().blockStorage().volumes().create(volumeBuilder.build()); - - server.takeRequest(); - - assertEquals(volume.getSize(), 10); - assertEquals(volume.multiattach(), Boolean.TRUE); + volumeBuilder.size(10); + volumeBuilder.name("test_openstack4j"); + volumeBuilder.description("test"); + volumeBuilder.multiattach(true); + Volume volume = osv2().blockStorage().volumes().create(volumeBuilder.build()); + + server.takeRequest(); + + assertEquals(volume.getSize(), 10); + assertEquals(volume.multiattach(), Boolean.TRUE); } } diff --git a/core-test/src/main/java/org/openstack4j/api/storage/VolumeTypeTests.java b/core-test/src/main/java/org/openstack4j/api/storage/VolumeTypeTests.java index bfb1ff7b5..cd42164c8 100644 --- a/core-test/src/main/java/org/openstack4j/api/storage/VolumeTypeTests.java +++ b/core-test/src/main/java/org/openstack4j/api/storage/VolumeTypeTests.java @@ -1,16 +1,16 @@ package org.openstack4j.api.storage; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; - import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.VolumeType; import org.testng.annotations.Test; +import java.io.IOException; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + @Test(suiteName = "Block Storage Tests") public class VolumeTypeTests extends AbstractTest { diff --git a/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVimTests.java b/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVimTests.java index 1086ef33b..a2d7848a6 100644 --- a/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVimTests.java +++ b/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVimTests.java @@ -1,13 +1,6 @@ package org.openstack4j.api.tacker.v1; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.api.exceptions.ServerResponseException; @@ -18,103 +11,106 @@ import org.testng.Assert; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; /** - * * @author Vishvesh Deshmukh * @date Sep 14, 2016 */ @Test(suiteName = "tacker/vnim") public class TackerVimTests extends AbstractTest { - private static final String TACKER_VIM = "/tacker/v1/vim.json"; - private static final String TACKER_VIMS = "/tacker/v1/vims.json"; - - @Override - protected Service service() { - return Service.TACKER; - } - - @Test - public void testListVims() throws Exception { - respondWith(TACKER_VIMS); - List vims = osv3().tacker().vim().list(); - assertEquals(1, vims.size()); - Preconditions.checkNotNull(vims.get(0)); - Logger.getLogger(getClass().getName()) - .info(getClass().getName() + " : Tacker VIM from List : " + vims.get(0)); - assertEquals(vims.get(0).getName(), "test-vim"); - } - - public void testGetVim() throws IOException { - respondWith(TACKER_VIM); - String id = "bad2f397-7436-4fc7-8043-726e173c5d30"; - Vim vim = osv3().tacker().vim().show(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Tacker VIM by ID : "+vim); - assertNotNull(vim); - assertEquals(id, vim.getId()); - assertEquals("test-vim", vim.getName()); - } - - public void testRegisterVim() throws IOException { - respondWith(TACKER_VIM); - VimProject vimProject = VimProject.create().name("admin").projectDomainName("default"); - - AuthCredentials authCredentials = AuthCredentials.create() - .username("admin") - .password("password") - .userDomainName("default"); - - Vim vim = Builders.tacker().vim() - .name("test-vim") - .description("test-vim-description") - .authUrl("http://openstack.os4j.com:35357/v3") - .isDefault(Boolean.TRUE) - .type("openstack") - .vimProject(vimProject) - .authCredentials(authCredentials) - .build(); - - vim = osv3().tacker().vim().register(vim); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Tacker Vim : "+vim); - - assertEquals("test-vim", vim.getName()); - } - - @Test(expectedExceptions = ServerResponseException.class) - public void testRegisterVimWithTackerError() throws IOException { - String jsonResponse = "{\"TackerError\": {" + private static final String TACKER_VIM = "/tacker/v1/vim.json"; + private static final String TACKER_VIMS = "/tacker/v1/vims.json"; + + @Override + protected Service service() { + return Service.TACKER; + } + + @Test + public void testListVims() throws Exception { + respondWith(TACKER_VIMS); + List vims = osv3().tacker().vim().list(); + assertEquals(1, vims.size()); + Preconditions.checkNotNull(vims.get(0)); + Logger.getLogger(getClass().getName()) + .info(getClass().getName() + " : Tacker VIM from List : " + vims.get(0)); + assertEquals(vims.get(0).getName(), "test-vim"); + } + + public void testGetVim() throws IOException { + respondWith(TACKER_VIM); + String id = "bad2f397-7436-4fc7-8043-726e173c5d30"; + Vim vim = osv3().tacker().vim().show(id); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Tacker VIM by ID : " + vim); + assertNotNull(vim); + assertEquals(id, vim.getId()); + assertEquals("test-vim", vim.getName()); + } + + public void testRegisterVim() throws IOException { + respondWith(TACKER_VIM); + VimProject vimProject = VimProject.create().name("admin").projectDomainName("default"); + + AuthCredentials authCredentials = AuthCredentials.create() + .username("admin") + .password("password") + .userDomainName("default"); + + Vim vim = Builders.tacker().vim() + .name("test-vim") + .description("test-vim-description") + .authUrl("http://openstack.os4j.com:35357/v3") + .isDefault(Boolean.TRUE) + .type("openstack") + .vimProject(vimProject) + .authCredentials(authCredentials) + .build(); + + vim = osv3().tacker().vim().register(vim); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Tacker Vim : " + vim); + + assertEquals("test-vim", vim.getName()); + } + + @Test(expectedExceptions = ServerResponseException.class) + public void testRegisterVimWithTackerError() throws IOException { + String jsonResponse = "{\"TackerError\": {" + "\"message\": \"'project_domain_name' is missing.\", " + "\"code\": 500}}"; - - respondWith(500, jsonResponse); - - VimProject vimProject = VimProject.create().name("admin"); - - AuthCredentials authCredentials = AuthCredentials.create() - .username("admin") - .password("password") - .userDomainName("default"); - - Vim vim = Builders.tacker().vim() - .name("test-vim") - .description("test-vim-description") - .authUrl("http://openstack.os4j.com:35357/v3") - .isDefault(Boolean.TRUE) - .type("openstack") - .vimProject(vimProject) - .authCredentials(authCredentials) - .build(); - - vim = osv3().tacker().vim().register(vim); - System.out.println("THROWING EXCEPTIONNNNNNNNN"); - Assert.fail("Exception should have been thrown."); - } - - public void testDeleteVim() throws IOException { - respondWith(200); - ActionResponse result = osv3().tacker().vim().delete("bad2f397-7436-4fc7-8043-726e173c5d30"); - assertTrue(result.isSuccess()); - } + + respondWith(500, jsonResponse); + + VimProject vimProject = VimProject.create().name("admin"); + + AuthCredentials authCredentials = AuthCredentials.create() + .username("admin") + .password("password") + .userDomainName("default"); + + Vim vim = Builders.tacker().vim() + .name("test-vim") + .description("test-vim-description") + .authUrl("http://openstack.os4j.com:35357/v3") + .isDefault(Boolean.TRUE) + .type("openstack") + .vimProject(vimProject) + .authCredentials(authCredentials) + .build(); + + vim = osv3().tacker().vim().register(vim); + System.out.println("THROWING EXCEPTIONNNNNNNNN"); + Assert.fail("Exception should have been thrown."); + } + + public void testDeleteVim() throws IOException { + respondWith(200); + ActionResponse result = osv3().tacker().vim().delete("bad2f397-7436-4fc7-8043-726e173c5d30"); + assertTrue(result.isSuccess()); + } } \ No newline at end of file diff --git a/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfTests.java b/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfTests.java index aaf1fe018..133d67ff8 100644 --- a/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfTests.java +++ b/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfTests.java @@ -1,13 +1,6 @@ package org.openstack4j.api.tacker.v1; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -17,76 +10,79 @@ import org.openstack4j.openstack.tacker.domain.VnfUpdateAttributes; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; /** - * * @author Vishvesh Deshmukh * @date Sep 6, 2016 */ @Test(suiteName = "tacker/vnf") public class TackerVnfTests extends AbstractTest { - private static final String TACKER_VNFS = "/tacker/v1/vnfs.json"; - private static final String TACKER_VNF_GET = "/tacker/v1/vnf-get.json"; - private static final String TACKER_VNF_CREATE = "/tacker/v1/vnf-create.json"; - private static final String TACKER_VNF_UPDATE = "/tacker/v1/vnf-update.json"; + private static final String TACKER_VNFS = "/tacker/v1/vnfs.json"; + private static final String TACKER_VNF_GET = "/tacker/v1/vnf-get.json"; + private static final String TACKER_VNF_CREATE = "/tacker/v1/vnf-create.json"; + private static final String TACKER_VNF_UPDATE = "/tacker/v1/vnf-update.json"; + + @Override + protected Service service() { + return Service.TACKER; + } + + @Test + public void testListVnfs() throws Exception { + respondWith(TACKER_VNFS); + List vnfs = osv3().tacker().vnf().list(); + assertEquals(1, vnfs.size()); + Preconditions.checkNotNull(vnfs.get(0)); + Logger.getLogger(getClass().getName()) + .info(getClass().getName() + " : Tacker VNF from List : " + vnfs.get(0)); + assertEquals(vnfs.get(0).getName(), "test-vnf"); + } + + public void testGetVnf() throws IOException { + respondWith(TACKER_VNF_GET); + String id = "afbbf7f4-59c2-45ed-b158-8c4e2e1d9104"; + Vnf vnf = osv3().tacker().vnf().get(id); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Tacker VNF by ID : " + vnf); + assertNotNull(vnf); + assertEquals(id, vnf.getId()); + assertEquals("test-vnf", vnf.getName()); + } + + public void testCreateVnf() throws IOException { + respondWith(TACKER_VNF_CREATE); + Vnf vnf = Builders.tacker().vnf() + .name("test-vnf") + .description("test-vnf-description") + .vnfdId("1363e776-6c79-4e53-8074-4e32e49f156a") + .build(); + + Vnf newVnf = osv3().tacker().vnf().create(vnf); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Tacker Vnf : " + newVnf); + + assertEquals("test-vnf", newVnf.getName()); + } + + public void testUpdateVnf() throws Exception { + respondWith(TACKER_VNF_UPDATE); + String vnfId = "4043f4bd-a728-4ee3-91d6-a11a6bb89030"; + String vnfUpdateConfig = "vdus:\n vdu1:\n id: vdu1\n vm_image: cirros-0.3.4-x86_64-uec\n instance_type: m1.tiny\n\n network_interfaces:\n management:\n network: net_mgmt\n management: true\n pkt_in:\n network: net0\n pkt_out:\n network: net1\n\n placement_policy:\n availability_zone: nova\n\n auto-scaling: noop\n\n"; + VnfUpdateAttributes vnfUpdateAttributes = VnfUpdateAttributes.create().config(vnfUpdateConfig); + VnfUpdate vnfUpdate = Builders.tacker().vnfUpdate().attributes(vnfUpdateAttributes).build(); + Vnf updatedVnf = osv3().tacker().vnf().update(vnfId, vnfUpdate); - @Override - protected Service service() { - return Service.TACKER; - } + assertEquals("test-update-vnf-description", updatedVnf.getDescription()); + assertEquals(TackerVnfStatus.PENDING_UPDATE, updatedVnf.getStatus()); + } - @Test - public void testListVnfs() throws Exception { - respondWith(TACKER_VNFS); - List vnfs = osv3().tacker().vnf().list(); - assertEquals(1, vnfs.size()); - Preconditions.checkNotNull(vnfs.get(0)); - Logger.getLogger(getClass().getName()) - .info(getClass().getName() + " : Tacker VNF from List : " + vnfs.get(0)); - assertEquals(vnfs.get(0).getName(), "test-vnf"); - } - - public void testGetVnf() throws IOException { - respondWith(TACKER_VNF_GET); - String id = "afbbf7f4-59c2-45ed-b158-8c4e2e1d9104"; - Vnf vnf = osv3().tacker().vnf().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Tacker VNF by ID : "+vnf); - assertNotNull(vnf); - assertEquals(id, vnf.getId()); - assertEquals("test-vnf", vnf.getName()); - } - - public void testCreateVnf() throws IOException { - respondWith(TACKER_VNF_CREATE); - Vnf vnf = Builders.tacker().vnf() - .name("test-vnf") - .description("test-vnf-description") - .vnfdId("1363e776-6c79-4e53-8074-4e32e49f156a") - .build(); - - Vnf newVnf = osv3().tacker().vnf().create(vnf); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Tacker Vnf : "+newVnf); - - assertEquals("test-vnf", newVnf.getName()); - } - - public void testUpdateVnf() throws Exception { - respondWith(TACKER_VNF_UPDATE); - String vnfId = "4043f4bd-a728-4ee3-91d6-a11a6bb89030"; - String vnfUpdateConfig = "vdus:\n vdu1:\n id: vdu1\n vm_image: cirros-0.3.4-x86_64-uec\n instance_type: m1.tiny\n\n network_interfaces:\n management:\n network: net_mgmt\n management: true\n pkt_in:\n network: net0\n pkt_out:\n network: net1\n\n placement_policy:\n availability_zone: nova\n\n auto-scaling: noop\n\n"; - VnfUpdateAttributes vnfUpdateAttributes = VnfUpdateAttributes.create().config(vnfUpdateConfig); - VnfUpdate vnfUpdate = Builders.tacker().vnfUpdate().attributes(vnfUpdateAttributes).build(); - Vnf updatedVnf = osv3().tacker().vnf().update(vnfId, vnfUpdate); - - assertEquals("test-update-vnf-description", updatedVnf.getDescription()); - assertEquals(TackerVnfStatus.PENDING_UPDATE, updatedVnf.getStatus()); - } - - public void testDeleteVnf() throws IOException { - respondWith(200); - ActionResponse result = osv3().tacker().vnf().delete("afbbf7f4-59c2-45ed-b158-8c4e2e1d9104"); - assertTrue(result.isSuccess()); - } + public void testDeleteVnf() throws IOException { + respondWith(200); + ActionResponse result = osv3().tacker().vnf().delete("afbbf7f4-59c2-45ed-b158-8c4e2e1d9104"); + assertTrue(result.isSuccess()); + } } \ No newline at end of file diff --git a/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfdTests.java b/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfdTests.java index ad7cf8eef..15e510bf9 100644 --- a/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfdTests.java +++ b/core-test/src/main/java/org/openstack4j/api/tacker/v1/TackerVnfdTests.java @@ -1,13 +1,7 @@ package org.openstack4j.api.tacker.v1; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; -import java.util.logging.Logger; - +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import org.openstack4j.api.AbstractTest; import org.openstack4j.api.Builders; import org.openstack4j.model.common.ActionResponse; @@ -16,74 +10,76 @@ import org.openstack4j.openstack.tacker.domain.VnfdServiceTypes; import org.testng.annotations.Test; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +import static org.testng.Assert.*; /** - * * @author Vishvesh Deshmukh * @date Sep 6, 2016 */ @Test(suiteName = "tacker/vnfd") public class TackerVnfdTests extends AbstractTest { - private static final String TACKER_VNFD = "/tacker/v1/vnfd.json"; - private static final String TACKER_VNFDS = "/tacker/v1/vnfds.json"; - - @Override - protected Service service() { - return Service.TACKER; - } - - @Test - public void testListVnfds() throws Exception { - respondWith(TACKER_VNFDS); - List vnfds = osv3().tacker().vnfd().list(); - assertEquals(1, vnfds.size()); - Preconditions.checkNotNull(vnfds.get(0)); - Logger.getLogger(getClass().getName()) - .info(getClass().getName() + " : Tacker VNFD from List : " + vnfds.get(0)); - assertEquals(vnfds.get(0).getName(), "test-vnfd"); - } - - public void testGetVnfd() throws IOException { - respondWith(TACKER_VNFD); - String id = "1363e776-6c79-4e53-8074-4e32e49f156a"; - Vnfd vnfd = osv3().tacker().vnfd().get(id); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Tacker VNFD by ID : "+vnfd); - assertNotNull(vnfd); - assertEquals(id, vnfd.getId()); - assertEquals("test-vnfd", vnfd.getName()); - } - - public void testCreateVnfd() throws IOException { - respondWith(TACKER_VNFD); - String vnfdTemplate = "template_name: sample-vnfd\ndescription: admin-example\n\nservice_properties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n vdu1:\n id: vdu1\n vm_image: cirros-0.3.4-x86_64-uec\n instance_type: m1.tiny\n\n network_interfaces:\n management:\n network: net_mgmt\n management: true\n pkt_in:\n network: net0\n pkt_out:\n network: net1\n\n placement_policy:\n availability_zone: nova\n\n auto-scaling: noop\n\n config:\n param0: key0\n param1: key1\n"; - - VnfdAttributes attributes = VnfdAttributes.create().vnfd(vnfdTemplate); - - VnfdServiceTypes serviceTypes = VnfdServiceTypes.create().serviceType("vnfd"); - - List serviceTypesList = Lists.newArrayList(serviceTypes); - - Vnfd vnfd = Builders.tacker().vnfd() - .name("test-vnfd") - .description("test-vnfd-description") - .infrastructureDriver("heat") - .managementDriver("noop") - .attributes(attributes) - .serviceTypes(serviceTypesList) - .build(); - - Vnfd newVnfd = osv3().tacker().vnfd().create(vnfd); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Tacker Vnfd : "+newVnfd); - - assertEquals("test-vnfd", newVnfd.getName()); - } - - public void testDeleteVnfd() throws IOException { - respondWith(200); - ActionResponse result = osv3().tacker().vnfd().delete("1363e776-6c79-4e53-8074-4e32e49f156a"); - assertTrue(result.isSuccess()); - } + private static final String TACKER_VNFD = "/tacker/v1/vnfd.json"; + private static final String TACKER_VNFDS = "/tacker/v1/vnfds.json"; + + @Override + protected Service service() { + return Service.TACKER; + } + + @Test + public void testListVnfds() throws Exception { + respondWith(TACKER_VNFDS); + List vnfds = osv3().tacker().vnfd().list(); + assertEquals(1, vnfds.size()); + Preconditions.checkNotNull(vnfds.get(0)); + Logger.getLogger(getClass().getName()) + .info(getClass().getName() + " : Tacker VNFD from List : " + vnfds.get(0)); + assertEquals(vnfds.get(0).getName(), "test-vnfd"); + } + + public void testGetVnfd() throws IOException { + respondWith(TACKER_VNFD); + String id = "1363e776-6c79-4e53-8074-4e32e49f156a"; + Vnfd vnfd = osv3().tacker().vnfd().get(id); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Tacker VNFD by ID : " + vnfd); + assertNotNull(vnfd); + assertEquals(id, vnfd.getId()); + assertEquals("test-vnfd", vnfd.getName()); + } + + public void testCreateVnfd() throws IOException { + respondWith(TACKER_VNFD); + String vnfdTemplate = "template_name: sample-vnfd\ndescription: admin-example\n\nservice_properties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n vdu1:\n id: vdu1\n vm_image: cirros-0.3.4-x86_64-uec\n instance_type: m1.tiny\n\n network_interfaces:\n management:\n network: net_mgmt\n management: true\n pkt_in:\n network: net0\n pkt_out:\n network: net1\n\n placement_policy:\n availability_zone: nova\n\n auto-scaling: noop\n\n config:\n param0: key0\n param1: key1\n"; + + VnfdAttributes attributes = VnfdAttributes.create().vnfd(vnfdTemplate); + + VnfdServiceTypes serviceTypes = VnfdServiceTypes.create().serviceType("vnfd"); + + List serviceTypesList = Lists.newArrayList(serviceTypes); + + Vnfd vnfd = Builders.tacker().vnfd() + .name("test-vnfd") + .description("test-vnfd-description") + .infrastructureDriver("heat") + .managementDriver("noop") + .attributes(attributes) + .serviceTypes(serviceTypesList) + .build(); + + Vnfd newVnfd = osv3().tacker().vnfd().create(vnfd); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Created Tacker Vnfd : " + newVnfd); + + assertEquals("test-vnfd", newVnfd.getName()); + } + + public void testDeleteVnfd() throws IOException { + respondWith(200); + ActionResponse result = osv3().tacker().vnfd().delete("1363e776-6c79-4e53-8074-4e32e49f156a"); + assertTrue(result.isSuccess()); + } } \ No newline at end of file diff --git a/core-test/src/main/java/org/openstack4j/api/telemetry/AlarmTests.java b/core-test/src/main/java/org/openstack4j/api/telemetry/AlarmTests.java index a25e94246..a075660f2 100644 --- a/core-test/src/main/java/org/openstack4j/api/telemetry/AlarmTests.java +++ b/core-test/src/main/java/org/openstack4j/api/telemetry/AlarmTests.java @@ -1,5 +1,6 @@ package org.openstack4j.api.telemetry; +import okhttp3.mockwebserver.RecordedRequest; import org.openstack4j.api.AbstractTest; import org.openstack4j.model.telemetry.Alarm; import org.testng.annotations.Test; @@ -9,18 +10,18 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; -import okhttp3.mockwebserver.RecordedRequest; + /** * telemetry alarm test cases - * @author zhangjianweibj * + * @author zhangjianweibj */ -@Test(suiteName="Alarms") +@Test(suiteName = "Alarms") public class AlarmTests extends AbstractTest { private static final String JSON_ALARMS = "/telemetry/alarms.json"; - private static final String JSON_ALARM= "/telemetry/alarm.json"; + private static final String JSON_ALARM = "/telemetry/alarm.json"; @Override protected Service service() { @@ -28,25 +29,24 @@ protected Service service() { } - public void listAlarmTest() throws IOException , InterruptedException { + public void listAlarmTest() throws IOException, InterruptedException { respondWith(JSON_ALARMS); - List list=osv3().telemetry().alarms().list(); + List list = osv3().telemetry().alarms().list(); RecordedRequest listRequest = server.takeRequest(); - assertEquals(7,list.size()); + assertEquals(7, list.size()); } - public void getAlarmTest() throws IOException, InterruptedException{ + public void getAlarmTest() throws IOException, InterruptedException { respondWith(JSON_ALARM); - Alarm alarm=osv3().telemetry().alarms().getById("03757eede9c540338e732d1a7fb07966"); + Alarm alarm = osv3().telemetry().alarms().getById("03757eede9c540338e732d1a7fb07966"); RecordedRequest listRequest = server.takeRequest(); assertNotNull(alarm); - assertEquals(alarm.getAlarmId(),"03757eede9c540338e732d1a7fb07966"); + assertEquals(alarm.getAlarmId(), "03757eede9c540338e732d1a7fb07966"); } - } diff --git a/core-test/src/main/java/org/openstack4j/api/telemetry/CapabilitiesTest.java b/core-test/src/main/java/org/openstack4j/api/telemetry/CapabilitiesTest.java index 41b4bf9e0..4dd1a5566 100644 --- a/core-test/src/main/java/org/openstack4j/api/telemetry/CapabilitiesTest.java +++ b/core-test/src/main/java/org/openstack4j/api/telemetry/CapabilitiesTest.java @@ -1,13 +1,13 @@ package org.openstack4j.api.telemetry; -import static org.testng.Assert.assertNotNull; - -import java.io.IOException; - import org.openstack4j.api.AbstractTest; import org.openstack4j.model.telemetry.Capabilities; import org.testng.annotations.Test; +import java.io.IOException; + +import static org.testng.Assert.assertNotNull; + @Test(suiteName = "Capabilities Tests") public class CapabilitiesTest extends AbstractTest { private static final String JSON_CAPABILITIES = "/telemetry/capabilities.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/telemetry/EventTests.java b/core-test/src/main/java/org/openstack4j/api/telemetry/EventTests.java index 81b2e1c91..cd55045ac 100644 --- a/core-test/src/main/java/org/openstack4j/api/telemetry/EventTests.java +++ b/core-test/src/main/java/org/openstack4j/api/telemetry/EventTests.java @@ -11,7 +11,7 @@ import static org.testng.Assert.assertEquals; -@Test(suiteName="Event Tests") +@Test(suiteName = "Event Tests") public class EventTests extends AbstractTest { private static final String JSON_EVENTS = "/telemetry/events.json"; diff --git a/core-test/src/main/java/org/openstack4j/api/telemetry/MeterSampleTests.java b/core-test/src/main/java/org/openstack4j/api/telemetry/MeterSampleTests.java index f302aa50f..585831be7 100644 --- a/core-test/src/main/java/org/openstack4j/api/telemetry/MeterSampleTests.java +++ b/core-test/src/main/java/org/openstack4j/api/telemetry/MeterSampleTests.java @@ -1,18 +1,15 @@ package org.openstack4j.api.telemetry; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; - +import okhttp3.mockwebserver.RecordedRequest; import org.openstack4j.api.AbstractTest; import org.openstack4j.model.telemetry.MeterSample; import org.openstack4j.model.telemetry.SampleCriteria; import org.testng.annotations.Test; -import okhttp3.mockwebserver.RecordedRequest; +import java.io.IOException; +import java.util.List; + +import static org.testng.Assert.*; @Test(suiteName = "Meter Sample Tests") public class MeterSampleTests extends AbstractTest { @@ -37,21 +34,21 @@ public void listMeterSampleTest() throws IOException, InterruptedException { assertNotNull(sample.getMetadata()); assertEquals(sample.getMetadata().size(), 26); } - + @Test public void listMeterSampleWithLimitTest() throws IOException, InterruptedException { respondWith(JSON_METER_SAMPLES); SampleCriteria sampleCriteria = SampleCriteria.create().limit(3); - - osv3().telemetry().meters().samples("cpu",sampleCriteria); - + + osv3().telemetry().meters().samples("cpu", sampleCriteria); + // Check that the list request is the one we expect RecordedRequest listRequest = server.takeRequest(); assertNotNull(listRequest.getHeader("X-Auth-Token")); assertTrue(listRequest.getRequestLine().contains("limit=3")); } - + @Test public void listMeterSampleWithLargerLimitTest() throws IOException, InterruptedException { respondWith(JSON_METER_SAMPLES); diff --git a/core-test/src/main/java/org/openstack4j/api/telemetry/ResourceTest.java b/core-test/src/main/java/org/openstack4j/api/telemetry/ResourceTest.java index 76efbaf17..e61e9117a 100644 --- a/core-test/src/main/java/org/openstack4j/api/telemetry/ResourceTest.java +++ b/core-test/src/main/java/org/openstack4j/api/telemetry/ResourceTest.java @@ -1,14 +1,14 @@ package org.openstack4j.api.telemetry; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.model.telemetry.Resource; +import org.testng.annotations.Test; import java.io.IOException; import java.util.List; -import org.openstack4j.api.AbstractTest; -import org.openstack4j.model.telemetry.Resource; -import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; @Test(suiteName = "Resource Tests") public class ResourceTest extends AbstractTest { diff --git a/core-test/src/main/java/org/openstack4j/api/telemetry/SampleTests.java b/core-test/src/main/java/org/openstack4j/api/telemetry/SampleTests.java index 1323dbe7f..a4c911a41 100644 --- a/core-test/src/main/java/org/openstack4j/api/telemetry/SampleTests.java +++ b/core-test/src/main/java/org/openstack4j/api/telemetry/SampleTests.java @@ -1,14 +1,14 @@ package org.openstack4j.api.telemetry; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; +import org.openstack4j.api.AbstractTest; +import org.openstack4j.model.telemetry.Sample; +import org.testng.annotations.Test; import java.io.IOException; import java.util.List; -import org.openstack4j.api.AbstractTest; -import org.openstack4j.model.telemetry.Sample; -import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; @Test(suiteName = "Sample Tests") public class SampleTests extends AbstractTest { diff --git a/core-test/src/main/java/org/openstack4j/api/trove/DBDatabaseServiceImplTest.java b/core-test/src/main/java/org/openstack4j/api/trove/DBDatabaseServiceImplTest.java index 855207aa0..ac00b5d82 100644 --- a/core-test/src/main/java/org/openstack4j/api/trove/DBDatabaseServiceImplTest.java +++ b/core-test/src/main/java/org/openstack4j/api/trove/DBDatabaseServiceImplTest.java @@ -20,8 +20,8 @@ * Created by sumit gandhi on 8/22/2016. */ -@Test(suiteName="trove/databases") -public class DBDatabaseServiceImplTest extends AbstractTest{ +@Test(suiteName = "trove/databases") +public class DBDatabaseServiceImplTest extends AbstractTest { private static final String TROVE_DATABASES = "/trove/databases.json"; @@ -31,17 +31,17 @@ protected Service service() { } @Test - public void testListDatabases() throws Exception{ + public void testListDatabases() throws Exception { String databaseInstanceId = "54c91755526e44b9808385a263db4aa6"; respondWith(TROVE_DATABASES); List databases = osv2().trove().databaseService().list(databaseInstanceId); assertEquals(5, databases.size()); Preconditions.checkNotNull(databases.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Database from List : "+ databases.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Database from List : " + databases.get(0)); } @Test - public void testCreateDatabase() throws Exception{ + public void testCreateDatabase() throws Exception { String databaseInstanceId = "54c91755526e44b9808385a263db4aa6"; respondWith(200); TroveBuilders troveBuilders = new TroveBuilders(); diff --git a/core-test/src/main/java/org/openstack4j/api/trove/DBDatastoreServiceImplTest.java b/core-test/src/main/java/org/openstack4j/api/trove/DBDatastoreServiceImplTest.java index 3e868e560..633c2f425 100644 --- a/core-test/src/main/java/org/openstack4j/api/trove/DBDatastoreServiceImplTest.java +++ b/core-test/src/main/java/org/openstack4j/api/trove/DBDatastoreServiceImplTest.java @@ -15,8 +15,8 @@ * Created by sumit gandhi on 8/22/2016. */ -@Test(suiteName="trove/datastores") -public class DBDatastoreServiceImplTest extends AbstractTest{ +@Test(suiteName = "trove/datastores") +public class DBDatastoreServiceImplTest extends AbstractTest { private static final String TROVE_DATASTORES = "/trove/datastores.json"; private static final String TROVE_DATASTORE = "/trove/datastore.json"; @@ -29,16 +29,16 @@ protected Service service() { } @Test - public void testListDatastores() throws Exception{ + public void testListDatastores() throws Exception { respondWith(TROVE_DATASTORES); List datastores = osv2().trove().datastoreService().list(); assertEquals(2, datastores.size()); Preconditions.checkNotNull(datastores.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Datastore from List : "+ datastores.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Datastore from List : " + datastores.get(0)); } @Test - public void testGetOneDatabastore() throws Exception{ + public void testGetOneDatabastore() throws Exception { String datastoreId = "648d260d-c346-4145-8a2d-bbd4d78aedf6"; respondWith(TROVE_DATASTORE); Datastore datastore = osv2().trove().datastoreService().get(datastoreId); @@ -47,17 +47,17 @@ public void testGetOneDatabastore() throws Exception{ } @Test - public void testListDatastoreVersions() throws Exception{ + public void testListDatastoreVersions() throws Exception { String datastoreId = "648d260d-c346-4145-8a2d-bbd4d78aedf6"; respondWith(TROVE_DATASTORE_VERSIONS); List datastoreVersions = osv2().trove().datastoreService().listDatastoreVersions(datastoreId); assertEquals(2, datastoreVersions.size()); Preconditions.checkNotNull(datastoreVersions.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Datastore version from List : "+ datastoreVersions.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Datastore version from List : " + datastoreVersions.get(0)); } @Test - public void testGetOneDatastoreVersion() throws Exception{ + public void testGetOneDatastoreVersion() throws Exception { String datastoreId = "648d260d-c346-4145-8a2d-bbd4d78aedf6"; String datastoreVersionId = "15b7d828-49a5-4d05-af65-e974e0aca7eb"; respondWith(TROVE_DATASTORE_VERSION); diff --git a/core-test/src/main/java/org/openstack4j/api/trove/DBFlavorServiceImplTest.java b/core-test/src/main/java/org/openstack4j/api/trove/DBFlavorServiceImplTest.java index 9ecfd7482..ccaccba43 100644 --- a/core-test/src/main/java/org/openstack4j/api/trove/DBFlavorServiceImplTest.java +++ b/core-test/src/main/java/org/openstack4j/api/trove/DBFlavorServiceImplTest.java @@ -14,7 +14,7 @@ * Created by sumit gandhi on 8/22/2016. */ -@Test(suiteName="trove/flavors") +@Test(suiteName = "trove/flavors") public class DBFlavorServiceImplTest extends AbstractTest { private static final String DATABASE_INSTANCE_FLAVORS = "/trove/instance_flavors.json"; @@ -26,24 +26,24 @@ protected Service service() { } @Test - public void testListDatabaseInstanceFlavors() throws Exception{ + public void testListDatabaseInstanceFlavors() throws Exception { respondWith(DATABASE_INSTANCE_FLAVORS); List flavors = osv2().trove().flavorService().list(); assertEquals(2, flavors.size()); Preconditions.checkNotNull(flavors.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Flavor from List : "+flavors.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Flavor from List : " + flavors.get(0)); - for(int i=0; i instances = osv2().trove().instanceService().list(); assertEquals(1, instances.size()); diff --git a/core-test/src/main/java/org/openstack4j/api/trove/DBUserServiceImplTest.java b/core-test/src/main/java/org/openstack4j/api/trove/DBUserServiceImplTest.java index bb070003c..cb9609a98 100644 --- a/core-test/src/main/java/org/openstack4j/api/trove/DBUserServiceImplTest.java +++ b/core-test/src/main/java/org/openstack4j/api/trove/DBUserServiceImplTest.java @@ -31,21 +31,21 @@ protected Service service() { } @Test - public void testListDatabaseUsers() throws Exception{ + public void testListDatabaseUsers() throws Exception { String databaseInstanceId = "54c91755526e44b9808385a263db4aa6"; respondWith(TROVE_DATABASE_USERS); List databaseUsers = osv2().trove().databaseUsersService().list(databaseInstanceId); assertEquals(2, databaseUsers.size()); Preconditions.checkNotNull(databaseUsers.get(0)); - Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Database User from List : "+ databaseUsers.get(0)); + Logger.getLogger(getClass().getName()).info(getClass().getName() + " : Database User from List : " + databaseUsers.get(0)); } @Test - public void testCreateDatabaseUser() throws Exception{ + public void testCreateDatabaseUser() throws Exception { String databaseInstanceId = "54c91755526e44b9808385a263db4aa6"; respondWith(200); TroveBuilders troveBuilders = new TroveBuilders(); - TroveDatabaseUser databaseUser = (TroveDatabaseUser)troveBuilders.databaseUserCreate().username("dbuser4") + TroveDatabaseUser databaseUser = (TroveDatabaseUser) troveBuilders.databaseUserCreate().username("dbuser4") .password("password").build(); List troveDatabaseUsers = new ArrayList<>(); troveDatabaseUsers.add(databaseUser); diff --git a/core-test/src/main/java/org/openstack4j/api/workflow/CronTriggerTest.java b/core-test/src/main/java/org/openstack4j/api/workflow/CronTriggerTest.java index 7175e703e..064b92f01 100644 --- a/core-test/src/main/java/org/openstack4j/api/workflow/CronTriggerTest.java +++ b/core-test/src/main/java/org/openstack4j/api/workflow/CronTriggerTest.java @@ -1,8 +1,8 @@ package org.openstack4j.api.workflow; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.workflow.Scope; import org.openstack4j.model.workflow.CronTrigger; +import org.openstack4j.model.workflow.Scope; import org.openstack4j.openstack.workflow.domain.MistralCronTrigger; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @@ -10,9 +10,7 @@ import java.util.Collections; import java.util.List; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; +import static org.testng.Assert.*; /** * Test cases for {@link CronTriggerService}. diff --git a/core-test/src/main/java/org/openstack4j/openstack/common/ServiceTypeTest.java b/core-test/src/main/java/org/openstack4j/openstack/common/ServiceTypeTest.java index 6952532cf..b43be131b 100644 --- a/core-test/src/main/java/org/openstack4j/openstack/common/ServiceTypeTest.java +++ b/core-test/src/main/java/org/openstack4j/openstack/common/ServiceTypeTest.java @@ -1,63 +1,65 @@ package org.openstack4j.openstack.common; +import org.openstack4j.api.types.ServiceType; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.openstack4j.api.types.ServiceType; + import static org.testng.Assert.assertEquals; -import org.testng.annotations.BeforeSuite; -import org.testng.annotations.Test; public class ServiceTypeTest { - private Map> types; + private Map> types; private Map> unknownTypes; - @BeforeSuite - public void setup() { - types = new HashMap<>(); - types.put(ServiceType.IDENTITY, Arrays.asList("identity","identityV2","identityv3")); - types.put(ServiceType.APP_CATALOG, Arrays.asList("application-catalog", "Application-catalogv2", "application-Catalogv3")); - types.put(ServiceType.COMPUTE, Arrays.asList("compute", "COMPUTEv2", "computeV3")); - types.put(ServiceType.IMAGE, Arrays.asList("image", "imageV2", "imagev3")); - types.put(ServiceType.BLOCK_STORAGE, Arrays.asList("volume", "volumev1", "volumev2")); - types.put(ServiceType.OBJECT_STORAGE, Arrays.asList("obJect-stOre", "object-storev2", "object-storev3")); - types.put(ServiceType.NETWORK, Arrays.asList("network", "networkv2.0", "networkV3")); - types.put(ServiceType.EC2, Arrays.asList("EC2","ec2V2","ec2v3")); - types.put(ServiceType.TELEMETRY, Arrays.asList("metering","meteringV2.0","meteringv3")); - types.put(ServiceType.TELEMETRY_AODH, Arrays.asList("alarming","alarmingV2","alarmingV3")); - types.put(ServiceType.ORCHESTRATION, Arrays.asList("orchestration","orchestrationv2","orchestrationv3")); - types.put(ServiceType.CLUSTERING, Arrays.asList("clustering","clusteringV2","clustering3")); - types.put(ServiceType.SAHARA, Arrays.asList("data_processing","data_processingV1","data_processingv3")); - types.put(ServiceType.SHARE, Arrays.asList("share","sharev2","shareV3")); - types.put(ServiceType.DATABASE, Arrays.asList("database","databaseV2","Databasev3")); - types.put(ServiceType.BARBICAN, Arrays.asList("key-manager","key-managerv2","key-managerv3")); - types.put(ServiceType.TACKER, Arrays.asList("nfv-orchestration","nfv-orchestrationv2","nfv-orchestration3")); - types.put(ServiceType.ARTIFACT, Arrays.asList("artifact","artifactv2","artifactv3")); - types.put(ServiceType.MAGNUM, Arrays.asList("container","ContainerV3","containerv1")); - types.put(ServiceType.DNS, Arrays.asList("dns","dnsv2","dnsV3")); - types.put(ServiceType.WORKFLOW, Arrays.asList("workflow","workflowv3","workflowv2")); + @BeforeSuite + public void setup() { + types = new HashMap<>(); + types.put(ServiceType.IDENTITY, Arrays.asList("identity", "identityV2", "identityv3")); + types.put(ServiceType.APP_CATALOG, Arrays.asList("application-catalog", "Application-catalogv2", "application-Catalogv3")); + types.put(ServiceType.COMPUTE, Arrays.asList("compute", "COMPUTEv2", "computeV3")); + types.put(ServiceType.IMAGE, Arrays.asList("image", "imageV2", "imagev3")); + types.put(ServiceType.BLOCK_STORAGE, Arrays.asList("volume", "volumev1", "volumev2")); + types.put(ServiceType.OBJECT_STORAGE, Arrays.asList("obJect-stOre", "object-storev2", "object-storev3")); + types.put(ServiceType.NETWORK, Arrays.asList("network", "networkv2.0", "networkV3")); + types.put(ServiceType.EC2, Arrays.asList("EC2", "ec2V2", "ec2v3")); + types.put(ServiceType.TELEMETRY, Arrays.asList("metering", "meteringV2.0", "meteringv3")); + types.put(ServiceType.TELEMETRY_AODH, Arrays.asList("alarming", "alarmingV2", "alarmingV3")); + types.put(ServiceType.ORCHESTRATION, Arrays.asList("orchestration", "orchestrationv2", "orchestrationv3")); + types.put(ServiceType.CLUSTERING, Arrays.asList("clustering", "clusteringV2", "clustering3")); + types.put(ServiceType.SAHARA, Arrays.asList("data_processing", "data_processingV1", "data_processingv3")); + types.put(ServiceType.SHARE, Arrays.asList("share", "sharev2", "shareV3")); + types.put(ServiceType.DATABASE, Arrays.asList("database", "databaseV2", "Databasev3")); + types.put(ServiceType.BARBICAN, Arrays.asList("key-manager", "key-managerv2", "key-managerv3")); + types.put(ServiceType.TACKER, Arrays.asList("nfv-orchestration", "nfv-orchestrationv2", "nfv-orchestration3")); + types.put(ServiceType.ARTIFACT, Arrays.asList("artifact", "artifactv2", "artifactv3")); + types.put(ServiceType.MAGNUM, Arrays.asList("container", "ContainerV3", "containerv1")); + types.put(ServiceType.DNS, Arrays.asList("dns", "dnsv2", "dnsV3")); + types.put(ServiceType.WORKFLOW, Arrays.asList("workflow", "workflowv3", "workflowv2")); - unknownTypes = new HashMap(); - unknownTypes.put(ServiceType.ORCHESTRATION, Arrays.asList("heat-cfg","heatother","heatvm","heat-cfg4")); + unknownTypes = new HashMap(); + unknownTypes.put(ServiceType.ORCHESTRATION, Arrays.asList("heat-cfg", "heatother", "heatvm", "heat-cfg4")); - } + } - @Test - public void testNameResolveByType() { + @Test + public void testNameResolveByType() { for (Map.Entry> entry : types.entrySet()) { - for(String type : entry.getValue()){ - assertEquals(entry.getKey(), ServiceType.forName(type)); - } - } - } + for (String type : entry.getValue()) { + assertEquals(entry.getKey(), ServiceType.forName(type)); + } + } + } @Test public void testNameNotResolved() { for (Map.Entry> entry : unknownTypes.entrySet()) { - for(String type : entry.getValue()){ + for (String type : entry.getValue()) { assertEquals(ServiceType.UNKNOWN, ServiceType.forName(type)); } } diff --git a/core-test/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializerTest.java b/core-test/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializerTest.java index ec64f0cb9..53118bc8b 100644 --- a/core-test/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializerTest.java +++ b/core-test/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializerTest.java @@ -1,6 +1,10 @@ package org.openstack4j.openstack.common; -import static org.testng.Assert.assertEquals; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -10,52 +14,47 @@ import java.util.Date; import java.util.TimeZone; -import org.testng.annotations.BeforeSuite; -import org.testng.annotations.Test; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.ObjectMapper; +import static org.testng.Assert.assertEquals; public class TelemetryDateDeserializerTest { - private ObjectMapper mapper; - private TelemetryDateDeserializer deserializer; - - @BeforeSuite - public void setup() { - mapper = new ObjectMapper(); - deserializer = new TelemetryDateDeserializer(); - } - - @Test - public void testShortDateFormatDeserialize() throws JsonParseException, IOException, ParseException { - Date actual = deserializer.deserialize(getParser("2017-06-28T14:00:00"), mapper.getDeserializationContext()); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); - sdf.setTimeZone(TimeZone.getTimeZone("UTC")); - Date expected = sdf.parse("2017-06-28T14:00:00.000"); - - assertEquals(actual, expected); - } - - @Test - public void testLongDateFormatDeserialize() throws JsonParseException, IOException, ParseException { - Date actual = deserializer.deserialize(getParser("2017-06-28T14:00:00.123000"), mapper.getDeserializationContext()); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); - sdf.setTimeZone(TimeZone.getTimeZone("UTC")); - Date expected = sdf.parse("2017-06-28T14:00:00.123"); - - assertEquals(actual, expected); - } - - private JsonParser getParser(String dateString) throws JsonParseException, IOException { - JsonParser parser = mapper.getFactory().createParser(new ByteArrayInputStream(String - .format("{\"date\":\"%s\"}", dateString).getBytes(StandardCharsets.UTF_8))); - parser.nextToken(); - parser.nextToken(); - parser.nextToken(); - return parser; - } + private ObjectMapper mapper; + private TelemetryDateDeserializer deserializer; + + @BeforeSuite + public void setup() { + mapper = new ObjectMapper(); + deserializer = new TelemetryDateDeserializer(); + } + + @Test + public void testShortDateFormatDeserialize() throws JsonParseException, IOException, ParseException { + Date actual = deserializer.deserialize(getParser("2017-06-28T14:00:00"), mapper.getDeserializationContext()); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); + Date expected = sdf.parse("2017-06-28T14:00:00.000"); + + assertEquals(actual, expected); + } + + @Test + public void testLongDateFormatDeserialize() throws JsonParseException, IOException, ParseException { + Date actual = deserializer.deserialize(getParser("2017-06-28T14:00:00.123000"), mapper.getDeserializationContext()); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); + Date expected = sdf.parse("2017-06-28T14:00:00.123"); + + assertEquals(actual, expected); + } + + private JsonParser getParser(String dateString) throws JsonParseException, IOException { + JsonParser parser = mapper.getFactory().createParser(new ByteArrayInputStream(String + .format("{\"date\":\"%s\"}", dateString).getBytes(StandardCharsets.UTF_8))); + parser.nextToken(); + parser.nextToken(); + parser.nextToken(); + return parser; + } } diff --git a/core-test/src/main/java/org/openstack4j/openstack/internal/MicroVersionedServiceTest.java b/core-test/src/main/java/org/openstack4j/openstack/internal/MicroVersionedServiceTest.java index 15ff69d1a..b0d6d608d 100644 --- a/core-test/src/main/java/org/openstack4j/openstack/internal/MicroVersionedServiceTest.java +++ b/core-test/src/main/java/org/openstack4j/openstack/internal/MicroVersionedServiceTest.java @@ -3,13 +3,9 @@ import org.openstack4j.api.AbstractTest; import org.openstack4j.api.types.ServiceType; import org.openstack4j.core.transport.HttpMethod; -import org.openstack4j.core.transport.HttpRequest; -import org.openstack4j.openstack.internal.MicroVersion; -import org.openstack4j.openstack.internal.MicroVersionedOpenStackService; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.lang.reflect.Method; import java.util.Map; import static org.testng.Assert.assertEquals; diff --git a/core-test/src/main/resources/all.xml b/core-test/src/main/resources/all.xml index eaa03ab60..03c96249f 100644 --- a/core-test/src/main/resources/all.xml +++ b/core-test/src/main/resources/all.xml @@ -1,12 +1,12 @@ - + - + - + \ No newline at end of file diff --git a/core-test/src/main/resources/compute/aggregate_create.json b/core-test/src/main/resources/compute/aggregate_create.json index ec9eb0442..ebe9ac9ed 100644 --- a/core-test/src/main/resources/compute/aggregate_create.json +++ b/core-test/src/main/resources/compute/aggregate_create.json @@ -1,7 +1,6 @@ { - "aggregate": - { - "name": "testAggregate01", - "availability_zone": "nova" - } + "aggregate": { + "name": "testAggregate01", + "availability_zone": "nova" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/aggregates.json b/core-test/src/main/resources/compute/aggregates.json index 94910717b..2331a33cd 100644 --- a/core-test/src/main/resources/compute/aggregates.json +++ b/core-test/src/main/resources/compute/aggregates.json @@ -1,35 +1,35 @@ { - "aggregates": [ - { - "availability_zone": "uec_zone_1", - "create": 1485163578000, - "created_at": 1485163578000, - "deleted": false, - "hosts": [ - "node-70.domain.tld", - "node-68.domain.tld", - "node-69.domain.tld" - ], - "id": "8", - "metadata": { - "availability_zone": "uec_zone_1" - }, - "name": "aggregate_zl_test" - }, - { - "availability_zone": "uec_zone_1", - "create": 1486968614000, - "created_at": 1486968614000, - "deleted": false, - "hosts": [ - "node-70.domain.tld", - "node-69.domain.tld" - ], - "id": "9", - "metadata": { - "availability_zone": "uec_zone_1" - }, - "name": "cyTest01" - } - ] + "aggregates": [ + { + "availability_zone": "uec_zone_1", + "create": 1485163578000, + "created_at": 1485163578000, + "deleted": false, + "hosts": [ + "node-70.domain.tld", + "node-68.domain.tld", + "node-69.domain.tld" + ], + "id": "8", + "metadata": { + "availability_zone": "uec_zone_1" + }, + "name": "aggregate_zl_test" + }, + { + "availability_zone": "uec_zone_1", + "create": 1486968614000, + "created_at": 1486968614000, + "deleted": false, + "hosts": [ + "node-70.domain.tld", + "node-69.domain.tld" + ], + "id": "9", + "metadata": { + "availability_zone": "uec_zone_1" + }, + "name": "cyTest01" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/ext/instance_action.json b/core-test/src/main/resources/compute/ext/instance_action.json index f259deefd..429f2f0fd 100644 --- a/core-test/src/main/resources/compute/ext/instance_action.json +++ b/core-test/src/main/resources/compute/ext/instance_action.json @@ -1,27 +1,27 @@ { - "instanceAction": { - "action": "reboot", - "events": [ - { - "event": "schedule", - "finish_time": "2012-12-05T01:02:00.000000", - "result": "Success", - "start_time": "2012-12-05T01:00:02.000000", - "traceback": "" - }, - { - "event": "compute_create", - "finish_time": "2012-12-05T01:04:00.000000", - "result": "Success", - "start_time": "2012-12-05T01:03:00.000000", - "traceback": "" - } - ], - "instance_uuid": "b48316c5-71e8-45e4-9884-6c78055b9b13", - "message": "", - "project_id": "147", - "request_id": "req-3293a3f1-b44c-4609-b8d2-d81b105636b8", - "start_time": "2012-12-05T00:00:00.000000", - "user_id": "789" - } + "instanceAction": { + "action": "reboot", + "events": [ + { + "event": "schedule", + "finish_time": "2012-12-05T01:02:00.000000", + "result": "Success", + "start_time": "2012-12-05T01:00:02.000000", + "traceback": "" + }, + { + "event": "compute_create", + "finish_time": "2012-12-05T01:04:00.000000", + "result": "Success", + "start_time": "2012-12-05T01:03:00.000000", + "traceback": "" + } + ], + "instance_uuid": "b48316c5-71e8-45e4-9884-6c78055b9b13", + "message": "", + "project_id": "147", + "request_id": "req-3293a3f1-b44c-4609-b8d2-d81b105636b8", + "start_time": "2012-12-05T00:00:00.000000", + "user_id": "789" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/ext/instance_actions.json b/core-test/src/main/resources/compute/ext/instance_actions.json index 91289589a..cff18a035 100644 --- a/core-test/src/main/resources/compute/ext/instance_actions.json +++ b/core-test/src/main/resources/compute/ext/instance_actions.json @@ -1,22 +1,22 @@ { - "instanceActions": [ - { - "action": "resize", - "instance_uuid": "b48316c5-71e8-45e4-9884-6c78055b9b13", - "message": "", - "project_id": "842", - "request_id": "req-25517360-b757-47d3-be45-0e8d2a01b36a", - "start_time": "2012-12-05T01:00:00.000000", - "user_id": "789" - }, - { - "action": "reboot", - "instance_uuid": "b48316c5-71e8-45e4-9884-6c78055b9b13", - "message": "", - "project_id": "147", - "request_id": "req-3293a3f1-b44c-4609-b8d2-d81b105636b8", - "start_time": "2012-12-05T00:00:00.000000", - "user_id": "789" - } - ] + "instanceActions": [ + { + "action": "resize", + "instance_uuid": "b48316c5-71e8-45e4-9884-6c78055b9b13", + "message": "", + "project_id": "842", + "request_id": "req-25517360-b757-47d3-be45-0e8d2a01b36a", + "start_time": "2012-12-05T01:00:00.000000", + "user_id": "789" + }, + { + "action": "reboot", + "instance_uuid": "b48316c5-71e8-45e4-9884-6c78055b9b13", + "message": "", + "project_id": "147", + "request_id": "req-3293a3f1-b44c-4609-b8d2-d81b105636b8", + "start_time": "2012-12-05T00:00:00.000000", + "user_id": "789" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/extensions.json b/core-test/src/main/resources/compute/extensions.json index f98707a29..6c3b3de86 100644 --- a/core-test/src/main/resources/compute/extensions.json +++ b/core-test/src/main/resources/compute/extensions.json @@ -1,24 +1,22 @@ { - "extensions":[ + "extensions": [ { - "updated":"2014-12-03T00:00:00Z", - "name":"Multinic", - "links":[ - + "updated": "2014-12-03T00:00:00Z", + "name": "Multinic", + "links": [ ], - "namespace":"http://docs.openstack.org/compute/ext/fake_xml", - "alias":"NMN", - "description":"Multiple network support." + "namespace": "http://docs.openstack.org/compute/ext/fake_xml", + "alias": "NMN", + "description": "Multiple network support." }, { - "updated":"2014-12-03T00:00:00Z", - "name":"DiskConfig", - "links":[ - + "updated": "2014-12-03T00:00:00Z", + "name": "DiskConfig", + "links": [ ], - "namespace":"http://docs.openstack.org/compute/ext/fake_xml", - "alias":"OS-DCF", - "description":"Disk Management Extension." + "namespace": "http://docs.openstack.org/compute/ext/fake_xml", + "alias": "OS-DCF", + "description": "Disk Management Extension." } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/flavor.json b/core-test/src/main/resources/compute/flavor.json index f0c637eeb..c4bc19be9 100644 --- a/core-test/src/main/resources/compute/flavor.json +++ b/core-test/src/main/resources/compute/flavor.json @@ -1,23 +1,23 @@ { - "flavor": { - "disk": 1, - "id": "1", - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/flavors/1", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/flavors/1", - "rel": "bookmark" - } - ], - "name": "m1.tiny", - "ram": 512, - "os-flavor-access:is_public": true, - "OS-FLV-EXT-DATA:ephemeral": 0, - "OS-FLV-DISABLED:disabled": false, - "rxtx_factor": 2.0, - "vcpus": 1 - } + "flavor": { + "disk": 1, + "id": "1", + "links": [ + { + "href": "http://openstack.example.com/v2/openstack/flavors/1", + "rel": "self" + }, + { + "href": "http://openstack.example.com/openstack/flavors/1", + "rel": "bookmark" + } + ], + "name": "m1.tiny", + "ram": 512, + "os-flavor-access:is_public": true, + "OS-FLV-EXT-DATA:ephemeral": 0, + "OS-FLV-DISABLED:disabled": false, + "rxtx_factor": 2.0, + "vcpus": 1 + } } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/flavor_create.json b/core-test/src/main/resources/compute/flavor_create.json index c8aeb3f7a..deff2600b 100644 --- a/core-test/src/main/resources/compute/flavor_create.json +++ b/core-test/src/main/resources/compute/flavor_create.json @@ -1,13 +1,13 @@ -{ - "flavor":{ - "vcpus":1, - "disk":2, - "name":"m1.tiny", - "os-flavor-access:is_public":true, - "rxtx_factor":2.0, - "OS-FLV-EXT-DATA:ephemeral":1, - "ram":128, - "id":"1", - "swap":1 - } +{ + "flavor": { + "vcpus": 1, + "disk": 2, + "name": "m1.tiny", + "os-flavor-access:is_public": true, + "rxtx_factor": 2.0, + "OS-FLV-EXT-DATA:ephemeral": 1, + "ram": 128, + "id": "1", + "swap": 1 + } } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/flavors.json b/core-test/src/main/resources/compute/flavors.json index ab86d2a52..9a924267f 100644 --- a/core-test/src/main/resources/compute/flavors.json +++ b/core-test/src/main/resources/compute/flavors.json @@ -1,74 +1,74 @@ { - "flavors": [ + "flavors": [ + { + "id": "1", + "links": [ { - "id": "1", - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/flavors/1", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/flavors/1", - "rel": "bookmark" - } - ], - "name": "m1.tiny" + "href": "http://openstack.example.com/v2/openstack/flavors/1", + "rel": "self" }, { - "id": "2", - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/flavors/2", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/flavors/2", - "rel": "bookmark" - } - ], - "name": "m1.small" + "href": "http://openstack.example.com/openstack/flavors/1", + "rel": "bookmark" + } + ], + "name": "m1.tiny" + }, + { + "id": "2", + "links": [ + { + "href": "http://openstack.example.com/v2/openstack/flavors/2", + "rel": "self" + }, + { + "href": "http://openstack.example.com/openstack/flavors/2", + "rel": "bookmark" + } + ], + "name": "m1.small" + }, + { + "id": "3", + "links": [ + { + "href": "http://openstack.example.com/v2/openstack/flavors/3", + "rel": "self" }, { - "id": "3", - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/flavors/3", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/flavors/3", - "rel": "bookmark" - } - ], - "name": "m1.medium" + "href": "http://openstack.example.com/openstack/flavors/3", + "rel": "bookmark" + } + ], + "name": "m1.medium" + }, + { + "id": "4", + "links": [ + { + "href": "http://openstack.example.com/v2/openstack/flavors/4", + "rel": "self" }, { - "id": "4", - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/flavors/4", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/flavors/4", - "rel": "bookmark" - } - ], - "name": "m1.large" + "href": "http://openstack.example.com/openstack/flavors/4", + "rel": "bookmark" + } + ], + "name": "m1.large" + }, + { + "id": "5", + "links": [ + { + "href": "http://openstack.example.com/v2/openstack/flavors/5", + "rel": "self" }, { - "id": "5", - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/flavors/5", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/flavors/5", - "rel": "bookmark" - } - ], - "name": "m1.xlarge" + "href": "http://openstack.example.com/openstack/flavors/5", + "rel": "bookmark" } - ] + ], + "name": "m1.xlarge" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/flavors_detailed.json b/core-test/src/main/resources/compute/flavors_detailed.json index e59b5baf4..c5b6de047 100644 --- a/core-test/src/main/resources/compute/flavors_detailed.json +++ b/core-test/src/main/resources/compute/flavors_detailed.json @@ -1,48 +1,48 @@ { - "flavors": [ + "flavors": [ + { + "name": "m1.nano", + "links": [ { - "name": "m1.nano", - "links": [ - { - "href": "http://openstack.example.com:8774/v2.1/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/0", - "rel": "self" - }, - { - "href": "http://openstack.example.com:8774/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/0", - "rel": "bookmark" - } - ], - "ram": 64, - "OS-FLV-DISABLED:disabled": false, - "vcpus": 1, - "swap": "", - "os-flavor-access:is_public": true, - "rxtx_factor": 1, - "OS-FLV-EXT-DATA:ephemeral": 0, - "disk": 1, - "id": "0" + "href": "http://openstack.example.com:8774/v2.1/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/0", + "rel": "self" }, { - "name": "m1.tiny", - "links": [ - { - "href": "http://openstack.example.com:8774/v2.1/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/1", - "rel": "self" - }, - { - "href": "http://openstack.example.com:8774/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/1", - "rel": "bookmark" - } - ], - "ram": 512, - "OS-FLV-DISABLED:disabled": false, - "vcpus": 1, - "swap": "", - "os-flavor-access:is_public": true, - "rxtx_factor": 1, - "OS-FLV-EXT-DATA:ephemeral": 0, - "disk": 1, - "id": "1" + "href": "http://openstack.example.com:8774/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/0", + "rel": "bookmark" } - ] + ], + "ram": 64, + "OS-FLV-DISABLED:disabled": false, + "vcpus": 1, + "swap": "", + "os-flavor-access:is_public": true, + "rxtx_factor": 1, + "OS-FLV-EXT-DATA:ephemeral": 0, + "disk": 1, + "id": "0" + }, + { + "name": "m1.tiny", + "links": [ + { + "href": "http://openstack.example.com:8774/v2.1/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/1", + "rel": "self" + }, + { + "href": "http://openstack.example.com:8774/8fd2b4f2b5cf4fa184e5c3c5020408c7/flavors/1", + "rel": "bookmark" + } + ], + "ram": 512, + "OS-FLV-DISABLED:disabled": false, + "vcpus": 1, + "swap": "", + "os-flavor-access:is_public": true, + "rxtx_factor": 1, + "OS-FLV-EXT-DATA:ephemeral": 0, + "disk": 1, + "id": "1" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/floatingips.json b/core-test/src/main/resources/compute/floatingips.json index 9e79b02db..fd64d54ce 100644 --- a/core-test/src/main/resources/compute/floatingips.json +++ b/core-test/src/main/resources/compute/floatingips.json @@ -1,33 +1,39 @@ { - "floating_ips": [{ - "instance_id": null, - "ip": "192.168.0.100", - "fixed_ip": null, - "id": "f8d696d4-573d-4750-baa5-2cf75771a824", - "pool": "floating" - }, { - "instance_id": null, - "ip": "192.168.0.101", - "fixed_ip": null, - "id": "88b80e99-e719-453d-a16b-9ae8abae3c7c", - "pool": "floating" - }, { - "instance_id": null, - "ip": "192.168.0.102", - "fixed_ip": null, - "id": "05d6f197-57d4-44b7-9ad5-994c8f8fe250", - "pool": "floating" - }, { - "instance_id": null, - "ip": "192.168.0.103", - "fixed_ip": null, - "id": "74db2673-23dd-4f44-8b01-4d92a023bb46", - "pool": "floating" - }, { - "instance_id": null, - "ip": "192.168.0.104", - "fixed_ip": null, - "id": "940484f3-d76e-4c18-9bbe-80901d6dbaa6", - "pool": "floating" - }] + "floating_ips": [ + { + "instance_id": null, + "ip": "192.168.0.100", + "fixed_ip": null, + "id": "f8d696d4-573d-4750-baa5-2cf75771a824", + "pool": "floating" + }, + { + "instance_id": null, + "ip": "192.168.0.101", + "fixed_ip": null, + "id": "88b80e99-e719-453d-a16b-9ae8abae3c7c", + "pool": "floating" + }, + { + "instance_id": null, + "ip": "192.168.0.102", + "fixed_ip": null, + "id": "05d6f197-57d4-44b7-9ad5-994c8f8fe250", + "pool": "floating" + }, + { + "instance_id": null, + "ip": "192.168.0.103", + "fixed_ip": null, + "id": "74db2673-23dd-4f44-8b01-4d92a023bb46", + "pool": "floating" + }, + { + "instance_id": null, + "ip": "192.168.0.104", + "fixed_ip": null, + "id": "940484f3-d76e-4c18-9bbe-80901d6dbaa6", + "pool": "floating" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/host_describe.json b/core-test/src/main/resources/compute/host_describe.json index fc19d3a17..cd40ce84a 100644 --- a/core-test/src/main/resources/compute/host_describe.json +++ b/core-test/src/main/resources/compute/host_describe.json @@ -1,31 +1,31 @@ { - "host": [ - { - "resource": { - "cpu": 1, - "disk_gb": 1028, - "host": "c1a7de0ac9d94e4baceae031d05caae3", - "memory_mb": 8192, - "project": "(total)" - } - }, - { - "resource": { - "cpu": 0, - "disk_gb": 0, - "host": "c1a7de0ac9d94e4baceae031d05caae3", - "memory_mb": 512, - "project": "(used_now)" - } - }, - { - "resource": { - "cpu": 0, - "disk_gb": 0, - "host": "c1a7de0ac9d94e4baceae031d05caae3", - "memory_mb": 0, - "project": "(used_max)" - } - } - ] + "host": [ + { + "resource": { + "cpu": 1, + "disk_gb": 1028, + "host": "c1a7de0ac9d94e4baceae031d05caae3", + "memory_mb": 8192, + "project": "(total)" + } + }, + { + "resource": { + "cpu": 0, + "disk_gb": 0, + "host": "c1a7de0ac9d94e4baceae031d05caae3", + "memory_mb": 512, + "project": "(used_now)" + } + }, + { + "resource": { + "cpu": 0, + "disk_gb": 0, + "host": "c1a7de0ac9d94e4baceae031d05caae3", + "memory_mb": 0, + "project": "(used_max)" + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/migrations.json b/core-test/src/main/resources/compute/migrations.json index 91775be77..99d43355b 100644 --- a/core-test/src/main/resources/compute/migrations.json +++ b/core-test/src/main/resources/compute/migrations.json @@ -1,32 +1,32 @@ { - "migrations": [ - { - "created_at": "2012-10-29T13:42:02.000000", - "dest_compute": "compute2", - "dest_host": "1.2.3.4", - "dest_node": "node2", - "id": 1234, - "instance_uuid": "instance_id_123", - "new_instance_type_id": 2, - "old_instance_type_id": 1, - "source_compute": "compute1", - "source_node": "node1", - "status": "Done", - "updated_at": "2012-10-29T13:42:02.000000" - }, - { - "created_at": "2013-10-22T13:42:02.000000", - "dest_compute": "compute20", - "dest_host": "5.6.7.8", - "dest_node": "node20", - "id": 5678, - "instance_uuid": "instance_id_456", - "new_instance_type_id": 6, - "old_instance_type_id": 5, - "source_compute": "compute10", - "source_node": "node10", - "status": "Done", - "updated_at": "2013-10-22T13:42:02.000000" - } - ] + "migrations": [ + { + "created_at": "2012-10-29T13:42:02.000000", + "dest_compute": "compute2", + "dest_host": "1.2.3.4", + "dest_node": "node2", + "id": 1234, + "instance_uuid": "instance_id_123", + "new_instance_type_id": 2, + "old_instance_type_id": 1, + "source_compute": "compute1", + "source_node": "node1", + "status": "Done", + "updated_at": "2012-10-29T13:42:02.000000" + }, + { + "created_at": "2013-10-22T13:42:02.000000", + "dest_compute": "compute20", + "dest_host": "5.6.7.8", + "dest_node": "node20", + "id": 5678, + "instance_uuid": "instance_id_456", + "new_instance_type_id": 6, + "old_instance_type_id": 5, + "source_compute": "compute10", + "source_node": "node10", + "status": "Done", + "updated_at": "2013-10-22T13:42:02.000000" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/server_console_output.json b/core-test/src/main/resources/compute/server_console_output.json index a8b20c6af..fe3ebcb78 100644 --- a/core-test/src/main/resources/compute/server_console_output.json +++ b/core-test/src/main/resources/compute/server_console_output.json @@ -1,3 +1,3 @@ { - "output": "open-vm-tools: not starting as this is not a VMware VM\nlandscape-client is not configured, please run landscape-config.\n * Stopping save kernel messages[74G[ OK ]\n * Stopping CPU interrupts balancing daemon[74G[ OK ]\n * Starting automatic crash report generation[74G[ OK ]\n * Restoring resolver state... [80G [74G[ OK ]\n * Starting Seed the pseudo random number generator on first boot[74G[[31mfail[39;49m]\n * Stopping System V runlevel compatibility[74G[ OK ]\nGenerating locales...\n en_US.UTF-8... up-to-date\nGeneration complete.\n\nUbuntu 14.04.1 LTS 05184ba3-00ba-4fbc-b7a2-03b62b884931 ttyS0\n\n05184ba3-00ba-4fbc-b7a2-03b62b884931 login: Cloud-init v. 0.7.5 running 'modules:final' at Fri, 24 Feb 2017 17:01:09 +0000. Up 22.35 seconds.\n\nci-info: ++++++++++Authorized keys from /home/ubuntu/.ssh/authorized_keys for user ubuntu+++++++++++\nci-info: +---------+-------------------------------------------------+---------+-------------------+\nci-info: | Keytype | Fingerprint (md5) | Options | Comment |\nci-info: +---------+-------------------------------------------------+---------+-------------------+\nci-info: | ssh-rsa | 93:99:62:d3:db:ec:d9:b1:8b:95:dd:a4:b2:80:2a:04 | - | Generated-by-Nova |\nci-info: +---------+-------------------------------------------------+---------+-------------------+\nec2: \nec2: #############################################################\nec2: -----BEGIN SSH HOST KEY FINGERPRINTS-----\nec2: 1024 7e:05:9e:2c:11:98:40:65:88:7b:f5:19:cc:fa:22:04 root@05184ba3-00ba-4fbc-b7a2-03b62b884931 (DSA)\nec2: 256 31:04:ad:9f:f6:4b:b3:9c:f7:ef:77:e5:8c:13:0d:88 root@05184ba3-00ba-4fbc-b7a2-03b62b884931 (ECDSA)\nec2: 2048 27:23:99:cd:4f:77:95:06:72:e1:ed:81:73:d4:d2:df root@05184ba3-00ba-4fbc-b7a2-03b62b884931 (RSA)\nec2: -----END SSH HOST KEY FINGERPRINTS-----\nec2: #############################################################\n-----BEGIN SSH HOST KEY KEYS-----\necdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGAuTHYYc8PW2ASU/qeqt6b9aP5QHr+sLKNZ+COeEBjEcSPcXfWLOTvvhaYtd7qV/BJ64brpRgnMaPVYkkGYw58= root@05184ba3-00ba-4fbc-b7a2-03b62b884931\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD32ZzkFehp0d6Iq3GcSTBeIt5Wx97g7JtsD/hVbv/8iQQzdMB4/M2wZ796FbqECEsi34+NUCm0RazLIBpeQ26Q9ffFMMag7T+0RypeeDYnj/2mr8KZbSM+Fj7o6E2JFlfPRDVlNhP1UMY8TeMr4T7tEs6IYEmxyBrXCNJ5aPxbfTVQrq9dphDhCtM/sBofbR3T71lgvTgHmZJp7ItFOokIa1LWs6uMP3LEROBmyTHDYPBDrTmaFZkx5gG0mBQlU2QqfA/7XSApLDZmCr/s7xgMfKy0NwONu/biNfFoPgRFKPM1NrV86P7CFMEyjN05bYAFe4xhO2tg2vjM07kxO2zr root@05184ba3-00ba-4fbc-b7a2-03b62b884931\n-----END SSH HOST KEY KEYS-----\nCloud-init v. 0.7.5 finished at Fri, 24 Feb 2017 17:01:10 +0000. Datasource DataSourceOpenStack [net,ver=2]. Up 22.60 seconds\n" + "output": "open-vm-tools: not starting as this is not a VMware VM\nlandscape-client is not configured, please run landscape-config.\n * Stopping save kernel messages[74G[ OK ]\n * Stopping CPU interrupts balancing daemon[74G[ OK ]\n * Starting automatic crash report generation[74G[ OK ]\n * Restoring resolver state... [80G [74G[ OK ]\n * Starting Seed the pseudo random number generator on first boot[74G[[31mfail[39;49m]\n * Stopping System V runlevel compatibility[74G[ OK ]\nGenerating locales...\n en_US.UTF-8... up-to-date\nGeneration complete.\n\nUbuntu 14.04.1 LTS 05184ba3-00ba-4fbc-b7a2-03b62b884931 ttyS0\n\n05184ba3-00ba-4fbc-b7a2-03b62b884931 login: Cloud-init v. 0.7.5 running 'modules:final' at Fri, 24 Feb 2017 17:01:09 +0000. Up 22.35 seconds.\n\nci-info: ++++++++++Authorized keys from /home/ubuntu/.ssh/authorized_keys for user ubuntu+++++++++++\nci-info: +---------+-------------------------------------------------+---------+-------------------+\nci-info: | Keytype | Fingerprint (md5) | Options | Comment |\nci-info: +---------+-------------------------------------------------+---------+-------------------+\nci-info: | ssh-rsa | 93:99:62:d3:db:ec:d9:b1:8b:95:dd:a4:b2:80:2a:04 | - | Generated-by-Nova |\nci-info: +---------+-------------------------------------------------+---------+-------------------+\nec2: \nec2: #############################################################\nec2: -----BEGIN SSH HOST KEY FINGERPRINTS-----\nec2: 1024 7e:05:9e:2c:11:98:40:65:88:7b:f5:19:cc:fa:22:04 root@05184ba3-00ba-4fbc-b7a2-03b62b884931 (DSA)\nec2: 256 31:04:ad:9f:f6:4b:b3:9c:f7:ef:77:e5:8c:13:0d:88 root@05184ba3-00ba-4fbc-b7a2-03b62b884931 (ECDSA)\nec2: 2048 27:23:99:cd:4f:77:95:06:72:e1:ed:81:73:d4:d2:df root@05184ba3-00ba-4fbc-b7a2-03b62b884931 (RSA)\nec2: -----END SSH HOST KEY FINGERPRINTS-----\nec2: #############################################################\n-----BEGIN SSH HOST KEY KEYS-----\necdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGAuTHYYc8PW2ASU/qeqt6b9aP5QHr+sLKNZ+COeEBjEcSPcXfWLOTvvhaYtd7qV/BJ64brpRgnMaPVYkkGYw58= root@05184ba3-00ba-4fbc-b7a2-03b62b884931\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD32ZzkFehp0d6Iq3GcSTBeIt5Wx97g7JtsD/hVbv/8iQQzdMB4/M2wZ796FbqECEsi34+NUCm0RazLIBpeQ26Q9ffFMMag7T+0RypeeDYnj/2mr8KZbSM+Fj7o6E2JFlfPRDVlNhP1UMY8TeMr4T7tEs6IYEmxyBrXCNJ5aPxbfTVQrq9dphDhCtM/sBofbR3T71lgvTgHmZJp7ItFOokIa1LWs6uMP3LEROBmyTHDYPBDrTmaFZkx5gG0mBQlU2QqfA/7XSApLDZmCr/s7xgMfKy0NwONu/biNfFoPgRFKPM1NrV86P7CFMEyjN05bYAFe4xhO2tg2vjM07kxO2zr root@05184ba3-00ba-4fbc-b7a2-03b62b884931\n-----END SSH HOST KEY KEYS-----\nCloud-init v. 0.7.5 finished at Fri, 24 Feb 2017 17:01:10 +0000. Datasource DataSourceOpenStack [net,ver=2]. Up 22.60 seconds\n" } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/server_create.json b/core-test/src/main/resources/compute/server_create.json index 22bca2a73..599e2a160 100644 --- a/core-test/src/main/resources/compute/server_create.json +++ b/core-test/src/main/resources/compute/server_create.json @@ -1,22 +1,22 @@ { - "server": { - "name": "server-test-1", - "imageRef": "b5660a6e-4b46-4be3-9707-6b47221b454f", - "flavorRef": "2", - "max_count": 1, - "min_count": 1, - "networks": [ - { - "uuid": "d32019d3-bc6e-4319-9c1d-6722fc136a22" - } - ], - "security_groups": [ - { - "name": "default" - }, - { - "name": "another-secgroup-name" - } - ] - } + "server": { + "name": "server-test-1", + "imageRef": "b5660a6e-4b46-4be3-9707-6b47221b454f", + "flavorRef": "2", + "max_count": 1, + "min_count": 1, + "networks": [ + { + "uuid": "d32019d3-bc6e-4319-9c1d-6722fc136a22" + } + ], + "security_groups": [ + { + "name": "default" + }, + { + "name": "another-secgroup-name" + } + ] + } } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/server_evacuate.json b/core-test/src/main/resources/compute/server_evacuate.json index 6cd942395..6d4cf745f 100644 --- a/core-test/src/main/resources/compute/server_evacuate.json +++ b/core-test/src/main/resources/compute/server_evacuate.json @@ -1,3 +1,3 @@ { - "adminPass": "MySecretPass" + "adminPass": "MySecretPass" } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/servers.json b/core-test/src/main/resources/compute/servers.json index 3ea61531e..f63097b88 100644 --- a/core-test/src/main/resources/compute/servers.json +++ b/core-test/src/main/resources/compute/servers.json @@ -1,56 +1,56 @@ { - "servers": [ + "servers": [ + { + "accessIPv4": "", + "accessIPv6": "", + "addresses": { + "private": [ + { + "addr": "192.168.0.3", + "version": 4 + } + ] + }, + "created": "2012-09-07T16:56:37Z", + "flavor": { + "id": "1", + "links": [ + { + "href": "http://openstack.example.com/openstack/flavors/1", + "rel": "bookmark" + } + ] + }, + "hostId": "16d193736a5cfdb60c697ca27ad071d6126fa13baeb670fc9d10645e", + "id": "05184ba3-00ba-4fbc-b7a2-03b62b884931", + "image": { + "id": "70a599e0-31e7-49b7-b260-868f441e862b", + "links": [ + { + "href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b", + "rel": "bookmark" + } + ] + }, + "links": [ { - "accessIPv4": "", - "accessIPv6": "", - "addresses": { - "private": [ - { - "addr": "192.168.0.3", - "version": 4 - } - ] - }, - "created": "2012-09-07T16:56:37Z", - "flavor": { - "id": "1", - "links": [ - { - "href": "http://openstack.example.com/openstack/flavors/1", - "rel": "bookmark" - } - ] - }, - "hostId": "16d193736a5cfdb60c697ca27ad071d6126fa13baeb670fc9d10645e", - "id": "05184ba3-00ba-4fbc-b7a2-03b62b884931", - "image": { - "id": "70a599e0-31e7-49b7-b260-868f441e862b", - "links": [ - { - "href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b", - "rel": "bookmark" - } - ] - }, - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931", - "rel": "bookmark" - } - ], - "metadata": { - "My Server Name": "Apache1" - }, - "name": "new-server-test", - "progress": 0, - "status": "ACTIVE", - "tenant_id": "openstack", - "updated": "2012-09-07T16:56:37Z", - "user_id": "fake" + "href": "http://openstack.example.com/v2/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931", + "rel": "self" + }, + { + "href": "http://openstack.example.com/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931", + "rel": "bookmark" } - ] + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "updated": "2012-09-07T16:56:37Z", + "user_id": "fake" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/services.json b/core-test/src/main/resources/compute/services.json index 2a311a163..b6aa5fbdb 100644 --- a/core-test/src/main/resources/compute/services.json +++ b/core-test/src/main/resources/compute/services.json @@ -1,39 +1,39 @@ { - "services": [ - { - "binary": "nova-scheduler", - "host": "host1", - "state": "up", - "status": "disabled", - "updated_at": "2012-10-29T13:42:02.000000", - "zone": "internal", - "disabled_reason": "test1" - }, - { - "binary": "nova-compute", - "host": "host1", - "state": "up", - "status": "disabled", - "updated_at": "2012-10-29T13:42:05.000000", - "zone": "nova" - }, - { - "binary": "nova-scheduler", - "host": "host2", - "state": "down", - "status": "enabled", - "updated_at": "2012-09-19T06:55:34.000000", - "zone": "internal", - "disabled_reason": "" - }, - { - "binary": "nova-compute", - "host": "host2", - "state": "down", - "status": "disabled", - "updated_at": "2012-09-18T08:03:38.000000", - "zone": "nova", - "disabled_reason": "test4" - } - ] + "services": [ + { + "binary": "nova-scheduler", + "host": "host1", + "state": "up", + "status": "disabled", + "updated_at": "2012-10-29T13:42:02.000000", + "zone": "internal", + "disabled_reason": "test1" + }, + { + "binary": "nova-compute", + "host": "host1", + "state": "up", + "status": "disabled", + "updated_at": "2012-10-29T13:42:05.000000", + "zone": "nova" + }, + { + "binary": "nova-scheduler", + "host": "host2", + "state": "down", + "status": "enabled", + "updated_at": "2012-09-19T06:55:34.000000", + "zone": "internal", + "disabled_reason": "" + }, + { + "binary": "nova-compute", + "host": "host2", + "state": "down", + "status": "disabled", + "updated_at": "2012-09-18T08:03:38.000000", + "zone": "nova", + "disabled_reason": "test4" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/compute/tags.json b/core-test/src/main/resources/compute/tags.json index 103c8a630..40e1ec4b9 100644 --- a/core-test/src/main/resources/compute/tags.json +++ b/core-test/src/main/resources/compute/tags.json @@ -1,3 +1,6 @@ { - "tags": ["tag1", "tag2"] + "tags": [ + "tag1", + "tag2" + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/heat/abandon.json b/core-test/src/main/resources/heat/abandon.json index 2db859570..49933bebc 100644 --- a/core-test/src/main/resources/heat/abandon.json +++ b/core-test/src/main/resources/heat/abandon.json @@ -1,55 +1,48 @@ { - "files":{ - - }, - "status":"COMPLETE", - "name":"stack_123", - "tags":null, - "stack_user_project_id":"44ed5c0be2384092b8e8b6444812db5d", - "environment":{ - "event_sinks":[ - - ], - "parameter_defaults":{ - - }, - "parameters":{ - - }, - "resource_registry":{ - "resources":{ - - } + "files": { + }, + "status": "COMPLETE", + "name": "stack_123", + "tags": null, + "stack_user_project_id": "44ed5c0be2384092b8e8b6444812db5d", + "environment": { + "event_sinks": [ + ], + "parameter_defaults": { + }, + "parameters": { + }, + "resource_registry": { + "resources": { } - }, - "template":{ - "heat_template_version":"2016-04-08", - "description":"A heat test template", - "resources":{ - "network_port":{ - "type":"OS::Neutron::Port", - "properties":{ - "network_id":"network123" - } - } + } + }, + "template": { + "heat_template_version": "2016-04-08", + "description": "A heat test template", + "resources": { + "network_port": { + "type": "OS::Neutron::Port", + "properties": { + "network_id": "network123" + } } - }, - "action":"CREATE", - "project_id":"0dbd25a2a75347cf88a0a52638b8fff3", - "id":"416c09e9-2022-4d43-854b-0292ddff3f5d", - "resources":{ - "network_port":{ - "status":"COMPLETE", - "name":"network_port", - "resource_data":{ - - }, - "resource_id":"1d0dccbb-0c99-48cd-b41b-abeca3ac6a42", - "action":"CREATE", - "type":"OS::Neutron::Port", - "metadata":{ - - } + } + }, + "action": "CREATE", + "project_id": "0dbd25a2a75347cf88a0a52638b8fff3", + "id": "416c09e9-2022-4d43-854b-0292ddff3f5d", + "resources": { + "network_port": { + "status": "COMPLETE", + "name": "network_port", + "resource_data": { + }, + "resource_id": "1d0dccbb-0c99-48cd-b41b-abeca3ac6a42", + "action": "CREATE", + "type": "OS::Neutron::Port", + "metadata": { } - } + } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/heat/adopt.json b/core-test/src/main/resources/heat/adopt.json index b6719058a..cb7c8b573 100644 --- a/core-test/src/main/resources/heat/adopt.json +++ b/core-test/src/main/resources/heat/adopt.json @@ -1,11 +1,11 @@ { - "stack":{ - "id":"79370050-6038-4ea2-baaa-3e4706d59e0e", - "links":[ - { - "href":"http://any.os.com:8004/v1/0dbd25a2a75347cf88a0a52638b8fff3/stacks/stack_123/79370050-6038-4ea2-baaa-3e4706d59e0e", - "rel":"self" - } - ] - } + "stack": { + "id": "79370050-6038-4ea2-baaa-3e4706d59e0e", + "links": [ + { + "href": "http://any.os.com:8004/v1/0dbd25a2a75347cf88a0a52638b8fff3/stacks/stack_123/79370050-6038-4ea2-baaa-3e4706d59e0e", + "rel": "self" + } + ] + } } diff --git a/core-test/src/main/resources/identity/v2/access.json b/core-test/src/main/resources/identity/v2/access.json index 92e3b9d15..5bfbc99bc 100644 --- a/core-test/src/main/resources/identity/v2/access.json +++ b/core-test/src/main/resources/identity/v2/access.json @@ -1,244 +1,267 @@ { - "access": { - "token": { - "issued_at": "2014-04-04T18:09:56.670624", - "expires": "2014-04-05T18:09:56Z", - "id": "MIILdQYJKoZIhvcNAQcCoIILZjCCC2ICAQExCTAHBgUrDgMCGjCCCcsGCSqGSIb3DQEHAaCCCbwEggm4eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNC0wNC0wNFQxODowOTo1Ni42NzA2MjQiLCAiZXhwaXJlcyI6ICIyMDE0LTA0LTA1VDE4OjA5OjU2WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogbnVsbCwgImVuYWJsZWQiOiB0cnVlLCAiaWQiOiAiYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QiLCAibmFtZSI6ICJhZG1pbiJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjg3NzQvdjIvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6ODc3NC92Mi9iODBmOGQ0ZTI4Yjc0MTg4ODU4YjY1NGNiMWZjY2Y3ZCIsICJpZCI6ICIzZDQ0MDU0ZmUwZWM0NDBlOWQ0NjQxYTcyMTkwMDJkZCIsICJwdWJsaWNVUkwiOiAiaHR0cDovLzE5Mi4xNjguNTYuMjUxOjg3NzQvdjIvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAiY29tcHV0ZSIsICJuYW1lIjogIm5vdmEifSwgeyJlbmRwb2ludHMiOiBbeyJhZG1pblVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6OTY5Ni8iLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6OTY5Ni8iLCAiaWQiOiAiNTRjOTE3NTU1MjZlNDRiOTgwODM4NWEyNjNkYjRhYTYiLCAicHVibGljVVJMIjogImh0dHA6Ly8xOTIuMTY4LjU2LjI1MTo5Njk2LyJ9XSwgImVuZHBvaW50c19saW5rcyI6IFtdLCAidHlwZSI6ICJuZXR3b3JrIiwgIm5hbWUiOiAibmV1dHJvbiJ9LCB7ImVuZHBvaW50cyI6IFt7ImFkbWluVVJMIjogImh0dHA6Ly8xMC4xMC4xMC41MTo5MjkyL3YyIiwgInJlZ2lvbiI6ICJSZWdpb25PbmUiLCAiaW50ZXJuYWxVUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjkyOTIvdjIiLCAiaWQiOiAiNDMyOWI3NzYwZDMyNGVmZThlNjQzMGJmMDQwZTViODgiLCAicHVibGljVVJMIjogImh0dHA6Ly8xOTIuMTY4LjU2LjI1MTo5MjkyL3YyIn1dLCAiZW5kcG9pbnRzX2xpbmtzIjogW10sICJ0eXBlIjogImltYWdlIiwgIm5hbWUiOiAiZ2xhbmNlIn0sIHsiZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjg3NzYvdjEvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6ODc3Ni92MS9iODBmOGQ0ZTI4Yjc0MTg4ODU4YjY1NGNiMWZjY2Y3ZCIsICJpZCI6ICI4MDliYzNiZjE4NzQ0MDk5OTBmMzg5MTFlM2IxYWE3YSIsICJwdWJsaWNVUkwiOiAiaHR0cDovLzE5Mi4xNjguNTYuMjUxOjg3NzYvdjEvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAidm9sdW1lIiwgIm5hbWUiOiAiY2luZGVyIn0sIHsiZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjg3NzMvc2VydmljZXMvQWRtaW4iLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6ODc3My9zZXJ2aWNlcy9DbG91ZCIsICJpZCI6ICI4MTIyNTk0YzNkYWI0ODI5OGI4OTBhMzY3Y2M3NTdmYiIsICJwdWJsaWNVUkwiOiAiaHR0cDovLzE5Mi4xNjguNTYuMjUxOjg3NzMvc2VydmljZXMvQ2xvdWQifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAiZWMyIiwgIm5hbWUiOiAiZWMyIn0sIHsiZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjM1MzU3L3YyLjAiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6NTAwMC92Mi4wIiwgImlkIjogIjM1ZDIyMDRiZmUxNDRjMzVhNWIzZWI5NmU3ODY3NmU4IiwgInB1YmxpY1VSTCI6ICJodHRwOi8vMTkyLjE2OC41Ni4yNTE6NTAwMC92Mi4wIn1dLCAiZW5kcG9pbnRzX2xpbmtzIjogW10sICJ0eXBlIjogImlkZW50aXR5IiwgIm5hbWUiOiAia2V5c3RvbmUifV0sICJ1c2VyIjogeyJ1c2VybmFtZSI6ICJhZG1pbiIsICJyb2xlc19saW5rcyI6IFtdLCAiaWQiOiAiZjkzMTIwODM4MjgxNGU1YWIzNDEyZjdlMDJjNWUzYWUiLCAicm9sZXMiOiBbeyJuYW1lIjogImFkbWluIn0sIHsibmFtZSI6ICJLZXlzdG9uZVNlcnZpY2VBZG1pbiJ9LCB7Im5hbWUiOiAiS2V5c3RvbmVBZG1pbiJ9XSwgIm5hbWUiOiAiYWRtaW4ifSwgIm1ldGFkYXRhIjogeyJpc19hZG1pbiI6IDAsICJyb2xlcyI6IFsiM2U5MjQ1ZTU2NjAzNDRlMzkzMjhhYTY4ZmM5ZWI2ZTAiLCAiMmNjZTI0Njc1MGNmNGUwZGEwOWFkYTkxOTcwMmUzMGMiLCAiNzE3MTNiODMwNmFkNDU2Njk5NjI4NmVkOGFmZGE4OWUiXX19fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAvA++EdcPjlpDnUlubOe4W3O3A0pbgyiehgES6qeIQt2wdODbR-SkUXW+H+199Gn4qbKsHLcbx82gMnXTWR-qXlDrpzApoZ0Om3wmnOKk7Z-nEX9cVweocBGKX0LUpU3j5tiJ4a+Ijn4UYbSypkao2Wl1Ky0NHE4vx7ns0G1bo4ErKrZZY3JPoPtPqc-wJ4JvTgRceVDR-Tv-VLjROSZ4SHHC7eeHaeva4FrGDSjqhBmhSkvuxH1xQ+7+GbtY2WJuN0nu6SrFVdLROWqFqd222zaF+gKNG8df6oFMUdevTs9pDaW+XWm39DARCMmUWehs1DUw65OfZmTsAgS28f8Rt", - "tenant": { - "description": null, - "enabled": true, - "id": "b80f8d4e28b74188858b654cb1fccf7d", - "name": "admin" - } - }, - "serviceCatalog": [ - { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8774\/v2\/b80f8d4e28b74188858b654cb1fccf7d", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8774\/v2\/b80f8d4e28b74188858b654cb1fccf7d", - "id": "3d44054fe0ec440e9d4641a7219002dd", - "publicURL": "http:\/\/127.0.0.1:8774\/v2\/b80f8d4e28b74188858b654cb1fccf7d" - } - ], - "endpoints_links": [], - "type": "compute", - "name": "nova" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8774\/v2.1\/b80f8d4e28b74188858b654cb1fccf7d", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8774\/v2.1\/b80f8d4e28b74188858b654cb1fccf7d", - "id": "3d44054fe0ec440e9d4641a7219002dd", - "publicURL": "http:\/\/127.0.0.1:8774\/v2.1\/b80f8d4e28b74188858b654cb1fccf7d" - } - ], - "endpoints_links": [], - "type": "computev21", - "name": "novav21" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:9696\/", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:9696\/", - "id": "54c91755526e44b9808385a263db4aa6", - "publicURL": "http:\/\/127.0.0.1:9696\/" - }, { - "adminURL": "http:\/\/127.0.0.1:9696\/", - "region": "RegionTwo", - "internalURL": "http:\/\/127.0.0.1:9696\/", - "id": "54c91755526e44b9808385a263db4aa6", - "publicURL": "http:\/\/127.0.0.1:9696\/" - } - ], - "endpoints_links": [], - "type": "network", - "name": "neutron" - }, { - "name": "Object Storage", - "type": "object-store", - "endpoints": [ - { - "tenantId": "10108557731121", - "publicURL": "http:\/\/127.0.0.1:8800\/v1\/10108557731121", - "publicURL2": "", - "region": "RegionOne", - "versionId": "1", - "versionInfo": "https:\/\/region-b.geo-1.objects.hpcloudsvc.com\/v1\/", - "versionList": "https:\/\/region-b.geo-1.objects.hpcloudsvc.com" - } - ] - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:9292\/v2", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:9292\/v2", - "id": "4329b7760d324efe8e6430bf040e5b88", - "publicURL": "http:\/\/127.0.0.1:9292\/v2" - } - ], - "endpoints_links": [], - "type": "image", - "name": "glance" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8786\/v1\/b80f8d4e28b74188858b654cb1fccf7d", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8786\/v1\/b80f8d4e28b74188858b654cb1fccf7d", - "id": "240163b88bcb4222ba96c2483f2b83f9", - "publicURL": "http:\/\/127.0.0.1:8786\/v1\/b80f8d4e28b74188858b654cb1fccf7d" - } - ], - "endpoints_links": [], - "type": "share", - "name": "manila" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8776\/v1\/b80f8d4e28b74188858b654cb1fccf7d", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8776\/v1\/b80f8d4e28b74188858b654cb1fccf7d", - "id": "809bc3bf1874409990f38911e3b1aa7a", - "publicURL": "http:\/\/127.0.0.1:8776\/v1\/b80f8d4e28b74188858b654cb1fccf7d" - } - ], - "endpoints_links": [], - "type": "volume", - "name": "cinder" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8773\/services\/Admin", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8773\/services\/Cloud", - "id": "8122594c3dab48298b890a367cc757fb", - "publicURL": "http:\/\/127.0.0.1:8773\/services\/Cloud" - } - ], - "endpoints_links": [], - "type": "ec2", - "name": "ec2" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:5000\/v2.0", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:5000\/v2.0", - "id": "35d2204bfe144c35a5b3eb96e78676e8", - "publicURL": "http:\/\/127.0.0.1:5000\/v2.0" - }, { - "adminURL": "http:\/\/127.0.0.1:5000\/v2.0", - "region": "RegionTwo", - "internalURL": "http:\/\/127.0.0.1:5000\/v2.0", - "id": "35d2204bfe144c35a5b3eb96e78676e8", - "publicURL": "http:\/\/127.0.0.1:5000\/v2.0" - } - ], - "endpoints_links": [], - "type": "identity", - "name": "keystone" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", - "id": "9c66xrg3gruv2a3hj8aatd7smmas23fy", - "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" - }, { - "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", - "region": "RegionTwo", - "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", - "id": "9c66xrgerruv2a3hj8batd7smmas23fy", - "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" - } - ], - "endpoints_links": [], - "type": "aodh", - "name": "alarming" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", - "id": "9c66xrg3rruv2a3hj8tatd7smmas23fy", - "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" - }, { - "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", - "region": "RegionTwo", - "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", - "id": "9c66xrg3rruv2a3hj8tatd7smmas23fy", - "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" - } - ], - "endpoints_links": [], - "type": "telemetry", - "name": "ceilometer" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8779\/v1.0\/26decac97b67478f9f64ff2c2c1b778e", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8779\/v1.0\/26decac97b67478f9f64ff2c2c1b778e", - "id": "19e954d8-6a91-11e6-8b77-86f30ca893d3", - "publicURL": "http:\/\/127.0.0.1:8779\/v1.0\/26decac97b67478f9f64ff2c2c1b778e" - } - ], - "endpoints_links": [], - "type": "database", - "name": "trove" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8989\/v2", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8989\/v2", - "id": "98d22770096a11e793ae92361f002671", - "publicURL": "http:\/\/127.0.0.1:8989\/v2" - } - ], - "endpoints_links": [], - "type": "workflow", - "name": "mistral" - }, { - "endpoints": [ - { - "adminURL": "http:\/\/127.0.0.1:8386\/v2", - "region": "RegionOne", - "internalURL": "http:\/\/127.0.0.1:8386\/v2", - "id": "8707e3735d4415c97ae231b4841eb1d", - "publicURL": "http:\/\/127.0.0.1:8386\/v2" - } - ], - "endpoints_links": [], - "type": "data-processing", - "name": "sahara" - } - ], - "user": { - "username": "admin", - "roles_links": [], - "id": "f931208382814e5ab3412f7e02c5e3ae", - "roles": [ - { - "name": "admin" - }, { - "name": "KeystoneServiceAdmin" - }, { - "name": "KeystoneAdmin" - } - ], - "name": "admin" - }, - "metadata": { - "is_admin": 0, - "roles": ["3e9245e5660344e39328aa68fc9eb6e0", "2cce246750cf4e0da09ada919702e30c", "71713b8306ad4566996286ed8afda89e"] - } - } + "access": { + "token": { + "issued_at": "2014-04-04T18:09:56.670624", + "expires": "2014-04-05T18:09:56Z", + "id": "MIILdQYJKoZIhvcNAQcCoIILZjCCC2ICAQExCTAHBgUrDgMCGjCCCcsGCSqGSIb3DQEHAaCCCbwEggm4eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNC0wNC0wNFQxODowOTo1Ni42NzA2MjQiLCAiZXhwaXJlcyI6ICIyMDE0LTA0LTA1VDE4OjA5OjU2WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogbnVsbCwgImVuYWJsZWQiOiB0cnVlLCAiaWQiOiAiYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QiLCAibmFtZSI6ICJhZG1pbiJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjg3NzQvdjIvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6ODc3NC92Mi9iODBmOGQ0ZTI4Yjc0MTg4ODU4YjY1NGNiMWZjY2Y3ZCIsICJpZCI6ICIzZDQ0MDU0ZmUwZWM0NDBlOWQ0NjQxYTcyMTkwMDJkZCIsICJwdWJsaWNVUkwiOiAiaHR0cDovLzE5Mi4xNjguNTYuMjUxOjg3NzQvdjIvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAiY29tcHV0ZSIsICJuYW1lIjogIm5vdmEifSwgeyJlbmRwb2ludHMiOiBbeyJhZG1pblVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6OTY5Ni8iLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6OTY5Ni8iLCAiaWQiOiAiNTRjOTE3NTU1MjZlNDRiOTgwODM4NWEyNjNkYjRhYTYiLCAicHVibGljVVJMIjogImh0dHA6Ly8xOTIuMTY4LjU2LjI1MTo5Njk2LyJ9XSwgImVuZHBvaW50c19saW5rcyI6IFtdLCAidHlwZSI6ICJuZXR3b3JrIiwgIm5hbWUiOiAibmV1dHJvbiJ9LCB7ImVuZHBvaW50cyI6IFt7ImFkbWluVVJMIjogImh0dHA6Ly8xMC4xMC4xMC41MTo5MjkyL3YyIiwgInJlZ2lvbiI6ICJSZWdpb25PbmUiLCAiaW50ZXJuYWxVUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjkyOTIvdjIiLCAiaWQiOiAiNDMyOWI3NzYwZDMyNGVmZThlNjQzMGJmMDQwZTViODgiLCAicHVibGljVVJMIjogImh0dHA6Ly8xOTIuMTY4LjU2LjI1MTo5MjkyL3YyIn1dLCAiZW5kcG9pbnRzX2xpbmtzIjogW10sICJ0eXBlIjogImltYWdlIiwgIm5hbWUiOiAiZ2xhbmNlIn0sIHsiZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjg3NzYvdjEvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6ODc3Ni92MS9iODBmOGQ0ZTI4Yjc0MTg4ODU4YjY1NGNiMWZjY2Y3ZCIsICJpZCI6ICI4MDliYzNiZjE4NzQ0MDk5OTBmMzg5MTFlM2IxYWE3YSIsICJwdWJsaWNVUkwiOiAiaHR0cDovLzE5Mi4xNjguNTYuMjUxOjg3NzYvdjEvYjgwZjhkNGUyOGI3NDE4ODg1OGI2NTRjYjFmY2NmN2QifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAidm9sdW1lIiwgIm5hbWUiOiAiY2luZGVyIn0sIHsiZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjg3NzMvc2VydmljZXMvQWRtaW4iLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6ODc3My9zZXJ2aWNlcy9DbG91ZCIsICJpZCI6ICI4MTIyNTk0YzNkYWI0ODI5OGI4OTBhMzY3Y2M3NTdmYiIsICJwdWJsaWNVUkwiOiAiaHR0cDovLzE5Mi4xNjguNTYuMjUxOjg3NzMvc2VydmljZXMvQ2xvdWQifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAiZWMyIiwgIm5hbWUiOiAiZWMyIn0sIHsiZW5kcG9pbnRzIjogW3siYWRtaW5VUkwiOiAiaHR0cDovLzEwLjEwLjEwLjUxOjM1MzU3L3YyLjAiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTAuMTAuMTAuNTE6NTAwMC92Mi4wIiwgImlkIjogIjM1ZDIyMDRiZmUxNDRjMzVhNWIzZWI5NmU3ODY3NmU4IiwgInB1YmxpY1VSTCI6ICJodHRwOi8vMTkyLjE2OC41Ni4yNTE6NTAwMC92Mi4wIn1dLCAiZW5kcG9pbnRzX2xpbmtzIjogW10sICJ0eXBlIjogImlkZW50aXR5IiwgIm5hbWUiOiAia2V5c3RvbmUifV0sICJ1c2VyIjogeyJ1c2VybmFtZSI6ICJhZG1pbiIsICJyb2xlc19saW5rcyI6IFtdLCAiaWQiOiAiZjkzMTIwODM4MjgxNGU1YWIzNDEyZjdlMDJjNWUzYWUiLCAicm9sZXMiOiBbeyJuYW1lIjogImFkbWluIn0sIHsibmFtZSI6ICJLZXlzdG9uZVNlcnZpY2VBZG1pbiJ9LCB7Im5hbWUiOiAiS2V5c3RvbmVBZG1pbiJ9XSwgIm5hbWUiOiAiYWRtaW4ifSwgIm1ldGFkYXRhIjogeyJpc19hZG1pbiI6IDAsICJyb2xlcyI6IFsiM2U5MjQ1ZTU2NjAzNDRlMzkzMjhhYTY4ZmM5ZWI2ZTAiLCAiMmNjZTI0Njc1MGNmNGUwZGEwOWFkYTkxOTcwMmUzMGMiLCAiNzE3MTNiODMwNmFkNDU2Njk5NjI4NmVkOGFmZGE4OWUiXX19fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAvA++EdcPjlpDnUlubOe4W3O3A0pbgyiehgES6qeIQt2wdODbR-SkUXW+H+199Gn4qbKsHLcbx82gMnXTWR-qXlDrpzApoZ0Om3wmnOKk7Z-nEX9cVweocBGKX0LUpU3j5tiJ4a+Ijn4UYbSypkao2Wl1Ky0NHE4vx7ns0G1bo4ErKrZZY3JPoPtPqc-wJ4JvTgRceVDR-Tv-VLjROSZ4SHHC7eeHaeva4FrGDSjqhBmhSkvuxH1xQ+7+GbtY2WJuN0nu6SrFVdLROWqFqd222zaF+gKNG8df6oFMUdevTs9pDaW+XWm39DARCMmUWehs1DUw65OfZmTsAgS28f8Rt", + "tenant": { + "description": null, + "enabled": true, + "id": "b80f8d4e28b74188858b654cb1fccf7d", + "name": "admin" + } + }, + "serviceCatalog": [ + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8774\/v2\/b80f8d4e28b74188858b654cb1fccf7d", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8774\/v2\/b80f8d4e28b74188858b654cb1fccf7d", + "id": "3d44054fe0ec440e9d4641a7219002dd", + "publicURL": "http:\/\/127.0.0.1:8774\/v2\/b80f8d4e28b74188858b654cb1fccf7d" + } + ], + "endpoints_links": [], + "type": "compute", + "name": "nova" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8774\/v2.1\/b80f8d4e28b74188858b654cb1fccf7d", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8774\/v2.1\/b80f8d4e28b74188858b654cb1fccf7d", + "id": "3d44054fe0ec440e9d4641a7219002dd", + "publicURL": "http:\/\/127.0.0.1:8774\/v2.1\/b80f8d4e28b74188858b654cb1fccf7d" + } + ], + "endpoints_links": [], + "type": "computev21", + "name": "novav21" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:9696\/", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:9696\/", + "id": "54c91755526e44b9808385a263db4aa6", + "publicURL": "http:\/\/127.0.0.1:9696\/" + }, + { + "adminURL": "http:\/\/127.0.0.1:9696\/", + "region": "RegionTwo", + "internalURL": "http:\/\/127.0.0.1:9696\/", + "id": "54c91755526e44b9808385a263db4aa6", + "publicURL": "http:\/\/127.0.0.1:9696\/" + } + ], + "endpoints_links": [], + "type": "network", + "name": "neutron" + }, + { + "name": "Object Storage", + "type": "object-store", + "endpoints": [ + { + "tenantId": "10108557731121", + "publicURL": "http:\/\/127.0.0.1:8800\/v1\/10108557731121", + "publicURL2": "", + "region": "RegionOne", + "versionId": "1", + "versionInfo": "https:\/\/region-b.geo-1.objects.hpcloudsvc.com\/v1\/", + "versionList": "https:\/\/region-b.geo-1.objects.hpcloudsvc.com" + } + ] + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:9292\/v2", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:9292\/v2", + "id": "4329b7760d324efe8e6430bf040e5b88", + "publicURL": "http:\/\/127.0.0.1:9292\/v2" + } + ], + "endpoints_links": [], + "type": "image", + "name": "glance" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8786\/v1\/b80f8d4e28b74188858b654cb1fccf7d", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8786\/v1\/b80f8d4e28b74188858b654cb1fccf7d", + "id": "240163b88bcb4222ba96c2483f2b83f9", + "publicURL": "http:\/\/127.0.0.1:8786\/v1\/b80f8d4e28b74188858b654cb1fccf7d" + } + ], + "endpoints_links": [], + "type": "share", + "name": "manila" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8776\/v1\/b80f8d4e28b74188858b654cb1fccf7d", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8776\/v1\/b80f8d4e28b74188858b654cb1fccf7d", + "id": "809bc3bf1874409990f38911e3b1aa7a", + "publicURL": "http:\/\/127.0.0.1:8776\/v1\/b80f8d4e28b74188858b654cb1fccf7d" + } + ], + "endpoints_links": [], + "type": "volume", + "name": "cinder" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8773\/services\/Admin", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8773\/services\/Cloud", + "id": "8122594c3dab48298b890a367cc757fb", + "publicURL": "http:\/\/127.0.0.1:8773\/services\/Cloud" + } + ], + "endpoints_links": [], + "type": "ec2", + "name": "ec2" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:5000\/v2.0", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:5000\/v2.0", + "id": "35d2204bfe144c35a5b3eb96e78676e8", + "publicURL": "http:\/\/127.0.0.1:5000\/v2.0" + }, + { + "adminURL": "http:\/\/127.0.0.1:5000\/v2.0", + "region": "RegionTwo", + "internalURL": "http:\/\/127.0.0.1:5000\/v2.0", + "id": "35d2204bfe144c35a5b3eb96e78676e8", + "publicURL": "http:\/\/127.0.0.1:5000\/v2.0" + } + ], + "endpoints_links": [], + "type": "identity", + "name": "keystone" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", + "id": "9c66xrg3gruv2a3hj8aatd7smmas23fy", + "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" + }, + { + "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", + "region": "RegionTwo", + "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", + "id": "9c66xrgerruv2a3hj8batd7smmas23fy", + "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" + } + ], + "endpoints_links": [], + "type": "aodh", + "name": "alarming" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", + "id": "9c66xrg3rruv2a3hj8tatd7smmas23fy", + "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" + }, + { + "adminURL": "http:\/\/127.0.0.1:8087\/v2.0", + "region": "RegionTwo", + "internalURL": "http:\/\/127.0.0.1:8087\/v2.0", + "id": "9c66xrg3rruv2a3hj8tatd7smmas23fy", + "publicURL": "http:\/\/127.0.0.1:8087\/v2.0" + } + ], + "endpoints_links": [], + "type": "telemetry", + "name": "ceilometer" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8779\/v1.0\/26decac97b67478f9f64ff2c2c1b778e", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8779\/v1.0\/26decac97b67478f9f64ff2c2c1b778e", + "id": "19e954d8-6a91-11e6-8b77-86f30ca893d3", + "publicURL": "http:\/\/127.0.0.1:8779\/v1.0\/26decac97b67478f9f64ff2c2c1b778e" + } + ], + "endpoints_links": [], + "type": "database", + "name": "trove" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8989\/v2", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8989\/v2", + "id": "98d22770096a11e793ae92361f002671", + "publicURL": "http:\/\/127.0.0.1:8989\/v2" + } + ], + "endpoints_links": [], + "type": "workflow", + "name": "mistral" + }, + { + "endpoints": [ + { + "adminURL": "http:\/\/127.0.0.1:8386\/v2", + "region": "RegionOne", + "internalURL": "http:\/\/127.0.0.1:8386\/v2", + "id": "8707e3735d4415c97ae231b4841eb1d", + "publicURL": "http:\/\/127.0.0.1:8386\/v2" + } + ], + "endpoints_links": [], + "type": "data-processing", + "name": "sahara" + } + ], + "user": { + "username": "admin", + "roles_links": [], + "id": "f931208382814e5ab3412f7e02c5e3ae", + "roles": [ + { + "name": "admin" + }, + { + "name": "KeystoneServiceAdmin" + }, + { + "name": "KeystoneAdmin" + } + ], + "name": "admin" + }, + "metadata": { + "is_admin": 0, + "roles": [ + "3e9245e5660344e39328aa68fc9eb6e0", + "2cce246750cf4e0da09ada919702e30c", + "71713b8306ad4566996286ed8afda89e" + ] + } + } } diff --git a/core-test/src/main/resources/identity/v2/extensions.json b/core-test/src/main/resources/identity/v2/extensions.json index 111f8e130..d0f0a8ed0 100644 --- a/core-test/src/main/resources/identity/v2/extensions.json +++ b/core-test/src/main/resources/identity/v2/extensions.json @@ -1,59 +1,62 @@ { - "extensions": { - "values": [ - { - "updated": "2013-07-07T12:00:0-00:00", - "name": "OpenStack S3 API", - "links": [ - { - "href": "https://github.com/openstack/identity-api", - "type": "text/html", - "rel": "describedby" - } - ], - "namespace": "http://docs.openstack.org/identity/api/ext/s3tokens/v1.0", - "alias": "s3tokens", - "description": "OpenStack S3 API." - }, { - "updated": "2013-07-11T17:14:00-00:00", - "name": "OpenStack Keystone Admin", - "links": [ - { - "href": "https://github.com/openstack/identity-api", - "type": "text/html", - "rel": "describedby" - } - ], - "namespace": "http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0", - "alias": "OS-KSADM", - "description": "OpenStack extensions to Keystone v2.0 API enabling Administrative Operations." - }, { - "updated": "2013-07-07T12:00:0-00:00", - "name": "OpenStack EC2 API", - "links": [ - { - "href": "https://github.com/openstack/identity-api", - "type": "text/html", - "rel": "describedby" - } - ], - "namespace": "http://docs.openstack.org/identity/api/ext/OS-EC2/v1.0", - "alias": "OS-EC2", - "description": "OpenStack EC2 Credentials backend." - }, { - "updated": "2013-07-23T12:00:0-00:00", - "name": "Openstack Keystone Endpoint Filter API", - "links": [ - { - "href": "https://github.com/openstack/identity-api/blob/master/openstack-identity-api/v3/src/markdown/identity-api-v3-os-ep-filter-ext.md", - "type": "text/html", - "rel": "describedby" - } - ], - "namespace": "http://docs.openstack.org/identity/api/ext/OS-EP-FILTER/v1.0", - "alias": "OS-EP-FILTER", - "description": "Openstack Keystone Endpoint Filter API." - } - ] - } + "extensions": { + "values": [ + { + "updated": "2013-07-07T12:00:0-00:00", + "name": "OpenStack S3 API", + "links": [ + { + "href": "https://github.com/openstack/identity-api", + "type": "text/html", + "rel": "describedby" + } + ], + "namespace": "http://docs.openstack.org/identity/api/ext/s3tokens/v1.0", + "alias": "s3tokens", + "description": "OpenStack S3 API." + }, + { + "updated": "2013-07-11T17:14:00-00:00", + "name": "OpenStack Keystone Admin", + "links": [ + { + "href": "https://github.com/openstack/identity-api", + "type": "text/html", + "rel": "describedby" + } + ], + "namespace": "http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0", + "alias": "OS-KSADM", + "description": "OpenStack extensions to Keystone v2.0 API enabling Administrative Operations." + }, + { + "updated": "2013-07-07T12:00:0-00:00", + "name": "OpenStack EC2 API", + "links": [ + { + "href": "https://github.com/openstack/identity-api", + "type": "text/html", + "rel": "describedby" + } + ], + "namespace": "http://docs.openstack.org/identity/api/ext/OS-EC2/v1.0", + "alias": "OS-EC2", + "description": "OpenStack EC2 Credentials backend." + }, + { + "updated": "2013-07-23T12:00:0-00:00", + "name": "Openstack Keystone Endpoint Filter API", + "links": [ + { + "href": "https://github.com/openstack/identity-api/blob/master/openstack-identity-api/v3/src/markdown/identity-api-v3-os-ep-filter-ext.md", + "type": "text/html", + "rel": "describedby" + } + ], + "namespace": "http://docs.openstack.org/identity/api/ext/OS-EP-FILTER/v1.0", + "alias": "OS-EP-FILTER", + "description": "Openstack Keystone Endpoint Filter API." + } + ] + } } diff --git a/core-test/src/main/resources/identity/v2/member-role.json b/core-test/src/main/resources/identity/v2/member-role.json index c83b11280..38631e58c 100644 --- a/core-test/src/main/resources/identity/v2/member-role.json +++ b/core-test/src/main/resources/identity/v2/member-role.json @@ -1,6 +1,6 @@ { - "role": { - "id": "b8e55a37fc3748de887f165954448db5", - "name": "Member" - } + "role": { + "id": "b8e55a37fc3748de887f165954448db5", + "name": "Member" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v2/roles.json b/core-test/src/main/resources/identity/v2/roles.json index 63c755bc4..6b5ce3bab 100644 --- a/core-test/src/main/resources/identity/v2/roles.json +++ b/core-test/src/main/resources/identity/v2/roles.json @@ -1,22 +1,26 @@ { - "roles": [ - { - "id": "2cce246750cf4e0da09ada919702e30c", - "name": "KeystoneServiceAdmin" - }, { - "id": "3e9245e5660344e39328aa68fc9eb6e0", - "name": "admin" - }, { - "id": "71713b8306ad4566996286ed8afda89e", - "name": "KeystoneAdmin" - }, { - "enabled": "True", - "description": "Default role for project membership", - "name": "_member_", - "id": "9fe2ff9ee4384b1894a90878d3e92bab" - }, { - "id": "b8e55a37fc3748de887f165954448db5", - "name": "Member" - } - ] + "roles": [ + { + "id": "2cce246750cf4e0da09ada919702e30c", + "name": "KeystoneServiceAdmin" + }, + { + "id": "3e9245e5660344e39328aa68fc9eb6e0", + "name": "admin" + }, + { + "id": "71713b8306ad4566996286ed8afda89e", + "name": "KeystoneAdmin" + }, + { + "enabled": "True", + "description": "Default role for project membership", + "name": "_member_", + "id": "9fe2ff9ee4384b1894a90878d3e92bab" + }, + { + "id": "b8e55a37fc3748de887f165954448db5", + "name": "Member" + } + ] } diff --git a/core-test/src/main/resources/identity/v2/tenant-admin.json b/core-test/src/main/resources/identity/v2/tenant-admin.json index 8cdc9a354..cb5ef52bf 100644 --- a/core-test/src/main/resources/identity/v2/tenant-admin.json +++ b/core-test/src/main/resources/identity/v2/tenant-admin.json @@ -1,8 +1,8 @@ { - "tenant": { - "description": null, - "enabled": true, - "id": "b80f8d4e28b74188858b654cb1fccf7d", - "name": "admin" - } + "tenant": { + "description": null, + "enabled": true, + "id": "b80f8d4e28b74188858b654cb1fccf7d", + "name": "admin" + } } diff --git a/core-test/src/main/resources/identity/v2/tenant-users.json b/core-test/src/main/resources/identity/v2/tenant-users.json index 2223c3621..53686741b 100644 --- a/core-test/src/main/resources/identity/v2/tenant-users.json +++ b/core-test/src/main/resources/identity/v2/tenant-users.json @@ -1,16 +1,17 @@ { - "users": [ - { - "id": "u1000", - "name": "jqsmith", - "email": "john.smith@example.org", - "enabled": true - }, { - "id": "u1001", - "name": "jqsmith", - "email": "john.smith@example.org", - "enabled": true - } - ], - "users_links": [] + "users": [ + { + "id": "u1000", + "name": "jqsmith", + "email": "john.smith@example.org", + "enabled": true + }, + { + "id": "u1001", + "name": "jqsmith", + "email": "john.smith@example.org", + "enabled": true + } + ], + "users_links": [] } diff --git a/core-test/src/main/resources/identity/v2/tenants.json b/core-test/src/main/resources/identity/v2/tenants.json index c7dde32e5..49714901e 100644 --- a/core-test/src/main/resources/identity/v2/tenants.json +++ b/core-test/src/main/resources/identity/v2/tenants.json @@ -1,21 +1,23 @@ { - "tenants_links": [], - "tenants": [ - { - "description": "", - "enabled": true, - "id": "b0a9abafc4ef41ad9201f891fb88aeb3", - "name": "project_one" - }, { - "description": null, - "enabled": true, - "id": "b80f8d4e28b74188858b654cb1fccf7d", - "name": "admin" - }, { - "description": null, - "enabled": true, - "id": "fae985a544c543dd9a799a7bb4953c69", - "name": "service" - } - ] + "tenants_links": [], + "tenants": [ + { + "description": "", + "enabled": true, + "id": "b0a9abafc4ef41ad9201f891fb88aeb3", + "name": "project_one" + }, + { + "description": null, + "enabled": true, + "id": "b80f8d4e28b74188858b654cb1fccf7d", + "name": "admin" + }, + { + "description": null, + "enabled": true, + "id": "fae985a544c543dd9a799a7bb4953c69", + "name": "service" + } + ] } diff --git a/core-test/src/main/resources/identity/v2/users.json b/core-test/src/main/resources/identity/v2/users.json index 9f3f81fca..04fd443d6 100644 --- a/core-test/src/main/resources/identity/v2/users.json +++ b/core-test/src/main/resources/identity/v2/users.json @@ -1,52 +1,59 @@ { - "users": [ - { - "name": "nova", - "id": "196cbcf9de4a40ff9b9292ab5b9e1e8d", - "enabled": true, - "email": "nova@domain.com", - "tenantId": "fae985a544c543dd9a799a7bb4953c69" - }, { - "name": "jack", - "id": "55184f77bc534ab7a2bf73d2cde2701b", - "enabled": true, - "email": "jack@jack.com", - "tenantId": "b0a9abafc4ef41ad9201f891fb88aeb3" - }, { - "name": "swift", - "id": "6485f1f8c5bb45418421c059e0ed0141", - "enabled": true, - "email": null, - "tenantId": "fae985a544c543dd9a799a7bb4953c69" - }, { - "name": "cinder", - "id": "80170078bc2349f9adca922f919fd749", - "enabled": true, - "email": "cinder@domain.com", - "tenantId": "fae985a544c543dd9a799a7bb4953c69" - }, { - "name": "glance", - "id": "917c06253ed1461caa40517453b3ba7c", - "enabled": true, - "email": "glance@domain.com", - "tenantId": "fae985a544c543dd9a799a7bb4953c69" - }, { - "name": "neutron", - "id": "a556c717d7b942a38b8712522f32a013", - "enabled": true, - "email": "neutron@domain.com", - "tenantId": "fae985a544c543dd9a799a7bb4953c69" - }, { - "name": "user_one", - "id": "d4abe4ee7a524d9da957861f3be38f68", - "enabled": true, - "email": "user_one@domain.com", - "tenantId": "b0a9abafc4ef41ad9201f891fb88aeb3" - }, { - "name": "admin", - "enabled": true, - "email": "admin@domain.com", - "id": "f931208382814e5ab3412f7e02c5e3ae" - } - ] + "users": [ + { + "name": "nova", + "id": "196cbcf9de4a40ff9b9292ab5b9e1e8d", + "enabled": true, + "email": "nova@domain.com", + "tenantId": "fae985a544c543dd9a799a7bb4953c69" + }, + { + "name": "jack", + "id": "55184f77bc534ab7a2bf73d2cde2701b", + "enabled": true, + "email": "jack@jack.com", + "tenantId": "b0a9abafc4ef41ad9201f891fb88aeb3" + }, + { + "name": "swift", + "id": "6485f1f8c5bb45418421c059e0ed0141", + "enabled": true, + "email": null, + "tenantId": "fae985a544c543dd9a799a7bb4953c69" + }, + { + "name": "cinder", + "id": "80170078bc2349f9adca922f919fd749", + "enabled": true, + "email": "cinder@domain.com", + "tenantId": "fae985a544c543dd9a799a7bb4953c69" + }, + { + "name": "glance", + "id": "917c06253ed1461caa40517453b3ba7c", + "enabled": true, + "email": "glance@domain.com", + "tenantId": "fae985a544c543dd9a799a7bb4953c69" + }, + { + "name": "neutron", + "id": "a556c717d7b942a38b8712522f32a013", + "enabled": true, + "email": "neutron@domain.com", + "tenantId": "fae985a544c543dd9a799a7bb4953c69" + }, + { + "name": "user_one", + "id": "d4abe4ee7a524d9da957861f3be38f68", + "enabled": true, + "email": "user_one@domain.com", + "tenantId": "b0a9abafc4ef41ad9201f891fb88aeb3" + }, + { + "name": "admin", + "enabled": true, + "email": "admin@domain.com", + "id": "f931208382814e5ab3412f7e02c5e3ae" + } + ] } diff --git a/core-test/src/main/resources/identity/v3/authv3_authorizationerror.json b/core-test/src/main/resources/identity/v3/authv3_authorizationerror.json index 59a185533..db2d9b5f5 100644 --- a/core-test/src/main/resources/identity/v3/authv3_authorizationerror.json +++ b/core-test/src/main/resources/identity/v3/authv3_authorizationerror.json @@ -1,7 +1,7 @@ { - "error": { - "message": "The request you have made requires authentication. (Disable debug mode to suppress these details.)", - "code": 401, - "title": "Unauthorized" - } + "error": { + "message": "The request you have made requires authentication. (Disable debug mode to suppress these details.)", + "code": 401, + "title": "Unauthorized" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/authv3_domain.json b/core-test/src/main/resources/identity/v3/authv3_domain.json index 73e19ed67..38b67cde7 100644 --- a/core-test/src/main/resources/identity/v3/authv3_domain.json +++ b/core-test/src/main/resources/identity/v3/authv3_domain.json @@ -1,298 +1,335 @@ { - "token": { - "domain": { - "id": "default", - "name": "Default" - }, - "methods": ["password"], - "roles": [ - { - "id": "6ead57f8ae124996af8b0beb72ff1007", - "name": "admin" - } - ], - "expires_at": "2015-08-26T14:14:09.416956Z", - "catalog": [ - { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:9292", - "region": "RegionOne", - "interface": "public", - "id": "6e82c8912d3f49a09df51035681d564c" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:9292", - "region": "RegionOne", - "interface": "admin", - "id": "7e44d321ae80457abc3728fa1e6feb32" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:9292", - "region": "RegionOne", - "interface": "internal", - "id": "c9a090a4597040849c03bc13588167f6" - } - ], - "type": "image", - "id": "0d56500210a24c38a3702b6825e24164", - "name": "glance" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8776/v2/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "internal", - "id": "261aaf6239bb49a4a1cfa87c19859138" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8776/v2/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "admin", - "id": "437d282e0bb94622aaacc4d194c069a9" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8776/v2/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "public", - "id": "5e78bf7bae7c4ff5b9720b2c2e4da743" - } - ], - "type": "volumev2", - "id": "2b92e79c45254516932c633229cd0e8b", - "name": "cinderv2" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8773/", - "region": "RegionOne", - "interface": "admin", - "id": "1ce26a6fffd0424bac135b9c68055b6e" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8773/", - "region": "RegionOne", - "interface": "public", - "id": "98db699b9ffa4dffb027d78163aad8cc" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8773/", - "region": "RegionOne", - "interface": "internal", - "id": "ece52860cf1e4eb6a8fed05c47a30147" - } - ], - "type": "ec2", - "id": "3364a7b95c664bf89a7a8db081576364", - "name": "ec2" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://127.0.0.1:8786/v1/b80f8d4e28b74188858b654cb1fccf7d", - "region": "RegionOne", - "interface": "admin", - "id": "b80f8d4e28b74188858b654cb1fccf7d" - }, { - "region_id": "RegionOne", - "url": "http://127.0.0.1:8786/v1/b80f8d4e28b74188858b654cb1fccf7d", - "region": "RegionOne", - "interface": "public", - "id": "b80f8d4e28b74188858b654cb1fccf7d" - }, { - "region_id": "RegionOne", - "url": "http://127.0.0.1:8786/v1/b80f8d4e28b74188858b654cb1fccf7d", - "region": "RegionOne", - "interface": "internal", - "id": "b80f8d4e28b74188858b654cb1fccf7d" - } - ], - "endpoints_links": [], - "type": "share", - "name": "manila" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8776/v1/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "admin", - "id": "4442fbd064844a7bbe6a792507d4b8e3" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8776/v1/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "internal", - "id": "4b4178fd2e3d4f329600cc4ceaaa7e3a" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8776/v1/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "public", - "id": "90977723dba04ea9a2a184c99565ccff" - } - ], - "type": "volume", - "id": "511b94ce0482484ea09028091dd5e9a5", - "name": "cinder" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8774/v2/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "internal", - "id": "81c51855280345e9a6c322ca986d4e4b" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8774/v2/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "admin", - "id": "a0310a37cf6144a6a967cbae9a7959ba" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8774/v2/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "public", - "id": "f6d38c03b9c04a9e924aaa288ce014b8" - } - ], - "type": "compute", - "id": "5b7028751ed045d79467c7845ecb8c58", - "name": "nova" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8774/v2.1/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "internal", - "id": "2f17e155b0aa47838394e6c4f6fe30e0" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8774/v2.1/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "public", - "id": "9d2555fd27dd44e5acfb5e56127d974b" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:8774/v2.1/123ac695d4db400a9001b91bb3b8aa46", - "region": "RegionOne", - "interface": "admin", - "id": "e8bdd9403fbb4efa8d77bfd4f6a5e34a" - } - ], - "type": "computev21", - "id": "97e665cbada043718180c5a6316df76a", - "name": "novav21" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:35357/v3", - "region": "RegionOne", - "interface": "admin", - "id": "185eda94de9340e58245062f75d7f80e" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:5000/v3", - "region": "RegionOne", - "interface": "internal", - "id": "9abd6797844d455f875af9537325cba4" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:5000/v3", - "region": "RegionOne", - "interface": "public", - "id": "d3b31f24e4ea40699f731e29e625c187" - } - ], - "type": "identity", - "id": "b577d8f7c7074d04a1165fcca638b600", - "name": "keystone_v3x" - }, { - "endpoints": [ - { - "region_id": "europe", - "url": "http://devstack.openstack.stack:35357/v3", - "region": "europe", - "interface": "admin", - "id": "32bb2c6aea944ea6b4956eb24142d2e2" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:5000/v3", - "region": "RegionOne", - "interface": "public", - "id": "480ea71dc8cf4c959df1c6304be87056" - }, { - "region_id": "europe", - "url": "http://devstack.openstack.stack:5000/v3", - "region": "europe", - "interface": "public", - "id": "600638643d22494fad4f30e3b22ae124" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:5000/v3", - "region": "RegionOne", - "interface": "internal", - "id": "8a254651925e4a3e9505c863a00c017e" - }, { - "region_id": "europe", - "url": "http://devstack.openstack.stack:5000/v3", - "region": "europe", - "interface": "internal", - "id": "b93da6aaba654d8cb451ff8378d7d2a5" - }, { - "region_id": "RegionOne", - "url": "http://devstack.openstack.stack:35357/v3", - "region": "RegionOne", - "interface": "admin", - "id": "d5f8e0da0f3345529a5fb324d735d4a3" - } - ], - "type": "identity_v3", - "id": "cd9002bbadfe495d81b5ee4c50768009", - "name": "keystone_v3" - }, { - "endpoints": [ - { - "region_id": "RegionOne", - "url": "http://127.0.0.1:8779/v1.0/26decac97b67478f9f64ff2c2c1b778e", - "region": "RegionOne", - "interface": "admin", - "id": "7202c1c716f74468b6d22a1a5f83e38d" - }, { - "region_id": "RegionOne", - "url": "http://127.0.0.1:8779/v1.0/26decac97b67478f9f64ff2c2c1b778e", - "region": "RegionOne", - "interface": "internal", - "id": "373cf9b0185c4406bd7cae1a1e9e1b95" - }, { - "region_id": "RegionOne", - "url": "http://127.0.0.1:8779/v1.0/26decac97b67478f9f64ff2c2c1b778e", - "region": "RegionOne", - "interface": "public", - "id": "58bc7c3c2c66464b99ec20a398492bce" - } - ], - "type": "database", - "id": "511b94ce0482484ea09028091dd5e9a5", - "name": "trove" - } - ], - "extras": {}, - "user": { - "domain": { - "id": "default", - "name": "Default" - }, - "id": "aa9f25defa6d4cafb48466df83106065", - "name": "admin" - }, - "audit_ids": ["jcxRTXu9T5e9giMO57cE3A", "FJwqoPgBQf-W3e9jqC3dcA"], - "issued_at": "2015-08-26T13:14:09.542711Z" - } + "token": { + "domain": { + "id": "default", + "name": "Default" + }, + "methods": [ + "password" + ], + "roles": [ + { + "id": "6ead57f8ae124996af8b0beb72ff1007", + "name": "admin" + } + ], + "expires_at": "2015-08-26T14:14:09.416956Z", + "catalog": [ + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:9292", + "region": "RegionOne", + "interface": "public", + "id": "6e82c8912d3f49a09df51035681d564c" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:9292", + "region": "RegionOne", + "interface": "admin", + "id": "7e44d321ae80457abc3728fa1e6feb32" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:9292", + "region": "RegionOne", + "interface": "internal", + "id": "c9a090a4597040849c03bc13588167f6" + } + ], + "type": "image", + "id": "0d56500210a24c38a3702b6825e24164", + "name": "glance" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8776/v2/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "internal", + "id": "261aaf6239bb49a4a1cfa87c19859138" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8776/v2/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "admin", + "id": "437d282e0bb94622aaacc4d194c069a9" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8776/v2/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "public", + "id": "5e78bf7bae7c4ff5b9720b2c2e4da743" + } + ], + "type": "volumev2", + "id": "2b92e79c45254516932c633229cd0e8b", + "name": "cinderv2" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8773/", + "region": "RegionOne", + "interface": "admin", + "id": "1ce26a6fffd0424bac135b9c68055b6e" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8773/", + "region": "RegionOne", + "interface": "public", + "id": "98db699b9ffa4dffb027d78163aad8cc" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8773/", + "region": "RegionOne", + "interface": "internal", + "id": "ece52860cf1e4eb6a8fed05c47a30147" + } + ], + "type": "ec2", + "id": "3364a7b95c664bf89a7a8db081576364", + "name": "ec2" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://127.0.0.1:8786/v1/b80f8d4e28b74188858b654cb1fccf7d", + "region": "RegionOne", + "interface": "admin", + "id": "b80f8d4e28b74188858b654cb1fccf7d" + }, + { + "region_id": "RegionOne", + "url": "http://127.0.0.1:8786/v1/b80f8d4e28b74188858b654cb1fccf7d", + "region": "RegionOne", + "interface": "public", + "id": "b80f8d4e28b74188858b654cb1fccf7d" + }, + { + "region_id": "RegionOne", + "url": "http://127.0.0.1:8786/v1/b80f8d4e28b74188858b654cb1fccf7d", + "region": "RegionOne", + "interface": "internal", + "id": "b80f8d4e28b74188858b654cb1fccf7d" + } + ], + "endpoints_links": [], + "type": "share", + "name": "manila" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8776/v1/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "admin", + "id": "4442fbd064844a7bbe6a792507d4b8e3" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8776/v1/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "internal", + "id": "4b4178fd2e3d4f329600cc4ceaaa7e3a" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8776/v1/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "public", + "id": "90977723dba04ea9a2a184c99565ccff" + } + ], + "type": "volume", + "id": "511b94ce0482484ea09028091dd5e9a5", + "name": "cinder" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8774/v2/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "internal", + "id": "81c51855280345e9a6c322ca986d4e4b" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8774/v2/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "admin", + "id": "a0310a37cf6144a6a967cbae9a7959ba" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8774/v2/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "public", + "id": "f6d38c03b9c04a9e924aaa288ce014b8" + } + ], + "type": "compute", + "id": "5b7028751ed045d79467c7845ecb8c58", + "name": "nova" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8774/v2.1/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "internal", + "id": "2f17e155b0aa47838394e6c4f6fe30e0" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8774/v2.1/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "public", + "id": "9d2555fd27dd44e5acfb5e56127d974b" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:8774/v2.1/123ac695d4db400a9001b91bb3b8aa46", + "region": "RegionOne", + "interface": "admin", + "id": "e8bdd9403fbb4efa8d77bfd4f6a5e34a" + } + ], + "type": "computev21", + "id": "97e665cbada043718180c5a6316df76a", + "name": "novav21" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:35357/v3", + "region": "RegionOne", + "interface": "admin", + "id": "185eda94de9340e58245062f75d7f80e" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:5000/v3", + "region": "RegionOne", + "interface": "internal", + "id": "9abd6797844d455f875af9537325cba4" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:5000/v3", + "region": "RegionOne", + "interface": "public", + "id": "d3b31f24e4ea40699f731e29e625c187" + } + ], + "type": "identity", + "id": "b577d8f7c7074d04a1165fcca638b600", + "name": "keystone_v3x" + }, + { + "endpoints": [ + { + "region_id": "europe", + "url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", + "interface": "admin", + "id": "32bb2c6aea944ea6b4956eb24142d2e2" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:5000/v3", + "region": "RegionOne", + "interface": "public", + "id": "480ea71dc8cf4c959df1c6304be87056" + }, + { + "region_id": "europe", + "url": "http://devstack.openstack.stack:5000/v3", + "region": "europe", + "interface": "public", + "id": "600638643d22494fad4f30e3b22ae124" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:5000/v3", + "region": "RegionOne", + "interface": "internal", + "id": "8a254651925e4a3e9505c863a00c017e" + }, + { + "region_id": "europe", + "url": "http://devstack.openstack.stack:5000/v3", + "region": "europe", + "interface": "internal", + "id": "b93da6aaba654d8cb451ff8378d7d2a5" + }, + { + "region_id": "RegionOne", + "url": "http://devstack.openstack.stack:35357/v3", + "region": "RegionOne", + "interface": "admin", + "id": "d5f8e0da0f3345529a5fb324d735d4a3" + } + ], + "type": "identity_v3", + "id": "cd9002bbadfe495d81b5ee4c50768009", + "name": "keystone_v3" + }, + { + "endpoints": [ + { + "region_id": "RegionOne", + "url": "http://127.0.0.1:8779/v1.0/26decac97b67478f9f64ff2c2c1b778e", + "region": "RegionOne", + "interface": "admin", + "id": "7202c1c716f74468b6d22a1a5f83e38d" + }, + { + "region_id": "RegionOne", + "url": "http://127.0.0.1:8779/v1.0/26decac97b67478f9f64ff2c2c1b778e", + "region": "RegionOne", + "interface": "internal", + "id": "373cf9b0185c4406bd7cae1a1e9e1b95" + }, + { + "region_id": "RegionOne", + "url": "http://127.0.0.1:8779/v1.0/26decac97b67478f9f64ff2c2c1b778e", + "region": "RegionOne", + "interface": "public", + "id": "58bc7c3c2c66464b99ec20a398492bce" + } + ], + "type": "database", + "id": "511b94ce0482484ea09028091dd5e9a5", + "name": "trove" + } + ], + "extras": {}, + "user": { + "domain": { + "id": "default", + "name": "Default" + }, + "id": "aa9f25defa6d4cafb48466df83106065", + "name": "admin" + }, + "audit_ids": [ + "jcxRTXu9T5e9giMO57cE3A", + "FJwqoPgBQf-W3e9jqC3dcA" + ], + "issued_at": "2015-08-26T13:14:09.542711Z" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/authv3_token.json b/core-test/src/main/resources/identity/v3/authv3_token.json index 8a3872b69..230ea1bf6 100644 --- a/core-test/src/main/resources/identity/v3/authv3_token.json +++ b/core-test/src/main/resources/identity/v3/authv3_token.json @@ -1,24 +1,31 @@ { -"token": { - "methods": ["token", "password"], - "expires_at": "2015-08-26T14:14:13.719898Z", + "token": { + "methods": [ + "token", + "password" + ], + "expires_at": "2015-08-26T14:14:13.719898Z", "extras": {}, "project": { - "domain": { - "id": "default", - "name": "Default" - }, - "id": "123ac695d4db400a9001b91bb3b8aa46", - "name": "admin" - }, + "domain": { + "id": "default", + "name": "Default" + }, + "id": "123ac695d4db400a9001b91bb3b8aa46", + "name": "admin" + }, "user": { - "domain": { - "id": "default", - "name": "Default"}, - "id": "aa9f25defa6d4cafb48466df83106065", - "name": "admin" - }, - "audit_ids": ["VtEJDKwAS6G1PE1cJZBTGw", "Kb3N3IhxT02fYwHt6964Zg"], + "domain": { + "id": "default", + "name": "Default" + }, + "id": "aa9f25defa6d4cafb48466df83106065", + "name": "admin" + }, + "audit_ids": [ + "VtEJDKwAS6G1PE1cJZBTGw", + "Kb3N3IhxT02fYwHt6964Zg" + ], "issued_at": "2015-08-26T13:14:13.779668Z" - } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/authv3_token_unscoped.json b/core-test/src/main/resources/identity/v3/authv3_token_unscoped.json index 5bc113b82..fcaae574b 100644 --- a/core-test/src/main/resources/identity/v3/authv3_token_unscoped.json +++ b/core-test/src/main/resources/identity/v3/authv3_token_unscoped.json @@ -1,16 +1,21 @@ { -"token": { - "methods": ["token"], - "expires_at": "2015-08-26T14:14:13.719898Z", + "token": { + "methods": [ + "token" + ], + "expires_at": "2015-08-26T14:14:13.719898Z", "extras": {}, "user": { - "domain": { - "id": "default", - "name": "Default"}, - "id": "aa9f25defa6d4cafb48466df83106065", - "name": "admin" - }, - "audit_ids": ["VtEJDKwAS6G1PE1cJZBTGw"], + "domain": { + "id": "default", + "name": "Default" + }, + "id": "aa9f25defa6d4cafb48466df83106065", + "name": "admin" + }, + "audit_ids": [ + "VtEJDKwAS6G1PE1cJZBTGw" + ], "issued_at": "2015-08-26T13:14:13.779668Z" - } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/authv3_unscoped.json b/core-test/src/main/resources/identity/v3/authv3_unscoped.json index 2ea5be45e..38c84ae2a 100644 --- a/core-test/src/main/resources/identity/v3/authv3_unscoped.json +++ b/core-test/src/main/resources/identity/v3/authv3_unscoped.json @@ -1,17 +1,21 @@ { - "token": { - "methods": ["password"], - "expires_at": "2015-08-26T14:14:10.395363Z", - "extras": {}, - "user": { - "domain": { - "id": "default", - "name": "Default" - }, - "id": "aa9f25defa6d4cafb48466df83106065", - "name": "admin" - }, - "audit_ids": ["jMpsNK77TA6hwF6bbBHQYA"], - "issued_at": "2015-08-26T13:14:10.395414Z" - } + "token": { + "methods": [ + "password" + ], + "expires_at": "2015-08-26T14:14:10.395363Z", + "extras": {}, + "user": { + "domain": { + "id": "default", + "name": "Default" + }, + "id": "aa9f25defa6d4cafb48466df83106065", + "name": "admin" + }, + "audit_ids": [ + "jMpsNK77TA6hwF6bbBHQYA" + ], + "issued_at": "2015-08-26T13:14:10.395414Z" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/create_user.json b/core-test/src/main/resources/identity/v3/create_user.json index a67cbdd85..108c1b5c0 100644 --- a/core-test/src/main/resources/identity/v3/create_user.json +++ b/core-test/src/main/resources/identity/v3/create_user.json @@ -1,14 +1,14 @@ { -"user": { - "name": "foobar", - "links": { - "self": "http://devstack.openstack.stack:35357/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" - }, - "domain_id": "default", - "enabled": true, - "email": "foobar@example.org", - "description" : "a new user", - "default_project_id" : "123ac695d4db400a9001b91bb3b8aa46", - "id": "29d5aaaa6d3b471e9c101ae470e649a6" - } + "user": { + "name": "foobar", + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" + }, + "domain_id": "default", + "enabled": true, + "email": "foobar@example.org", + "description": "a new user", + "default_project_id": "123ac695d4db400a9001b91bb3b8aa46", + "id": "29d5aaaa6d3b471e9c101ae470e649a6" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/credentials_update_response.json b/core-test/src/main/resources/identity/v3/credentials_update_response.json index b2c22fdb5..fef848c9a 100644 --- a/core-test/src/main/resources/identity/v3/credentials_update_response.json +++ b/core-test/src/main/resources/identity/v3/credentials_update_response.json @@ -1,12 +1,12 @@ { - "credential": { - "user_id": "aa9f25defa6d4cafb48466df83106065", - "links": { - "self": "http://127.0.0.1:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510" - }, - "blob": "{\"access\":\"181920\",\"secret\":\"updatedSecretKey\"}", - "project_id": "123ac695d4db400a9001b91bb3b8aa46", - "type": "ec2", - "id": "3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510" - } + "credential": { + "user_id": "aa9f25defa6d4cafb48466df83106065", + "links": { + "self": "http://127.0.0.1:5000/v3/credentials/3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510" + }, + "blob": "{\"access\":\"181920\",\"secret\":\"updatedSecretKey\"}", + "project_id": "123ac695d4db400a9001b91bb3b8aa46", + "type": "ec2", + "id": "3d3367228f9c7665266604462ec60029bcd83ad89614021a80b2eb879c572510" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/domains_create_response.json b/core-test/src/main/resources/identity/v3/domains_create_response.json index 9f8e5b16e..dfd695e76 100644 --- a/core-test/src/main/resources/identity/v3/domains_create_response.json +++ b/core-test/src/main/resources/identity/v3/domains_create_response.json @@ -1,11 +1,11 @@ { - "domain": { - "links": { - "self": "http://127.0.0.1:5000/v3/domains/98c110ae41c249189c9d5c25d8377b65" - }, - "enabled": true, - "description": "Domain used for CRUD tests", - "name": "Domain_CRUD", - "id": "98c110ae41c249189c9d5c25d8377b65" - } + "domain": { + "links": { + "self": "http://127.0.0.1:5000/v3/domains/98c110ae41c249189c9d5c25d8377b65" + }, + "enabled": true, + "description": "Domain used for CRUD tests", + "name": "Domain_CRUD", + "id": "98c110ae41c249189c9d5c25d8377b65" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/domains_update_response.json b/core-test/src/main/resources/identity/v3/domains_update_response.json index 9646d4c38..0d0e7e5f2 100644 --- a/core-test/src/main/resources/identity/v3/domains_update_response.json +++ b/core-test/src/main/resources/identity/v3/domains_update_response.json @@ -1,11 +1,11 @@ { - "domain": { - "links": { - "self": "http://127.0.0.1:5000/v3/domains/98c110ae41c249189c9d5c25d8377b65" - }, - "enabled": true, - "description": "An updated domain used for CRUD tests", - "name": "Domain_CRUD", - "id": "98c110ae41c249189c9d5c25d8377b65" - } + "domain": { + "links": { + "self": "http://127.0.0.1:5000/v3/domains/98c110ae41c249189c9d5c25d8377b65" + }, + "enabled": true, + "description": "An updated domain used for CRUD tests", + "name": "Domain_CRUD", + "id": "98c110ae41c249189c9d5c25d8377b65" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/groups_create_response.json b/core-test/src/main/resources/identity/v3/groups_create_response.json index 5716d52b7..e800ea1d2 100644 --- a/core-test/src/main/resources/identity/v3/groups_create_response.json +++ b/core-test/src/main/resources/identity/v3/groups_create_response.json @@ -1,11 +1,11 @@ { - "group": { - "domain_id": "default", - "description": "Group used for CRUD tests", - "id": "c0d675eac29945ad9dfd08aa1bb75751", - "links": { - "self": "http://127.0.0.1:5000/v3/groups/c0d675eac29945ad9dfd08aa1bb75751" - }, - "name": "GROUP_CRUD" - } + "group": { + "domain_id": "default", + "description": "Group used for CRUD tests", + "id": "c0d675eac29945ad9dfd08aa1bb75751", + "links": { + "self": "http://127.0.0.1:5000/v3/groups/c0d675eac29945ad9dfd08aa1bb75751" + }, + "name": "GROUP_CRUD" + } } diff --git a/core-test/src/main/resources/identity/v3/groups_getByName_empty.json b/core-test/src/main/resources/identity/v3/groups_getByName_empty.json index 22ce5819d..0d88ab3e1 100644 --- a/core-test/src/main/resources/identity/v3/groups_getByName_empty.json +++ b/core-test/src/main/resources/identity/v3/groups_getByName_empty.json @@ -1,8 +1,8 @@ { - "links": { - "self": "http://127.0.0.1:5000/v3/groups", - "previous": null, - "next": null - }, - "groups": [] + "links": { + "self": "http://127.0.0.1:5000/v3/groups", + "previous": null, + "next": null + }, + "groups": [] } diff --git a/core-test/src/main/resources/identity/v3/groups_get_byId.json b/core-test/src/main/resources/identity/v3/groups_get_byId.json index 5716d52b7..e800ea1d2 100644 --- a/core-test/src/main/resources/identity/v3/groups_get_byId.json +++ b/core-test/src/main/resources/identity/v3/groups_get_byId.json @@ -1,11 +1,11 @@ { - "group": { - "domain_id": "default", - "description": "Group used for CRUD tests", - "id": "c0d675eac29945ad9dfd08aa1bb75751", - "links": { - "self": "http://127.0.0.1:5000/v3/groups/c0d675eac29945ad9dfd08aa1bb75751" - }, - "name": "GROUP_CRUD" - } + "group": { + "domain_id": "default", + "description": "Group used for CRUD tests", + "id": "c0d675eac29945ad9dfd08aa1bb75751", + "links": { + "self": "http://127.0.0.1:5000/v3/groups/c0d675eac29945ad9dfd08aa1bb75751" + }, + "name": "GROUP_CRUD" + } } diff --git a/core-test/src/main/resources/identity/v3/groups_update_response.json b/core-test/src/main/resources/identity/v3/groups_update_response.json index 50993acf7..be7e2456c 100644 --- a/core-test/src/main/resources/identity/v3/groups_update_response.json +++ b/core-test/src/main/resources/identity/v3/groups_update_response.json @@ -1,11 +1,11 @@ { - "group": { - "domain_id": "default", - "description": "An updated group used for CRUD tests", - "id": "c0d675eac29945ad9dfd08aa1bb75751", - "links": { - "self": "http://127.0.0.1:5000/v3/groups/c0d675eac29945ad9dfd08aa1bb75751" - }, - "name": "GROUP_CRUD" - } + "group": { + "domain_id": "default", + "description": "An updated group used for CRUD tests", + "id": "c0d675eac29945ad9dfd08aa1bb75751", + "links": { + "self": "http://127.0.0.1:5000/v3/groups/c0d675eac29945ad9dfd08aa1bb75751" + }, + "name": "GROUP_CRUD" + } } diff --git a/core-test/src/main/resources/identity/v3/list_domain_user_roles.json b/core-test/src/main/resources/identity/v3/list_domain_user_roles.json index 89c2dae4d..cbbdd98f7 100644 --- a/core-test/src/main/resources/identity/v3/list_domain_user_roles.json +++ b/core-test/src/main/resources/identity/v3/list_domain_user_roles.json @@ -1,14 +1,16 @@ { - "links": { - "self": "http://devstack.openstack.stack:5000/v3/domains/default/users/aa9f25defa6d4cafb48466df83106065/roles", - "previous": null, - "next": null - }, - "roles": [{ - "id": "aae88952465d4c32b0a1140a76601b68", - "links": { - "self": "http://devstack.openstack.stack:5000/v3/roles/aa9f25defa6d4cafb48466df83106065" - }, - "name": "admin" - }] + "links": { + "self": "http://devstack.openstack.stack:5000/v3/domains/default/users/aa9f25defa6d4cafb48466df83106065/roles", + "previous": null, + "next": null + }, + "roles": [ + { + "id": "aae88952465d4c32b0a1140a76601b68", + "links": { + "self": "http://devstack.openstack.stack:5000/v3/roles/aa9f25defa6d4cafb48466df83106065" + }, + "name": "admin" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/list_project_user_roles.json b/core-test/src/main/resources/identity/v3/list_project_user_roles.json index 757fb2400..46de0c5b0 100644 --- a/core-test/src/main/resources/identity/v3/list_project_user_roles.json +++ b/core-test/src/main/resources/identity/v3/list_project_user_roles.json @@ -1,14 +1,16 @@ { - "links": { - "self": "http://devstack.openstack.stack:5000/v3/projects/123ac695d4db400a9001b91bb3b8aa46/users/aa9f25defa6d4cafb48466df83106065/roles", - "previous": null, - "next": null - }, - "roles": [{ - "id": "aae88952465d4c32b0a1140a76601b68", - "links": { - "self": "http://devstack.openstack.stack:5000/v3/roles/aa9f25defa6d4cafb48466df83106065" - }, - "name": "admin" - }] + "links": { + "self": "http://devstack.openstack.stack:5000/v3/projects/123ac695d4db400a9001b91bb3b8aa46/users/aa9f25defa6d4cafb48466df83106065/roles", + "previous": null, + "next": null + }, + "roles": [ + { + "id": "aae88952465d4c32b0a1140a76601b68", + "links": { + "self": "http://devstack.openstack.stack:5000/v3/roles/aa9f25defa6d4cafb48466df83106065" + }, + "name": "admin" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/list_user_groups.json b/core-test/src/main/resources/identity/v3/list_user_groups.json index 2cec429c9..ae5ebb0fe 100644 --- a/core-test/src/main/resources/identity/v3/list_user_groups.json +++ b/core-test/src/main/resources/identity/v3/list_user_groups.json @@ -1,27 +1,27 @@ { - "groups": [ - { - "description": "Developers cleared for work on all general projects", - "domain_id": "default", - "id": "ea167b", - "links": { - "self": "https://identity:35357/v3/groups/ea167b" - }, - "name": "Developers" - }, - { - "description": "Developers cleared for work on secret projects", - "domain_id": "default", - "id": "a62db1", - "links": { - "self": "https://identity:35357/v3/groups/a62db1" - }, - "name": "Secure Developers" - } - ], - "links": { - "self": "http://identity:35357/v3/users/aa9f25defa6d4cafb48466df83106065/groups", - "previous": null, - "next": null + "groups": [ + { + "description": "Developers cleared for work on all general projects", + "domain_id": "default", + "id": "ea167b", + "links": { + "self": "https://identity:35357/v3/groups/ea167b" + }, + "name": "Developers" + }, + { + "description": "Developers cleared for work on secret projects", + "domain_id": "default", + "id": "a62db1", + "links": { + "self": "https://identity:35357/v3/groups/a62db1" + }, + "name": "Secure Developers" } + ], + "links": { + "self": "http://identity:35357/v3/users/aa9f25defa6d4cafb48466df83106065/groups", + "previous": null, + "next": null + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/list_user_projects.json b/core-test/src/main/resources/identity/v3/list_user_projects.json index 8f904773e..297bb30ec 100644 --- a/core-test/src/main/resources/identity/v3/list_user_projects.json +++ b/core-test/src/main/resources/identity/v3/list_user_projects.json @@ -1,31 +1,31 @@ { - "projects": [ - { - "description": "description of this project", - "domain_id": "default", - "enabled": true, - "id": "456788", - "parent_id": "212223", - "links": { - "self": "http://identity:35357/v3/projects/456788" - }, - "name": "a project name" - }, - { - "description": "description of this project", - "domain_id": "default", - "enabled": true, - "id": "456789", - "parent_id": "212223", - "links": { - "self": "http://identity:35357/v3/projects/456789" - }, - "name": "another domain" - } - ], - "links": { - "self": "http://identity:35357/v3/users/aa9f25defa6d4cafb48466df83106065/projects", - "previous": null, - "next": null + "projects": [ + { + "description": "description of this project", + "domain_id": "default", + "enabled": true, + "id": "456788", + "parent_id": "212223", + "links": { + "self": "http://identity:35357/v3/projects/456788" + }, + "name": "a project name" + }, + { + "description": "description of this project", + "domain_id": "default", + "enabled": true, + "id": "456789", + "parent_id": "212223", + "links": { + "self": "http://identity:35357/v3/projects/456789" + }, + "name": "another domain" } + ], + "links": { + "self": "http://identity:35357/v3/users/aa9f25defa6d4cafb48466df83106065/projects", + "previous": null, + "next": null + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/policies_get_byId.json b/core-test/src/main/resources/identity/v3/policies_get_byId.json index 4490d3672..4c788d137 100644 --- a/core-test/src/main/resources/identity/v3/policies_get_byId.json +++ b/core-test/src/main/resources/identity/v3/policies_get_byId.json @@ -1,12 +1,12 @@ { - "policy": { - "user_id": "aa9f25defa6d4cafb48466df83106065", - "links": { - "self": "http://identity:35357/v3/policies/13c92821e4c4476a878d3aae7444f52f" - }, - "blob": "{'admin' : 'role:admin-user'}", - "project_id": "123ac695d4db400a9001b91bb3b8aa46", - "type": "application/json", - "id": "13c92821e4c4476a878d3aae7444f52f" - } + "policy": { + "user_id": "aa9f25defa6d4cafb48466df83106065", + "links": { + "self": "http://identity:35357/v3/policies/13c92821e4c4476a878d3aae7444f52f" + }, + "blob": "{'admin' : 'role:admin-user'}", + "project_id": "123ac695d4db400a9001b91bb3b8aa46", + "type": "application/json", + "id": "13c92821e4c4476a878d3aae7444f52f" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/policies_update_response.json b/core-test/src/main/resources/identity/v3/policies_update_response.json index b98ddf612..1be21ee4a 100644 --- a/core-test/src/main/resources/identity/v3/policies_update_response.json +++ b/core-test/src/main/resources/identity/v3/policies_update_response.json @@ -1,12 +1,12 @@ { - "policy": { - "user_id": "aa9f25defa6d4cafb48466df83106065", - "links": { - "self": "http://identity:35357/v3/policies/13c92821e4c4476a878d3aae7444f52f" - }, - "blob": "{'admin' : 'role:non-admin-user'}", - "project_id": "123ac695d4db400a9001b91bb3b8aa46", - "type": "application/json", - "id": "13c92821e4c4476a878d3aae7444f52f" - } + "policy": { + "user_id": "aa9f25defa6d4cafb48466df83106065", + "links": { + "self": "http://identity:35357/v3/policies/13c92821e4c4476a878d3aae7444f52f" + }, + "blob": "{'admin' : 'role:non-admin-user'}", + "project_id": "123ac695d4db400a9001b91bb3b8aa46", + "type": "application/json", + "id": "13c92821e4c4476a878d3aae7444f52f" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/projects_create_response.json b/core-test/src/main/resources/identity/v3/projects_create_response.json index a99eb73a2..3a2c6c0be 100644 --- a/core-test/src/main/resources/identity/v3/projects_create_response.json +++ b/core-test/src/main/resources/identity/v3/projects_create_response.json @@ -11,6 +11,10 @@ "domain_id": "7a71863c2d1d4444b3e6c2cd36955e1e", "name": "ProjectX", "extra_key1": "value1", - "tags": ["one", "two", "three"] + "tags": [ + "one", + "two", + "three" + ] } } diff --git a/core-test/src/main/resources/identity/v3/projects_getByName_empty.json b/core-test/src/main/resources/identity/v3/projects_getByName_empty.json index 53bcf361d..d7a011947 100644 --- a/core-test/src/main/resources/identity/v3/projects_getByName_empty.json +++ b/core-test/src/main/resources/identity/v3/projects_getByName_empty.json @@ -1,8 +1,8 @@ { - "links": { - "self": "http://127.0.0.1:5000/v3/projects", - "previous": null, - "next": null - }, - "projects": [] + "links": { + "self": "http://127.0.0.1:5000/v3/projects", + "previous": null, + "next": null + }, + "projects": [] } diff --git a/core-test/src/main/resources/identity/v3/read_user.json b/core-test/src/main/resources/identity/v3/read_user.json index aa6bb13fc..fc85426c3 100644 --- a/core-test/src/main/resources/identity/v3/read_user.json +++ b/core-test/src/main/resources/identity/v3/read_user.json @@ -1,17 +1,19 @@ { - "users": [{ - "name": "foobar", - "links": { - "self": "http://devstack.openstack.stack:5000/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" - }, - "domain_id": "default", - "enabled": true, - "email": "foobar@example.org", - "id": "29d5aaaa6d3b471e9c101ae470e649a6" - }], - "links": { - "self": "http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=foobar", - "previous": null, - "next": null + "users": [ + { + "name": "foobar", + "links": { + "self": "http://devstack.openstack.stack:5000/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" + }, + "domain_id": "default", + "enabled": true, + "email": "foobar@example.org", + "id": "29d5aaaa6d3b471e9c101ae470e649a6" } + ], + "links": { + "self": "http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=foobar", + "previous": null, + "next": null + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/regions_get_byId.json b/core-test/src/main/resources/identity/v3/regions_get_byId.json index 4a22c0bbc..130284ff7 100644 --- a/core-test/src/main/resources/identity/v3/regions_get_byId.json +++ b/core-test/src/main/resources/identity/v3/regions_get_byId.json @@ -1,10 +1,10 @@ { - "region": { - "parent_region_id": "RegionOne", - "id": "Region_CRUD", - "links": { - "self": "http://127.0.0.1:5000/v3/regions/Region_CRUD" - }, - "description": "No description provided." - } + "region": { + "parent_region_id": "RegionOne", + "id": "Region_CRUD", + "links": { + "self": "http://127.0.0.1:5000/v3/regions/Region_CRUD" + }, + "description": "No description provided." + } } diff --git a/core-test/src/main/resources/identity/v3/regions_update_response.json b/core-test/src/main/resources/identity/v3/regions_update_response.json index f451f97a2..dd42380dd 100644 --- a/core-test/src/main/resources/identity/v3/regions_update_response.json +++ b/core-test/src/main/resources/identity/v3/regions_update_response.json @@ -1,10 +1,10 @@ { - "region": { - "parent_region_id": "RegionOne", - "id": "Region_CRUD", - "links": { - "self": "http://127.0.0.1:5000/v3/regions/Region_CRUD" - }, - "description": "A updated region used for CRUD tests." - } + "region": { + "parent_region_id": "RegionOne", + "id": "Region_CRUD", + "links": { + "self": "http://127.0.0.1:5000/v3/regions/Region_CRUD" + }, + "description": "A updated region used for CRUD tests." + } } diff --git a/core-test/src/main/resources/identity/v3/roles_get_byId.json b/core-test/src/main/resources/identity/v3/roles_get_byId.json index 2d85ad9f3..436c40012 100644 --- a/core-test/src/main/resources/identity/v3/roles_get_byId.json +++ b/core-test/src/main/resources/identity/v3/roles_get_byId.json @@ -1,10 +1,10 @@ { - "role": { - "id": "aae88952465d4c32b0a1140a76601b68", - "domain_id" : "default", - "links": { - "self": "http://127.0.0.1:5000/v3/roles/aae88952465d4c32b0a1140a76601b68" - }, - "name": "admin" - } + "role": { + "id": "aae88952465d4c32b0a1140a76601b68", + "domain_id": "default", + "links": { + "self": "http://127.0.0.1:5000/v3/roles/aae88952465d4c32b0a1140a76601b68" + }, + "name": "admin" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/roles_grantRole_error.json b/core-test/src/main/resources/identity/v3/roles_grantRole_error.json index 28f4335a8..eab9662d4 100644 --- a/core-test/src/main/resources/identity/v3/roles_grantRole_error.json +++ b/core-test/src/main/resources/identity/v3/roles_grantRole_error.json @@ -1,7 +1,7 @@ { - "error": { - "message": "Could not find role: nonExistingRoleId", - "code": 404, - "title": "Not Found" - } + "error": { + "message": "Could not find role: nonExistingRoleId", + "code": 404, + "title": "Not Found" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/roles_list.json b/core-test/src/main/resources/identity/v3/roles_list.json index 4b221a1a9..7ff4f565d 100644 --- a/core-test/src/main/resources/identity/v3/roles_list.json +++ b/core-test/src/main/resources/identity/v3/roles_list.json @@ -6,7 +6,7 @@ }, "roles": [ { - "domain_id" : "default", + "domain_id": "default", "id": "1106df77e969413ca2a24aca5d5af0a6", "links": { "self": "http://127.0.0.1:5000/v3/roles/1106df77e969413ca2a24aca5d5af0a6" @@ -14,7 +14,7 @@ "name": "ResellerAdmin" }, { - "domain_id" : "default", + "domain_id": "default", "id": "4585a09447dd4eeea1ffcf495e0003a9", "links": { "self": "http://127.0.0.1:5000/v3/roles/4585a09447dd4eeea1ffcf495e0003a9" @@ -22,7 +22,7 @@ "name": "Member" }, { - "domain_id" : "default", + "domain_id": "default", "id": "9fe2ff9ee4384b1894a90878d3e92bab", "links": { "self": "http://127.0.0.1:5000/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab" @@ -30,7 +30,7 @@ "name": "_member_" }, { - "domain_id" : "default", + "domain_id": "default", "id": "c85149ed1b5548549289a576f1ab946e", "links": { "self": "http://127.0.0.1:5000/v3/roles/c85149ed1b5548549289a576f1ab946e" @@ -38,7 +38,7 @@ "name": "service" }, { - "domain_id" : "default", + "domain_id": "default", "id": "d164e3440b5741808e5d8ec324b51e0b", "links": { "self": "http://127.0.0.1:5000/v3/roles/d164e3440b5741808e5d8ec324b51e0b" @@ -46,7 +46,7 @@ "name": "admin" }, { - "domain_id" : "default", + "domain_id": "default", "id": "f2b9666d7c41407b8a56fda3c76379ec", "links": { "self": "http://127.0.0.1:5000/v3/roles/f2b9666d7c41407b8a56fda3c76379ec" diff --git a/core-test/src/main/resources/identity/v3/roles_multiple_entries.json b/core-test/src/main/resources/identity/v3/roles_multiple_entries.json index b80e50d36..5c46e7056 100644 --- a/core-test/src/main/resources/identity/v3/roles_multiple_entries.json +++ b/core-test/src/main/resources/identity/v3/roles_multiple_entries.json @@ -6,7 +6,7 @@ }, "roles": [ { - "domain_id" : "default", + "domain_id": "default", "id": "d164e3440b5741808e5d8ec324b51e0b", "links": { "self": "http://127.0.0.1:5000/v3/roles/d164e3440b5741808e5d8ec324b51e0b" @@ -14,7 +14,7 @@ "name": "admin" }, { - "domain_id" : "default", + "domain_id": "default", "id": "d164e3440b5741808e5d8ec324b51e0c", "links": { "self": "http://127.0.0.1:5000/v3/roles/d164e3440b5741808e5d8ec324b51e0c" diff --git a/core-test/src/main/resources/identity/v3/roles_one_entry.json b/core-test/src/main/resources/identity/v3/roles_one_entry.json index fcd2d8c27..697fd4e8d 100644 --- a/core-test/src/main/resources/identity/v3/roles_one_entry.json +++ b/core-test/src/main/resources/identity/v3/roles_one_entry.json @@ -6,7 +6,7 @@ }, "roles": [ { - "domain_id" : "default", + "domain_id": "default", "id": "aae88952465d4c32b0a1140a76601b68", "links": { "self": "http://127.0.0.1:5000/v3/roles/d164e3440b5741808e5d8ec324b51e0b" diff --git a/core-test/src/main/resources/identity/v3/roles_revokeRole_error.json b/core-test/src/main/resources/identity/v3/roles_revokeRole_error.json index 455894413..2e8711a68 100644 --- a/core-test/src/main/resources/identity/v3/roles_revokeRole_error.json +++ b/core-test/src/main/resources/identity/v3/roles_revokeRole_error.json @@ -1,7 +1,7 @@ { - "error": { - "message": "Could not find role assignment with role: anotherExistingUnassignedRoleId, user or group: aa9f25defa6d4cafb48466df83106065, project or domain: 123ac695d4db400a9001b91bb3b8aa46", - "code": 404, - "title": "Not Found" - } + "error": { + "message": "Could not find role assignment with role: anotherExistingUnassignedRoleId, user or group: aa9f25defa6d4cafb48466df83106065, project or domain: 123ac695d4db400a9001b91bb3b8aa46", + "code": 404, + "title": "Not Found" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/roles_update.json b/core-test/src/main/resources/identity/v3/roles_update.json index 51a553818..7c473d0b3 100644 --- a/core-test/src/main/resources/identity/v3/roles_update.json +++ b/core-test/src/main/resources/identity/v3/roles_update.json @@ -1,10 +1,10 @@ { - "role": { - "domain_id" : "default", - "id": "aae88952465d4c32b0a1140a76601b68", - "links": { - "self": "http://127.0.0.1:5000/v3/roles/aae88952465d4c32b0a1140a76601b68" - }, - "name": "cloudAdmin" - } + "role": { + "domain_id": "default", + "id": "aae88952465d4c32b0a1140a76601b68", + "links": { + "self": "http://127.0.0.1:5000/v3/roles/aae88952465d4c32b0a1140a76601b68" + }, + "name": "cloudAdmin" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/services_get_byId.json b/core-test/src/main/resources/identity/v3/services_get_byId.json index 7639e5789..bdbe160b7 100644 --- a/core-test/src/main/resources/identity/v3/services_get_byId.json +++ b/core-test/src/main/resources/identity/v3/services_get_byId.json @@ -1,12 +1,12 @@ { - "service": { - "name": "Service_CRUD", - "links": { - "self": "http://127.0.0.1:5000/v3/services/5439da9864004dd088fce14c1c626a4b" - }, - "enabled": true, - "type": "identity", - "id": "5439da9864004dd088fce14c1c626a4b", - "description": "Identity Service" - } + "service": { + "name": "Service_CRUD", + "links": { + "self": "http://127.0.0.1:5000/v3/services/5439da9864004dd088fce14c1c626a4b" + }, + "enabled": true, + "type": "identity", + "id": "5439da9864004dd088fce14c1c626a4b", + "description": "Identity Service" + } } diff --git a/core-test/src/main/resources/identity/v3/services_update_response.json b/core-test/src/main/resources/identity/v3/services_update_response.json index 504989db0..1896d8c6a 100644 --- a/core-test/src/main/resources/identity/v3/services_update_response.json +++ b/core-test/src/main/resources/identity/v3/services_update_response.json @@ -1,12 +1,12 @@ { - "service": { - "name": "Service_CRUD", - "links": { - "self": "http://127.0.0.1:5000/v3/services/5439da9864004dd088fce14c1c626a4b" - }, - "enabled": true, - "type": "identity", - "id": "5439da9864004dd088fce14c1c626a4b", - "description": "An updated service used for tests" - } + "service": { + "name": "Service_CRUD", + "links": { + "self": "http://127.0.0.1:5000/v3/services/5439da9864004dd088fce14c1c626a4b" + }, + "enabled": true, + "type": "identity", + "id": "5439da9864004dd088fce14c1c626a4b", + "description": "An updated service used for tests" + } } diff --git a/core-test/src/main/resources/identity/v3/update_user.json b/core-test/src/main/resources/identity/v3/update_user.json index 52e5dd35d..7c03dc6eb 100644 --- a/core-test/src/main/resources/identity/v3/update_user.json +++ b/core-test/src/main/resources/identity/v3/update_user.json @@ -1,18 +1,18 @@ { - "user": { - "name": "foobar", - "links": { - "self": "http://devstack.openstack,stack:5000/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" - }, - "extra": { - "email": "updatedFoobar@example.org", - "links": { - "self": "http://devstack.openstack.stack:5000/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" - } - }, - "domain_id": "default", - "enabled": true, - "id": "29d5aaaa6d3b471e9c101ae470e649a6", - "email": "updatedFoobar@example.org" - } + "user": { + "name": "foobar", + "links": { + "self": "http://devstack.openstack,stack:5000/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" + }, + "extra": { + "email": "updatedFoobar@example.org", + "links": { + "self": "http://devstack.openstack.stack:5000/v3/users/29d5aaaa6d3b471e9c101ae470e649a6" + } + }, + "domain_id": "default", + "enabled": true, + "id": "29d5aaaa6d3b471e9c101ae470e649a6", + "email": "updatedFoobar@example.org" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/user_add_ToGroup_fail.json b/core-test/src/main/resources/identity/v3/user_add_ToGroup_fail.json index b9df9d506..581def17a 100644 --- a/core-test/src/main/resources/identity/v3/user_add_ToGroup_fail.json +++ b/core-test/src/main/resources/identity/v3/user_add_ToGroup_fail.json @@ -1,7 +1,7 @@ { -"error": { - "message": "Could not find group: invalidGroup", - "code": 404, - "title": "Not Found" - } + "error": { + "message": "Could not find group: invalidGroup", + "code": 404, + "title": "Not Found" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/user_delete_fail.json b/core-test/src/main/resources/identity/v3/user_delete_fail.json index ca163f8eb..5131b8699 100644 --- a/core-test/src/main/resources/identity/v3/user_delete_fail.json +++ b/core-test/src/main/resources/identity/v3/user_delete_fail.json @@ -1,7 +1,7 @@ { - "error": { - "message": "Could not find user: invalidUser", - "code": 404, - "title": "Not Found" - } + "error": { + "message": "Could not find user: invalidUser", + "code": 404, + "title": "Not Found" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/user_get_byId.json b/core-test/src/main/resources/identity/v3/user_get_byId.json index 84111d2e5..4e8a055b1 100644 --- a/core-test/src/main/resources/identity/v3/user_get_byId.json +++ b/core-test/src/main/resources/identity/v3/user_get_byId.json @@ -1,13 +1,13 @@ { - "user": { - "domain_id": "default", - "name": "admin", - "links": { - "self": "http://devstack.openstack.stack:5000/v3/users/aa9f25defa6d4cafb48466df83106065" - }, - "id": "aa9f25defa6d4cafb48466df83106065", - "enabled": true, - "email": null, - "default_project_id": "123ac695d4db400a9001b91bb3b8aa46" - } + "user": { + "domain_id": "default", + "name": "admin", + "links": { + "self": "http://devstack.openstack.stack:5000/v3/users/aa9f25defa6d4cafb48466df83106065" + }, + "id": "aa9f25defa6d4cafb48466df83106065", + "enabled": true, + "email": null, + "default_project_id": "123ac695d4db400a9001b91bb3b8aa46" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/user_get_byName.json b/core-test/src/main/resources/identity/v3/user_get_byName.json index f33d58d5d..229a242d0 100644 --- a/core-test/src/main/resources/identity/v3/user_get_byName.json +++ b/core-test/src/main/resources/identity/v3/user_get_byName.json @@ -1,28 +1,31 @@ { - "users": [{ - "domain_id": "default", - "name": "admin", - "links": { - "self": "https://identity:35357/v3/users/aa9f25defa6d4cafb48466df83106065" - }, - "id": "aa9f25defa6d4cafb48466df83106065", - "enabled": true, - "email": "admin@example.com", - "default_project_id": "123ac695d4db400a9001b91bb3b8aa46" - }, { - "domain_id": "anotherDomain", - "name": "admin", - "links": { - "self": "https://identity:35357/v3/users/fba5560a39594863a284cbd759380185" - }, - "id": "fba5560a39594863a284cbd759380185", - "enabled": true, - "email": "admin@AnotherDomain.com", - "default_project_id": "9e6aa6c98ce540898a6cea3c71336b32" - }], - "links": { - "self": "http://devstack.openstack.stack:5000/v3/users?name=admin", - "previous": null, - "next": null + "users": [ + { + "domain_id": "default", + "name": "admin", + "links": { + "self": "https://identity:35357/v3/users/aa9f25defa6d4cafb48466df83106065" + }, + "id": "aa9f25defa6d4cafb48466df83106065", + "enabled": true, + "email": "admin@example.com", + "default_project_id": "123ac695d4db400a9001b91bb3b8aa46" + }, + { + "domain_id": "anotherDomain", + "name": "admin", + "links": { + "self": "https://identity:35357/v3/users/fba5560a39594863a284cbd759380185" + }, + "id": "fba5560a39594863a284cbd759380185", + "enabled": true, + "email": "admin@AnotherDomain.com", + "default_project_id": "9e6aa6c98ce540898a6cea3c71336b32" } + ], + "links": { + "self": "http://devstack.openstack.stack:5000/v3/users?name=admin", + "previous": null, + "next": null + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId.json b/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId.json index 24c58a5c8..44e8994c7 100644 --- a/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId.json +++ b/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId.json @@ -1,18 +1,20 @@ { - "users": [{ - "domain_id": "default", - "name": "admin", - "links": { - "self": "http://devstack.openstack.stack:5000/v3/users/aa9f25defa6d4cafb48466df83106065" - }, - "id": "aa9f25defa6d4cafb48466df83106065", - "enabled": true, - "email": null, - "default_project_id": "123ac695d4db400a9001b91bb3b8aa46" - }], - "links": { - "self": "http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=admin", - "previous": null, - "next": null + "users": [ + { + "domain_id": "default", + "name": "admin", + "links": { + "self": "http://devstack.openstack.stack:5000/v3/users/aa9f25defa6d4cafb48466df83106065" + }, + "id": "aa9f25defa6d4cafb48466df83106065", + "enabled": true, + "email": null, + "default_project_id": "123ac695d4db400a9001b91bb3b8aa46" } + ], + "links": { + "self": "http://devstack.openstack.stack:5000/v3/users?domain_id=default&name=admin", + "previous": null, + "next": null + } } \ No newline at end of file diff --git a/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId_not_exist.json b/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId_not_exist.json index 6f4f0f703..cdec42cd9 100644 --- a/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId_not_exist.json +++ b/core-test/src/main/resources/identity/v3/user_get_byName_byDomainId_not_exist.json @@ -1,8 +1,8 @@ { - "users": [], - "links": { - "self": "http://127.0.0.1:5000/v3/users", - "previous": null, - "next": null - } + "users": [], + "links": { + "self": "http://127.0.0.1:5000/v3/users", + "previous": null, + "next": null + } } diff --git a/core-test/src/main/resources/identity/v3/users.json b/core-test/src/main/resources/identity/v3/users.json index f09204a8b..6aca60a0c 100644 --- a/core-test/src/main/resources/identity/v3/users.json +++ b/core-test/src/main/resources/identity/v3/users.json @@ -1,69 +1,69 @@ { -"users": [ - { - "name": "glance", - "links": { - "self": "http://devstack.openstack.stack:35357/v3/users/07cfb841cddd46819e3dcd5df238ae04" - }, - "domain_id": "default", - "enabled": true, - "email": null, - "id": "07cfb841cddd46819e3dcd5df238ae04" - }, - { - "name": "demo", - "links": { - "self": "http://devstack.openstack.stack:35357/v3/users/11ba3db90590446fb6d7e0efe6c1f46a" - }, - "domain_id": "default", - "enabled": true, - "email": "demo@example.com", - "id": "11ba3db90590446fb6d7e0efe6c1f46a" - }, - { - "name": "cinder", - "links": { - "self": "http://devstack.openstack.stack:35357/v3/users/1523e8606bd1400cae36a40e0f3f817e" - }, - "domain_id": "default", - "enabled": true, - "email": null, - "id": "1523e8606bd1400cae36a40e0f3f817e" - }, - { - "name": "nova", - "links": { - "self": "http://devstack.openstack.stack:35357/v3/users/7afec08993c24bb09df141e513738030" - }, - "domain_id": "default", - "enabled": true, - "email": null, - "id": "7afec08993c24bb09df141e513738030" - }, - { - "name": "u-foobar", - "links": { - "self": "http://devstack.openstack.stack:35357/v3/users/938bd5585fd145efaadb4a7e588078c1" - }, - "domain_id": "default", - "enabled": true, - "email": "foobar@example.com", - "id": "938bd5585fd145efaadb4a7e588078c1" - }, - { - "name": "admin", - "links": { - "self": "http://devstack.openstack.stack:35357/v3/users/aa9f25defa6d4cafb48466df83106065" - }, - "domain_id": "default", - "enabled": true, - "email": null, - "id": "aa9f25defa6d4cafb48466df83106065" - } - ], -"links": { - "self": "http://devstack.openstack.stack:35357/v3/users", - "previous": null, - "next": null - } + "users": [ + { + "name": "glance", + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users/07cfb841cddd46819e3dcd5df238ae04" + }, + "domain_id": "default", + "enabled": true, + "email": null, + "id": "07cfb841cddd46819e3dcd5df238ae04" + }, + { + "name": "demo", + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users/11ba3db90590446fb6d7e0efe6c1f46a" + }, + "domain_id": "default", + "enabled": true, + "email": "demo@example.com", + "id": "11ba3db90590446fb6d7e0efe6c1f46a" + }, + { + "name": "cinder", + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users/1523e8606bd1400cae36a40e0f3f817e" + }, + "domain_id": "default", + "enabled": true, + "email": null, + "id": "1523e8606bd1400cae36a40e0f3f817e" + }, + { + "name": "nova", + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users/7afec08993c24bb09df141e513738030" + }, + "domain_id": "default", + "enabled": true, + "email": null, + "id": "7afec08993c24bb09df141e513738030" + }, + { + "name": "u-foobar", + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users/938bd5585fd145efaadb4a7e588078c1" + }, + "domain_id": "default", + "enabled": true, + "email": "foobar@example.com", + "id": "938bd5585fd145efaadb4a7e588078c1" + }, + { + "name": "admin", + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users/aa9f25defa6d4cafb48466df83106065" + }, + "domain_id": "default", + "enabled": true, + "email": null, + "id": "aa9f25defa6d4cafb48466df83106065" + } + ], + "links": { + "self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, + "next": null + } } \ No newline at end of file diff --git a/core-test/src/main/resources/image/v2/image-with-locations.json b/core-test/src/main/resources/image/v2/image-with-locations.json index 3ab605857..0787f8466 100644 --- a/core-test/src/main/resources/image/v2/image-with-locations.json +++ b/core-test/src/main/resources/image/v2/image-with-locations.json @@ -14,13 +14,16 @@ "status": "active", "tags": [], "visibility": "public", - "locations": [{ - "url": "rbd://xxxx/images/xxxx/snap", - "metadata": {} - }, { - "url": "rbd://yyyy/images/yyyy/snap", - "metadata": {} - }], + "locations": [ + { + "url": "rbd://xxxx/images/xxxx/snap", + "metadata": {} + }, + { + "url": "rbd://yyyy/images/yyyy/snap", + "metadata": {} + } + ], "min_disk": 0, "virtual_size": null, "name": "some-image", diff --git a/core-test/src/main/resources/image/v2/images.json b/core-test/src/main/resources/image/v2/images.json index 20fd6a045..99d594c71 100644 --- a/core-test/src/main/resources/image/v2/images.json +++ b/core-test/src/main/resources/image/v2/images.json @@ -27,7 +27,6 @@ "status": "active", "name": "CentOS-7-x86_64-GenericCloud-1604", "tags": [ - ], "container_format": "bare", "created_at": "2016-08-09T21:31:49Z", diff --git a/core-test/src/main/resources/magnum/baymodel_create_resp.json b/core-test/src/main/resources/magnum/baymodel_create_resp.json index bdf0fd896..45e3eff4e 100644 --- a/core-test/src/main/resources/magnum/baymodel_create_resp.json +++ b/core-test/src/main/resources/magnum/baymodel_create_resp.json @@ -1,44 +1,43 @@ -{ - "insecure_registry":null, - "links":[ - { - "href":"http://127.0.0.1:9511/v1/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", - "rel":"self" - }, - { - "href":"http://1127.0.0.1:9511/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", - "rel":"bookmark" - } - ], - "http_proxy":"http://10.164.177.169:8080", - "updated_at":null, - "floating_ip_enabled":true, - "fixed_subnet":null, - "master_flavor_id":null, - "uuid":"085e1c4d-4f68-4bfd-8462-74b9e14e4f39", - "no_proxy":"10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost", - "https_proxy":"http://10.164.177.169:8080", - "tls_disabled":false, - "keypair_id":"kp", - "public":false, - "labels":{ - - }, - "docker_volume_size":3, - "server_type":"vm", - "external_network_id":"public", - "cluster_distro":"fedora-atomic", - "image_id":"fedora-atomic-latest", - "volume_driver":"cinder", - "registry_enabled":false, - "docker_storage_driver":"devicemapper", - "apiserver_port":null, - "name":"k8s-bm2", - "created_at":"2016-08-29T02:08:08+00:00", - "network_driver":"flannel", - "fixed_network":null, - "coe":"kubernetes", - "flavor_id":"m1.small", - "master_lb_enabled":true, - "dns_nameserver":"8.8.8.8" +{ + "insecure_registry": null, + "links": [ + { + "href": "http://127.0.0.1:9511/v1/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", + "rel": "self" + }, + { + "href": "http://1127.0.0.1:9511/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", + "rel": "bookmark" + } + ], + "http_proxy": "http://10.164.177.169:8080", + "updated_at": null, + "floating_ip_enabled": true, + "fixed_subnet": null, + "master_flavor_id": null, + "uuid": "085e1c4d-4f68-4bfd-8462-74b9e14e4f39", + "no_proxy": "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost", + "https_proxy": "http://10.164.177.169:8080", + "tls_disabled": false, + "keypair_id": "kp", + "public": false, + "labels": { + }, + "docker_volume_size": 3, + "server_type": "vm", + "external_network_id": "public", + "cluster_distro": "fedora-atomic", + "image_id": "fedora-atomic-latest", + "volume_driver": "cinder", + "registry_enabled": false, + "docker_storage_driver": "devicemapper", + "apiserver_port": null, + "name": "k8s-bm2", + "created_at": "2016-08-29T02:08:08+00:00", + "network_driver": "flannel", + "fixed_network": null, + "coe": "kubernetes", + "flavor_id": "m1.small", + "master_lb_enabled": true, + "dns_nameserver": "8.8.8.8" } \ No newline at end of file diff --git a/core-test/src/main/resources/magnum/baymodel_get_all_resp.json b/core-test/src/main/resources/magnum/baymodel_get_all_resp.json index 5e6edb0e3..ef41af9af 100644 --- a/core-test/src/main/resources/magnum/baymodel_get_all_resp.json +++ b/core-test/src/main/resources/magnum/baymodel_get_all_resp.json @@ -1,53 +1,52 @@ { - "links": { - "self": "http://127.0.0.1:9511/v1/baymodels", - "previous": null, - "next": null - }, - "baymodels": [ + "links": { + "self": "http://127.0.0.1:9511/v1/baymodels", + "previous": null, + "next": null + }, + "baymodels": [ + { + "insecure_registry": null, + "links": [ { - "insecure_registry": null, - "links": [ - { - "href": "http://10.164.180.104:9511/v1/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", - "rel": "self" - }, - { - "href": "http://10.164.180.104:9511/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", - "rel": "bookmark" - } - ], - "http_proxy": "http://10.164.177.169:8080", - "updated_at": null, - "floating_ip_enabled": true, - "fixed_subnet": null, - "master_flavor_id": null, - "uuid": "085e1c4d-4f68-4bfd-8462-74b9e14e4f39", - "no_proxy": "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost", - "https_proxy": "http://10.164.177.169:8080", - "tls_disabled": false, - "keypair_id": "kp", - "public": false, - "labels": { - - }, - "docker_volume_size": 3, - "server_type": "vm", - "external_network_id": "public", - "cluster_distro": "fedora-atomic", - "image_id": "fedora-atomic-latest", - "volume_driver": "cinder", - "registry_enabled": false, - "docker_storage_driver": "devicemapper", - "apiserver_port": null, - "name": "k8s-bm2", - "created_at": "2016-08-29T02:08:08+00:00", - "network_driver": "flannel", - "fixed_network": null, - "coe": "kubernetes", - "flavor_id": "m1.small", - "master_lb_enabled": true, - "dns_nameserver": "8.8.8.8" + "href": "http://10.164.180.104:9511/v1/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", + "rel": "self" + }, + { + "href": "http://10.164.180.104:9511/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39", + "rel": "bookmark" } - ] + ], + "http_proxy": "http://10.164.177.169:8080", + "updated_at": null, + "floating_ip_enabled": true, + "fixed_subnet": null, + "master_flavor_id": null, + "uuid": "085e1c4d-4f68-4bfd-8462-74b9e14e4f39", + "no_proxy": "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost", + "https_proxy": "http://10.164.177.169:8080", + "tls_disabled": false, + "keypair_id": "kp", + "public": false, + "labels": { + }, + "docker_volume_size": 3, + "server_type": "vm", + "external_network_id": "public", + "cluster_distro": "fedora-atomic", + "image_id": "fedora-atomic-latest", + "volume_driver": "cinder", + "registry_enabled": false, + "docker_storage_driver": "devicemapper", + "apiserver_port": null, + "name": "k8s-bm2", + "created_at": "2016-08-29T02:08:08+00:00", + "network_driver": "flannel", + "fixed_network": null, + "coe": "kubernetes", + "flavor_id": "m1.small", + "master_lb_enabled": true, + "dns_nameserver": "8.8.8.8" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/magnum/mservices.json b/core-test/src/main/resources/magnum/mservices.json index 9ca7e5922..abc4f582c 100644 --- a/core-test/src/main/resources/magnum/mservices.json +++ b/core-test/src/main/resources/magnum/mservices.json @@ -4,16 +4,16 @@ "previous": null, "next": null }, - "mservices": [ - { - "id":"1", - "binary":"magnum-conductor", - "state":"up", - "host":"harsh-OptiPlex-7040", - "created_at":"2017-02-03T07:03:27+00:00", - "report_count":1903, - "updated_at":"2017-02-07T05:41:24+00:00", - "disabled_reason":null - } + "mservices": [ + { + "id": "1", + "binary": "magnum-conductor", + "state": "up", + "host": "harsh-OptiPlex-7040", + "created_at": "2017-02-03T07:03:27+00:00", + "report_count": 1903, + "updated_at": "2017-02-07T05:41:24+00:00", + "disabled_reason": null + } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/metering/alarms.json b/core-test/src/main/resources/metering/alarms.json index 7c2ab0da9..619317889 100644 --- a/core-test/src/main/resources/metering/alarms.json +++ b/core-test/src/main/resources/metering/alarms.json @@ -1,72 +1,82 @@ -[{ - "alarm_actions" : ["http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_out?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=800c42eb3f4a49218f45688547c77266&SignatureVersion=2&Signature=Hgbvixq0VkVKJIKEyuIIEx7a68ut2eCl0EpxoaahUVU%3D"], - "ok_actions" : [], - "name" : "sdfasdf-scale_out_WebAS-Sig-l4ue3wfz6otx", - "timestamp" : "2015-01-20T15:06:06.625000", - "enabled" : true, - "state" : "insufficient data", - "state_timestamp" : "2015-01-20T15:06:06.625000", - "threshold_rule" : { - "meter_name" : "cpu", - "evaluation_periods" : 2, - "period" : 60, - "statistic" : "avg", - "threshold" : 500.0, - "query" : [{ - "field" : "metadata.metering.metadata.stack_id", - "value" : "4bb97267-0657-4834-bbe2-eb0a5f40480d", - "op" : "eq" - }, { - "field" : "metadata.metering.metadata.resource_name", - "value" : "WebAS-OeM", - "op" : "eq" - } - ], - "comparison_operator" : "gt", - "exclude_outliers" : false - }, - "alarm_id" : "7de0effc-bf54-4ffd-bb63-dec286d4f17f", - "time_constraints" : [], - "insufficient_data_actions" : [], - "repeat_actions" : true, - "user_id" : "de2fd0ebac804ef8970e69ae5a4b4a16", - "project_id" : "3c8edb30c13d471d96c9881dee761134", - "type" : "threshold", - "description" : "scale out" - }, { - "alarm_actions" : ["http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_in?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=aca03ce06e4e4aec97aeea345b817249&SignatureVersion=2&Signature=H743x%2FSH8mLzSW%2BHmQLedflGIv69R6EFsa9VIduT6m8%3D"], - "ok_actions" : [], - "name" : "sdfasdf-scale_in_WebAS-Sig-ob3jxa7tl6ch", - "timestamp" : "2015-01-20T15:06:06.724000", - "enabled" : true, - "state" : "insufficient data", - "state_timestamp" : "2015-01-20T15:06:06.724000", - "threshold_rule" : { - "meter_name" : "cpu", - "evaluation_periods" : 2, - "period" : 60, - "statistic" : "avg", - "threshold" : 100.0, - "query" : [{ - "field" : "metadata.metering.metadata.stack_id", - "value" : "4bb97267-0657-4834-bbe2-eb0a5f40480d", - "op" : "eq" - }, { - "field" : "metadata.metering.metadata.resource_name", - "value" : "WebAS-OeM", - "op" : "eq" - } - ], - "comparison_operator" : "lt", - "exclude_outliers" : false - }, - "alarm_id" : "ca1ac89f-5dfe-4209-b92f-f9ca4f4eb85b", - "time_constraints" : [], - "insufficient_data_actions" : [], - "repeat_actions" : true, - "user_id" : "de2fd0ebac804ef8970e69ae5a4b4a16", - "project_id" : "3c8edb30c13d471d96c9881dee761134", - "type" : "threshold", - "description" : "scale in" - } +[ + { + "alarm_actions": [ + "http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_out?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=800c42eb3f4a49218f45688547c77266&SignatureVersion=2&Signature=Hgbvixq0VkVKJIKEyuIIEx7a68ut2eCl0EpxoaahUVU%3D" + ], + "ok_actions": [], + "name": "sdfasdf-scale_out_WebAS-Sig-l4ue3wfz6otx", + "timestamp": "2015-01-20T15:06:06.625000", + "enabled": true, + "state": "insufficient data", + "state_timestamp": "2015-01-20T15:06:06.625000", + "threshold_rule": { + "meter_name": "cpu", + "evaluation_periods": 2, + "period": 60, + "statistic": "avg", + "threshold": 500.0, + "query": [ + { + "field": "metadata.metering.metadata.stack_id", + "value": "4bb97267-0657-4834-bbe2-eb0a5f40480d", + "op": "eq" + }, + { + "field": "metadata.metering.metadata.resource_name", + "value": "WebAS-OeM", + "op": "eq" + } + ], + "comparison_operator": "gt", + "exclude_outliers": false + }, + "alarm_id": "7de0effc-bf54-4ffd-bb63-dec286d4f17f", + "time_constraints": [], + "insufficient_data_actions": [], + "repeat_actions": true, + "user_id": "de2fd0ebac804ef8970e69ae5a4b4a16", + "project_id": "3c8edb30c13d471d96c9881dee761134", + "type": "threshold", + "description": "scale out" + }, + { + "alarm_actions": [ + "http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_in?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=aca03ce06e4e4aec97aeea345b817249&SignatureVersion=2&Signature=H743x%2FSH8mLzSW%2BHmQLedflGIv69R6EFsa9VIduT6m8%3D" + ], + "ok_actions": [], + "name": "sdfasdf-scale_in_WebAS-Sig-ob3jxa7tl6ch", + "timestamp": "2015-01-20T15:06:06.724000", + "enabled": true, + "state": "insufficient data", + "state_timestamp": "2015-01-20T15:06:06.724000", + "threshold_rule": { + "meter_name": "cpu", + "evaluation_periods": 2, + "period": 60, + "statistic": "avg", + "threshold": 100.0, + "query": [ + { + "field": "metadata.metering.metadata.stack_id", + "value": "4bb97267-0657-4834-bbe2-eb0a5f40480d", + "op": "eq" + }, + { + "field": "metadata.metering.metadata.resource_name", + "value": "WebAS-OeM", + "op": "eq" + } + ], + "comparison_operator": "lt", + "exclude_outliers": false + }, + "alarm_id": "ca1ac89f-5dfe-4209-b92f-f9ca4f4eb85b", + "time_constraints": [], + "insufficient_data_actions": [], + "repeat_actions": true, + "user_id": "de2fd0ebac804ef8970e69ae5a4b4a16", + "project_id": "3c8edb30c13d471d96c9881dee761134", + "type": "threshold", + "description": "scale in" + } ] \ No newline at end of file diff --git a/core-test/src/main/resources/murano/v1/deployments.json b/core-test/src/main/resources/murano/v1/deployments.json index 19fb754fd..2f3c4247b 100644 --- a/core-test/src/main/resources/murano/v1/deployments.json +++ b/core-test/src/main/resources/murano/v1/deployments.json @@ -1,75 +1,75 @@ { - "deployments" : [ + "deployments": [ { - "state" : "completed_w_errors", - "environment_id" : "3e57cee8b55448f6af0752d31d7e27d6", - "started" : "2016-10-03T10:59:16", - "id" : "ccfd5e951c70428c852bee3b2a9a132e", - "created" : "2016-10-03T10:59:16", - "description" : { - "defaultNetworks" : { - "flat" : null, - "environment" : { - "?" : { - "id" : "382b25faadc34d879f7d8ff00ff5f5a7", - "type" : "io.murano.resources.NeutronNetwork" + "state": "completed_w_errors", + "environment_id": "3e57cee8b55448f6af0752d31d7e27d6", + "started": "2016-10-03T10:59:16", + "id": "ccfd5e951c70428c852bee3b2a9a132e", + "created": "2016-10-03T10:59:16", + "description": { + "defaultNetworks": { + "flat": null, + "environment": { + "?": { + "id": "382b25faadc34d879f7d8ff00ff5f5a7", + "type": "io.murano.resources.NeutronNetwork" }, - "name" : "test-network" + "name": "test-network" } }, - "services" : [ + "services": [ { - "instance" : { - "availabilityZone" : "nova", - "assignFloatingIp" : true, - "?" : { - "type" : "io.murano.resources.LinuxMuranoInstance", - "id" : "3adbc662-e6a8-4914-ba22-edc46ba2b3b4" + "instance": { + "availabilityZone": "nova", + "assignFloatingIp": true, + "?": { + "type": "io.murano.resources.LinuxMuranoInstance", + "id": "3adbc662-e6a8-4914-ba22-edc46ba2b3b4" }, - "flavor" : "m1.medium", - "name" : "jpehxitty1jcc1", - "keyname" : "ssh-key", - "image" : "1d35715f-cbca-48ec-9397-82a3fed7d253" + "flavor": "m1.medium", + "name": "jpehxitty1jcc1", + "keyname": "ssh-key", + "image": "1d35715f-cbca-48ec-9397-82a3fed7d253" }, - "name" : "Docker Standalone Host", - "?" : { - "id" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", - "type" : "com.mirantis.docker.DockerStandaloneHost", - "_26411a1861294160833743e45d0eaad9" : { - "name" : "Docker Standalone Host" + "name": "Docker Standalone Host", + "?": { + "id": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", + "type": "com.mirantis.docker.DockerStandaloneHost", + "_26411a1861294160833743e45d0eaad9": { + "name": "Docker Standalone Host" } }, - "dockerRegistry" : "" + "dockerRegistry": "" }, { - "name" : "DockerHTTPdSite", - "?" : { - "type" : "com.example.docker.DockerHTTPdSite", - "_26411a1861294160833743e45d0eaad9" : { - "name" : "Docker HTTPd Site" + "name": "DockerHTTPdSite", + "?": { + "type": "com.example.docker.DockerHTTPdSite", + "_26411a1861294160833743e45d0eaad9": { + "name": "Docker HTTPd Site" }, - "id" : "7c449c3c-ccdf-45ba-bf3c-496149918df7" + "id": "7c449c3c-ccdf-45ba-bf3c-496149918df7" }, - "siteRepo" : "https://github.com/nmakhotkin/example-web.git", - "host" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", - "publish" : true + "siteRepo": "https://github.com/nmakhotkin/example-web.git", + "host": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", + "publish": true } ], - "name" : "test", - "?" : { - "id" : "3e57cee8b55448f6af0752d31d7e27d6", - "type" : "io.murano.Environment" + "name": "test", + "?": { + "id": "3e57cee8b55448f6af0752d31d7e27d6", + "type": "io.murano.Environment" } }, - "finished" : "2016-10-03T12:02:16", - "result" : { - "result" : { - "message" : "[murano.common.exceptions.TimeoutException]: The murano-agent did not respond within 3600 seconds", - "details" : "murano.common.exceptions.TimeoutException: The murano-agent did not respond within 3600 seconds\nTraceback (most recent call last):\n File \"/tmp/murano-packages-cache/io.murano/0.0.0/e5fe46b0-ba10-4f97-aa0e-ca25b18b7e3d/Classes/Environment.yaml\", " + "finished": "2016-10-03T12:02:16", + "result": { + "result": { + "message": "[murano.common.exceptions.TimeoutException]: The murano-agent did not respond within 3600 seconds", + "details": "murano.common.exceptions.TimeoutException: The murano-agent did not respond within 3600 seconds\nTraceback (most recent call last):\n File \"/tmp/murano-packages-cache/io.murano/0.0.0/e5fe46b0-ba10-4f97-aa0e-ca25b18b7e3d/Classes/Environment.yaml\", " }, - "isException" : true + "isException": true }, - "updated" : "2016-10-03T12:02:16" + "updated": "2016-10-03T12:02:16" } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/murano/v1/environment-rename.json b/core-test/src/main/resources/murano/v1/environment-rename.json index 9110d51aa..b69e61235 100644 --- a/core-test/src/main/resources/murano/v1/environment-rename.json +++ b/core-test/src/main/resources/murano/v1/environment-rename.json @@ -1,9 +1,9 @@ { - "name" : "renamed-test", - "tenant_id" : "e62d6f1538074da1a56c5e393398c999", - "updated" : "2016-09-18T15:30:34", - "id" : "721f76f9a9d64ebcacc76189cb8978a9", - "version" : 1, - "created" : "2016-09-18T14:16:34", - "status" : "ready" + "name": "renamed-test", + "tenant_id": "e62d6f1538074da1a56c5e393398c999", + "updated": "2016-09-18T15:30:34", + "id": "721f76f9a9d64ebcacc76189cb8978a9", + "version": 1, + "created": "2016-09-18T14:16:34", + "status": "ready" } \ No newline at end of file diff --git a/core-test/src/main/resources/murano/v1/environment.json b/core-test/src/main/resources/murano/v1/environment.json index 48346a5e9..669b3637a 100644 --- a/core-test/src/main/resources/murano/v1/environment.json +++ b/core-test/src/main/resources/murano/v1/environment.json @@ -1,85 +1,95 @@ { - "name" : "test", - "tenant_id" : "e62d6f1538074da1a56c5e393398c999", - "updated" : "2016-09-18T15:30:34", - "id" : "721f76f9a9d64ebcacc76189cb8978a9", - "version" : 1, - "created" : "2016-09-18T14:16:34", - "status" : "ready", - "services" : [ - { - "instance" : { - "availabilityZone" : "nova", - "openstackId" : "8204d92c-9a79-4474-9f65-2f54f092948e", - "name" : "Docker", - "securityGroupName" : null, - "image" : "500375f8-e64b-453e-8b46-5d5d0d1d926a", - "ipAddresses" : [ "10.0.115.3", "172.16.167.175" ], - "networks" : { - "useFlatNetwork" : false, - "primaryNetwork" : null, - "useEnvironmentNetwork" : true, - "customNetworks" : [ ] + "name": "test", + "tenant_id": "e62d6f1538074da1a56c5e393398c999", + "updated": "2016-09-18T15:30:34", + "id": "721f76f9a9d64ebcacc76189cb8978a9", + "version": 1, + "created": "2016-09-18T14:16:34", + "status": "ready", + "services": [ + { + "instance": { + "availabilityZone": "nova", + "openstackId": "8204d92c-9a79-4474-9f65-2f54f092948e", + "name": "Docker", + "securityGroupName": null, + "image": "500375f8-e64b-453e-8b46-5d5d0d1d926a", + "ipAddresses": [ + "10.0.115.3", + "172.16.167.175" + ], + "networks": { + "useFlatNetwork": false, + "primaryNetwork": null, + "useEnvironmentNetwork": true, + "customNetworks": [] }, - "keyname" : "nmakhotkin", - "sharedIps" : [ ], - "floatingIpAddress" : "172.16.167.175", - "flavor" : "m1.medium", - "assignFloatingIp" : true, - "?" : { - "classVersion" : "0.0.0", - "name" : null, - "package" : "io.murano", - "type" : "io.murano.resources.LinuxMuranoInstance", - "_actions" : { }, - "id" : "c350d3f6-5d58-44e8-97ce-930f112c7f9e" + "keyname": "nmakhotkin", + "sharedIps": [], + "floatingIpAddress": "172.16.167.175", + "flavor": "m1.medium", + "assignFloatingIp": true, + "?": { + "classVersion": "0.0.0", + "name": null, + "package": "io.murano", + "type": "io.murano.resources.LinuxMuranoInstance", + "_actions": {}, + "id": "c350d3f6-5d58-44e8-97ce-930f112c7f9e" } }, - "name" : "DockerVM", - "dockerRegistry" : null, - "containers" : [ "DockerHTTPdSite" ], - "applicationEndpoints" : [{ - "applicationName" : "DockerHTTPdSite", - "portScope" : "public", - "protocol" : "TCP", - "containerPort" : 80, - "address" : "172.16.167.175", - "scope" : "public", - "port" : 80 - }], - "?" : { - "classVersion" : "0.0.0", - "_26411a1861294160833743e45d0eaad9" : { - "name" : "Docker VM Service" + "name": "DockerVM", + "dockerRegistry": null, + "containers": [ + "DockerHTTPdSite" + ], + "applicationEndpoints": [ + { + "applicationName": "DockerHTTPdSite", + "portScope": "public", + "protocol": "TCP", + "containerPort": 80, + "address": "172.16.167.175", + "scope": "public", + "port": 80 + } + ], + "?": { + "classVersion": "0.0.0", + "_26411a1861294160833743e45d0eaad9": { + "name": "Docker VM Service" }, - "name" : null, - "package" : "com.mirantis.docker.DockerStandaloneHost", - "_actions" : { }, - "status" : "pending", - "type" : "com.mirantis.docker.DockerStandaloneHost", - "id" : "2614f193-f13e-42b1-af7e-01729bb5af75" + "name": null, + "package": "com.mirantis.docker.DockerStandaloneHost", + "_actions": {}, + "status": "pending", + "type": "com.mirantis.docker.DockerStandaloneHost", + "id": "2614f193-f13e-42b1-af7e-01729bb5af75" } - }, { - "siteRepo" : "https://github.com/nmakhotkin/example-web.git", - "publish" : true, - "name" : "DockerHTTPdSite", - "host" : "2614f193-f13e-42b1-af7e-01729bb5af75", - "applicationEndpoints" : [{ - "portScope" : "public", - "protocol" : "TCP", - "port" : 80, - "address" : "172.16.167.175", - "scope" : "public", - "containerPort" : 80 - }], - "?" : { - "classVersion" : "0.0.0", - "_26411a1861294160833743e45d0eaad9" : { - "name" : "Docker HTTPd Site" + }, + { + "siteRepo": "https://github.com/nmakhotkin/example-web.git", + "publish": true, + "name": "DockerHTTPdSite", + "host": "2614f193-f13e-42b1-af7e-01729bb5af75", + "applicationEndpoints": [ + { + "portScope": "public", + "protocol": "TCP", + "port": 80, + "address": "172.16.167.175", + "scope": "public", + "containerPort": 80 + } + ], + "?": { + "classVersion": "0.0.0", + "_26411a1861294160833743e45d0eaad9": { + "name": "Docker HTTPd Site" }, - "name" : null, - "package" : "com.example.docker.DockerHTTPdSite", - "_actions" : { + "name": null, + "package": "com.example.docker.DockerHTTPdSite", + "_actions": { "e8d61b75-df6a-42c6-be2c-5b6aeaa60f5c_getTest": { "name": "getTest", "title": "getTest", @@ -91,9 +101,9 @@ "enabled": true } }, - "status" : "pending", - "type" : "com.example.docker.DockerHTTPdSite", - "id" : "e8d61b75-df6a-42c6-be2c-5b6aeaa60f5c" + "status": "pending", + "type": "com.example.docker.DockerHTTPdSite", + "id": "e8d61b75-df6a-42c6-be2c-5b6aeaa60f5c" } } ] diff --git a/core-test/src/main/resources/murano/v1/environments.json b/core-test/src/main/resources/murano/v1/environments.json index 6ec2fb513..5a41ad01b 100644 --- a/core-test/src/main/resources/murano/v1/environments.json +++ b/core-test/src/main/resources/murano/v1/environments.json @@ -1,22 +1,22 @@ { - "environments" : [ + "environments": [ { - "version" : 0, - "name" : "some_env", - "id" : "e1c1b5a0b3284f188c5d91ab18bf0451", - "tenant_id" : "e62d6f1538074da1a56c5e393398c999", - "status" : "ready", - "created" : "2016-09-27T11:35:19", - "updated" : "2016-09-27T11:35:19" + "version": 0, + "name": "some_env", + "id": "e1c1b5a0b3284f188c5d91ab18bf0451", + "tenant_id": "e62d6f1538074da1a56c5e393398c999", + "status": "ready", + "created": "2016-09-27T11:35:19", + "updated": "2016-09-27T11:35:19" }, { - "updated" : "2016-09-18T15:30:34", - "created" : "2016-09-18T14:16:34", - "status" : "deploy failure", - "id" : "721f76f9a9d64ebcacc76189cb8978a9", - "tenant_id" : "e62d6f1538074da1a56c5e393398c999", - "version" : 1, - "name" : "test" + "updated": "2016-09-18T15:30:34", + "created": "2016-09-18T14:16:34", + "status": "deploy failure", + "id": "721f76f9a9d64ebcacc76189cb8978a9", + "tenant_id": "e62d6f1538074da1a56c5e393398c999", + "version": 1, + "name": "test" } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/murano/v1/filtered_reports.json b/core-test/src/main/resources/murano/v1/filtered_reports.json index 47db393eb..d49d33d51 100644 --- a/core-test/src/main/resources/murano/v1/filtered_reports.json +++ b/core-test/src/main/resources/murano/v1/filtered_reports.json @@ -1,37 +1,37 @@ { - "reports" : [ + "reports": [ { - "created" : "2016-10-03T10:59:19", - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "entity" : null, - "entity_id" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", - "text" : "Create VM for Docker Server", - "updated" : "2016-10-03T10:59:19", - "level" : "info", - "details" : null, - "id" : "ad4b8072a06f46a8889f3844eb2a5854" + "created": "2016-10-03T10:59:19", + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "entity": null, + "entity_id": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", + "text": "Create VM for Docker Server", + "updated": "2016-10-03T10:59:19", + "level": "info", + "details": null, + "id": "ad4b8072a06f46a8889f3844eb2a5854" }, { - "level" : "info", - "id" : "bcaae839106341cca9c09b336c3b225c", - "details" : null, - "updated" : "2016-10-03T11:02:15", - "entity_id" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", - "entity" : null, - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "text" : "Docker Server is up and running", - "created" : "2016-10-03T11:02:15" + "level": "info", + "id": "bcaae839106341cca9c09b336c3b225c", + "details": null, + "updated": "2016-10-03T11:02:15", + "entity_id": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", + "entity": null, + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "text": "Docker Server is up and running", + "created": "2016-10-03T11:02:15" }, { - "updated" : "2016-10-03T11:02:16", - "details" : null, - "id" : "e5558d941efb4371a8a316c29cb77cf0", - "level" : "info", - "created" : "2016-10-03T11:02:16", - "text" : "Pulling app image stanlagun/httpdgitsite", - "entity" : null, - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "entity_id" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90" + "updated": "2016-10-03T11:02:16", + "details": null, + "id": "e5558d941efb4371a8a316c29cb77cf0", + "level": "info", + "created": "2016-10-03T11:02:16", + "text": "Pulling app image stanlagun/httpdgitsite", + "entity": null, + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "entity_id": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90" } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/murano/v1/reports.json b/core-test/src/main/resources/murano/v1/reports.json index baf3a6ad7..15cfa9a1b 100644 --- a/core-test/src/main/resources/murano/v1/reports.json +++ b/core-test/src/main/resources/murano/v1/reports.json @@ -1,92 +1,92 @@ { - "reports" : [ + "reports": [ { - "level" : "info", - "updated" : "2016-10-03T10:59:15", - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "details" : null, - "created" : "2016-10-03T10:59:15", - "text" : "Action deploy is scheduled", - "entity_id" : null, - "id" : "62ab8549892641ad9c7a2dc67d4ae19e", - "entity" : null + "level": "info", + "updated": "2016-10-03T10:59:15", + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "details": null, + "created": "2016-10-03T10:59:15", + "text": "Action deploy is scheduled", + "entity_id": null, + "id": "62ab8549892641ad9c7a2dc67d4ae19e", + "entity": null }, { - "entity" : null, - "entity_id" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", - "id" : "ad4b8072a06f46a8889f3844eb2a5854", - "text" : "Create VM for Docker Server", - "created" : "2016-10-03T10:59:19", - "details" : null, - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "level" : "info", - "updated" : "2016-10-03T10:59:19" + "entity": null, + "entity_id": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", + "id": "ad4b8072a06f46a8889f3844eb2a5854", + "text": "Create VM for Docker Server", + "created": "2016-10-03T10:59:19", + "details": null, + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "level": "info", + "updated": "2016-10-03T10:59:19" }, { - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "level" : "info", - "updated" : "2016-10-03T11:02:15", - "details" : null, - "created" : "2016-10-03T11:02:15", - "text" : "Docker Server is up and running", - "id" : "bcaae839106341cca9c09b336c3b225c", - "entity_id" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", - "entity" : null + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "level": "info", + "updated": "2016-10-03T11:02:15", + "details": null, + "created": "2016-10-03T11:02:15", + "text": "Docker Server is up and running", + "id": "bcaae839106341cca9c09b336c3b225c", + "entity_id": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", + "entity": null }, { - "entity" : null, - "text" : "Installing HTTPd and site from https://github.com/nmakhotkin/example-web.git", - "id" : "79b9e64e0b1f4e42b27acb7a147ac43b", - "entity_id" : "7c449c3c-ccdf-45ba-bf3c-496149918df7", - "level" : "info", - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "updated" : "2016-10-03T11:02:16", - "details" : null, - "created" : "2016-10-03T11:02:16" + "entity": null, + "text": "Installing HTTPd and site from https://github.com/nmakhotkin/example-web.git", + "id": "79b9e64e0b1f4e42b27acb7a147ac43b", + "entity_id": "7c449c3c-ccdf-45ba-bf3c-496149918df7", + "level": "info", + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "updated": "2016-10-03T11:02:16", + "details": null, + "created": "2016-10-03T11:02:16" }, { - "entity" : null, - "updated" : "2016-10-03T11:02:16", - "level" : "info", - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "details" : null, - "created" : "2016-10-03T11:02:16", - "text" : "Pulling app image stanlagun/httpdgitsite", - "entity_id" : "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", - "id" : "e5558d941efb4371a8a316c29cb77cf0" + "entity": null, + "updated": "2016-10-03T11:02:16", + "level": "info", + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "details": null, + "created": "2016-10-03T11:02:16", + "text": "Pulling app image stanlagun/httpdgitsite", + "entity_id": "5c2a7dae-097d-4a1c-85cb-e7db2ed62d90", + "id": "e5558d941efb4371a8a316c29cb77cf0" }, { - "entity_id" : "7c449c3c-ccdf-45ba-bf3c-496149918df7", - "id" : "c6118ba64013414fab387f627506c711", - "text" : "Error: The murano-agent did not respond within 3600 seconds", - "created" : "2016-10-03T12:02:16", - "details" : null, - "level" : "error", - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "updated" : "2016-10-03T12:02:16", - "entity" : null + "entity_id": "7c449c3c-ccdf-45ba-bf3c-496149918df7", + "id": "c6118ba64013414fab387f627506c711", + "text": "Error: The murano-agent did not respond within 3600 seconds", + "created": "2016-10-03T12:02:16", + "details": null, + "level": "error", + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "updated": "2016-10-03T12:02:16", + "entity": null }, { - "text" : "[murano.common.exceptions.TimeoutException]: The murano-agent did not respond within 3600 seconds", - "id" : "9a794a79c1ea43bd8adbafeae430de32", - "entity_id" : "3e57cee8b55448f6af0752d31d7e27d6", - "level" : "error", - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "updated" : "2016-10-03T12:02:16", - "created" : "2016-10-03T12:02:16", - "details" : null, - "entity" : null + "text": "[murano.common.exceptions.TimeoutException]: The murano-agent did not respond within 3600 seconds", + "id": "9a794a79c1ea43bd8adbafeae430de32", + "entity_id": "3e57cee8b55448f6af0752d31d7e27d6", + "level": "error", + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "updated": "2016-10-03T12:02:16", + "created": "2016-10-03T12:02:16", + "details": null, + "entity": null }, { - "entity" : null, - "created" : "2016-10-03T12:02:16", - "details" : null, - "task_id" : "ccfd5e951c70428c852bee3b2a9a132e", - "level" : "info", - "updated" : "2016-10-03T12:02:16", - "entity_id" : null, - "id" : "b49accc24f5944e3a2cf0f620d48fe85", - "text" : "Deployment finished with errors" + "entity": null, + "created": "2016-10-03T12:02:16", + "details": null, + "task_id": "ccfd5e951c70428c852bee3b2a9a132e", + "level": "info", + "updated": "2016-10-03T12:02:16", + "entity_id": null, + "id": "b49accc24f5944e3a2cf0f620d48fe85", + "text": "Deployment finished with errors" } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/murano/v1/service.json b/core-test/src/main/resources/murano/v1/service.json index 5610eba92..4a24bd053 100644 --- a/core-test/src/main/resources/murano/v1/service.json +++ b/core-test/src/main/resources/murano/v1/service.json @@ -1,40 +1,45 @@ { - "instance" : { - "availabilityZone" : "nova", - "openstackId" : "8204d92c-9a79-4474-9f65-2f54f092948e", - "name" : "Docker", - "securityGroupName" : null, - "image" : "500375f8-e64b-453e-8b46-5d5d0d1d926a", - "ipAddresses" : [ "10.0.115.3", "172.16.167.175" ], - "networks" : { - "useFlatNetwork" : false, - "primaryNetwork" : null, - "useEnvironmentNetwork" : true, - "customNetworks" : [] + "instance": { + "availabilityZone": "nova", + "openstackId": "8204d92c-9a79-4474-9f65-2f54f092948e", + "name": "Docker", + "securityGroupName": null, + "image": "500375f8-e64b-453e-8b46-5d5d0d1d926a", + "ipAddresses": [ + "10.0.115.3", + "172.16.167.175" + ], + "networks": { + "useFlatNetwork": false, + "primaryNetwork": null, + "useEnvironmentNetwork": true, + "customNetworks": [] }, - "keyname" : "nmakhotkin", - "sharedIps" : [], - "floatingIpAddress" : "172.16.167.175", - "flavor" : "m1.medium", - "assignFloatingIp" : true, - "?" : { - "classVersion" : "0.0.0", - "name" : null, - "package" : "io.murano", - "type" : "io.murano.resources.LinuxMuranoInstance", - "_actions" : {}, - "id" : "c350d3f6-5d58-44e8-97ce-930f112c7f9e" + "keyname": "nmakhotkin", + "sharedIps": [], + "floatingIpAddress": "172.16.167.175", + "flavor": "m1.medium", + "assignFloatingIp": true, + "?": { + "classVersion": "0.0.0", + "name": null, + "package": "io.murano", + "type": "io.murano.resources.LinuxMuranoInstance", + "_actions": {}, + "id": "c350d3f6-5d58-44e8-97ce-930f112c7f9e" } }, - "name" : "DockerVM", - "dockerRegistry" : null, - "containers" : [ "DockerHTTPdSite" ], - "applicationEndpoints" : [], + "name": "DockerVM", + "dockerRegistry": null, + "containers": [ + "DockerHTTPdSite" + ], + "applicationEndpoints": [], "?": { "_26411a1861294160833743e45d0eaad9": { "name": "Docker VM Service" }, - "_actions" : { + "_actions": { "2614f193-f13e-42b1-af7e-01729bb5af75_getTest": { "name": "getTest", "title": "getTest", diff --git a/core-test/src/main/resources/murano/v1/services.json b/core-test/src/main/resources/murano/v1/services.json index 2cb946ec9..713b389d1 100644 --- a/core-test/src/main/resources/murano/v1/services.json +++ b/core-test/src/main/resources/murano/v1/services.json @@ -1,108 +1,124 @@ -[ { - "instance" : { - "availabilityZone" : "nova", - "openstackId" : "8204d92c-9a79-4474-9f65-2f54f092948e", - "name" : "Docker", - "securityGroupName" : null, - "image" : "500375f8-e64b-453e-8b46-5d5d0d1d926a", - "ipAddresses" : [ "10.0.115.3", "172.16.167.175" ], - "networks" : { - "useFlatNetwork" : false, - "primaryNetwork" : null, - "useEnvironmentNetwork" : true, - "customNetworks" : [ ] +[ + { + "instance": { + "availabilityZone": "nova", + "openstackId": "8204d92c-9a79-4474-9f65-2f54f092948e", + "name": "Docker", + "securityGroupName": null, + "image": "500375f8-e64b-453e-8b46-5d5d0d1d926a", + "ipAddresses": [ + "10.0.115.3", + "172.16.167.175" + ], + "networks": { + "useFlatNetwork": false, + "primaryNetwork": null, + "useEnvironmentNetwork": true, + "customNetworks": [] + }, + "keyname": "nmakhotkin", + "sharedIps": [], + "floatingIpAddress": "172.16.167.175", + "flavor": "m1.medium", + "assignFloatingIp": true, + "?": { + "classVersion": "0.0.0", + "name": null, + "package": "io.murano", + "type": "io.murano.resources.LinuxMuranoInstance", + "_actions": {}, + "id": "c350d3f6-5d58-44e8-97ce-930f112c7f9e" + } }, - "keyname" : "nmakhotkin", - "sharedIps" : [ ], - "floatingIpAddress" : "172.16.167.175", - "flavor" : "m1.medium", - "assignFloatingIp" : true, - "?" : { - "classVersion" : "0.0.0", - "name" : null, - "package" : "io.murano", - "type" : "io.murano.resources.LinuxMuranoInstance", - "_actions" : { }, - "id" : "c350d3f6-5d58-44e8-97ce-930f112c7f9e" + "name": "DockerVM", + "dockerRegistry": null, + "containers": [ + "DockerHTTPdSite" + ], + "applicationEndpoints": [ + { + "applicationName": "DockerHTTPdSite", + "portScope": "public", + "protocol": "TCP", + "containerPort": 80, + "address": "10.0.115.3", + "scope": "cloud", + "port": 80 + }, + { + "applicationName": "DockerHTTPdSite", + "portScope": "public", + "protocol": "TCP", + "containerPort": 80, + "address": "172.16.167.175", + "scope": "public", + "port": 80 + }, + { + "applicationName": "DockerHTTPdSite", + "portScope": "public", + "protocol": "TCP", + "containerPort": 80, + "address": "172.17.0.1", + "scope": "host", + "port": 80 + } + ], + "?": { + "classVersion": "0.0.0", + "_26411a1861294160833743e45d0eaad9": { + "name": "Docker VM Service" + }, + "name": null, + "package": "com.mirantis.docker.DockerStandaloneHost", + "_actions": {}, + "status": "pending", + "type": "com.mirantis.docker.DockerStandaloneHost", + "id": "2614f193-f13e-42b1-af7e-01729bb5af75" } }, - "name" : "DockerVM", - "dockerRegistry" : null, - "containers" : [ "DockerHTTPdSite" ], - "applicationEndpoints" : [ { - "applicationName" : "DockerHTTPdSite", - "portScope" : "public", - "protocol" : "TCP", - "containerPort" : 80, - "address" : "10.0.115.3", - "scope" : "cloud", - "port" : 80 - }, { - "applicationName" : "DockerHTTPdSite", - "portScope" : "public", - "protocol" : "TCP", - "containerPort" : 80, - "address" : "172.16.167.175", - "scope" : "public", - "port" : 80 - }, { - "applicationName" : "DockerHTTPdSite", - "portScope" : "public", - "protocol" : "TCP", - "containerPort" : 80, - "address" : "172.17.0.1", - "scope" : "host", - "port" : 80 - } ], - "?" : { - "classVersion" : "0.0.0", - "_26411a1861294160833743e45d0eaad9" : { - "name" : "Docker VM Service" - }, - "name" : null, - "package" : "com.mirantis.docker.DockerStandaloneHost", - "_actions" : { }, - "status" : "pending", - "type" : "com.mirantis.docker.DockerStandaloneHost", - "id" : "2614f193-f13e-42b1-af7e-01729bb5af75" - } -}, { - "siteRepo" : "https://github.com/nmakhotkin/example-web.git", - "publish" : true, - "name" : "DockerHTTPdSite", - "host" : "2614f193-f13e-42b1-af7e-01729bb5af75", - "applicationEndpoints" : [ { - "portScope" : "public", - "protocol" : "TCP", - "port" : 80, - "address" : "10.0.115.3", - "scope" : "cloud", - "containerPort" : 80 - }, { - "portScope" : "public", - "protocol" : "TCP", - "port" : 80, - "address" : "172.16.167.175", - "scope" : "public", - "containerPort" : 80 - }, { - "portScope" : "public", - "protocol" : "TCP", - "port" : 80, - "address" : "172.17.0.1", - "scope" : "host", - "containerPort" : 80 - } ], - "?" : { - "classVersion" : "0.0.0", - "_26411a1861294160833743e45d0eaad9" : { - "name" : "Docker HTTPd Site" - }, - "name" : null, - "package" : "com.example.docker.DockerHTTPdSite", - "_actions" : { }, - "status" : "pending", - "type" : "com.example.docker.DockerHTTPdSite", - "id" : "e8d61b75-df6a-42c6-be2c-5b6aeaa60f5c" + { + "siteRepo": "https://github.com/nmakhotkin/example-web.git", + "publish": true, + "name": "DockerHTTPdSite", + "host": "2614f193-f13e-42b1-af7e-01729bb5af75", + "applicationEndpoints": [ + { + "portScope": "public", + "protocol": "TCP", + "port": 80, + "address": "10.0.115.3", + "scope": "cloud", + "containerPort": 80 + }, + { + "portScope": "public", + "protocol": "TCP", + "port": 80, + "address": "172.16.167.175", + "scope": "public", + "containerPort": 80 + }, + { + "portScope": "public", + "protocol": "TCP", + "port": 80, + "address": "172.17.0.1", + "scope": "host", + "containerPort": 80 + } + ], + "?": { + "classVersion": "0.0.0", + "_26411a1861294160833743e45d0eaad9": { + "name": "Docker HTTPd Site" + }, + "name": null, + "package": "com.example.docker.DockerHTTPdSite", + "_actions": {}, + "status": "pending", + "type": "com.example.docker.DockerHTTPdSite", + "id": "e8d61b75-df6a-42c6-be2c-5b6aeaa60f5c" + } } -} ] \ No newline at end of file +] \ No newline at end of file diff --git a/core-test/src/main/resources/murano/v1/session.json b/core-test/src/main/resources/murano/v1/session.json index 80857217f..902599f68 100644 --- a/core-test/src/main/resources/murano/v1/session.json +++ b/core-test/src/main/resources/murano/v1/session.json @@ -1,9 +1,9 @@ { - "user_id" : "bd6c061b247a477c8717014896a5d66c", - "state" : "opened", - "version" : 3, - "environment_id" : "e1c1b5a0b3284f188c5d91ab18bf0451", - "id" : "b8f4006064d24c10a33d9ed68e554f0f", - "created" : "2016-09-28T13:14:13", - "updated" : "2016-09-28T13:14:13" + "user_id": "bd6c061b247a477c8717014896a5d66c", + "state": "opened", + "version": 3, + "environment_id": "e1c1b5a0b3284f188c5d91ab18bf0451", + "id": "b8f4006064d24c10a33d9ed68e554f0f", + "created": "2016-09-28T13:14:13", + "updated": "2016-09-28T13:14:13" } \ No newline at end of file diff --git a/core-test/src/main/resources/network/agents.json b/core-test/src/main/resources/network/agents.json index ca03363a5..710790be4 100644 --- a/core-test/src/main/resources/network/agents.json +++ b/core-test/src/main/resources/network/agents.json @@ -1,271 +1,264 @@ { - "agents":[ - { - "binary":"neutron-dhcp-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:22", - "alive":true, - "topic":"dhcp_agent", - "host":"cic-0-3", - "agent_type":"DHCP agent", - "created_at":"2015-03-18 20:28:02", - "started_at":"2015-03-18 20:28:02", - "id":"086d8a3d-ef23-4708-909b-0c459528e2a6", - "configurations":{ - "subnets":6, - "use_namespaces":true, - "dhcp_lease_duration":120, - "dhcp_driver":"neutron.agent.linux.dhcp.Dnsmasq", - "networks":6, - "ports":8 - } - }, - { - "binary":"neutron-l3-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:23", - "alive":true, - "topic":"l3_agent", - "host":"cic-0-2", - "agent_type":"L3 agent", - "created_at":"2015-03-18 20:02:02", - "started_at":"2015-03-18 20:02:02", - "id":"190ecbc2-77e0-4e4f-a96b-aa849edb357b", - "configurations":{ - "router_id":"", - "gateway_external_network_id":"", - "handle_internal_only_routers":false, - "use_namespaces":true, - "routers":0, - "interfaces":0, - "floating_ips":0, - "interface_driver":"neutron.agent.linux.interface.OVSInterfaceDriver", - "ex_gw_ports":0 - } - }, - { - "binary":"neutron-openvswitch-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:21", - "alive":true, - "topic":"N/A", - "host":"compute-0-8", - "agent_type":"Open vSwitch agent", - "created_at":"2015-03-18 20:38:39", - "started_at":"2015-03-18 20:38:56", - "id":"342d52e4-f253-443e-ab68-b7147b6b01ba", - "configurations":{ - "tunnel_types":[ - - ], - "tunneling_ip":"", - "bridge_mappings":{ - "default":"br-prv" - }, - "l2_population":false, - "devices":1 - } - }, - { - "binary":"neutron-openvswitch-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:22", - "alive":true, - "topic":"N/A", - "host":"compute-0-7", - "agent_type":"Open vSwitch agent", - "created_at":"2015-03-18 20:38:39", - "started_at":"2015-03-18 20:38:56", - "id":"4604070d-cb78-4500-8af8-97b346b5ccca", - "configurations":{ - "tunnel_types":[ - - ], - "tunneling_ip":"", - "bridge_mappings":{ - "default":"br-prv" - }, - "l2_population":false, - "devices":0 - } - }, - { - "binary":"neutron-openvswitch-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:23", - "alive":true, - "topic":"N/A", - "host":"cic-0-4", - "agent_type":"Open vSwitch agent", - "created_at":"2015-03-18 20:20:57", - "started_at":"2015-03-18 20:25:42", - "id":"862ad7e5-11f0-4c3c-86e7-0995b6c66d11", - "configurations":{ - "tunnel_types":[ - - ], - "tunneling_ip":"", - "bridge_mappings":{ - "default":"br-prv" - }, - "l2_population":false, - "devices":0 - } - }, - { - "binary":"neutron-openvswitch-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:25", - "alive":true, - "topic":"N/A", - "host":"cic-0-3", - "agent_type":"Open vSwitch agent", - "created_at":"2015-03-18 20:20:46", - "started_at":"2015-03-18 20:25:35", - "id":"a594869e-cef0-49c9-a06e-54eb3ce74730", - "configurations":{ - "tunnel_types":[ - - ], - "tunneling_ip":"", - "bridge_mappings":{ - "default":"br-prv" - }, - "l2_population":false, - "devices":7 - } - }, - { - "binary":"neutron-openvswitch-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:24", - "alive":true, - "topic":"N/A", - "host":"compute-0-5", - "agent_type":"Open vSwitch agent", - "created_at":"2015-03-18 20:38:42", - "started_at":"2015-03-18 20:38:59", - "id":"c98d1a7a-e972-4bcf-844c-dfb764e806c6", - "configurations":{ - "tunnel_types":[ - - ], - "tunneling_ip":"", - "bridge_mappings":{ - "default":"br-prv" - }, - "l2_population":false, - "devices":2 - } - }, - { - "binary":"neutron-openvswitch-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:25", - "alive":true, - "topic":"N/A", - "host":"cic-0-2", - "agent_type":"Open vSwitch agent", - "created_at":"2015-03-18 19:57:10", - "started_at":"2015-03-18 19:59:05", - "id":"cbccc4f9-9083-4a31-bfba-705556c2c898", - "configurations":{ - "tunnel_types":[ - - ], - "tunneling_ip":"", - "bridge_mappings":{ - "default":"br-prv" - }, - "l2_population":false, - "devices":0 - } - }, - { - "binary":"neutron-metadata-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:25", - "alive":true, - "topic":"N/A", - "host":"cic-0-3", - "agent_type":"Metadata agent", - "created_at":"2015-03-18 20:26:45", - "started_at":"2015-03-18 20:26:45", - "id":"d228eaae-1690-4d5e-b991-929f00df00ae", - "configurations":{ - "nova_metadata_port":8775, - "nova_metadata_ip":"192.168.2.20", - "metadata_proxy_socket":"/var/lib/neutron/metadata_proxy" - } - }, - { - "binary":"neutron-openvswitch-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:21", - "alive":true, - "topic":"N/A", - "host":"compute-0-6", - "agent_type":"Open vSwitch agent", - "created_at":"2015-03-18 20:38:39", - "started_at":"2015-03-18 20:38:56", - "id":"d30479f4-52a0-4664-aafa-820889edcc05", - "configurations":{ - "tunnel_types":[ - - ], - "tunneling_ip":"", - "bridge_mappings":{ - "default":"br-prv" - }, - "l2_population":false, - "devices":5 - } - }, - { - "binary":"neutron-metadata-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:23", - "alive":true, - "topic":"N/A", - "host":"cic-0-2", - "agent_type":"Metadata agent", - "created_at":"2015-03-18 19:59:48", - "started_at":"2015-03-18 19:59:48", - "id":"d4700160-9945-428b-994c-4570e255e2ee", - "configurations":{ - "nova_metadata_port":8775, - "nova_metadata_ip":"192.168.2.20", - "metadata_proxy_socket":"/var/lib/neutron/metadata_proxy" - } - }, - { - "binary":"neutron-metadata-agent", - "description":null, - "admin_state_up":true, - "heartbeat_timestamp":"2015-03-19 15:55:23", - "alive":true, - "topic":"N/A", - "host":"cic-0-4", - "agent_type":"Metadata agent", - "created_at":"2015-03-18 20:26:53", - "started_at":"2015-03-18 20:26:53", - "id":"e06c1445-abee-49e2-9f2c-769257f8b989", - "configurations":{ - "nova_metadata_port":8775, - "nova_metadata_ip":"192.168.2.20", - "metadata_proxy_socket":"/var/lib/neutron/metadata_proxy" - } + "agents": [ + { + "binary": "neutron-dhcp-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:22", + "alive": true, + "topic": "dhcp_agent", + "host": "cic-0-3", + "agent_type": "DHCP agent", + "created_at": "2015-03-18 20:28:02", + "started_at": "2015-03-18 20:28:02", + "id": "086d8a3d-ef23-4708-909b-0c459528e2a6", + "configurations": { + "subnets": 6, + "use_namespaces": true, + "dhcp_lease_duration": 120, + "dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", + "networks": 6, + "ports": 8 } - ] + }, + { + "binary": "neutron-l3-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:23", + "alive": true, + "topic": "l3_agent", + "host": "cic-0-2", + "agent_type": "L3 agent", + "created_at": "2015-03-18 20:02:02", + "started_at": "2015-03-18 20:02:02", + "id": "190ecbc2-77e0-4e4f-a96b-aa849edb357b", + "configurations": { + "router_id": "", + "gateway_external_network_id": "", + "handle_internal_only_routers": false, + "use_namespaces": true, + "routers": 0, + "interfaces": 0, + "floating_ips": 0, + "interface_driver": "neutron.agent.linux.interface.OVSInterfaceDriver", + "ex_gw_ports": 0 + } + }, + { + "binary": "neutron-openvswitch-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:21", + "alive": true, + "topic": "N/A", + "host": "compute-0-8", + "agent_type": "Open vSwitch agent", + "created_at": "2015-03-18 20:38:39", + "started_at": "2015-03-18 20:38:56", + "id": "342d52e4-f253-443e-ab68-b7147b6b01ba", + "configurations": { + "tunnel_types": [ + ], + "tunneling_ip": "", + "bridge_mappings": { + "default": "br-prv" + }, + "l2_population": false, + "devices": 1 + } + }, + { + "binary": "neutron-openvswitch-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:22", + "alive": true, + "topic": "N/A", + "host": "compute-0-7", + "agent_type": "Open vSwitch agent", + "created_at": "2015-03-18 20:38:39", + "started_at": "2015-03-18 20:38:56", + "id": "4604070d-cb78-4500-8af8-97b346b5ccca", + "configurations": { + "tunnel_types": [ + ], + "tunneling_ip": "", + "bridge_mappings": { + "default": "br-prv" + }, + "l2_population": false, + "devices": 0 + } + }, + { + "binary": "neutron-openvswitch-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:23", + "alive": true, + "topic": "N/A", + "host": "cic-0-4", + "agent_type": "Open vSwitch agent", + "created_at": "2015-03-18 20:20:57", + "started_at": "2015-03-18 20:25:42", + "id": "862ad7e5-11f0-4c3c-86e7-0995b6c66d11", + "configurations": { + "tunnel_types": [ + ], + "tunneling_ip": "", + "bridge_mappings": { + "default": "br-prv" + }, + "l2_population": false, + "devices": 0 + } + }, + { + "binary": "neutron-openvswitch-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:25", + "alive": true, + "topic": "N/A", + "host": "cic-0-3", + "agent_type": "Open vSwitch agent", + "created_at": "2015-03-18 20:20:46", + "started_at": "2015-03-18 20:25:35", + "id": "a594869e-cef0-49c9-a06e-54eb3ce74730", + "configurations": { + "tunnel_types": [ + ], + "tunneling_ip": "", + "bridge_mappings": { + "default": "br-prv" + }, + "l2_population": false, + "devices": 7 + } + }, + { + "binary": "neutron-openvswitch-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:24", + "alive": true, + "topic": "N/A", + "host": "compute-0-5", + "agent_type": "Open vSwitch agent", + "created_at": "2015-03-18 20:38:42", + "started_at": "2015-03-18 20:38:59", + "id": "c98d1a7a-e972-4bcf-844c-dfb764e806c6", + "configurations": { + "tunnel_types": [ + ], + "tunneling_ip": "", + "bridge_mappings": { + "default": "br-prv" + }, + "l2_population": false, + "devices": 2 + } + }, + { + "binary": "neutron-openvswitch-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:25", + "alive": true, + "topic": "N/A", + "host": "cic-0-2", + "agent_type": "Open vSwitch agent", + "created_at": "2015-03-18 19:57:10", + "started_at": "2015-03-18 19:59:05", + "id": "cbccc4f9-9083-4a31-bfba-705556c2c898", + "configurations": { + "tunnel_types": [ + ], + "tunneling_ip": "", + "bridge_mappings": { + "default": "br-prv" + }, + "l2_population": false, + "devices": 0 + } + }, + { + "binary": "neutron-metadata-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:25", + "alive": true, + "topic": "N/A", + "host": "cic-0-3", + "agent_type": "Metadata agent", + "created_at": "2015-03-18 20:26:45", + "started_at": "2015-03-18 20:26:45", + "id": "d228eaae-1690-4d5e-b991-929f00df00ae", + "configurations": { + "nova_metadata_port": 8775, + "nova_metadata_ip": "192.168.2.20", + "metadata_proxy_socket": "/var/lib/neutron/metadata_proxy" + } + }, + { + "binary": "neutron-openvswitch-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:21", + "alive": true, + "topic": "N/A", + "host": "compute-0-6", + "agent_type": "Open vSwitch agent", + "created_at": "2015-03-18 20:38:39", + "started_at": "2015-03-18 20:38:56", + "id": "d30479f4-52a0-4664-aafa-820889edcc05", + "configurations": { + "tunnel_types": [ + ], + "tunneling_ip": "", + "bridge_mappings": { + "default": "br-prv" + }, + "l2_population": false, + "devices": 5 + } + }, + { + "binary": "neutron-metadata-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:23", + "alive": true, + "topic": "N/A", + "host": "cic-0-2", + "agent_type": "Metadata agent", + "created_at": "2015-03-18 19:59:48", + "started_at": "2015-03-18 19:59:48", + "id": "d4700160-9945-428b-994c-4570e255e2ee", + "configurations": { + "nova_metadata_port": 8775, + "nova_metadata_ip": "192.168.2.20", + "metadata_proxy_socket": "/var/lib/neutron/metadata_proxy" + } + }, + { + "binary": "neutron-metadata-agent", + "description": null, + "admin_state_up": true, + "heartbeat_timestamp": "2015-03-19 15:55:23", + "alive": true, + "topic": "N/A", + "host": "cic-0-4", + "agent_type": "Metadata agent", + "created_at": "2015-03-18 20:26:53", + "started_at": "2015-03-18 20:26:53", + "id": "e06c1445-abee-49e2-9f2c-769257f8b989", + "configurations": { + "nova_metadata_port": 8775, + "nova_metadata_ip": "192.168.2.20", + "metadata_proxy_socket": "/var/lib/neutron/metadata_proxy" + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/availability_zones.json b/core-test/src/main/resources/network/availability_zones.json index 26012a65c..d5cc4cdf5 100644 --- a/core-test/src/main/resources/network/availability_zones.json +++ b/core-test/src/main/resources/network/availability_zones.json @@ -1,9 +1,9 @@ { - "availability_zones": [ - { - "state": "available", - "resource": "network", - "name": "nova" - } - ] + "availability_zones": [ + { + "state": "available", + "resource": "network", + "name": "nova" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewall.json b/core-test/src/main/resources/network/firewalls/firewall.json index 461f4e660..bd1f4143f 100644 --- a/core-test/src/main/resources/network/firewalls/firewall.json +++ b/core-test/src/main/resources/network/firewalls/firewall.json @@ -1,11 +1,11 @@ { - "firewall": { - "admin_state_up": true, - "description": "Sample-Firewall", - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "Sample-Firewall", - "status": "ACTIVE", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } + "firewall": { + "admin_state_up": true, + "description": "Sample-Firewall", + "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", + "name": "Sample-Firewall", + "status": "ACTIVE", + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallpolicies.json b/core-test/src/main/resources/network/firewalls/firewallpolicies.json index 10f9d47ac..9f6b791d4 100644 --- a/core-test/src/main/resources/network/firewalls/firewallpolicies.json +++ b/core-test/src/main/resources/network/firewalls/firewallpolicies.json @@ -1,15 +1,15 @@ { - "firewall_policies": [ - { - "audited": false, - "description": "Sample-Firewall-Policy", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "Sample-Firewall-Policy", - "shared": false, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] + "firewall_policies": [ + { + "audited": false, + "description": "Sample-Firewall-Policy", + "firewall_rules": [ + "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" + ], + "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "name": "Sample-Firewall-Policy", + "shared": false, + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallpolicy.json b/core-test/src/main/resources/network/firewalls/firewallpolicy.json index e0533cab9..673ab9c12 100644 --- a/core-test/src/main/resources/network/firewalls/firewallpolicy.json +++ b/core-test/src/main/resources/network/firewalls/firewallpolicy.json @@ -1,13 +1,13 @@ { - "firewall_policy": { - "audited": false, - "description": "Test-Firewall-Policy", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "Test-Firewall-Policy", - "shared": false, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } + "firewall_policy": { + "audited": false, + "description": "Test-Firewall-Policy", + "firewall_rules": [ + "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" + ], + "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "name": "Test-Firewall-Policy", + "shared": false, + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallpolicyrule.json b/core-test/src/main/resources/network/firewalls/firewallpolicyrule.json index eb411b631..0ec984add 100644 --- a/core-test/src/main/resources/network/firewalls/firewallpolicyrule.json +++ b/core-test/src/main/resources/network/firewalls/firewallpolicyrule.json @@ -1,13 +1,13 @@ { - "audited": false, - "description": "", - "firewall_list": [], - "firewall_rules": [ - "a08ef905-0ff6-4784-8374-175fffe7dade", - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "shared": false, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + "audited": false, + "description": "", + "firewall_list": [], + "firewall_rules": [ + "a08ef905-0ff6-4784-8374-175fffe7dade", + "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" + ], + "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "name": "test-policy", + "shared": false, + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallpolicyupdate.json b/core-test/src/main/resources/network/firewalls/firewallpolicyupdate.json index 0e54e7d2b..ed79a6776 100644 --- a/core-test/src/main/resources/network/firewalls/firewallpolicyupdate.json +++ b/core-test/src/main/resources/network/firewalls/firewallpolicyupdate.json @@ -1,12 +1,12 @@ { - "firewall_policy": { - "audited": true, - "description": "Test-Firewall-Policy-Update", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "Test-Firewall-Policy-Update", - "shared": true - } + "firewall_policy": { + "audited": true, + "description": "Test-Firewall-Policy-Update", + "firewall_rules": [ + "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" + ], + "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "name": "Test-Firewall-Policy-Update", + "shared": true + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallrule.json b/core-test/src/main/resources/network/firewalls/firewallrule.json index 7a27e26af..f0ce1b99b 100644 --- a/core-test/src/main/resources/network/firewalls/firewallrule.json +++ b/core-test/src/main/resources/network/firewalls/firewallrule.json @@ -1,19 +1,19 @@ { - "firewall_rule": { - "action": "allow", - "description": "Sample-Firewall-Rule", - "destination_ip_address": "2.2.2.0/24", - "destination_port": "80", - "enabled": true, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": 1, - "protocol": "tcp", - "shared": false, - "source_ip_address": "1.1.1.0/24", - "source_port": "20", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } + "firewall_rule": { + "action": "allow", + "description": "Sample-Firewall-Rule", + "destination_ip_address": "2.2.2.0/24", + "destination_port": "80", + "enabled": true, + "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", + "ip_version": 4, + "name": "ALLOW_HTTP", + "position": 1, + "protocol": "tcp", + "shared": false, + "source_ip_address": "1.1.1.0/24", + "source_port": "20", + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallrules.json b/core-test/src/main/resources/network/firewalls/firewallrules.json index ce1bd940e..d03aed097 100644 --- a/core-test/src/main/resources/network/firewalls/firewallrules.json +++ b/core-test/src/main/resources/network/firewalls/firewallrules.json @@ -1,21 +1,21 @@ { - "firewall_rules": [ - { - "action": "allow", - "description": "Sample-Firewall-Rule", - "destination_ip_address": "2.2.2.0/24", - "destination_port": "80", - "enabled": true, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": 1, - "protocol": "tcp", - "shared": false, - "source_ip_address": "1.1.1.0/24", - "source_port": "20", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] + "firewall_rules": [ + { + "action": "allow", + "description": "Sample-Firewall-Rule", + "destination_ip_address": "2.2.2.0/24", + "destination_port": "80", + "enabled": true, + "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", + "ip_version": 4, + "name": "ALLOW_HTTP", + "position": 1, + "protocol": "tcp", + "shared": false, + "source_ip_address": "1.1.1.0/24", + "source_port": "20", + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallruleupdate.json b/core-test/src/main/resources/network/firewalls/firewallruleupdate.json index de2970f8b..99ce8331b 100644 --- a/core-test/src/main/resources/network/firewalls/firewallruleupdate.json +++ b/core-test/src/main/resources/network/firewalls/firewallruleupdate.json @@ -1,19 +1,19 @@ { - "firewall_rule": { - "action": "deny", - "description": "Sample-Firewall-Rule-Update", - "destination_ip_address": "2.2.2.0/24", - "destination_port": "80", - "enabled": false, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": 1, - "protocol": "tcp", - "shared": false, - "source_ip_address": "1.1.1.0/24", - "source_port": "20", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } + "firewall_rule": { + "action": "deny", + "description": "Sample-Firewall-Rule-Update", + "destination_ip_address": "2.2.2.0/24", + "destination_port": "80", + "enabled": false, + "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", + "ip_version": 4, + "name": "ALLOW_HTTP", + "position": 1, + "protocol": "tcp", + "shared": false, + "source_ip_address": "1.1.1.0/24", + "source_port": "20", + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewalls.json b/core-test/src/main/resources/network/firewalls/firewalls.json index 21991e0be..fd2034608 100644 --- a/core-test/src/main/resources/network/firewalls/firewalls.json +++ b/core-test/src/main/resources/network/firewalls/firewalls.json @@ -1,13 +1,13 @@ { - "firewalls": [ - { - "admin_state_up": true, - "description": "Simple-Firewall-Test", - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "firewall-test", - "status": "ACTIVE", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] + "firewalls": [ + { + "admin_state_up": true, + "description": "Simple-Firewall-Test", + "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", + "name": "firewall-test", + "status": "ACTIVE", + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/firewalls/firewallupdate.json b/core-test/src/main/resources/network/firewalls/firewallupdate.json index f15e9e7a9..560015614 100644 --- a/core-test/src/main/resources/network/firewalls/firewallupdate.json +++ b/core-test/src/main/resources/network/firewalls/firewallupdate.json @@ -1,11 +1,11 @@ { - "firewall": { - "admin_state_up": false, - "description": "Test-Firewall-Update", - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "Test-Firewall-Update", - "status": "ACTIVE", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } + "firewall": { + "admin_state_up": false, + "description": "Test-Firewall-Update", + "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", + "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", + "name": "Test-Firewall-Update", + "status": "ACTIVE", + "tenant_id": "45977fa2dbd7482098dd68d0d8970117" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/external_policies.json b/core-test/src/main/resources/network/gbp/external_policies.json index bb174ba78..345aa024d 100644 --- a/core-test/src/main/resources/network/gbp/external_policies.json +++ b/core-test/src/main/resources/network/gbp/external_policies.json @@ -1,42 +1,40 @@ { - "external_policies":[ - { - "consumed_policy_rule_sets":[ - "590f005f-de21-4466-905f-457487cc9a60", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "description":"test-ext-grp-desc-1", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "provided_policy_rule_sets":[ - "590f005f-de21-4466-905f-457487cc9a60", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "shared":false, - "external_segments":[ - "fff89eb8-8f9d-49a2-b66c-ad75d9a95287" - ], - "id":"6294837a-8f35-4071-b766-3a4ff3d8afbb", - "name":"test-ext-grp-1" - }, - { - "consumed_policy_rule_sets":[ - "590f005f-de21-4466-905f-457487cc9a60", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "description":"test-ext-grp-desc-2", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "provided_policy_rule_sets":[ - "590f005f-de21-4466-905f-457487cc9a60", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "shared":false, - "external_segments":[ - "fff89eb8-8f9d-49a2-b66c-ad75d9a95287" - ], - "id":"7294837a-8f35-4071-b766-3a4ff3d8afbb", - "name":"test-ext-grp-2" - } - - - ] + "external_policies": [ + { + "consumed_policy_rule_sets": [ + "590f005f-de21-4466-905f-457487cc9a60", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "description": "test-ext-grp-desc-1", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "provided_policy_rule_sets": [ + "590f005f-de21-4466-905f-457487cc9a60", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "shared": false, + "external_segments": [ + "fff89eb8-8f9d-49a2-b66c-ad75d9a95287" + ], + "id": "6294837a-8f35-4071-b766-3a4ff3d8afbb", + "name": "test-ext-grp-1" + }, + { + "consumed_policy_rule_sets": [ + "590f005f-de21-4466-905f-457487cc9a60", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "description": "test-ext-grp-desc-2", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "provided_policy_rule_sets": [ + "590f005f-de21-4466-905f-457487cc9a60", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "shared": false, + "external_segments": [ + "fff89eb8-8f9d-49a2-b66c-ad75d9a95287" + ], + "id": "7294837a-8f35-4071-b766-3a4ff3d8afbb", + "name": "test-ext-grp-2" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/external_policy.json b/core-test/src/main/resources/network/gbp/external_policy.json index e789ab04c..fedfdf450 100644 --- a/core-test/src/main/resources/network/gbp/external_policy.json +++ b/core-test/src/main/resources/network/gbp/external_policy.json @@ -1,32 +1,32 @@ { - "external_policy":{ - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "c3207474-19ee-4241-81e5-9e20995f2065", - "f19a90af-0103-429d-8118-3920bf2f27db", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "description":"test-ext-policy-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "c3207474-19ee-4241-81e5-9e20995f2065", - "f19a90af-0103-429d-8118-3920bf2f27db", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "shared":false, - "external_segments":[ - "f062e3b9-a668-4265-95d0-239c2061ca12" - ], - "id":"8d14b663-c67d-4fa7-b23f-0732cb9aa292", - "name":"test-ext-policy" - } + "external_policy": { + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "c3207474-19ee-4241-81e5-9e20995f2065", + "f19a90af-0103-429d-8118-3920bf2f27db", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "description": "test-ext-policy-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "c3207474-19ee-4241-81e5-9e20995f2065", + "f19a90af-0103-429d-8118-3920bf2f27db", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "shared": false, + "external_segments": [ + "f062e3b9-a668-4265-95d0-239c2061ca12" + ], + "id": "8d14b663-c67d-4fa7-b23f-0732cb9aa292", + "name": "test-ext-policy" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/external_policy_update.json b/core-test/src/main/resources/network/gbp/external_policy_update.json index 62098a3a0..3b1158bca 100644 --- a/core-test/src/main/resources/network/gbp/external_policy_update.json +++ b/core-test/src/main/resources/network/gbp/external_policy_update.json @@ -1,22 +1,22 @@ { - "external_policy":{ - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "description":"test-ext-policy-desc-update", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "shared":false, - "external_segments":[ - "f062e3b9-a668-4265-95d0-239c2061ca12" - ], - "id":"8d14b663-c67d-4fa7-b23f-0732cb9aa292", - "name":"test-ext-policy-update" - } + "external_policy": { + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "description": "test-ext-policy-desc-update", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "shared": false, + "external_segments": [ + "f062e3b9-a668-4265-95d0-239c2061ca12" + ], + "id": "8d14b663-c67d-4fa7-b23f-0732cb9aa292", + "name": "test-ext-policy-update" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/external_segment.json b/core-test/src/main/resources/network/gbp/external_segment.json index e6e4b4447..e7a526fd6 100644 --- a/core-test/src/main/resources/network/gbp/external_segment.json +++ b/core-test/src/main/resources/network/gbp/external_segment.json @@ -1,25 +1,21 @@ { - "external_segment":{ - "description":"extSeg01-desc", - "external_policies":[ - - ], - "port_address_translation":false, - "shared":false, - "cidr":"172.16.0.0/12", - "id":"df9e5238-084e-4053-8871-81b63167e2f4", - "name":"extSeg01", - "l3_policies":[ - - ], - "subnet_id":null, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "nat_pools":[ - - ], - "ip_version":4, - "external_routes":[ - - ] - } + "external_segment": { + "description": "extSeg01-desc", + "external_policies": [ + ], + "port_address_translation": false, + "shared": false, + "cidr": "172.16.0.0/12", + "id": "df9e5238-084e-4053-8871-81b63167e2f4", + "name": "extSeg01", + "l3_policies": [ + ], + "subnet_id": null, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "nat_pools": [ + ], + "ip_version": 4, + "external_routes": [ + ] + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/external_segment_update.json b/core-test/src/main/resources/network/gbp/external_segment_update.json index 7d2e3e150..87b81d028 100644 --- a/core-test/src/main/resources/network/gbp/external_segment_update.json +++ b/core-test/src/main/resources/network/gbp/external_segment_update.json @@ -1,25 +1,21 @@ { - "external_segment":{ - "description":"extSeg01-desc-update", - "external_policies":[ - - ], - "port_address_translation":false, - "shared":false, - "cidr":"172.16.0.0/12", - "id":"df9e5238-084e-4053-8871-81b63167e2f4", - "name":"extSeg01-update", - "l3_policies":[ - - ], - "subnet_id":null, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "nat_pools":[ - - ], - "ip_version":4, - "external_routes":[ - - ] - } + "external_segment": { + "description": "extSeg01-desc-update", + "external_policies": [ + ], + "port_address_translation": false, + "shared": false, + "cidr": "172.16.0.0/12", + "id": "df9e5238-084e-4053-8871-81b63167e2f4", + "name": "extSeg01-update", + "l3_policies": [ + ], + "subnet_id": null, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "nat_pools": [ + ], + "ip_version": 4, + "external_routes": [ + ] + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/external_segments.json b/core-test/src/main/resources/network/gbp/external_segments.json index 9fa9f8389..81e43ea7d 100644 --- a/core-test/src/main/resources/network/gbp/external_segments.json +++ b/core-test/src/main/resources/network/gbp/external_segments.json @@ -1,56 +1,56 @@ { - "external_segments":[ - { - "description":"Datacenter-Out-desc", - "external_policies":[ - "6294837a-8f35-4071-b766-3a4ff3d8afbb" - ], - "port_address_translation":false, - "shared":true, - "cidr":"1.101.2.1/28", - "id":"fff89eb8-8f9d-49a2-b66c-ad75d9a95287", - "name":"Datacenter-Out", - "l3_policies":[ - "da7083c6-3d5b-450c-8163-0b156d55eba6" - ], - "subnet_id":"182c0b15-3f48-453d-b163-ea91effe2784", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "nat_pools":[ - "e2d4fce7-4c55-497b-ac4c-290dd202c71a" - ], - "ip_version":4, - "external_routes":[ - { - "nexthop":"", - "destination":"0.0.0.0/0" - } - ] - }, - { - "description":"Datacenter-Out-2-desc", - "external_policies":[ - "6294837a-8f35-4071-b766-3a4ff3d8afbb" - ], - "port_address_translation":false, - "shared":true, - "cidr":"1.101.2.1/28", - "id":"ggg89eb8-8f9d-49a2-b66c-ad75d9a95287", - "name":"Datacenter-Out-2", - "l3_policies":[ - "da7083c6-3d5b-450c-8163-0b156d55eba6" - ], - "subnet_id":"182c0b15-3f48-453d-b163-ea91effe2784", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "nat_pools":[ - "e2d4fce7-4c55-497b-ac4c-290dd202c71a" - ], - "ip_version":4, - "external_routes":[ - { - "nexthop":"", - "destination":"0.0.0.0/0" - } - ] - } - ] + "external_segments": [ + { + "description": "Datacenter-Out-desc", + "external_policies": [ + "6294837a-8f35-4071-b766-3a4ff3d8afbb" + ], + "port_address_translation": false, + "shared": true, + "cidr": "1.101.2.1/28", + "id": "fff89eb8-8f9d-49a2-b66c-ad75d9a95287", + "name": "Datacenter-Out", + "l3_policies": [ + "da7083c6-3d5b-450c-8163-0b156d55eba6" + ], + "subnet_id": "182c0b15-3f48-453d-b163-ea91effe2784", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "nat_pools": [ + "e2d4fce7-4c55-497b-ac4c-290dd202c71a" + ], + "ip_version": 4, + "external_routes": [ + { + "nexthop": "", + "destination": "0.0.0.0/0" + } + ] + }, + { + "description": "Datacenter-Out-2-desc", + "external_policies": [ + "6294837a-8f35-4071-b766-3a4ff3d8afbb" + ], + "port_address_translation": false, + "shared": true, + "cidr": "1.101.2.1/28", + "id": "ggg89eb8-8f9d-49a2-b66c-ad75d9a95287", + "name": "Datacenter-Out-2", + "l3_policies": [ + "da7083c6-3d5b-450c-8163-0b156d55eba6" + ], + "subnet_id": "182c0b15-3f48-453d-b163-ea91effe2784", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "nat_pools": [ + "e2d4fce7-4c55-497b-ac4c-290dd202c71a" + ], + "ip_version": 4, + "external_routes": [ + { + "nexthop": "", + "destination": "0.0.0.0/0" + } + ] + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/l2_policies.json b/core-test/src/main/resources/network/gbp/l2_policies.json index 65a4a49ea..b8c98772b 100644 --- a/core-test/src/main/resources/network/gbp/l2_policies.json +++ b/core-test/src/main/resources/network/gbp/l2_policies.json @@ -1,124 +1,124 @@ { - "l2_policies":[ - { - "description":"Implicitly created L2 policy", - "network_id":"f9c1f545-6ea6-4b05-99d5-50f02ed3c640", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "1fb00129-06cf-48e5-8282-d15dbf4be60b" - ], - "shared":false, - "id":"08c1c093-6337-4383-938e-2d9c6cac531a", - "name":"test-policy-target-group" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"43f98ed6-3e4a-4dfe-a1d4-3b7692641811", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "62acdf14-184d-4565-9660-e5f0ec454e79" - ], - "shared":false, - "id":"138305c9-2749-4291-b9ff-adb901a660f1", - "name":"test-policy-target-group" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"58a69068-075b-44a4-8829-52b233cafd70", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "d3f59dc9-f7c4-4183-8315-4fa3f5ca3202" - ], - "shared":false, - "id":"36af9906-300e-465a-85fc-716694de38c7", - "name":"test-policy-target-group" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"20e0314c-3d75-496a-ab7f-14fac20d6efd", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "l3_policy_id":"8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", - "policy_target_groups":[ - "2b2a44de-0992-4cf8-bbd6-b2e4c565e16d" - ], - "shared":false, - "id":"65fc10d2-f173-48db-ad50-72f29790c4d1", - "name":"test" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"852eb20e-edf2-48c4-a498-a776fe93bb4d", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "ab19a691-24e1-44e8-bc74-38b233305f52" - ], - "shared":false, - "id":"7dc44fbd-bc2b-4aa3-808c-0498183f5e21", - "name":"test-policy-target-group" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"e05accfc-c550-4528-bfe3-5a52382482fd", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "aab0872f-890f-46b1-b461-86877039c23e" - ], - "shared":false, - "id":"7eea106a-714d-41aa-ac69-de4c3f2e4b44", - "name":"test-policy-target-group" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"6f9a05c9-b162-4e75-8ae3-9fea2c5eee31", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "3ecf2178-25bb-4611-8a10-0dc074e90295" - ], - "shared":false, - "id":"9fe34254-28fd-4db2-bba6-f8c35c51617e", - "name":"test-policy-target-group" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"c0631952-3247-40ad-bb0e-8e7dc7c9feff", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "61073812-3994-40c2-96f0-6bff03804e47" - ], - "shared":false, - "id":"a8aea144-92d8-4830-ae9f-41af291adb42", - "name":"test-policy-target-group" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"e16c1817-463b-42ab-afbf-801434e845be", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "a72f99fa-68d1-494a-bc63-8b9e9b526f76" - ], - "shared":false, - "id":"c1cc9bd8-49a5-4699-aa26-b276ced4cc67", - "name":"sha1-test" - }, - { - "description":"Implicitly created L2 policy", - "network_id":"1f3d040d-0cd4-4ae2-839d-bccbd718a58f", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "793c0497-39e8-4c76-a751-1d115d7a3b21" - ], - "shared":false, - "id":"d02b17ad-ef26-4a04-9071-82a5cfa100a6", - "name":"test-policy-target-group" - } - ] + "l2_policies": [ + { + "description": "Implicitly created L2 policy", + "network_id": "f9c1f545-6ea6-4b05-99d5-50f02ed3c640", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "1fb00129-06cf-48e5-8282-d15dbf4be60b" + ], + "shared": false, + "id": "08c1c093-6337-4383-938e-2d9c6cac531a", + "name": "test-policy-target-group" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "43f98ed6-3e4a-4dfe-a1d4-3b7692641811", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "62acdf14-184d-4565-9660-e5f0ec454e79" + ], + "shared": false, + "id": "138305c9-2749-4291-b9ff-adb901a660f1", + "name": "test-policy-target-group" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "58a69068-075b-44a4-8829-52b233cafd70", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "d3f59dc9-f7c4-4183-8315-4fa3f5ca3202" + ], + "shared": false, + "id": "36af9906-300e-465a-85fc-716694de38c7", + "name": "test-policy-target-group" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "20e0314c-3d75-496a-ab7f-14fac20d6efd", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "l3_policy_id": "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", + "policy_target_groups": [ + "2b2a44de-0992-4cf8-bbd6-b2e4c565e16d" + ], + "shared": false, + "id": "65fc10d2-f173-48db-ad50-72f29790c4d1", + "name": "test" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "852eb20e-edf2-48c4-a498-a776fe93bb4d", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "ab19a691-24e1-44e8-bc74-38b233305f52" + ], + "shared": false, + "id": "7dc44fbd-bc2b-4aa3-808c-0498183f5e21", + "name": "test-policy-target-group" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "e05accfc-c550-4528-bfe3-5a52382482fd", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "aab0872f-890f-46b1-b461-86877039c23e" + ], + "shared": false, + "id": "7eea106a-714d-41aa-ac69-de4c3f2e4b44", + "name": "test-policy-target-group" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "6f9a05c9-b162-4e75-8ae3-9fea2c5eee31", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "3ecf2178-25bb-4611-8a10-0dc074e90295" + ], + "shared": false, + "id": "9fe34254-28fd-4db2-bba6-f8c35c51617e", + "name": "test-policy-target-group" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "c0631952-3247-40ad-bb0e-8e7dc7c9feff", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "61073812-3994-40c2-96f0-6bff03804e47" + ], + "shared": false, + "id": "a8aea144-92d8-4830-ae9f-41af291adb42", + "name": "test-policy-target-group" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "e16c1817-463b-42ab-afbf-801434e845be", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "a72f99fa-68d1-494a-bc63-8b9e9b526f76" + ], + "shared": false, + "id": "c1cc9bd8-49a5-4699-aa26-b276ced4cc67", + "name": "sha1-test" + }, + { + "description": "Implicitly created L2 policy", + "network_id": "1f3d040d-0cd4-4ae2-839d-bccbd718a58f", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "793c0497-39e8-4c76-a751-1d115d7a3b21" + ], + "shared": false, + "id": "d02b17ad-ef26-4a04-9071-82a5cfa100a6", + "name": "test-policy-target-group" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/l2_policy.json b/core-test/src/main/resources/network/gbp/l2_policy.json index 22bf9a4b1..f64ae404b 100644 --- a/core-test/src/main/resources/network/gbp/l2_policy.json +++ b/core-test/src/main/resources/network/gbp/l2_policy.json @@ -1,14 +1,14 @@ { - "l2_policy":{ - "description":"Implicitly created L2 policy", - "network_id":"f9c1f545-6ea6-4b05-99d5-50f02ed3c640", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "1fb00129-06cf-48e5-8282-d15dbf4be60b" - ], - "shared":false, - "id":"08c1c093-6337-4383-938e-2d9c6cac531a", - "name":"test-policy-target-group" - } + "l2_policy": { + "description": "Implicitly created L2 policy", + "network_id": "f9c1f545-6ea6-4b05-99d5-50f02ed3c640", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "1fb00129-06cf-48e5-8282-d15dbf4be60b" + ], + "shared": false, + "id": "08c1c093-6337-4383-938e-2d9c6cac531a", + "name": "test-policy-target-group" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/l2_policy_update.json b/core-test/src/main/resources/network/gbp/l2_policy_update.json index 30468f4cb..411920140 100644 --- a/core-test/src/main/resources/network/gbp/l2_policy_update.json +++ b/core-test/src/main/resources/network/gbp/l2_policy_update.json @@ -1,14 +1,14 @@ { - "l2_policy":{ - "description":"Implicitly created L2 policy-update", - "network_id":"f9c1f545-6ea6-4b05-99d5-50f02ed3c640", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "l3_policy_id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "policy_target_groups":[ - "1fb00129-06cf-48e5-8282-d15dbf4be60b" - ], - "shared":false, - "id":"08c1c093-6337-4383-938e-2d9c6cac531a", - "name":"test-policy-target-group-update" - } + "l2_policy": { + "description": "Implicitly created L2 policy-update", + "network_id": "f9c1f545-6ea6-4b05-99d5-50f02ed3c640", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "l3_policy_id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "policy_target_groups": [ + "1fb00129-06cf-48e5-8282-d15dbf4be60b" + ], + "shared": false, + "id": "08c1c093-6337-4383-938e-2d9c6cac531a", + "name": "test-policy-target-group-update" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/l3_policies.json b/core-test/src/main/resources/network/gbp/l3_policies.json index eee034060..d8baf71d8 100644 --- a/core-test/src/main/resources/network/gbp/l3_policies.json +++ b/core-test/src/main/resources/network/gbp/l3_policies.json @@ -1,52 +1,50 @@ { - "l3_policies":[ - { - "description":"Implicitly created L3 policy", - "routers":[ - - ], - "subnet_prefix_length":24, - "l2_policies":[ - "65fc10d2-f173-48db-ad50-72f29790c4d1" - ], - "id":"8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", - "ip_pool":"192.168.0.0/16", - "name":"default", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "ip_version":4, - "shared":false, - "external_segments":{ - - } - }, - { - "description":"Implicitly created L3 policy", - "routers":[ - "d0b07840-a86c-4848-b61c-a8febc196feb" - ], - "subnet_prefix_length":24, - "l2_policies":[ - "08c1c093-6337-4383-938e-2d9c6cac531a", - "138305c9-2749-4291-b9ff-adb901a660f1", - "36af9906-300e-465a-85fc-716694de38c7", - "7dc44fbd-bc2b-4aa3-808c-0498183f5e21", - "7eea106a-714d-41aa-ac69-de4c3f2e4b44", - "9fe34254-28fd-4db2-bba6-f8c35c51617e", - "a8aea144-92d8-4830-ae9f-41af291adb42", - "c1cc9bd8-49a5-4699-aa26-b276ced4cc67", - "d02b17ad-ef26-4a04-9071-82a5cfa100a6" - ], - "id":"da7083c6-3d5b-450c-8163-0b156d55eba6", - "ip_pool":"192.168.0.0/16", - "name":"default", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "ip_version":4, - "shared":false, - "external_segments":{ - "fff89eb8-8f9d-49a2-b66c-ad75d9a95287":[ - "169.254.0.2" - ] - } + "l3_policies": [ + { + "description": "Implicitly created L3 policy", + "routers": [ + ], + "subnet_prefix_length": 24, + "l2_policies": [ + "65fc10d2-f173-48db-ad50-72f29790c4d1" + ], + "id": "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", + "ip_pool": "192.168.0.0/16", + "name": "default", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "ip_version": 4, + "shared": false, + "external_segments": { } - ] + }, + { + "description": "Implicitly created L3 policy", + "routers": [ + "d0b07840-a86c-4848-b61c-a8febc196feb" + ], + "subnet_prefix_length": 24, + "l2_policies": [ + "08c1c093-6337-4383-938e-2d9c6cac531a", + "138305c9-2749-4291-b9ff-adb901a660f1", + "36af9906-300e-465a-85fc-716694de38c7", + "7dc44fbd-bc2b-4aa3-808c-0498183f5e21", + "7eea106a-714d-41aa-ac69-de4c3f2e4b44", + "9fe34254-28fd-4db2-bba6-f8c35c51617e", + "a8aea144-92d8-4830-ae9f-41af291adb42", + "c1cc9bd8-49a5-4699-aa26-b276ced4cc67", + "d02b17ad-ef26-4a04-9071-82a5cfa100a6" + ], + "id": "da7083c6-3d5b-450c-8163-0b156d55eba6", + "ip_pool": "192.168.0.0/16", + "name": "default", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "ip_version": 4, + "shared": false, + "external_segments": { + "fff89eb8-8f9d-49a2-b66c-ad75d9a95287": [ + "169.254.0.2" + ] + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/l3_policy.json b/core-test/src/main/resources/network/gbp/l3_policy.json index 7b8cba552..636d1c653 100644 --- a/core-test/src/main/resources/network/gbp/l3_policy.json +++ b/core-test/src/main/resources/network/gbp/l3_policy.json @@ -1,21 +1,19 @@ { - "l3_policy":{ - "description":"Implicitly created L3 policy", - "routers":[ - - ], - "subnet_prefix_length":24, - "l2_policies":[ - "65fc10d2-f173-48db-ad50-72f29790c4d1" - ], - "id":"8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", - "ip_pool":"192.168.0.0/16", - "name":"default", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "ip_version":4, - "shared":false, - "external_segments":{ - - } - } + "l3_policy": { + "description": "Implicitly created L3 policy", + "routers": [ + ], + "subnet_prefix_length": 24, + "l2_policies": [ + "65fc10d2-f173-48db-ad50-72f29790c4d1" + ], + "id": "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", + "ip_pool": "192.168.0.0/16", + "name": "default", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "ip_version": 4, + "shared": false, + "external_segments": { + } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/l3_policy_update.json b/core-test/src/main/resources/network/gbp/l3_policy_update.json index 14c3a6bdd..8afe63f2a 100644 --- a/core-test/src/main/resources/network/gbp/l3_policy_update.json +++ b/core-test/src/main/resources/network/gbp/l3_policy_update.json @@ -1,21 +1,19 @@ { - "l3_policy":{ - "description":"Implicitly created L3 policy-update", - "routers":[ - - ], - "subnet_prefix_length":24, - "l2_policies":[ - "65fc10d2-f173-48db-ad50-72f29790c4d1" - ], - "id":"8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", - "ip_pool":"192.168.0.0/16", - "name":"default-update", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "ip_version":4, - "shared":false, - "external_segments":{ - - } - } + "l3_policy": { + "description": "Implicitly created L3 policy-update", + "routers": [ + ], + "subnet_prefix_length": 24, + "l2_policies": [ + "65fc10d2-f173-48db-ad50-72f29790c4d1" + ], + "id": "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d", + "ip_pool": "192.168.0.0/16", + "name": "default-update", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "ip_version": 4, + "shared": false, + "external_segments": { + } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/nat_pool.json b/core-test/src/main/resources/network/gbp/nat_pool.json index dc45383d2..4ec4295de 100644 --- a/core-test/src/main/resources/network/gbp/nat_pool.json +++ b/core-test/src/main/resources/network/gbp/nat_pool.json @@ -1,13 +1,13 @@ { - "nat_pool":{ - "subnet_id":"0703a1f7-f641-41a5-abd0-c8302bf01af8", - "name":"ptg_nat_pool", - "external_segment_id":"fff89eb8-8f9d-49a2-b66c-ad75d9a95287", - "shared":true, - "ip_version":4, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "ip_pool":"1.101.2.112/28", - "id":"e2d4fce7-4c55-497b-ac4c-290dd202c71a", - "description":"" - } + "nat_pool": { + "subnet_id": "0703a1f7-f641-41a5-abd0-c8302bf01af8", + "name": "ptg_nat_pool", + "external_segment_id": "fff89eb8-8f9d-49a2-b66c-ad75d9a95287", + "shared": true, + "ip_version": 4, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "ip_pool": "1.101.2.112/28", + "id": "e2d4fce7-4c55-497b-ac4c-290dd202c71a", + "description": "" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/nat_pool_update.json b/core-test/src/main/resources/network/gbp/nat_pool_update.json index d35952f55..81d2d1b94 100644 --- a/core-test/src/main/resources/network/gbp/nat_pool_update.json +++ b/core-test/src/main/resources/network/gbp/nat_pool_update.json @@ -1,13 +1,13 @@ { - "nat_pool":{ - "subnet_id":"0703a1f7-f641-41a5-abd0-c8302bf01af8", - "name":"ptg_nat_pool-update", - "external_segment_id":"fff89eb8-8f9d-49a2-b66c-ad75d9a95287", - "shared":true, - "ip_version":4, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "ip_pool":"1.101.2.112/28", - "id":"e2d4fce7-4c55-497b-ac4c-290dd202c71a", - "description":"" - } + "nat_pool": { + "subnet_id": "0703a1f7-f641-41a5-abd0-c8302bf01af8", + "name": "ptg_nat_pool-update", + "external_segment_id": "fff89eb8-8f9d-49a2-b66c-ad75d9a95287", + "shared": true, + "ip_version": 4, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "ip_pool": "1.101.2.112/28", + "id": "e2d4fce7-4c55-497b-ac4c-290dd202c71a", + "description": "" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/nat_pools.json b/core-test/src/main/resources/network/gbp/nat_pools.json index 641f2b331..c2289c497 100644 --- a/core-test/src/main/resources/network/gbp/nat_pools.json +++ b/core-test/src/main/resources/network/gbp/nat_pools.json @@ -1,27 +1,26 @@ { - "nat_pools":[ - { - "subnet_id":"0703a1f7-f641-41a5-abd0-c8302bf01af8", - "name":"ptg_nat_pool-1", - "external_segment_id":"fff89eb8-8f9d-49a2-b66c-ad75d9a95287", - "shared":true, - "ip_version":4, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "ip_pool":"1.101.2.112/28", - "id":"f2e4fce7-4c55-497b-ac4c-290dd202c71a", - "description":"" - }, - { - "subnet_id":"1233a1f7-f641-41a5-abd0-c8302bf01af8", - "name":"ptg_nat_pool-2", - "external_segment_id":"fff89eb8-8f9d-49a2-b66c-ad75d9a95287", - "shared":true, - "ip_version":4, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "ip_pool":"1.102.3.113/28", - "id":"e2d4fce7-4c55-497b-ac4c-290dd202c71a", - "description":"" - } - - ] + "nat_pools": [ + { + "subnet_id": "0703a1f7-f641-41a5-abd0-c8302bf01af8", + "name": "ptg_nat_pool-1", + "external_segment_id": "fff89eb8-8f9d-49a2-b66c-ad75d9a95287", + "shared": true, + "ip_version": 4, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "ip_pool": "1.101.2.112/28", + "id": "f2e4fce7-4c55-497b-ac4c-290dd202c71a", + "description": "" + }, + { + "subnet_id": "1233a1f7-f641-41a5-abd0-c8302bf01af8", + "name": "ptg_nat_pool-2", + "external_segment_id": "fff89eb8-8f9d-49a2-b66c-ad75d9a95287", + "shared": true, + "ip_version": 4, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "ip_pool": "1.102.3.113/28", + "id": "e2d4fce7-4c55-497b-ac4c-290dd202c71a", + "description": "" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/network_service_policies.json b/core-test/src/main/resources/network/gbp/network_service_policies.json index 463ced722..8c253c547 100644 --- a/core-test/src/main/resources/network/gbp/network_service_policies.json +++ b/core-test/src/main/resources/network/gbp/network_service_policies.json @@ -1,38 +1,36 @@ { - "network_service_policies":[ + "network_service_policies": [ { - "description":"Second network service profile", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "network_service_params":[ + "description": "Second network service profile", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "network_service_params": [ { - "type":"ip_pool", - "name":"param2", - "value":"nat_pool" + "type": "ip_pool", + "name": "param2", + "value": "nat_pool" } ], - "policy_target_groups":[ - + "policy_target_groups": [ ], - "shared":false, - "id":"d98e3cd5-3eb4-41ba-9069-6f5867ceb162", - "name":"Test2" + "shared": false, + "id": "d98e3cd5-3eb4-41ba-9069-6f5867ceb162", + "name": "Test2" }, { - "description":"First network service profile", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "network_service_params":[ + "description": "First network service profile", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "network_service_params": [ { - "type":"ip_single", - "name":"param1", - "value":"self_subnet" + "type": "ip_single", + "name": "param1", + "value": "self_subnet" } ], - "policy_target_groups":[ - + "policy_target_groups": [ ], - "shared":true, - "id":"e252a688-2b09-4aab-ae4a-ad57fd9154f2", - "name":"Test1" + "shared": true, + "id": "e252a688-2b09-4aab-ae4a-ad57fd9154f2", + "name": "Test1" } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/network_service_policy.json b/core-test/src/main/resources/network/gbp/network_service_policy.json index 17f2b2ad2..1d0cbb640 100644 --- a/core-test/src/main/resources/network/gbp/network_service_policy.json +++ b/core-test/src/main/resources/network/gbp/network_service_policy.json @@ -1,19 +1,18 @@ { "network_service_policy": { - "description":"Second network service profile", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "network_service_params":[ - { - "type":"ip_pool", - "name":"param2", - "value":"nat_pool" - } - ], - "policy_target_groups":[ - - ], - "shared":false, - "id":"d98e3cd5-3eb4-41ba-9069-6f5867ceb162", - "name":"Test2" - } + "description": "Second network service profile", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "network_service_params": [ + { + "type": "ip_pool", + "name": "param2", + "value": "nat_pool" + } + ], + "policy_target_groups": [ + ], + "shared": false, + "id": "d98e3cd5-3eb4-41ba-9069-6f5867ceb162", + "name": "Test2" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/network_service_policy_update.json b/core-test/src/main/resources/network/gbp/network_service_policy_update.json index f8b40def6..807d0af43 100644 --- a/core-test/src/main/resources/network/gbp/network_service_policy_update.json +++ b/core-test/src/main/resources/network/gbp/network_service_policy_update.json @@ -1,19 +1,18 @@ { "network_service_policy": { - "description":"Updated network service profile", - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "network_service_params":[ + "description": "Updated network service profile", + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "network_service_params": [ { - "type":"ip_pool", - "name":"param", - "value":"nat_pool" + "type": "ip_pool", + "name": "param", + "value": "nat_pool" } ], - "policy_target_groups":[ - + "policy_target_groups": [ ], - "shared":false, - "id":"d98e3cd5-3eb4-41ba-9069-6f5867ceb162", - "name":"TestUpdate" + "shared": false, + "id": "d98e3cd5-3eb4-41ba-9069-6f5867ceb162", + "name": "TestUpdate" } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_action.json b/core-test/src/main/resources/network/gbp/policy_action.json index 316767d9d..2d7788d2d 100644 --- a/core-test/src/main/resources/network/gbp/policy_action.json +++ b/core-test/src/main/resources/network/gbp/policy_action.json @@ -1,11 +1,11 @@ { - "policy_action":{ - "action_value":null, - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "action_type":"allow", - "shared":false, - "id":"b25bbad7-224b-4810-ae1c-7d10fb4468b5", - "name":"allow" - } + "policy_action": { + "action_value": null, + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "action_type": "allow", + "shared": false, + "id": "b25bbad7-224b-4810-ae1c-7d10fb4468b5", + "name": "allow" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_action_update.json b/core-test/src/main/resources/network/gbp/policy_action_update.json index c0773efb9..d29be8908 100644 --- a/core-test/src/main/resources/network/gbp/policy_action_update.json +++ b/core-test/src/main/resources/network/gbp/policy_action_update.json @@ -1,11 +1,11 @@ { - "policy_action":{ - "action_value":null, - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "action_type":"redirect", - "shared":false, - "id":"b25bbad7-224b-4810-ae1c-7d10fb4468b5", - "name":"redirect" - } + "policy_action": { + "action_value": null, + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "action_type": "redirect", + "shared": false, + "id": "b25bbad7-224b-4810-ae1c-7d10fb4468b5", + "name": "redirect" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_actions.json b/core-test/src/main/resources/network/gbp/policy_actions.json index b8728bb51..8b97a7154 100644 --- a/core-test/src/main/resources/network/gbp/policy_actions.json +++ b/core-test/src/main/resources/network/gbp/policy_actions.json @@ -1,22 +1,22 @@ { - "policy_actions":[ - { - "action_value":null, - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "action_type":"allow", - "shared":false, - "id":"b25bbad7-224b-4810-ae1c-7d10fb4468b5", - "name":"allow" - }, - { - "action_value":null, - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "action_type":"redirect", - "shared":false, - "id":"f26bbad7-224b-4810-ae1c-7d10fb4468b5", - "name":"redirect" - } - ] + "policy_actions": [ + { + "action_value": null, + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "action_type": "allow", + "shared": false, + "id": "b25bbad7-224b-4810-ae1c-7d10fb4468b5", + "name": "allow" + }, + { + "action_value": null, + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "action_type": "redirect", + "shared": false, + "id": "f26bbad7-224b-4810-ae1c-7d10fb4468b5", + "name": "redirect" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_classifier.json b/core-test/src/main/resources/network/gbp/policy_classifier.json index c54f5fcde..3ac8ed7c9 100644 --- a/core-test/src/main/resources/network/gbp/policy_classifier.json +++ b/core-test/src/main/resources/network/gbp/policy_classifier.json @@ -1,12 +1,12 @@ { - "policy_classifier":{ - "direction":"bi", - "protocol":"icmp", - "name":"icmp", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "port_range":null, - "shared":false, - "id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "description":"" - } + "policy_classifier": { + "direction": "bi", + "protocol": "icmp", + "name": "icmp", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "port_range": null, + "shared": false, + "id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "description": "" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_classifier_update.json b/core-test/src/main/resources/network/gbp/policy_classifier_update.json index 811c1e5af..ac86435e4 100644 --- a/core-test/src/main/resources/network/gbp/policy_classifier_update.json +++ b/core-test/src/main/resources/network/gbp/policy_classifier_update.json @@ -1,12 +1,12 @@ { - "policy_classifier":{ - "direction":"bi", - "protocol":"icmp", - "name":"icmp", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "port_range":null, - "shared":false, - "id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "description":"icmp-update" - } + "policy_classifier": { + "direction": "bi", + "protocol": "icmp", + "name": "icmp", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "port_range": null, + "shared": false, + "id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "description": "icmp-update" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_classifiers.json b/core-test/src/main/resources/network/gbp/policy_classifiers.json index 969e17287..951ffdb27 100644 --- a/core-test/src/main/resources/network/gbp/policy_classifiers.json +++ b/core-test/src/main/resources/network/gbp/policy_classifiers.json @@ -1,24 +1,24 @@ { - "policy_classifiers":[ - { - "direction":"bi", - "protocol":"icmp", - "name":"icmp", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "port_range":null, - "shared":false, - "id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "description":"" - }, - { - "direction":"bi", - "protocol":"tcp", - "name":"tcp-22-classifier", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "port_range":"22", - "shared":false, - "id":"48c702a8-80e0-4781-a8d5-80ae7de53cdc", - "description":"" - } - ] + "policy_classifiers": [ + { + "direction": "bi", + "protocol": "icmp", + "name": "icmp", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "port_range": null, + "shared": false, + "id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "description": "" + }, + { + "direction": "bi", + "protocol": "tcp", + "name": "tcp-22-classifier", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "port_range": "22", + "shared": false, + "id": "48c702a8-80e0-4781-a8d5-80ae7de53cdc", + "description": "" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_rule.json b/core-test/src/main/resources/network/gbp/policy_rule.json index 52c36209c..0460ab715 100644 --- a/core-test/src/main/resources/network/gbp/policy_rule.json +++ b/core-test/src/main/resources/network/gbp/policy_rule.json @@ -1,14 +1,14 @@ { - "policy_rule":{ - "description":"", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":true, - "shared":false, - "id":"059909d1-7f20-40cf-a78a-27c340a5aaac", - "name":"icmp-rule" - } + "policy_rule": { + "description": "", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": true, + "shared": false, + "id": "059909d1-7f20-40cf-a78a-27c340a5aaac", + "name": "icmp-rule" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_rule_set.json b/core-test/src/main/resources/network/gbp/policy_rule_set.json index a6ab52515..0f898921d 100644 --- a/core-test/src/main/resources/network/gbp/policy_rule_set.json +++ b/core-test/src/main/resources/network/gbp/policy_rule_set.json @@ -1,20 +1,19 @@ { - "policy_rule_set":{ - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "e3c53e40-2035-47e1-9fef-90e7f4178207" - ], - "parent_id":null, - "shared":false, - "id":"1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - } + "policy_rule_set": { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "e3c53e40-2035-47e1-9fef-90e7f4178207" + ], + "parent_id": null, + "shared": false, + "id": "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_rule_set_update.json b/core-test/src/main/resources/network/gbp/policy_rule_set_update.json index ba8e526f6..19c69ca7f 100644 --- a/core-test/src/main/resources/network/gbp/policy_rule_set_update.json +++ b/core-test/src/main/resources/network/gbp/policy_rule_set_update.json @@ -1,20 +1,19 @@ { - "policy_rule_set":{ - "description":"test-rule-set-desc-update", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "e3c53e40-2035-47e1-9fef-90e7f4178207" - ], - "parent_id":null, - "shared":false, - "id":"1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set-update" - } + "policy_rule_set": { + "description": "test-rule-set-desc-update", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "e3c53e40-2035-47e1-9fef-90e7f4178207" + ], + "parent_id": null, + "shared": false, + "id": "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set-update" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_rule_sets.json b/core-test/src/main/resources/network/gbp/policy_rule_sets.json index 2e26f509e..220c4dea1 100644 --- a/core-test/src/main/resources/network/gbp/policy_rule_sets.json +++ b/core-test/src/main/resources/network/gbp/policy_rule_sets.json @@ -1,188 +1,178 @@ { - "policy_rule_sets":[ - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "e3c53e40-2035-47e1-9fef-90e7f4178207" - ], - "parent_id":null, - "shared":false, - "id":"1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - }, - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "090e386e-d666-4970-b7ae-96c3dc1de201", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "5e36495c-e120-41b9-91b5-e416b3679e80", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "cafef68e-a7c0-4c86-8a2f-1ade01388b61", - "e3c53e40-2035-47e1-9fef-90e7f4178207", - "ebf19fd2-73c0-43fa-9276-9690d5bc7467" - ], - "parent_id":null, - "shared":false, - "id":"3d8a2e5b-e5c8-4f53-b1e3-75602398397d", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - }, - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06" - ], - "parent_id":null, - "shared":false, - "id":"408a5153-efc5-4bea-a3ef-2c838e330254", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - }, - { - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2" - ], - "parent_id":null, - "shared":false, - "id":"590f005f-de21-4466-905f-457487cc9a60", - "child_policy_rule_sets":[ - - ], - "name":"tcp-22" - }, - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "090e386e-d666-4970-b7ae-96c3dc1de201", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "5e36495c-e120-41b9-91b5-e416b3679e80", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "9ddb8b9c-f630-4e0b-821f-26ad4b43762b", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "cafef68e-a7c0-4c86-8a2f-1ade01388b61", - "e3c53e40-2035-47e1-9fef-90e7f4178207", - "ebf19fd2-73c0-43fa-9276-9690d5bc7467" - ], - "parent_id":null, - "shared":false, - "id":"b2ab358d-93fb-4ffc-bbb7-b6c582042520", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - }, - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "090e386e-d666-4970-b7ae-96c3dc1de201", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "cafef68e-a7c0-4c86-8a2f-1ade01388b61", - "e3c53e40-2035-47e1-9fef-90e7f4178207" - ], - "parent_id":null, - "shared":false, - "id":"b8a116d4-d674-438c-9fc6-973f2d6f5019", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - }, - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "e3c53e40-2035-47e1-9fef-90e7f4178207" - ], - "parent_id":null, - "shared":false, - "id":"c3207474-19ee-4241-81e5-9e20995f2065", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - }, - { - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac" - ], - "parent_id":null, - "shared":false, - "id":"de829eb3-4867-442f-bac7-c59906c610b0", - "child_policy_rule_sets":[ - - ], - "name":"icmp-allow" - }, - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "090e386e-d666-4970-b7ae-96c3dc1de201", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "cafef68e-a7c0-4c86-8a2f-1ade01388b61", - "e3c53e40-2035-47e1-9fef-90e7f4178207", - "ebf19fd2-73c0-43fa-9276-9690d5bc7467" - ], - "parent_id":null, - "shared":false, - "id":"ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - }, - { - "description":"test-rule-set-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_rules":[ - "059909d1-7f20-40cf-a78a-27c340a5aaac", - "090e386e-d666-4970-b7ae-96c3dc1de201", - "1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "e3c53e40-2035-47e1-9fef-90e7f4178207" - ], - "parent_id":null, - "shared":false, - "id":"f19a90af-0103-429d-8118-3920bf2f27db", - "child_policy_rule_sets":[ - - ], - "name":"test-rule-set" - } - ] + "policy_rule_sets": [ + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "e3c53e40-2035-47e1-9fef-90e7f4178207" + ], + "parent_id": null, + "shared": false, + "id": "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + }, + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "090e386e-d666-4970-b7ae-96c3dc1de201", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "5e36495c-e120-41b9-91b5-e416b3679e80", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "cafef68e-a7c0-4c86-8a2f-1ade01388b61", + "e3c53e40-2035-47e1-9fef-90e7f4178207", + "ebf19fd2-73c0-43fa-9276-9690d5bc7467" + ], + "parent_id": null, + "shared": false, + "id": "3d8a2e5b-e5c8-4f53-b1e3-75602398397d", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + }, + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06" + ], + "parent_id": null, + "shared": false, + "id": "408a5153-efc5-4bea-a3ef-2c838e330254", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + }, + { + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2" + ], + "parent_id": null, + "shared": false, + "id": "590f005f-de21-4466-905f-457487cc9a60", + "child_policy_rule_sets": [ + ], + "name": "tcp-22" + }, + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "090e386e-d666-4970-b7ae-96c3dc1de201", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "5e36495c-e120-41b9-91b5-e416b3679e80", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "9ddb8b9c-f630-4e0b-821f-26ad4b43762b", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "cafef68e-a7c0-4c86-8a2f-1ade01388b61", + "e3c53e40-2035-47e1-9fef-90e7f4178207", + "ebf19fd2-73c0-43fa-9276-9690d5bc7467" + ], + "parent_id": null, + "shared": false, + "id": "b2ab358d-93fb-4ffc-bbb7-b6c582042520", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + }, + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "090e386e-d666-4970-b7ae-96c3dc1de201", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "cafef68e-a7c0-4c86-8a2f-1ade01388b61", + "e3c53e40-2035-47e1-9fef-90e7f4178207" + ], + "parent_id": null, + "shared": false, + "id": "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + }, + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "e3c53e40-2035-47e1-9fef-90e7f4178207" + ], + "parent_id": null, + "shared": false, + "id": "c3207474-19ee-4241-81e5-9e20995f2065", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + }, + { + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac" + ], + "parent_id": null, + "shared": false, + "id": "de829eb3-4867-442f-bac7-c59906c610b0", + "child_policy_rule_sets": [ + ], + "name": "icmp-allow" + }, + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "090e386e-d666-4970-b7ae-96c3dc1de201", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "cafef68e-a7c0-4c86-8a2f-1ade01388b61", + "e3c53e40-2035-47e1-9fef-90e7f4178207", + "ebf19fd2-73c0-43fa-9276-9690d5bc7467" + ], + "parent_id": null, + "shared": false, + "id": "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + }, + { + "description": "test-rule-set-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_rules": [ + "059909d1-7f20-40cf-a78a-27c340a5aaac", + "090e386e-d666-4970-b7ae-96c3dc1de201", + "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "e3c53e40-2035-47e1-9fef-90e7f4178207" + ], + "parent_id": null, + "shared": false, + "id": "f19a90af-0103-429d-8118-3920bf2f27db", + "child_policy_rule_sets": [ + ], + "name": "test-rule-set" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_rule_update.json b/core-test/src/main/resources/network/gbp/policy_rule_update.json index 9e1364a2d..304488bc2 100644 --- a/core-test/src/main/resources/network/gbp/policy_rule_update.json +++ b/core-test/src/main/resources/network/gbp/policy_rule_update.json @@ -1,14 +1,14 @@ { - "policy_rule":{ - "description":"icmp-rule-desc-update", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":true, - "shared":false, - "id":"059909d1-7f20-40cf-a78a-27c340a5aaac", - "name":"icmp-rule-update" - } + "policy_rule": { + "description": "icmp-rule-desc-update", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": true, + "shared": false, + "id": "059909d1-7f20-40cf-a78a-27c340a5aaac", + "name": "icmp-rule-update" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_rules.json b/core-test/src/main/resources/network/gbp/policy_rules.json index 3271f456f..f34f91c4f 100644 --- a/core-test/src/main/resources/network/gbp/policy_rules.json +++ b/core-test/src/main/resources/network/gbp/policy_rules.json @@ -1,124 +1,124 @@ { - "policy_rules":[ - { - "description":"", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":true, - "shared":false, - "id":"059909d1-7f20-40cf-a78a-27c340a5aaac", - "name":"icmp-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"090e386e-d666-4970-b7ae-96c3dc1de201", - "name":"test-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"1fc1a2fc-4701-49dc-95b1-01aac2101eee", - "name":"test-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"5e36495c-e120-41b9-91b5-e416b3679e80", - "name":"test-rule" - }, - { - "description":"", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"48c702a8-80e0-4781-a8d5-80ae7de53cdc", - "enabled":true, - "shared":false, - "id":"8f993007-1f2a-4ae1-9882-2fddec5f3bd2", - "name":"tcp-22-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"9ddb8b9c-f630-4e0b-821f-26ad4b43762b", - "name":"test-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", - "name":"test-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"cafef68e-a7c0-4c86-8a2f-1ade01388b61", - "name":"test-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"e3c53e40-2035-47e1-9fef-90e7f4178207", - "name":"test-rule" - }, - { - "description":"test-rule-desc", - "policy_actions":[ - "b25bbad7-224b-4810-ae1c-7d10fb4468b5" - ], - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_classifier_id":"36e41adb-0b9b-4a11-abd5-66e5386139d4", - "enabled":false, - "shared":false, - "id":"ebf19fd2-73c0-43fa-9276-9690d5bc7467", - "name":"test-rule" - } - ] + "policy_rules": [ + { + "description": "", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": true, + "shared": false, + "id": "059909d1-7f20-40cf-a78a-27c340a5aaac", + "name": "icmp-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "090e386e-d666-4970-b7ae-96c3dc1de201", + "name": "test-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "1fc1a2fc-4701-49dc-95b1-01aac2101eee", + "name": "test-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "5e36495c-e120-41b9-91b5-e416b3679e80", + "name": "test-rule" + }, + { + "description": "", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "48c702a8-80e0-4781-a8d5-80ae7de53cdc", + "enabled": true, + "shared": false, + "id": "8f993007-1f2a-4ae1-9882-2fddec5f3bd2", + "name": "tcp-22-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "9ddb8b9c-f630-4e0b-821f-26ad4b43762b", + "name": "test-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "ab3e99cc-ffb4-48c4-9111-c4c4721c9d06", + "name": "test-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "cafef68e-a7c0-4c86-8a2f-1ade01388b61", + "name": "test-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "e3c53e40-2035-47e1-9fef-90e7f4178207", + "name": "test-rule" + }, + { + "description": "test-rule-desc", + "policy_actions": [ + "b25bbad7-224b-4810-ae1c-7d10fb4468b5" + ], + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_classifier_id": "36e41adb-0b9b-4a11-abd5-66e5386139d4", + "enabled": false, + "shared": false, + "id": "ebf19fd2-73c0-43fa-9276-9690d5bc7467", + "name": "test-rule" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_target.json b/core-test/src/main/resources/network/gbp/policy_target.json index bdf596ad0..5d76fd559 100644 --- a/core-test/src/main/resources/network/gbp/policy_target.json +++ b/core-test/src/main/resources/network/gbp/policy_target.json @@ -1,11 +1,11 @@ { - "policy_target":{ - "description":"test-policytarget-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "cluster_id":"", - "port_id":"36af8850-3514-4343-8293-9f9faae980d6", - "id":"0d65eebe-4efe-456e-aec3-7856e4e839b4", - "name":"test-policytarget" - } + "policy_target": { + "description": "test-policytarget-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "cluster_id": "", + "port_id": "36af8850-3514-4343-8293-9f9faae980d6", + "id": "0d65eebe-4efe-456e-aec3-7856e4e839b4", + "name": "test-policytarget" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_target_group.json b/core-test/src/main/resources/network/gbp/policy_target_group.json index ec1778255..3045d781a 100644 --- a/core-test/src/main/resources/network/gbp/policy_target_group.json +++ b/core-test/src/main/resources/network/gbp/policy_target_group.json @@ -1,38 +1,37 @@ { - "policy_target_group":{ - "subnets":[ - "a9eb39d9-9dd4-4ad5-be9d-b96456d64078" - ], - "description":"test-policy-target-group-desc", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "c3207474-19ee-4241-81e5-9e20995f2065", - "f19a90af-0103-429d-8118-3920bf2f27db", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "l2_policy_id":"a8aea144-92d8-4830-ae9f-41af291adb42", - "id":"61073812-3994-40c2-96f0-6bff03804e47", - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "c3207474-19ee-4241-81e5-9e20995f2065", - "f19a90af-0103-429d-8118-3920bf2f27db", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "name":"test-policy-target-group", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - - ], - "shared":false - } + "policy_target_group": { + "subnets": [ + "a9eb39d9-9dd4-4ad5-be9d-b96456d64078" + ], + "description": "test-policy-target-group-desc", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "c3207474-19ee-4241-81e5-9e20995f2065", + "f19a90af-0103-429d-8118-3920bf2f27db", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "l2_policy_id": "a8aea144-92d8-4830-ae9f-41af291adb42", + "id": "61073812-3994-40c2-96f0-6bff03804e47", + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "c3207474-19ee-4241-81e5-9e20995f2065", + "f19a90af-0103-429d-8118-3920bf2f27db", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "name": "test-policy-target-group", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + ], + "shared": false + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_target_group_update.json b/core-test/src/main/resources/network/gbp/policy_target_group_update.json index 63a9ae552..359db9abf 100644 --- a/core-test/src/main/resources/network/gbp/policy_target_group_update.json +++ b/core-test/src/main/resources/network/gbp/policy_target_group_update.json @@ -1,38 +1,37 @@ { - "policy_target_group":{ - "subnets":[ - "a9eb39d9-9dd4-4ad5-be9d-b96456d64078" - ], - "description":"test-policy-target-group-desc-update", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "c3207474-19ee-4241-81e5-9e20995f2065", - "f19a90af-0103-429d-8118-3920bf2f27db", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "l2_policy_id":"a8aea144-92d8-4830-ae9f-41af291adb42", - "id":"61073812-3994-40c2-96f0-6bff03804e47", - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "c3207474-19ee-4241-81e5-9e20995f2065", - "f19a90af-0103-429d-8118-3920bf2f27db", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "name":"test-policy-target-group-update", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - - ], - "shared":false - } + "policy_target_group": { + "subnets": [ + "a9eb39d9-9dd4-4ad5-be9d-b96456d64078" + ], + "description": "test-policy-target-group-desc-update", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "c3207474-19ee-4241-81e5-9e20995f2065", + "f19a90af-0103-429d-8118-3920bf2f27db", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "l2_policy_id": "a8aea144-92d8-4830-ae9f-41af291adb42", + "id": "61073812-3994-40c2-96f0-6bff03804e47", + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "c3207474-19ee-4241-81e5-9e20995f2065", + "f19a90af-0103-429d-8118-3920bf2f27db", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "name": "test-policy-target-group-update", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + ], + "shared": false + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_target_groups.json b/core-test/src/main/resources/network/gbp/policy_target_groups.json index c11459380..02783b906 100644 --- a/core-test/src/main/resources/network/gbp/policy_target_groups.json +++ b/core-test/src/main/resources/network/gbp/policy_target_groups.json @@ -1,240 +1,231 @@ { - "policy_target_groups":[ - { - "subnets":[ - "21d17ece-2d2a-4a48-b274-5889db2dc6cf" - ], - "description":"test-policy-target-group-desc", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "l2_policy_id":"08c1c093-6337-4383-938e-2d9c6cac531a", - "id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "consumed_policy_rule_sets":[ - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "name":"test-policy-target-group", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - "53067983-9d3e-4109-97a6-e70cd656aedc", - "d448d8e8-0297-4d91-8fad-bb53d12cd999" - ], - "shared":false - }, - { - "subnets":[ - "c3fe0204-182f-4758-8ff7-79e5e859f17e" - ], - "description":"", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - - ], - "l2_policy_id":"65fc10d2-f173-48db-ad50-72f29790c4d1", - "id":"2b2a44de-0992-4cf8-bbd6-b2e4c565e16d", - "consumed_policy_rule_sets":[ - - ], - "name":"test", - "service_management":false, - "tenant_id":"abc0b828ace347049b0835f4a4d10040", - "policy_targets":[ - - ], - "shared":false - }, - { - "subnets":[ - "c6b667bf-f9cb-4f12-ae75-c9e76f9d491d" - ], - "description":"test-policy-target-group-desc", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0", - "f19a90af-0103-429d-8118-3920bf2f27db" - ], - "l2_policy_id":"9fe34254-28fd-4db2-bba6-f8c35c51617e", - "id":"3ecf2178-25bb-4611-8a10-0dc074e90295", - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0", - "f19a90af-0103-429d-8118-3920bf2f27db" - ], - "name":"test-policy-target-group", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - - ], - "shared":false - }, - { - "subnets":[ - "a9eb39d9-9dd4-4ad5-be9d-b96456d64078" - ], - "description":"test-policy-target-group-desc", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "f19a90af-0103-429d-8118-3920bf2f27db" - ], - "l2_policy_id":"a8aea144-92d8-4830-ae9f-41af291adb42", - "id":"61073812-3994-40c2-96f0-6bff03804e47", - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "b8a116d4-d674-438c-9fc6-973f2d6f5019", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0", - "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", - "f19a90af-0103-429d-8118-3920bf2f27db" - ], - "name":"test-policy-target-group", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - - ], - "shared":false - }, - { - "subnets":[ - "e3111e17-8b29-46af-9385-41b1fb65b7ac" - ], - "description":"test-policy-target-group-desc", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "l2_policy_id":"d02b17ad-ef26-4a04-9071-82a5cfa100a6", - "id":"793c0497-39e8-4c76-a751-1d115d7a3b21", - "consumed_policy_rule_sets":[ - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "name":"test-policy-target-group", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - - ], - "shared":false - }, - { - "subnets":[ - "9aadf5e8-5353-4681-87b2-0852fe5ce535" - ], - "description":"", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "590f005f-de21-4466-905f-457487cc9a60", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "l2_policy_id":"c1cc9bd8-49a5-4699-aa26-b276ced4cc67", - "id":"a72f99fa-68d1-494a-bc63-8b9e9b526f76", - "consumed_policy_rule_sets":[ - - ], - "name":"sha1-test", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - "7f518810-fa72-4b3d-8e28-c98970c868d5", - "8b3eb48f-1f12-43fb-806d-36890935dcdd", - "96e32649-1c39-4083-aeec-05d87c02a95a", - "b129c48a-94e1-4894-af44-1b46acb7a405", - "e29bb234-ee3c-4dc4-8b55-eae90da9d11a" - ], - "shared":false - }, - { - "subnets":[ - "cdeefff4-2b54-4ed4-bd83-fd73c6f63691" - ], - "description":"test-policy-target-group-desc", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "l2_policy_id":"7eea106a-714d-41aa-ac69-de4c3f2e4b44", - "id":"aab0872f-890f-46b1-b461-86877039c23e", - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0" - ], - "name":"test-policy-target-group", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - - ], - "shared":false - }, - { - "subnets":[ - "af933a15-dafc-4ad5-aa1e-6ad84df85d30" - ], - "description":"test-policy-target-group-desc", - "network_service_policy_id":null, - "provided_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0", - "f19a90af-0103-429d-8118-3920bf2f27db" - ], - "l2_policy_id":"7dc44fbd-bc2b-4aa3-808c-0498183f5e21", - "id":"ab19a691-24e1-44e8-bc74-38b233305f52", - "consumed_policy_rule_sets":[ - "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", - "408a5153-efc5-4bea-a3ef-2c838e330254", - "590f005f-de21-4466-905f-457487cc9a60", - "c3207474-19ee-4241-81e5-9e20995f2065", - "de829eb3-4867-442f-bac7-c59906c610b0", - "f19a90af-0103-429d-8118-3920bf2f27db" - ], - "name":"test-policy-target-group", - "service_management":false, - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_targets":[ - - ], - "shared":false - } - ] + "policy_target_groups": [ + { + "subnets": [ + "21d17ece-2d2a-4a48-b274-5889db2dc6cf" + ], + "description": "test-policy-target-group-desc", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "l2_policy_id": "08c1c093-6337-4383-938e-2d9c6cac531a", + "id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "consumed_policy_rule_sets": [ + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "name": "test-policy-target-group", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + "53067983-9d3e-4109-97a6-e70cd656aedc", + "d448d8e8-0297-4d91-8fad-bb53d12cd999" + ], + "shared": false + }, + { + "subnets": [ + "c3fe0204-182f-4758-8ff7-79e5e859f17e" + ], + "description": "", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + ], + "l2_policy_id": "65fc10d2-f173-48db-ad50-72f29790c4d1", + "id": "2b2a44de-0992-4cf8-bbd6-b2e4c565e16d", + "consumed_policy_rule_sets": [ + ], + "name": "test", + "service_management": false, + "tenant_id": "abc0b828ace347049b0835f4a4d10040", + "policy_targets": [ + ], + "shared": false + }, + { + "subnets": [ + "c6b667bf-f9cb-4f12-ae75-c9e76f9d491d" + ], + "description": "test-policy-target-group-desc", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0", + "f19a90af-0103-429d-8118-3920bf2f27db" + ], + "l2_policy_id": "9fe34254-28fd-4db2-bba6-f8c35c51617e", + "id": "3ecf2178-25bb-4611-8a10-0dc074e90295", + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0", + "f19a90af-0103-429d-8118-3920bf2f27db" + ], + "name": "test-policy-target-group", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + ], + "shared": false + }, + { + "subnets": [ + "a9eb39d9-9dd4-4ad5-be9d-b96456d64078" + ], + "description": "test-policy-target-group-desc", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "f19a90af-0103-429d-8118-3920bf2f27db" + ], + "l2_policy_id": "a8aea144-92d8-4830-ae9f-41af291adb42", + "id": "61073812-3994-40c2-96f0-6bff03804e47", + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "b8a116d4-d674-438c-9fc6-973f2d6f5019", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0", + "ec0b5a7d-f963-45de-b4e4-864d59dc8c0b", + "f19a90af-0103-429d-8118-3920bf2f27db" + ], + "name": "test-policy-target-group", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + ], + "shared": false + }, + { + "subnets": [ + "e3111e17-8b29-46af-9385-41b1fb65b7ac" + ], + "description": "test-policy-target-group-desc", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "l2_policy_id": "d02b17ad-ef26-4a04-9071-82a5cfa100a6", + "id": "793c0497-39e8-4c76-a751-1d115d7a3b21", + "consumed_policy_rule_sets": [ + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "name": "test-policy-target-group", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + ], + "shared": false + }, + { + "subnets": [ + "9aadf5e8-5353-4681-87b2-0852fe5ce535" + ], + "description": "", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "590f005f-de21-4466-905f-457487cc9a60", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "l2_policy_id": "c1cc9bd8-49a5-4699-aa26-b276ced4cc67", + "id": "a72f99fa-68d1-494a-bc63-8b9e9b526f76", + "consumed_policy_rule_sets": [ + ], + "name": "sha1-test", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + "7f518810-fa72-4b3d-8e28-c98970c868d5", + "8b3eb48f-1f12-43fb-806d-36890935dcdd", + "96e32649-1c39-4083-aeec-05d87c02a95a", + "b129c48a-94e1-4894-af44-1b46acb7a405", + "e29bb234-ee3c-4dc4-8b55-eae90da9d11a" + ], + "shared": false + }, + { + "subnets": [ + "cdeefff4-2b54-4ed4-bd83-fd73c6f63691" + ], + "description": "test-policy-target-group-desc", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "l2_policy_id": "7eea106a-714d-41aa-ac69-de4c3f2e4b44", + "id": "aab0872f-890f-46b1-b461-86877039c23e", + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0" + ], + "name": "test-policy-target-group", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + ], + "shared": false + }, + { + "subnets": [ + "af933a15-dafc-4ad5-aa1e-6ad84df85d30" + ], + "description": "test-policy-target-group-desc", + "network_service_policy_id": null, + "provided_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0", + "f19a90af-0103-429d-8118-3920bf2f27db" + ], + "l2_policy_id": "7dc44fbd-bc2b-4aa3-808c-0498183f5e21", + "id": "ab19a691-24e1-44e8-bc74-38b233305f52", + "consumed_policy_rule_sets": [ + "1bbc10a8-aeb2-4e53-ab31-a1fed18763f4", + "408a5153-efc5-4bea-a3ef-2c838e330254", + "590f005f-de21-4466-905f-457487cc9a60", + "c3207474-19ee-4241-81e5-9e20995f2065", + "de829eb3-4867-442f-bac7-c59906c610b0", + "f19a90af-0103-429d-8118-3920bf2f27db" + ], + "name": "test-policy-target-group", + "service_management": false, + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_targets": [ + ], + "shared": false + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_target_update.json b/core-test/src/main/resources/network/gbp/policy_target_update.json index 1f1e5831f..176a6495b 100644 --- a/core-test/src/main/resources/network/gbp/policy_target_update.json +++ b/core-test/src/main/resources/network/gbp/policy_target_update.json @@ -1,11 +1,11 @@ { - "policy_target":{ - "description":"test-policytarget-desc-update", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "cluster_id":"", - "port_id":"36af8850-3514-4343-8293-9f9faae980d6", - "id":"0d65eebe-4efe-456e-aec3-7856e4e839b4", - "name":"test-policytarget-update" - } + "policy_target": { + "description": "test-policytarget-desc-update", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "cluster_id": "", + "port_id": "36af8850-3514-4343-8293-9f9faae980d6", + "id": "0d65eebe-4efe-456e-aec3-7856e4e839b4", + "name": "test-policytarget-update" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/gbp/policy_targets.json b/core-test/src/main/resources/network/gbp/policy_targets.json index e04878a51..9b259c676 100644 --- a/core-test/src/main/resources/network/gbp/policy_targets.json +++ b/core-test/src/main/resources/network/gbp/policy_targets.json @@ -1,94 +1,94 @@ { - "policy_targets":[ - { - "description":"test-policytarget-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "cluster_id":"", - "port_id":"36af8850-3514-4343-8293-9f9faae980d6", - "id":"0d65eebe-4efe-456e-aec3-7856e4e839b4", - "name":"test-policytarget" - }, - { - "description":"test-policytarget-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "cluster_id":"", - "port_id":"fa9fac04-5d25-4a20-8175-04a6f791ea99", - "id":"4a61a578-27e6-4198-b9e7-f98ef3e485fa", - "name":"test-policytarget" - }, - { - "description":"test-policytarget-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "cluster_id":"", - "port_id":"0e957061-8434-454d-96da-b0979ec5cd24", - "id":"53067983-9d3e-4109-97a6-e70cd656aedc", - "name":"test-policytarget" - }, - { - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"a72f99fa-68d1-494a-bc63-8b9e9b526f76", - "cluster_id":"", - "port_id":"0c6efb28-f381-454d-bd95-34e3bcd9223e", - "id":"7f518810-fa72-4b3d-8e28-c98970c868d5", - "name":"sha1-test-5_gbpui" - }, - { - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"a72f99fa-68d1-494a-bc63-8b9e9b526f76", - "cluster_id":"", - "port_id":"83ec2dd8-7509-40ed-a3b3-b2999b80cefc", - "id":"8b3eb48f-1f12-43fb-806d-36890935dcdd", - "name":"test-sha1-3_gbpui" - }, - { - "description":"test-policytarget-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "cluster_id":"", - "port_id":"7bc1fb71-3512-4e8b-84db-40ca553bc14c", - "id":"93dc0ff9-ef62-4be1-9723-1902a816df49", - "name":"test-policytarget" - }, - { - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"a72f99fa-68d1-494a-bc63-8b9e9b526f76", - "cluster_id":"", - "port_id":"d05221a2-d1a8-450d-bc1f-d1b3eb349cca", - "id":"96e32649-1c39-4083-aeec-05d87c02a95a", - "name":"test-sha1-2_gbpui" - }, - { - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"a72f99fa-68d1-494a-bc63-8b9e9b526f76", - "cluster_id":"", - "port_id":"886de83e-dcaa-4a98-a206-7acecd8ded50", - "id":"b129c48a-94e1-4894-af44-1b46acb7a405", - "name":"test-sha1-1_gbpui" - }, - { - "description":"test-policytarget-desc", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"1fb00129-06cf-48e5-8282-d15dbf4be60b", - "cluster_id":"", - "port_id":"87f9f3b8-e8f2-427b-a2ef-2312931d0a35", - "id":"d448d8e8-0297-4d91-8fad-bb53d12cd999", - "name":"test-policytarget" - }, - { - "description":"", - "tenant_id":"8be60cc30edc44978d24d51ce5f8d9da", - "policy_target_group_id":"a72f99fa-68d1-494a-bc63-8b9e9b526f76", - "cluster_id":"", - "port_id":"bbdf8e39-088a-4cc6-8d17-e64ab2a469c0", - "id":"e29bb234-ee3c-4dc4-8b55-eae90da9d11a", - "name":"sha1-test-4_gbpui" - } - ] + "policy_targets": [ + { + "description": "test-policytarget-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "cluster_id": "", + "port_id": "36af8850-3514-4343-8293-9f9faae980d6", + "id": "0d65eebe-4efe-456e-aec3-7856e4e839b4", + "name": "test-policytarget" + }, + { + "description": "test-policytarget-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "cluster_id": "", + "port_id": "fa9fac04-5d25-4a20-8175-04a6f791ea99", + "id": "4a61a578-27e6-4198-b9e7-f98ef3e485fa", + "name": "test-policytarget" + }, + { + "description": "test-policytarget-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "cluster_id": "", + "port_id": "0e957061-8434-454d-96da-b0979ec5cd24", + "id": "53067983-9d3e-4109-97a6-e70cd656aedc", + "name": "test-policytarget" + }, + { + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "a72f99fa-68d1-494a-bc63-8b9e9b526f76", + "cluster_id": "", + "port_id": "0c6efb28-f381-454d-bd95-34e3bcd9223e", + "id": "7f518810-fa72-4b3d-8e28-c98970c868d5", + "name": "sha1-test-5_gbpui" + }, + { + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "a72f99fa-68d1-494a-bc63-8b9e9b526f76", + "cluster_id": "", + "port_id": "83ec2dd8-7509-40ed-a3b3-b2999b80cefc", + "id": "8b3eb48f-1f12-43fb-806d-36890935dcdd", + "name": "test-sha1-3_gbpui" + }, + { + "description": "test-policytarget-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "cluster_id": "", + "port_id": "7bc1fb71-3512-4e8b-84db-40ca553bc14c", + "id": "93dc0ff9-ef62-4be1-9723-1902a816df49", + "name": "test-policytarget" + }, + { + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "a72f99fa-68d1-494a-bc63-8b9e9b526f76", + "cluster_id": "", + "port_id": "d05221a2-d1a8-450d-bc1f-d1b3eb349cca", + "id": "96e32649-1c39-4083-aeec-05d87c02a95a", + "name": "test-sha1-2_gbpui" + }, + { + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "a72f99fa-68d1-494a-bc63-8b9e9b526f76", + "cluster_id": "", + "port_id": "886de83e-dcaa-4a98-a206-7acecd8ded50", + "id": "b129c48a-94e1-4894-af44-1b46acb7a405", + "name": "test-sha1-1_gbpui" + }, + { + "description": "test-policytarget-desc", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "1fb00129-06cf-48e5-8282-d15dbf4be60b", + "cluster_id": "", + "port_id": "87f9f3b8-e8f2-427b-a2ef-2312931d0a35", + "id": "d448d8e8-0297-4d91-8fad-bb53d12cd999", + "name": "test-policytarget" + }, + { + "description": "", + "tenant_id": "8be60cc30edc44978d24d51ce5f8d9da", + "policy_target_group_id": "a72f99fa-68d1-494a-bc63-8b9e9b526f76", + "cluster_id": "", + "port_id": "bbdf8e39-088a-4cc6-8d17-e64ab2a469c0", + "id": "e29bb234-ee3c-4dc4-8b55-eae90da9d11a", + "name": "sha1-test-4_gbpui" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/lbpool.json b/core-test/src/main/resources/network/lbpool.json index 972e3892d..4c06d7644 100644 --- a/core-test/src/main/resources/network/lbpool.json +++ b/core-test/src/main/resources/network/lbpool.json @@ -1,19 +1,19 @@ { - "pool": { - "admin_state_up": true, - "description": "simple pool", - "healthmonitor_id": null, - "id": "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5", - "lb_method": "ROUND_ROBIN", - "listeners": [ - { - "id": "35cb8516-1173-4035-8dae-0dae3453f37f" - } - ], - "members": [], - "name": "pool1", - "protocol": "HTTP", - "subnet_id":"7d1dab60-cf8a-4f75-af5c-44aab98b0c42", - "tenant_id":"d7fd03242ffa4933863bc528ed884fb6" - } + "pool": { + "admin_state_up": true, + "description": "simple pool", + "healthmonitor_id": null, + "id": "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5", + "lb_method": "ROUND_ROBIN", + "listeners": [ + { + "id": "35cb8516-1173-4035-8dae-0dae3453f37f" + } + ], + "members": [], + "name": "pool1", + "protocol": "HTTP", + "subnet_id": "7d1dab60-cf8a-4f75-af5c-44aab98b0c42", + "tenant_id": "d7fd03242ffa4933863bc528ed884fb6" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/lbpool_update.json b/core-test/src/main/resources/network/lbpool_update.json index 3b8005c15..24b3cdddf 100644 --- a/core-test/src/main/resources/network/lbpool_update.json +++ b/core-test/src/main/resources/network/lbpool_update.json @@ -1,19 +1,19 @@ { - "pool": { - "admin_state_up": false, - "description": "update", - "healthmonitor_id": null, - "id": "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5", - "lb_method": "LEAST_CONNECTIONS", - "listeners": [ - { - "id": "35cb8516-1173-4035-8dae-0dae3453f37f" - } - ], - "members": [], - "name": "update", - "protocol": "HTTP", - "subnet_id":"7d1dab60-cf8a-4f75-af5c-44aab98b0c42", - "tenant_id":"d7fd03242ffa4933863bc528ed884fb6" - } + "pool": { + "admin_state_up": false, + "description": "update", + "healthmonitor_id": null, + "id": "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5", + "lb_method": "LEAST_CONNECTIONS", + "listeners": [ + { + "id": "35cb8516-1173-4035-8dae-0dae3453f37f" + } + ], + "members": [], + "name": "update", + "protocol": "HTTP", + "subnet_id": "7d1dab60-cf8a-4f75-af5c-44aab98b0c42", + "tenant_id": "d7fd03242ffa4933863bc528ed884fb6" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/lbpools.json b/core-test/src/main/resources/network/lbpools.json index 41bb48a7e..67c0e39b0 100644 --- a/core-test/src/main/resources/network/lbpools.json +++ b/core-test/src/main/resources/network/lbpools.json @@ -1,24 +1,24 @@ { - "pools":[ - { - "status":"ACTIVE", - "lb_method":"ROUND_ROBIN", - "protocol":"HTTP", - "description":"", - "health_monitors":[ - "466c8345-28d8-4f84-a246-e04380b0461d", - "5d4b5228-33b0-4e60-b225-9b727c1a20e7" - ], - "subnet_id":"8032909d-47a1-4715-90af-5153ffe39861", - "tenant_id":"83657cfcdfe44cd5920adaf26c48ceea", - "admin_state_up":true, - "name":"app_pool", - "members":[ - "701b531b-111a-4f21-ad85-4795b7b12af6", - "beb53b4d-230b-4abd-8118-575b8fa006ef" - ], - "id":"72741b06-df4d-4715-b142-276b6bce75ab", - "vip_id":"4ec89087-d057-4e2c-911f-60a3b47ee304" - } - ] + "pools": [ + { + "status": "ACTIVE", + "lb_method": "ROUND_ROBIN", + "protocol": "HTTP", + "description": "", + "health_monitors": [ + "466c8345-28d8-4f84-a246-e04380b0461d", + "5d4b5228-33b0-4e60-b225-9b727c1a20e7" + ], + "subnet_id": "8032909d-47a1-4715-90af-5153ffe39861", + "tenant_id": "83657cfcdfe44cd5920adaf26c48ceea", + "admin_state_up": true, + "name": "app_pool", + "members": [ + "701b531b-111a-4f21-ad85-4795b7b12af6", + "beb53b4d-230b-4abd-8118-575b8fa006ef" + ], + "id": "72741b06-df4d-4715-b142-276b6bce75ab", + "vip_id": "4ec89087-d057-4e2c-911f-60a3b47ee304" + } + ] } diff --git a/core-test/src/main/resources/network/lbpoolsv2.json b/core-test/src/main/resources/network/lbpoolsv2.json index 4d41ec572..634571235 100644 --- a/core-test/src/main/resources/network/lbpoolsv2.json +++ b/core-test/src/main/resources/network/lbpoolsv2.json @@ -14,7 +14,6 @@ } ], "members": [ - ], "id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", "name": "testlbpool" @@ -33,7 +32,6 @@ } ], "members": [ - ], "id": "ff2f9954-2481-4e11-93ee-72b77b6c5c98", "name": "pool1" diff --git a/core-test/src/main/resources/network/lbpoolv2.json b/core-test/src/main/resources/network/lbpoolv2.json index ea194fe2a..462521486 100644 --- a/core-test/src/main/resources/network/lbpoolv2.json +++ b/core-test/src/main/resources/network/lbpoolv2.json @@ -13,7 +13,6 @@ } ], "members": [ - ], "id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", "name": "testlbpool" diff --git a/core-test/src/main/resources/network/lbpoolv2_update.json b/core-test/src/main/resources/network/lbpoolv2_update.json index 514d0a788..6e6f524f7 100644 --- a/core-test/src/main/resources/network/lbpoolv2_update.json +++ b/core-test/src/main/resources/network/lbpoolv2_update.json @@ -13,7 +13,6 @@ } ], "members": [ - ], "id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", "name": "v2update" diff --git a/core-test/src/main/resources/network/listenersv2.json b/core-test/src/main/resources/network/listenersv2.json index 443dbab9b..58f1247c0 100644 --- a/core-test/src/main/resources/network/listenersv2.json +++ b/core-test/src/main/resources/network/listenersv2.json @@ -13,7 +13,6 @@ ], "tenant_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "sni_container_refs": [ - ], "connection_limit": -1, "default_pool_id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", @@ -33,7 +32,6 @@ ], "tenant_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "sni_container_refs": [ - ], "connection_limit": -1, "default_pool_id": "e0467102-6406-484d-8262-3922a2f2b36b", diff --git a/core-test/src/main/resources/network/loadbalancersv2.json b/core-test/src/main/resources/network/loadbalancersv2.json index 0844fcfdd..11fc1bd2e 100644 --- a/core-test/src/main/resources/network/loadbalancersv2.json +++ b/core-test/src/main/resources/network/loadbalancersv2.json @@ -6,7 +6,6 @@ "tenant_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "provisioning_status": "ACTIVE", "listeners": [ - ], "vip_address": "10.0.0.13", "vip_port_id": "82fbaa1c-a8af-47d3-94fe-a0ac1a33257b", diff --git a/core-test/src/main/resources/network/loadbalancerv2.json b/core-test/src/main/resources/network/loadbalancerv2.json index c230bf0b9..b808b4132 100644 --- a/core-test/src/main/resources/network/loadbalancerv2.json +++ b/core-test/src/main/resources/network/loadbalancerv2.json @@ -5,7 +5,6 @@ "tenant_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "provisioning_status": "ACTIVE", "listeners": [ - ], "vip_address": "10.0.0.13", "vip_port_id": "82fbaa1c-a8af-47d3-94fe-a0ac1a33257b", diff --git a/core-test/src/main/resources/network/loadbalancerv2_update.json b/core-test/src/main/resources/network/loadbalancerv2_update.json index 4b42fda9b..7c37e468e 100644 --- a/core-test/src/main/resources/network/loadbalancerv2_update.json +++ b/core-test/src/main/resources/network/loadbalancerv2_update.json @@ -5,7 +5,6 @@ "tenant_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "provisioning_status": "ACTIVE", "listeners": [ - ], "vip_address": "10.0.0.13", "vip_port_id": "82fbaa1c-a8af-47d3-94fe-a0ac1a33257b", diff --git a/core-test/src/main/resources/network/network-external.json b/core-test/src/main/resources/network/network-external.json index 60437dd0a..c1514986c 100644 --- a/core-test/src/main/resources/network/network-external.json +++ b/core-test/src/main/resources/network/network-external.json @@ -1,25 +1,25 @@ { - "network": { - "status": "ACTIVE", - "subnets": [], - "name": "net1", - "admin_state_up": true, - "tenant_id": "9bacb3c5d39d41a79512987f338cf177", - "segments": [ - { - "provider:segmentation_id": 2, - "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", - "provider:network_type": "vlan" - }, - { - "provider:segmentation_id": null, - "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", - "provider:network_type": "stt" - } - ], - "router:external": true, - "shared": false, - "port_security_enabled": true, - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c" - } + "network": { + "status": "ACTIVE", + "subnets": [], + "name": "net1", + "admin_state_up": true, + "tenant_id": "9bacb3c5d39d41a79512987f338cf177", + "segments": [ + { + "provider:segmentation_id": 2, + "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", + "provider:network_type": "vlan" + }, + { + "provider:segmentation_id": null, + "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", + "provider:network_type": "stt" + } + ], + "router:external": true, + "shared": false, + "port_security_enabled": true, + "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/network.json b/core-test/src/main/resources/network/network.json index 7b3c5cae8..edefd31d1 100644 --- a/core-test/src/main/resources/network/network.json +++ b/core-test/src/main/resources/network/network.json @@ -1,24 +1,24 @@ { - "network": { - "status": "ACTIVE", - "subnets": [], - "name": "net1", - "admin_state_up": true, - "tenant_id": "9bacb3c5d39d41a79512987f338cf177", - "segments": [ - { - "provider:segmentation_id": 2, - "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", - "provider:network_type": "vlan" - }, - { - "provider:segmentation_id": null, - "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", - "provider:network_type": "stt" - } - ], - "shared": false, - "port_security_enabled": true, - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c" - } + "network": { + "status": "ACTIVE", + "subnets": [], + "name": "net1", + "admin_state_up": true, + "tenant_id": "9bacb3c5d39d41a79512987f338cf177", + "segments": [ + { + "provider:segmentation_id": 2, + "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", + "provider:network_type": "vlan" + }, + { + "provider:segmentation_id": null, + "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453", + "provider:network_type": "stt" + } + ], + "shared": false, + "port_security_enabled": true, + "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/network_zone.json b/core-test/src/main/resources/network/network_zone.json index 97c922546..fa47665b3 100644 --- a/core-test/src/main/resources/network/network_zone.json +++ b/core-test/src/main/resources/network/network_zone.json @@ -1,22 +1,24 @@ { - "network": { - "admin_state_up": true, - "availability_zone_hints": ["nova"], - "availability_zones": [], - "created_at": "2016-03-08T20:19:41", - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", - "mtu": 0, - "name": "net1", - "port_security_enabled": true, - "project_id": "9bacb3c5d39d41a79512987f338cf177", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [], - "tenant_id": "9bacb3c5d39d41a79512987f338cf177", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } + "network": { + "admin_state_up": true, + "availability_zone_hints": [ + "nova" + ], + "availability_zones": [], + "created_at": "2016-03-08T20:19:41", + "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", + "mtu": 0, + "name": "net1", + "port_security_enabled": true, + "project_id": "9bacb3c5d39d41a79512987f338cf177", + "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", + "router:external": false, + "shared": false, + "status": "ACTIVE", + "subnets": [], + "tenant_id": "9bacb3c5d39d41a79512987f338cf177", + "updated_at": "2016-03-08T20:19:41", + "vlan_transparent": false, + "description": "" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/networks_filtered.json b/core-test/src/main/resources/network/networks_filtered.json index 8197c21f7..5527350f9 100644 --- a/core-test/src/main/resources/network/networks_filtered.json +++ b/core-test/src/main/resources/network/networks_filtered.json @@ -1,16 +1,20 @@ { - "networks": [{ - "status": "ACTIVE", - "subnets": ["0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9"], - "name": "netOK", - "provider:physical_network": null, - "admin_state_up": true, - "tenant_id": "9712d107d5f9445a9fc5b4108502e312", - "mtu": 0, - "router:external": true, - "shared": true, - "provider:network_type": "vxlan", - "id": "73f6f1ac-5e58-4801-88c3-7e12c6ddfb39", - "provider:segmentation_id": 101101 - }] + "networks": [ + { + "status": "ACTIVE", + "subnets": [ + "0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9" + ], + "name": "netOK", + "provider:physical_network": null, + "admin_state_up": true, + "tenant_id": "9712d107d5f9445a9fc5b4108502e312", + "mtu": 0, + "router:external": true, + "shared": true, + "provider:network_type": "vxlan", + "id": "73f6f1ac-5e58-4801-88c3-7e12c6ddfb39", + "provider:segmentation_id": 101101 + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/port_external.json b/core-test/src/main/resources/network/port_external.json index 21f732eb5..a110bf540 100644 --- a/core-test/src/main/resources/network/port_external.json +++ b/core-test/src/main/resources/network/port_external.json @@ -1,18 +1,18 @@ { - "port": { - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad", - "binding:profile": { - "local_link_information": [ - { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - } - ] - }, - "binding:vnic_type": "baremetal", - "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "device_owner": "baremetal:none" - } + "port": { + "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", + "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad", + "binding:profile": { + "local_link_information": [ + { + "port_id": "Ethernet3/1", + "switch_id": "0a:1b:2c:3d:4e:5f", + "switch_info": "switch1" + } + ] + }, + "binding:vnic_type": "baremetal", + "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", + "device_owner": "baremetal:none" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/ports_external.json b/core-test/src/main/resources/network/ports_external.json index 7b6f5915f..90ef43e3d 100644 --- a/core-test/src/main/resources/network/ports_external.json +++ b/core-test/src/main/resources/network/ports_external.json @@ -1,52 +1,52 @@ { - "ports": [ + "ports": [ + { + "admin_state_up": false, + "allowed_address_pairs": [], + "data_plane_status": null, + "description": "", + "device_id": "", + "device_owner": "", + "fixed_ips": [ { - "admin_state_up": false, - "allowed_address_pairs": [], - "data_plane_status": null, - "description": "", - "device_id": "", - "device_owner": "", - "fixed_ips": [ - { - "ip_address": "10.0.0.5", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "94225baa-9d3f-4b93-bf12-b41e7ce49cdb", - "mac_address": "fa:16:3e:48:b8:9f", - "name": "sample_port_1", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", - "security_groups": [ - "f0ac4394-7e4a-4409-9701-ba8be283dbc3" - ], - "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" - }, + "ip_address": "10.0.0.5", + "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" + } + ], + "id": "94225baa-9d3f-4b93-bf12-b41e7ce49cdb", + "mac_address": "fa:16:3e:48:b8:9f", + "name": "sample_port_1", + "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", + "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", + "security_groups": [ + "f0ac4394-7e4a-4409-9701-ba8be283dbc3" + ], + "status": "DOWN", + "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" + }, + { + "admin_state_up": false, + "allowed_address_pairs": [], + "data_plane_status": null, + "description": "", + "device_id": "", + "device_owner": "", + "fixed_ips": [ { - "admin_state_up": false, - "allowed_address_pairs": [], - "data_plane_status": null, - "description": "", - "device_id": "", - "device_owner": "", - "fixed_ips": [ - { - "ip_address": "10.0.0.6", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "235b09e0-63c4-47f1-b221-66ba54c21760", - "mac_address": "fa:16:3e:f4:73:df", - "name": "sample_port_2", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", - "security_groups": [ - "f0ac4394-7e4a-4409-9701-ba8be283dbc3" - ], - "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" + "ip_address": "10.0.0.6", + "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" } - ] + ], + "id": "235b09e0-63c4-47f1-b221-66ba54c21760", + "mac_address": "fa:16:3e:f4:73:df", + "name": "sample_port_2", + "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", + "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", + "security_groups": [ + "f0ac4394-7e4a-4409-9701-ba8be283dbc3" + ], + "status": "DOWN", + "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/sfc/flow_classifier.json b/core-test/src/main/resources/network/sfc/flow_classifier.json index 9a2ff9b29..39f381c67 100644 --- a/core-test/src/main/resources/network/sfc/flow_classifier.json +++ b/core-test/src/main/resources/network/sfc/flow_classifier.json @@ -1,22 +1,22 @@ { - "flow_classifier": { - "id": "12345678-abcd-abcd-abcd-abcdefabcdef", - "name": "FC1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 1", - "protocol": "TCP", - "ethertype": "IPv4", - "source_port_range_min": 22, - "source_port_range_max": 3000, - "destination_port_range_min": 80, - "destination_port_range_max": 80, - "source_ip_prefix": null, - "destination_ip_prefix": "10.20.30.40", - "logical_destination_port": null, - "logical_source_port": "abcdefab-abcd-abcd-abcd-abcdefabcdef", - "l7_parameters": { - "aparam": "A" - } + "flow_classifier": { + "id": "12345678-abcd-abcd-abcd-abcdefabcdef", + "name": "FC1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 1", + "protocol": "TCP", + "ethertype": "IPv4", + "source_port_range_min": 22, + "source_port_range_max": 3000, + "destination_port_range_min": 80, + "destination_port_range_max": 80, + "source_ip_prefix": null, + "destination_ip_prefix": "10.20.30.40", + "logical_destination_port": null, + "logical_source_port": "abcdefab-abcd-abcd-abcd-abcdefabcdef", + "l7_parameters": { + "aparam": "A" } + } } diff --git a/core-test/src/main/resources/network/sfc/flow_classifiers.json b/core-test/src/main/resources/network/sfc/flow_classifiers.json index 99913937d..90778d17d 100644 --- a/core-test/src/main/resources/network/sfc/flow_classifiers.json +++ b/core-test/src/main/resources/network/sfc/flow_classifiers.json @@ -1,40 +1,44 @@ { - "flow_classifiers": [ - { - "id" : "12345678-abcd-abcd-abcd-abcdefabcdef", - "name": "FC1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 1", - "protocol": "TCP", - "ethertype": "IPv4", - "source_port_range_min": 22, - "source_port_range_max": 3000, - "destination_port_range_min": 80, - "destination_port_range_max": 80, - "source_ip_prefix": null, - "destination_ip_prefix": "10.20.30.40", - "logical_destination_port": "12345678-abcd-abcd-abcd-abcdefabcdef", - "logical_source_port": "abcdefab-abcd-abcd-abcd-abcdefabcdef", - "l7_parameters": { "aparam": "A"} - }, - { - "id" : "abcdefab-abcd-abcd-abcd-abcdefabcdef", - "name": "FC2", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 2", - "protocol": "TCP", - "ethertype": "IPv4", - "source_port_range_min": 22, - "source_port_range_max": 3000, - "destination_port_range_min": 80, - "destination_port_range_max": 80, - "source_ip_prefix": null, - "destination_ip_prefix": "50.60.70.80", - "logical_destination_port": "12345678-abcd-abcd-abcd-abcdefabcdef", - "logical_source_port": "abcdefab-abcd-abcd-abcd-abcdefabcdef", - "l7_parameters": { "bparam": "B"} - } - ] + "flow_classifiers": [ + { + "id": "12345678-abcd-abcd-abcd-abcdefabcdef", + "name": "FC1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 1", + "protocol": "TCP", + "ethertype": "IPv4", + "source_port_range_min": 22, + "source_port_range_max": 3000, + "destination_port_range_min": 80, + "destination_port_range_max": 80, + "source_ip_prefix": null, + "destination_ip_prefix": "10.20.30.40", + "logical_destination_port": "12345678-abcd-abcd-abcd-abcdefabcdef", + "logical_source_port": "abcdefab-abcd-abcd-abcd-abcdefabcdef", + "l7_parameters": { + "aparam": "A" + } + }, + { + "id": "abcdefab-abcd-abcd-abcd-abcdefabcdef", + "name": "FC2", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 2", + "protocol": "TCP", + "ethertype": "IPv4", + "source_port_range_min": 22, + "source_port_range_max": 3000, + "destination_port_range_min": 80, + "destination_port_range_max": 80, + "source_ip_prefix": null, + "destination_ip_prefix": "50.60.70.80", + "logical_destination_port": "12345678-abcd-abcd-abcd-abcdefabcdef", + "logical_source_port": "abcdefab-abcd-abcd-abcd-abcdefabcdef", + "l7_parameters": { + "bparam": "B" + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/sfc/port_chain.json b/core-test/src/main/resources/network/sfc/port_chain.json index 16dd071e8..887fa0886 100644 --- a/core-test/src/main/resources/network/sfc/port_chain.json +++ b/core-test/src/main/resources/network/sfc/port_chain.json @@ -1,13 +1,19 @@ { - "port_chain": { - "id" : "0abcdef", - "name": "PC1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test port chain", - "chain_id": "43210", - "flow_classifiers": [ "12345678-abcd-abcd-abcd-abcdefabcdef" ], - "port_pair_groups": [ "abcdefab-abcd-abcd-abcd-abcdefabcdef" ], - "chain_parameters": { "aparam": "A"} + "port_chain": { + "id": "0abcdef", + "name": "PC1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test port chain", + "chain_id": "43210", + "flow_classifiers": [ + "12345678-abcd-abcd-abcd-abcdefabcdef" + ], + "port_pair_groups": [ + "abcdefab-abcd-abcd-abcd-abcdefabcdef" + ], + "chain_parameters": { + "aparam": "A" } + } } diff --git a/core-test/src/main/resources/network/sfc/port_chains.json b/core-test/src/main/resources/network/sfc/port_chains.json index 2eb8a816c..388f049cf 100644 --- a/core-test/src/main/resources/network/sfc/port_chains.json +++ b/core-test/src/main/resources/network/sfc/port_chains.json @@ -1,26 +1,38 @@ { - "port_chains": [ - { - "id" : "0abcdef", - "name": "PC1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test port chain 1", - "chain_id": "43210", - "flow_classifiers": [ "12345678-abcd-abcd-abcd-abcdefabcdef" ], - "port_pair_groups": [ "abcdefab-abcd-abcd-abcd-abcdefabcdef" ], - "chain_parameters": { "aparam": "A"} - }, - { - "id" : "1fedcba", - "name": "PC2", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test port chain 2", - "chain_id": "98765", - "flow_classifiers": [ "12345678-abcd-abcd-abcd-abcdefabcdef" ], - "port_pair_groups": [ "abcdefab-abcd-abcd-abcd-abcdefabcdef" ], - "chain_parameters": { "aparam": "A"} - } - ] + "port_chains": [ + { + "id": "0abcdef", + "name": "PC1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test port chain 1", + "chain_id": "43210", + "flow_classifiers": [ + "12345678-abcd-abcd-abcd-abcdefabcdef" + ], + "port_pair_groups": [ + "abcdefab-abcd-abcd-abcd-abcdefabcdef" + ], + "chain_parameters": { + "aparam": "A" + } + }, + { + "id": "1fedcba", + "name": "PC2", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test port chain 2", + "chain_id": "98765", + "flow_classifiers": [ + "12345678-abcd-abcd-abcd-abcdefabcdef" + ], + "port_pair_groups": [ + "abcdefab-abcd-abcd-abcd-abcdefabcdef" + ], + "chain_parameters": { + "aparam": "A" + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/sfc/port_pair.json b/core-test/src/main/resources/network/sfc/port_pair.json index 9af2add0b..49355912d 100644 --- a/core-test/src/main/resources/network/sfc/port_pair.json +++ b/core-test/src/main/resources/network/sfc/port_pair.json @@ -1,12 +1,14 @@ { - "port_pair": { - "id" : "abcdef", - "name": "PP1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 1", - "egress": "abcdefab-abcd-abcd-abcd-abcdefabcdef", - "ingress": "12345678-abcd-abcd-abcd-abcdefabcdef", - "service_function_parameters": { "aparam": "A"} + "port_pair": { + "id": "abcdef", + "name": "PP1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 1", + "egress": "abcdefab-abcd-abcd-abcd-abcdefabcdef", + "ingress": "12345678-abcd-abcd-abcd-abcdefabcdef", + "service_function_parameters": { + "aparam": "A" } + } } diff --git a/core-test/src/main/resources/network/sfc/port_pair_group.json b/core-test/src/main/resources/network/sfc/port_pair_group.json index 35bf2696e..90e6eeb04 100644 --- a/core-test/src/main/resources/network/sfc/port_pair_group.json +++ b/core-test/src/main/resources/network/sfc/port_pair_group.json @@ -1,13 +1,15 @@ { - "port_pair_group": { - "id" : "abcdef", - "name": "PP1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 1", - "port_pairs": [ "abcdefab-abcd-abcd-abcd-abcdefabcdef" ], - "port_pair_group_parameters": { - "lb_fields": "ip_src" - } + "port_pair_group": { + "id": "abcdef", + "name": "PP1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 1", + "port_pairs": [ + "abcdefab-abcd-abcd-abcd-abcdefabcdef" + ], + "port_pair_group_parameters": { + "lb_fields": "ip_src" } + } } diff --git a/core-test/src/main/resources/network/sfc/port_pair_groups.json b/core-test/src/main/resources/network/sfc/port_pair_groups.json index 6ddd15ff3..9f30935db 100644 --- a/core-test/src/main/resources/network/sfc/port_pair_groups.json +++ b/core-test/src/main/resources/network/sfc/port_pair_groups.json @@ -1,26 +1,30 @@ { - "port_pair_groups": [ - { - "id" : "0abcdef", - "name": "PP1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 1", - "port_pairs": [ "abcdefab-abcd-abcd-abcd-abcdefabcdef" ], - "port_pair_group_parameters": { - "lb_fields": "ip_src" - } - }, - { - "id" : "1fedcba", - "name": "PP2", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 2", - "port_pairs": [ "abcdefab-abcd-abcd-abcd-abcdefabcdef" ], - "port_pair_group_parameters": { - "lb_fields": "ip_src" - } - } - ] + "port_pair_groups": [ + { + "id": "0abcdef", + "name": "PP1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 1", + "port_pairs": [ + "abcdefab-abcd-abcd-abcd-abcdefabcdef" + ], + "port_pair_group_parameters": { + "lb_fields": "ip_src" + } + }, + { + "id": "1fedcba", + "name": "PP2", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 2", + "port_pairs": [ + "abcdefab-abcd-abcd-abcd-abcdefabcdef" + ], + "port_pair_group_parameters": { + "lb_fields": "ip_src" + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/sfc/port_pairs.json b/core-test/src/main/resources/network/sfc/port_pairs.json index ca22793fd..688f57dd0 100644 --- a/core-test/src/main/resources/network/sfc/port_pairs.json +++ b/core-test/src/main/resources/network/sfc/port_pairs.json @@ -1,24 +1,28 @@ { - "port_pairs": [ - { - "id" : "0abcdef", - "name": "PP1", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 1", - "egress": "abcdefab-abcd-abcd-abcd-abcdefabcdef", - "ingress": "12345678-abcd-abcd-abcd-abcdefabcdef", - "service_function_parameters": { "aparam": "A"} - }, - { - "id" : "1fedcba", - "name": "PP2", - "project_id": "12345678909876543210abcdefabcdef", - "tenant_id": "12345678909876543210abcdefabcdef", - "description": "Openstack4j test flow classifier 2", - "egress": "abcdefab-abcd-abcd-abcd-abcdefabcdef", - "ingress": "12345678-abcd-abcd-abcd-abcdefabcdef", - "service_function_parameters": { "bparam": "B"} - } - ] + "port_pairs": [ + { + "id": "0abcdef", + "name": "PP1", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 1", + "egress": "abcdefab-abcd-abcd-abcd-abcdefabcdef", + "ingress": "12345678-abcd-abcd-abcd-abcdefabcdef", + "service_function_parameters": { + "aparam": "A" + } + }, + { + "id": "1fedcba", + "name": "PP2", + "project_id": "12345678909876543210abcdefabcdef", + "tenant_id": "12345678909876543210abcdefabcdef", + "description": "Openstack4j test flow classifier 2", + "egress": "abcdefab-abcd-abcd-abcd-abcdefabcdef", + "ingress": "12345678-abcd-abcd-abcd-abcdefabcdef", + "service_function_parameters": { + "bparam": "B" + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/subnet_ipv6.json b/core-test/src/main/resources/network/subnet_ipv6.json index 1984f6741..93ead69df 100644 --- a/core-test/src/main/resources/network/subnet_ipv6.json +++ b/core-test/src/main/resources/network/subnet_ipv6.json @@ -1,30 +1,30 @@ { - "subnet": { - "name": "sub1", - "enable_dhcp": true, - "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "segment_id": null, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "dns_nameservers": [], - "allocation_pools": [ - { - "start": "2620:0:2d0:200::2", - "end": "2620:0:2d0:200:ffff:ffff:ffff:fffe" - } - ], - "host_routes": [], - "ip_version": 6, - "gateway_ip": "2620:0:2d0:200::1", - "cidr": "2620:0:2d0:200::/64", - "id": "3b80198d-4f7b-4f77-9ef5-774d54e17126", - "created_at": "2016-10-10T14:35:47Z", - "description": "", - "ipv6_address_mode": "dhcpv6-stateful", - "ipv6_ra_mode": "dhcpv6-stateful", - "revision_number": 2, - "service_types": [], - "subnetpool_id": null, - "updated_at": "2016-10-10T14:35:47Z" - } + "subnet": { + "name": "sub1", + "enable_dhcp": true, + "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", + "segment_id": null, + "project_id": "4fd44f30292945e481c7b8a0c8908869", + "tenant_id": "4fd44f30292945e481c7b8a0c8908869", + "dns_nameservers": [], + "allocation_pools": [ + { + "start": "2620:0:2d0:200::2", + "end": "2620:0:2d0:200:ffff:ffff:ffff:fffe" + } + ], + "host_routes": [], + "ip_version": 6, + "gateway_ip": "2620:0:2d0:200::1", + "cidr": "2620:0:2d0:200::/64", + "id": "3b80198d-4f7b-4f77-9ef5-774d54e17126", + "created_at": "2016-10-10T14:35:47Z", + "description": "", + "ipv6_address_mode": "dhcpv6-stateful", + "ipv6_ra_mode": "dhcpv6-stateful", + "revision_number": 2, + "service_types": [], + "subnetpool_id": null, + "updated_at": "2016-10-10T14:35:47Z" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/octavia/lbpoolsv2.json b/core-test/src/main/resources/octavia/lbpoolsv2.json index 6545a7f20..83cc0eb31 100644 --- a/core-test/src/main/resources/octavia/lbpoolsv2.json +++ b/core-test/src/main/resources/octavia/lbpoolsv2.json @@ -14,7 +14,6 @@ } ], "members": [ - ], "id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", "name": "testlbpool" @@ -33,7 +32,6 @@ } ], "members": [ - ], "id": "ff2f9954-2481-4e11-93ee-72b77b6c5c98", "name": "pool1" diff --git a/core-test/src/main/resources/octavia/lbpoolv2.json b/core-test/src/main/resources/octavia/lbpoolv2.json index 462fbf032..e84b2ef28 100644 --- a/core-test/src/main/resources/octavia/lbpoolv2.json +++ b/core-test/src/main/resources/octavia/lbpoolv2.json @@ -13,7 +13,6 @@ } ], "members": [ - ], "id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", "name": "testlbpool" diff --git a/core-test/src/main/resources/octavia/lbpoolv2_update.json b/core-test/src/main/resources/octavia/lbpoolv2_update.json index d6148ff9b..575a61042 100644 --- a/core-test/src/main/resources/octavia/lbpoolv2_update.json +++ b/core-test/src/main/resources/octavia/lbpoolv2_update.json @@ -13,7 +13,6 @@ } ], "members": [ - ], "id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", "name": "v2update" diff --git a/core-test/src/main/resources/octavia/listenersv2.json b/core-test/src/main/resources/octavia/listenersv2.json index 52b8548cf..b2b3f9a68 100644 --- a/core-test/src/main/resources/octavia/listenersv2.json +++ b/core-test/src/main/resources/octavia/listenersv2.json @@ -13,7 +13,6 @@ ], "project_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "sni_container_refs": [ - ], "connection_limit": -1, "default_pool_id": "b7f6a49f-ebd8-43c5-b792-5748366eff21", @@ -33,7 +32,6 @@ ], "project_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "sni_container_refs": [ - ], "connection_limit": -1, "default_pool_id": "e0467102-6406-484d-8262-3922a2f2b36b", diff --git a/core-test/src/main/resources/octavia/loadbalancersv2.json b/core-test/src/main/resources/octavia/loadbalancersv2.json index ee8a19972..6e785c91b 100644 --- a/core-test/src/main/resources/octavia/loadbalancersv2.json +++ b/core-test/src/main/resources/octavia/loadbalancersv2.json @@ -6,7 +6,6 @@ "project_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "provisioning_status": "ACTIVE", "listeners": [ - ], "vip_address": "10.0.0.13", "vip_port_id": "82fbaa1c-a8af-47d3-94fe-a0ac1a33257b", diff --git a/core-test/src/main/resources/octavia/loadbalancerv2.json b/core-test/src/main/resources/octavia/loadbalancerv2.json index 188e41961..72296b10f 100644 --- a/core-test/src/main/resources/octavia/loadbalancerv2.json +++ b/core-test/src/main/resources/octavia/loadbalancerv2.json @@ -5,7 +5,6 @@ "project_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "provisioning_status": "ACTIVE", "listeners": [ - ], "vip_address": "10.0.0.13", "vip_port_id": "82fbaa1c-a8af-47d3-94fe-a0ac1a33257b", diff --git a/core-test/src/main/resources/octavia/loadbalancerv2_update.json b/core-test/src/main/resources/octavia/loadbalancerv2_update.json index 55475f302..dd49567ab 100644 --- a/core-test/src/main/resources/octavia/loadbalancerv2_update.json +++ b/core-test/src/main/resources/octavia/loadbalancerv2_update.json @@ -5,7 +5,6 @@ "project_id": "6f759d84e3ca496ab77f8c0ffaa0311e", "provisioning_status": "ACTIVE", "listeners": [ - ], "vip_address": "10.0.0.13", "vip_port_id": "82fbaa1c-a8af-47d3-94fe-a0ac1a33257b", diff --git a/core-test/src/main/resources/sahara/cluster_create_req.json b/core-test/src/main/resources/sahara/cluster_create_req.json index 029964694..e69c60ffa 100644 --- a/core-test/src/main/resources/sahara/cluster_create_req.json +++ b/core-test/src/main/resources/sahara/cluster_create_req.json @@ -1,29 +1,32 @@ { - "name" : "cluster-test-1", - "cluster_configs" : { - "HDFS" : { - "dfs.replication" : 1 + "name": "cluster-test-1", + "cluster_configs": { + "HDFS": { + "dfs.replication": 1 }, - "Spark" : { - "spark.executor.memory" : "1g", - "spark.executor.cores" : 2 + "Spark": { + "spark.executor.memory": "1g", + "spark.executor.cores": 2 } }, - "default_image_id" : "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", - "user_keypair_id" : "tester", - "plugin_name" : "spark", - "neutron_management_network" : "4c065f9c-ad1b-43c4-ba1e-893d330da079", - "node_groups" : [ { - "name" : "worker", - "count" : 2, - "node_group_template_id" : "f78dda4d-17e1-48cd-ab85-ee56261382ef", - "flavor_id" : "ef7f4d7f-267f-4762-abe2-729fe350256c" - }, { - "name" : "master", - "count" : 1, - "node_group_template_id" : "0febf422-98ee-47e6-a1c5-60f90f1f9c96", - "flavor_id" : "ef7f4d7f-267f-4762-abe2-729fe350256c" - } ], - "hadoop_version" : "1.6.2" + "default_image_id": "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", + "user_keypair_id": "tester", + "plugin_name": "spark", + "neutron_management_network": "4c065f9c-ad1b-43c4-ba1e-893d330da079", + "node_groups": [ + { + "name": "worker", + "count": 2, + "node_group_template_id": "f78dda4d-17e1-48cd-ab85-ee56261382ef", + "flavor_id": "ef7f4d7f-267f-4762-abe2-729fe350256c" + }, + { + "name": "master", + "count": 1, + "node_group_template_id": "0febf422-98ee-47e6-a1c5-60f90f1f9c96", + "flavor_id": "ef7f4d7f-267f-4762-abe2-729fe350256c" + } + ], + "hadoop_version": "1.6.2" } diff --git a/core-test/src/main/resources/sahara/cluster_create_resp.json b/core-test/src/main/resources/sahara/cluster_create_resp.json index 5154a807a..905da79cb 100644 --- a/core-test/src/main/resources/sahara/cluster_create_resp.json +++ b/core-test/src/main/resources/sahara/cluster_create_resp.json @@ -1,106 +1,106 @@ { - "cluster": { - "provision_progress": [], - "user_keypair_id": "tester", - "updated_at": "2017-08-04T08:33:44", - "is_transient": false, - "use_autoconfig": true, - "node_groups": [ - { - "volume_local_to_instance": false, - "availability_zone": "nova", - "updated_at": null, - "instances": [], - "node_group_template_id": "f78dda4d-17e1-48cd-ab85-ee56261382ef", - "volumes_per_node": 0, - "id": "36f4ecc7-e098-4fbc-826b-e645a4e0561c", - "security_groups": [ - "0a3f7e8d-3769-45ac-ac74-89efaa179404" - ], - "shares": [], - "node_configs": { - "HDFS": {} - }, - "auto_security_group": false, - "volumes_availability_zone": null, - "volume_mount_prefix": "/volumes/disk", - "floating_ip_pool": "7c6358b6-11da-4da5-9ae6-cb42dd51f483", - "image_id": "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", - "volumes_size": null, - "is_proxy_gateway": false, - "count": 2, - "name": "worker", - "created_at": "2017-08-04T08:33:43", - "volume_type": null, - "node_processes": [ - "datanode", - "slave" - ], - "flavor_id": "ef7f4d7f-267f-4762-abe2-729fe350256c", - "use_autoconfig": true - }, - { - "volume_local_to_instance": false, - "availability_zone": "nova", - "updated_at": null, - "instances": [], - "node_group_template_id": "0febf422-98ee-47e6-a1c5-60f90f1f9c96", - "volumes_per_node": 0, - "id": "d4a382ca-6c9c-48ef-84c2-c9ad3360cd81", - "security_groups": [ - "0a3f7e8d-3769-45ac-ac74-89efaa179404" - ], - "shares": [], - "node_configs": { - "HDFS": {} - }, - "auto_security_group": false, - "volumes_availability_zone": null, - "volume_mount_prefix": "/volumes/disk", - "floating_ip_pool": "7c6358b6-11da-4da5-9ae6-cb42dd51f483", - "image_id": "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", - "volumes_size": null, - "is_proxy_gateway": false, - "count": 1, - "name": "master", - "created_at": "2017-08-04T08:33:43", - "volume_type": null, - "node_processes": [ - "namenode", - "master" - ], - "flavor_id": "ef7f4d7f-267f-4762-abe2-729fe350256c", - "use_autoconfig": true - } - ], - "management_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDaOGD3eWnT48rv3MlnF5D9z8B0Xw76IjlSt2fijRKUnlB3EAdMsi8QutO2Z+uPJXtZZsxfBvKabCpuSh5C6NWq2cjvEcb+HisXcRD5LDfJ7KUkNJRqJcHMiLMZv3WSfUSn37HXhPW09vz72Td8e0bkr7kbcbO5goc/hMoszP/Q5Yt62I6j6tgPBTr4mZuSXTlhIxg27RIvrHueWUhKL4iT3yCBgk+QU9PNRFDzHPg5ZLCAoQerOkj7yuN0iwWUvXx5McLQiLI5bB3th1Ov65rsLw+Me/WrTLHmbY2AK24gTQ8XtuLbKei84WGMkmZBQ15B27kC0uoos8EeiZcvO9cb Generated-by-Sahara\n", - "id": "c7ce1662-0ee7-4307-a7ed-a77fa1b0e667", - "trust_id": null, - "cluster_configs": { - "HDFS": { - "dfs.replication": 1 - }, - "Spark": { - "spark.executor.memory": "1g", - "spark.executor.cores": 2 - } - }, - "default_image_id": "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", - "domain_name": null, - "shares": null, - "status": "Validating", - "neutron_management_network": "4c065f9c-ad1b-43c4-ba1e-893d330da079", - "description": null, - "plugin_name": "spark", - "anti_affinity": [], - "is_public": false, - "status_description": "", - "hadoop_version": "1.6.2", - "info": {}, - "cluster_template_id": null, - "name": "cluster-test-1", - "tenant_id": "31f13106bac54c1992077cca18f02c6e", - "created_at": "2017-08-04T08:33:43", - "is_protected": false - } + "cluster": { + "provision_progress": [], + "user_keypair_id": "tester", + "updated_at": "2017-08-04T08:33:44", + "is_transient": false, + "use_autoconfig": true, + "node_groups": [ + { + "volume_local_to_instance": false, + "availability_zone": "nova", + "updated_at": null, + "instances": [], + "node_group_template_id": "f78dda4d-17e1-48cd-ab85-ee56261382ef", + "volumes_per_node": 0, + "id": "36f4ecc7-e098-4fbc-826b-e645a4e0561c", + "security_groups": [ + "0a3f7e8d-3769-45ac-ac74-89efaa179404" + ], + "shares": [], + "node_configs": { + "HDFS": {} + }, + "auto_security_group": false, + "volumes_availability_zone": null, + "volume_mount_prefix": "/volumes/disk", + "floating_ip_pool": "7c6358b6-11da-4da5-9ae6-cb42dd51f483", + "image_id": "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", + "volumes_size": null, + "is_proxy_gateway": false, + "count": 2, + "name": "worker", + "created_at": "2017-08-04T08:33:43", + "volume_type": null, + "node_processes": [ + "datanode", + "slave" + ], + "flavor_id": "ef7f4d7f-267f-4762-abe2-729fe350256c", + "use_autoconfig": true + }, + { + "volume_local_to_instance": false, + "availability_zone": "nova", + "updated_at": null, + "instances": [], + "node_group_template_id": "0febf422-98ee-47e6-a1c5-60f90f1f9c96", + "volumes_per_node": 0, + "id": "d4a382ca-6c9c-48ef-84c2-c9ad3360cd81", + "security_groups": [ + "0a3f7e8d-3769-45ac-ac74-89efaa179404" + ], + "shares": [], + "node_configs": { + "HDFS": {} + }, + "auto_security_group": false, + "volumes_availability_zone": null, + "volume_mount_prefix": "/volumes/disk", + "floating_ip_pool": "7c6358b6-11da-4da5-9ae6-cb42dd51f483", + "image_id": "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", + "volumes_size": null, + "is_proxy_gateway": false, + "count": 1, + "name": "master", + "created_at": "2017-08-04T08:33:43", + "volume_type": null, + "node_processes": [ + "namenode", + "master" + ], + "flavor_id": "ef7f4d7f-267f-4762-abe2-729fe350256c", + "use_autoconfig": true + } + ], + "management_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDaOGD3eWnT48rv3MlnF5D9z8B0Xw76IjlSt2fijRKUnlB3EAdMsi8QutO2Z+uPJXtZZsxfBvKabCpuSh5C6NWq2cjvEcb+HisXcRD5LDfJ7KUkNJRqJcHMiLMZv3WSfUSn37HXhPW09vz72Td8e0bkr7kbcbO5goc/hMoszP/Q5Yt62I6j6tgPBTr4mZuSXTlhIxg27RIvrHueWUhKL4iT3yCBgk+QU9PNRFDzHPg5ZLCAoQerOkj7yuN0iwWUvXx5McLQiLI5bB3th1Ov65rsLw+Me/WrTLHmbY2AK24gTQ8XtuLbKei84WGMkmZBQ15B27kC0uoos8EeiZcvO9cb Generated-by-Sahara\n", + "id": "c7ce1662-0ee7-4307-a7ed-a77fa1b0e667", + "trust_id": null, + "cluster_configs": { + "HDFS": { + "dfs.replication": 1 + }, + "Spark": { + "spark.executor.memory": "1g", + "spark.executor.cores": 2 + } + }, + "default_image_id": "f56cc7c5-9588-49fa-8bcd-5c5d5eda5466", + "domain_name": null, + "shares": null, + "status": "Validating", + "neutron_management_network": "4c065f9c-ad1b-43c4-ba1e-893d330da079", + "description": null, + "plugin_name": "spark", + "anti_affinity": [], + "is_public": false, + "status_description": "", + "hadoop_version": "1.6.2", + "info": {}, + "cluster_template_id": null, + "name": "cluster-test-1", + "tenant_id": "31f13106bac54c1992077cca18f02c6e", + "created_at": "2017-08-04T08:33:43", + "is_protected": false + } } diff --git a/core-test/src/main/resources/senlin/v1/action.json b/core-test/src/main/resources/senlin/v1/action.json index 2e857c92f..9bcfdf1e4 100644 --- a/core-test/src/main/resources/senlin/v1/action.json +++ b/core-test/src/main/resources/senlin/v1/action.json @@ -1,23 +1,23 @@ { - "action": { - "action": "CLUSTER_SCALE_IN", - "cause": "RPC Request", - "created_at": "2016-06-15T02:42:38.000000", - "data": {}, - "depended_by": [], - "depends_on": [], - "end_time": 1465958528, - "id": "ffbb9175-d510-4bc1-b676-c6aba2a4ca81", - "inputs": {}, - "interval": -1, - "name": "webhook_991e3872", - "outputs": {}, - "owner": null, - "start_time": 1465958528, - "status": "FAILED", - "status_reason": "The target capacity (0) is less than the cluster's min_size (1).", - "target": "aff44f0d-5078-4e06-974e-5d2bc8ac1856", - "timeout": 3600, - "updated_at": null - } + "action": { + "action": "CLUSTER_SCALE_IN", + "cause": "RPC Request", + "created_at": "2016-06-15T02:42:38.000000", + "data": {}, + "depended_by": [], + "depends_on": [], + "end_time": 1465958528, + "id": "ffbb9175-d510-4bc1-b676-c6aba2a4ca81", + "inputs": {}, + "interval": -1, + "name": "webhook_991e3872", + "outputs": {}, + "owner": null, + "start_time": 1465958528, + "status": "FAILED", + "status_reason": "The target capacity (0) is less than the cluster's min_size (1).", + "target": "aff44f0d-5078-4e06-974e-5d2bc8ac1856", + "timeout": 3600, + "updated_at": null + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/actions.json b/core-test/src/main/resources/senlin/v1/actions.json index 3592df27d..9717716d0 100644 --- a/core-test/src/main/resources/senlin/v1/actions.json +++ b/core-test/src/main/resources/senlin/v1/actions.json @@ -1,93 +1,93 @@ { - "actions": [ - { - "action": "CLUSTER_CREATE", - "cause": "RPC Request", - "created_at": "2016-05-24T09:25:15.000000", - "data": {}, - "depended_by": [], - "depends_on": [], - "end_time": 1464081920, - "id": "1ac0a47b-06de-44cd-a014-79981f1dec19", - "inputs": {}, - "interval": -1, - "name": "cluster_create_7e0c9843", - "outputs": {}, - "owner": null, - "start_time": 1464081920, - "status": "SUCCEEDED", - "status_reason": "Action completed successfully.", - "target": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "timeout": 3600, - "updated_at": null - }, - { - "action": "NODE_CREATE", - "cause": "RPC Request", - "created_at": "2016-05-24T09:25:16.000000", - "data": {}, - "depended_by": [], - "depends_on": [], - "end_time": 1464081920, - "id": "48f83782-bf02-4308-b8e8-a6c3b6e816b0", - "inputs": {}, - "interval": -1, - "name": "node_create_d3451489", - "outputs": {}, - "owner": null, - "start_time": 1464081920, - "status": "FAILED", - "status_reason": "Node creation failed.", - "target": "d3451489-708b-4bd0-a147-a0c02dd9cb00", - "timeout": 3600, - "updated_at": null - }, - { - "action": "CLUSTER_ATTACH_POLICY", - "cause": "RPC Request", - "created_at": "2016-05-24T09:25:18.000000", - "data": {}, - "depended_by": [], - "depends_on": [], - "end_time": 1464081920, - "id": "11d999e8-2513-4751-8bfd-7566f4129107", - "inputs": { - "enabled": true, - "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199" - }, - "interval": -1, - "name": "attach_policy_7e0c9843", - "outputs": {}, - "owner": null, - "start_time": 1464081920, - "status": "SUCCEEDED", - "status_reason": "Action completed successfully.", - "target": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "timeout": 3600, - "updated_at": null - }, - { - "action": "NODE_RECOVER", - "cause": "RPC Request", - "created_at": "2016-05-24T09:25:18.000000", - "data": {}, - "depended_by": [], - "depends_on": [], - "end_time": 1464081920, - "id": "66560462-f297-4cf7-8e40-75a447f8a975", - "inputs": { - "operation": "rebuild" - }, - "interval": -1, - "name": "node_recover_d3451489", - "outputs": {}, - "owner": null, - "start_time": 1464081920, - "status": "FAILED", - "status_reason": "Node recover failed.", - "target": "d3451489-708b-4bd0-a147-a0c02dd9cb00", - "timeout": 3600, - "updated_at": null - } - ] + "actions": [ + { + "action": "CLUSTER_CREATE", + "cause": "RPC Request", + "created_at": "2016-05-24T09:25:15.000000", + "data": {}, + "depended_by": [], + "depends_on": [], + "end_time": 1464081920, + "id": "1ac0a47b-06de-44cd-a014-79981f1dec19", + "inputs": {}, + "interval": -1, + "name": "cluster_create_7e0c9843", + "outputs": {}, + "owner": null, + "start_time": 1464081920, + "status": "SUCCEEDED", + "status_reason": "Action completed successfully.", + "target": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "timeout": 3600, + "updated_at": null + }, + { + "action": "NODE_CREATE", + "cause": "RPC Request", + "created_at": "2016-05-24T09:25:16.000000", + "data": {}, + "depended_by": [], + "depends_on": [], + "end_time": 1464081920, + "id": "48f83782-bf02-4308-b8e8-a6c3b6e816b0", + "inputs": {}, + "interval": -1, + "name": "node_create_d3451489", + "outputs": {}, + "owner": null, + "start_time": 1464081920, + "status": "FAILED", + "status_reason": "Node creation failed.", + "target": "d3451489-708b-4bd0-a147-a0c02dd9cb00", + "timeout": 3600, + "updated_at": null + }, + { + "action": "CLUSTER_ATTACH_POLICY", + "cause": "RPC Request", + "created_at": "2016-05-24T09:25:18.000000", + "data": {}, + "depended_by": [], + "depends_on": [], + "end_time": 1464081920, + "id": "11d999e8-2513-4751-8bfd-7566f4129107", + "inputs": { + "enabled": true, + "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199" + }, + "interval": -1, + "name": "attach_policy_7e0c9843", + "outputs": {}, + "owner": null, + "start_time": 1464081920, + "status": "SUCCEEDED", + "status_reason": "Action completed successfully.", + "target": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "timeout": 3600, + "updated_at": null + }, + { + "action": "NODE_RECOVER", + "cause": "RPC Request", + "created_at": "2016-05-24T09:25:18.000000", + "data": {}, + "depended_by": [], + "depends_on": [], + "end_time": 1464081920, + "id": "66560462-f297-4cf7-8e40-75a447f8a975", + "inputs": { + "operation": "rebuild" + }, + "interval": -1, + "name": "node_recover_d3451489", + "outputs": {}, + "owner": null, + "start_time": 1464081920, + "status": "FAILED", + "status_reason": "Node recover failed.", + "target": "d3451489-708b-4bd0-a147-a0c02dd9cb00", + "timeout": 3600, + "updated_at": null + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/build_info.json b/core-test/src/main/resources/senlin/v1/build_info.json index 02e33c384..2864f9320 100644 --- a/core-test/src/main/resources/senlin/v1/build_info.json +++ b/core-test/src/main/resources/senlin/v1/build_info.json @@ -1,10 +1,10 @@ { - "build_info": { - "api": { - "revision": "1.0" - }, - "engine": { - "revision": "2.0" - } + "build_info": { + "api": { + "revision": "1.0" + }, + "engine": { + "revision": "2.0" } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/cluster.json b/core-test/src/main/resources/senlin/v1/cluster.json index e852cb948..23638627f 100644 --- a/core-test/src/main/resources/senlin/v1/cluster.json +++ b/core-test/src/main/resources/senlin/v1/cluster.json @@ -1,24 +1,24 @@ { - "cluster": { - "created_at": "2015-02-11T15:13:20", - "data": {}, - "desired_capacity": 0, - "domain": null, - "id": "45edadcb-c73b-4920-87e1-518b2f29f54b", - "init_at": "2015-02-10T14:26:10", - "max_size": -1, - "metadata": {}, - "min_size": 0, - "name": "test_cluster", - "nodes": [], - "policies": [], - "profile_id": "edc63d0a-2ca4-48fa-9854-27926da76a4a", - "profile_name": "mystack", - "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", - "status": "ACTIVE", - "status_reason": "Creation succeeded", - "timeout": 3600, - "updated_at": null, - "user": "5e5bf8027826429c96af157f68dc9072" - } + "cluster": { + "created_at": "2015-02-11T15:13:20", + "data": {}, + "desired_capacity": 0, + "domain": null, + "id": "45edadcb-c73b-4920-87e1-518b2f29f54b", + "init_at": "2015-02-10T14:26:10", + "max_size": -1, + "metadata": {}, + "min_size": 0, + "name": "test_cluster", + "nodes": [], + "policies": [], + "profile_id": "edc63d0a-2ca4-48fa-9854-27926da76a4a", + "profile_name": "mystack", + "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", + "status": "ACTIVE", + "status_reason": "Creation succeeded", + "timeout": 3600, + "updated_at": null, + "user": "5e5bf8027826429c96af157f68dc9072" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/cluster_policies.json b/core-test/src/main/resources/senlin/v1/cluster_policies.json index 7529488cf..5c2ef9590 100644 --- a/core-test/src/main/resources/senlin/v1/cluster_policies.json +++ b/core-test/src/main/resources/senlin/v1/cluster_policies.json @@ -1,22 +1,22 @@ { - "cluster_policies": [ - { - "cluster_id": "7d85f602-a948-4a30-afd4-e84f47471c15", - "cluster_name": "cluster4", - "enabled": true, - "id": "06be3a1f-b238-4a96-a737-ceec5714087e", - "policy_id": "714fe676-a08f-4196-b7af-61d52eeded15", - "policy_name": "dp01", - "policy_type": "senlin.policy.deletion-1.0" - }, - { - "cluster_id": "7d85f602-a948-4a30-afd4-e84f47471c15", - "cluster_name": "cluster4", - "enabled": true, - "id": "abddc45e-ac31-4f90-93cc-db55a7d8dd6d", - "policy_id": "e026e09f-a3e9-4dad-a1b9-d7ba316026a1", - "policy_name": "sp1", - "policy_type": "senlin.policy.scaling-1.0" - } - ] + "cluster_policies": [ + { + "cluster_id": "7d85f602-a948-4a30-afd4-e84f47471c15", + "cluster_name": "cluster4", + "enabled": true, + "id": "06be3a1f-b238-4a96-a737-ceec5714087e", + "policy_id": "714fe676-a08f-4196-b7af-61d52eeded15", + "policy_name": "dp01", + "policy_type": "senlin.policy.deletion-1.0" + }, + { + "cluster_id": "7d85f602-a948-4a30-afd4-e84f47471c15", + "cluster_name": "cluster4", + "enabled": true, + "id": "abddc45e-ac31-4f90-93cc-db55a7d8dd6d", + "policy_id": "e026e09f-a3e9-4dad-a1b9-d7ba316026a1", + "policy_name": "sp1", + "policy_type": "senlin.policy.scaling-1.0" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/cluster_policy.json b/core-test/src/main/resources/senlin/v1/cluster_policy.json index 9a8d91929..87cebaf00 100644 --- a/core-test/src/main/resources/senlin/v1/cluster_policy.json +++ b/core-test/src/main/resources/senlin/v1/cluster_policy.json @@ -1,11 +1,11 @@ { - "cluster_policy": { - "cluster_id": "7d85f602-a948-4a30-afd4-e84f47471c15", - "cluster_name": "cluster4", - "enabled": true, - "id": "06be3a1f-b238-4a96-a737-ceec5714087e", - "policy_id": "714fe676-a08f-4196-b7af-61d52eeded15", - "policy_name": "dp01", - "policy_type": "senlin.policy.deletion-1.0" - } + "cluster_policy": { + "cluster_id": "7d85f602-a948-4a30-afd4-e84f47471c15", + "cluster_name": "cluster4", + "enabled": true, + "id": "06be3a1f-b238-4a96-a737-ceec5714087e", + "policy_id": "714fe676-a08f-4196-b7af-61d52eeded15", + "policy_name": "dp01", + "policy_type": "senlin.policy.deletion-1.0" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/clusters.json b/core-test/src/main/resources/senlin/v1/clusters.json index 51a044ba7..dda101beb 100644 --- a/core-test/src/main/resources/senlin/v1/clusters.json +++ b/core-test/src/main/resources/senlin/v1/clusters.json @@ -1,112 +1,112 @@ { - "clusters": [ - { - "created_at": "2016-05-24T09:25:16", - "data": {}, - "desired_capacity": 2, - "domain": null, - "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "init_at": "2016-05-24T09:25:15", - "max_size": -1, - "metadata": {}, - "min_size": 0, - "name": "lion-cluster", - "nodes": [ - "d3451489-708b-4bd0-a147-a0c02dd9cb00", - "b17c69ae-6315-4d9b-b4e5-88c288725bf5" - ], - "policies": [ - "be24729e-c60c-4f06-9ba4-2d3872c23199" - ], - "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "profile_name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ERROR", - "status_reason": "Failed in creating nodes.", - "timeout": 3600, - "updated_at": "2016-05-24T09:25:18", - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "created_at": "2016-05-24T09:26:09", - "data": {}, - "desired_capacity": 2, - "domain": null, - "id": "b20496b9-d90c-4ad2-804d-5032624eebbc", - "init_at": "2016-05-24T09:26:09", - "max_size": -1, - "metadata": {}, - "min_size": 0, - "name": "lion-cluster", - "nodes": [ - "58bf0682-cc63-41bf-ab04-c3f27db2b478", - "27dc9555-3de2-479a-9e55-032d1e4bff1b" - ], - "policies": [ - "93f3f9d1-3a58-4b4b-90d0-c0493e0379a0" - ], - "profile_id": "4a746f95-eb4f-488f-b8dc-b1789b14cafd", - "profile_name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ERROR", - "status_reason": "Failed in creating nodes.", - "timeout": 3600, - "updated_at": "2016-05-24T09:26:12", - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "created_at": "2016-05-25T08:34:02", - "data": {}, - "desired_capacity": 2, - "domain": null, - "id": "5938380f-6903-4322-bdd9-d0597a0b6f41", - "init_at": "2016-05-25T08:34:02", - "max_size": -1, - "metadata": {}, - "min_size": 0, - "name": "lion-cluster", - "nodes": [ - "3437e6d0-e116-4863-ad45-f9e30721af5c", - "69f1a026-c397-474e-ab57-0003a882ddeb" - ], - "policies": [ - "390ff9e8-8ad3-464c-9535-c895b3f1bda3" - ], - "profile_id": "ae7c8828-486a-4d35-9ee7-f1985362ba81", - "profile_name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ERROR", - "status_reason": "Failed in creating nodes.", - "timeout": 3600, - "updated_at": "2016-05-25T08:34:15", - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "created_at": "2016-05-25T08:38:40", - "data": {}, - "desired_capacity": 0, - "domain": null, - "id": "17192bab-aca9-4a81-98d7-822f4d62c28b", - "init_at": "2016-05-25T08:38:39", - "max_size": -1, - "metadata": {}, - "min_size": 0, - "name": "lion-cluster", - "nodes": [ - "59b8b6db-c550-44ed-9c4b-6a41397af9e3", - "2955c3f6-4804-45c9-9b70-04ee4ed3941f" - ], - "policies": [ - "ee76b62b-e303-4abf-9fe4-7376318ffc92" - ], - "profile_id": "61ae5541-ccd5-45e2-8e68-05ae2af613e2", - "profile_name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ACTIVE", - "status_reason": "Node lion-node123: Creation in progress", - "timeout": 3600, - "updated_at": "2016-05-25T08:39:00", - "user": "fa465946d3aa4b4caa411da77632d6b6" - } - ] + "clusters": [ + { + "created_at": "2016-05-24T09:25:16", + "data": {}, + "desired_capacity": 2, + "domain": null, + "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "init_at": "2016-05-24T09:25:15", + "max_size": -1, + "metadata": {}, + "min_size": 0, + "name": "lion-cluster", + "nodes": [ + "d3451489-708b-4bd0-a147-a0c02dd9cb00", + "b17c69ae-6315-4d9b-b4e5-88c288725bf5" + ], + "policies": [ + "be24729e-c60c-4f06-9ba4-2d3872c23199" + ], + "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "profile_name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ERROR", + "status_reason": "Failed in creating nodes.", + "timeout": 3600, + "updated_at": "2016-05-24T09:25:18", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-24T09:26:09", + "data": {}, + "desired_capacity": 2, + "domain": null, + "id": "b20496b9-d90c-4ad2-804d-5032624eebbc", + "init_at": "2016-05-24T09:26:09", + "max_size": -1, + "metadata": {}, + "min_size": 0, + "name": "lion-cluster", + "nodes": [ + "58bf0682-cc63-41bf-ab04-c3f27db2b478", + "27dc9555-3de2-479a-9e55-032d1e4bff1b" + ], + "policies": [ + "93f3f9d1-3a58-4b4b-90d0-c0493e0379a0" + ], + "profile_id": "4a746f95-eb4f-488f-b8dc-b1789b14cafd", + "profile_name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ERROR", + "status_reason": "Failed in creating nodes.", + "timeout": 3600, + "updated_at": "2016-05-24T09:26:12", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:34:02", + "data": {}, + "desired_capacity": 2, + "domain": null, + "id": "5938380f-6903-4322-bdd9-d0597a0b6f41", + "init_at": "2016-05-25T08:34:02", + "max_size": -1, + "metadata": {}, + "min_size": 0, + "name": "lion-cluster", + "nodes": [ + "3437e6d0-e116-4863-ad45-f9e30721af5c", + "69f1a026-c397-474e-ab57-0003a882ddeb" + ], + "policies": [ + "390ff9e8-8ad3-464c-9535-c895b3f1bda3" + ], + "profile_id": "ae7c8828-486a-4d35-9ee7-f1985362ba81", + "profile_name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ERROR", + "status_reason": "Failed in creating nodes.", + "timeout": 3600, + "updated_at": "2016-05-25T08:34:15", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:38:40", + "data": {}, + "desired_capacity": 0, + "domain": null, + "id": "17192bab-aca9-4a81-98d7-822f4d62c28b", + "init_at": "2016-05-25T08:38:39", + "max_size": -1, + "metadata": {}, + "min_size": 0, + "name": "lion-cluster", + "nodes": [ + "59b8b6db-c550-44ed-9c4b-6a41397af9e3", + "2955c3f6-4804-45c9-9b70-04ee4ed3941f" + ], + "policies": [ + "ee76b62b-e303-4abf-9fe4-7376318ffc92" + ], + "profile_id": "61ae5541-ccd5-45e2-8e68-05ae2af613e2", + "profile_name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ACTIVE", + "status_reason": "Node lion-node123: Creation in progress", + "timeout": 3600, + "updated_at": "2016-05-25T08:39:00", + "user": "fa465946d3aa4b4caa411da77632d6b6" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/event.json b/core-test/src/main/resources/senlin/v1/event.json index dc364ce16..4f116116f 100644 --- a/core-test/src/main/resources/senlin/v1/event.json +++ b/core-test/src/main/resources/senlin/v1/event.json @@ -1,16 +1,16 @@ { - "event": { - "action": "create", - "cluster_id": null, - "id": "2d255b9c-8f36-41a2-a137-c0175ccc29c3", - "level": "20", - "obj_id": "0df0931b-e251-4f2e-8719-4ebfda3627ba", - "obj_name": "node009", - "obj_type": "NODE", - "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", - "status": "CREATING", - "status_reason": "Initializing", - "timestamp": "2015-03-05T08:53:15", - "user": "a21ded6060534d99840658a777c2af5a" - } + "event": { + "action": "create", + "cluster_id": null, + "id": "2d255b9c-8f36-41a2-a137-c0175ccc29c3", + "level": "20", + "obj_id": "0df0931b-e251-4f2e-8719-4ebfda3627ba", + "obj_name": "node009", + "obj_type": "NODE", + "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", + "status": "CREATING", + "status_reason": "Initializing", + "timestamp": "2015-03-05T08:53:15", + "user": "a21ded6060534d99840658a777c2af5a" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/events.json b/core-test/src/main/resources/senlin/v1/events.json index 39556974e..fa47c1dc1 100644 --- a/core-test/src/main/resources/senlin/v1/events.json +++ b/core-test/src/main/resources/senlin/v1/events.json @@ -1,292 +1,292 @@ { - "events": [ - { - "action": "CLUSTER_CREATE", - "cluster": { - "created_at": "2016-05-24T09:25:16.000000", - "data": {}, - "desired_capacity": 2, - "domain": null, - "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "init_at": "2016-05-24T09:25:15.000000", - "max_size": -1, - "meta_data": {}, - "min_size": 0, - "name": "lion-cluster", - "next_index": 3, - "parent": null, - "policies": [ - { - "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "data": null, - "enabled": true, - "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", - "last_op": "2016-05-24T09:25:18.000000", - "policy": { - "cooldown": null, - "created_at": "2016-05-24T09:25:17.000000", - "data": {}, - "domain": null, - "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "level": null, - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "priority": 100 - } - ], - "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ERROR", - "status_reason": "Failed in creating nodes.", - "timeout": 3600, - "updated_at": "2016-05-24T09:25:18.000000", - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, + "events": [ + { + "action": "CLUSTER_CREATE", + "cluster": { + "created_at": "2016-05-24T09:25:16.000000", + "data": {}, + "desired_capacity": 2, + "domain": null, + "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "init_at": "2016-05-24T09:25:15.000000", + "max_size": -1, + "meta_data": {}, + "min_size": 0, + "name": "lion-cluster", + "next_index": 3, + "parent": null, + "policies": [ + { "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "id": "b6d7b823-1811-492b-8a54-fb15a5a0bafe", - "level": "20", - "meta_data": {}, - "obj_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "obj_name": "cluster_create_7e0c9843", - "obj_type": "CLUSTERACTION", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "START", - "status_reason": "The action is being processed.", - "timestamp": "2016-05-24T09:25:15", - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "action": "CLUSTER_CREATE", - "cluster": { - "created_at": "2016-05-24T09:25:16.000000", - "data": {}, - "desired_capacity": 2, - "domain": null, - "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "init_at": "2016-05-24T09:25:15.000000", - "max_size": -1, - "meta_data": {}, - "min_size": 0, - "name": "lion-cluster", - "next_index": 3, - "parent": null, - "policies": [ - { - "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "data": null, - "enabled": true, - "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", - "last_op": "2016-05-24T09:25:18.000000", - "policy": { - "cooldown": null, - "created_at": "2016-05-24T09:25:17.000000", - "data": {}, - "domain": null, - "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "level": null, - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "priority": 100 - } - ], - "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ERROR", - "status_reason": "Failed in creating nodes.", - "timeout": 3600, - "updated_at": "2016-05-24T09:25:18.000000", - "user": "fa465946d3aa4b4caa411da77632d6b6" + "data": null, + "enabled": true, + "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", + "last_op": "2016-05-24T09:25:18.000000", + "policy": { + "cooldown": null, + "created_at": "2016-05-24T09:25:17.000000", + "data": {}, + "domain": null, + "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "level": null, + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" + }, + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" }, + "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "priority": 100 + } + ], + "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ERROR", + "status_reason": "Failed in creating nodes.", + "timeout": 3600, + "updated_at": "2016-05-24T09:25:18.000000", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "id": "b6d7b823-1811-492b-8a54-fb15a5a0bafe", + "level": "20", + "meta_data": {}, + "obj_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "obj_name": "cluster_create_7e0c9843", + "obj_type": "CLUSTERACTION", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "START", + "status_reason": "The action is being processed.", + "timestamp": "2016-05-24T09:25:15", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "action": "CLUSTER_CREATE", + "cluster": { + "created_at": "2016-05-24T09:25:16.000000", + "data": {}, + "desired_capacity": 2, + "domain": null, + "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "init_at": "2016-05-24T09:25:15.000000", + "max_size": -1, + "meta_data": {}, + "min_size": 0, + "name": "lion-cluster", + "next_index": 3, + "parent": null, + "policies": [ + { "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "id": "1c4fb2b1-14b3-4188-b8ac-62936d8917f4", - "level": "20", - "meta_data": {}, - "obj_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "obj_name": "cluster_create_7e0c9843", - "obj_type": "CLUSTERACTION", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "SUCCEEDED", - "status_reason": "Cluster creation succeeded.", - "timestamp": "2016-05-24T09:25:16", - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "action": "NODE_CREATE", - "cluster": { - "created_at": "2016-05-24T09:25:16.000000", - "data": {}, - "desired_capacity": 2, - "domain": null, - "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "init_at": "2016-05-24T09:25:15.000000", - "max_size": -1, - "meta_data": {}, - "min_size": 0, - "name": "lion-cluster", - "next_index": 3, - "parent": null, - "policies": [ - { - "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "data": null, - "enabled": true, - "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", - "last_op": "2016-05-24T09:25:18.000000", - "policy": { - "cooldown": null, - "created_at": "2016-05-24T09:25:17.000000", - "data": {}, - "domain": null, - "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "level": null, - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "priority": 100 - } - ], - "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ERROR", - "status_reason": "Failed in creating nodes.", - "timeout": 3600, - "updated_at": "2016-05-24T09:25:18.000000", - "user": "fa465946d3aa4b4caa411da77632d6b6" + "data": null, + "enabled": true, + "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", + "last_op": "2016-05-24T09:25:18.000000", + "policy": { + "cooldown": null, + "created_at": "2016-05-24T09:25:17.000000", + "data": {}, + "domain": null, + "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "level": null, + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" + }, + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" }, + "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "priority": 100 + } + ], + "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ERROR", + "status_reason": "Failed in creating nodes.", + "timeout": 3600, + "updated_at": "2016-05-24T09:25:18.000000", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "id": "1c4fb2b1-14b3-4188-b8ac-62936d8917f4", + "level": "20", + "meta_data": {}, + "obj_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "obj_name": "cluster_create_7e0c9843", + "obj_type": "CLUSTERACTION", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "SUCCEEDED", + "status_reason": "Cluster creation succeeded.", + "timestamp": "2016-05-24T09:25:16", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "action": "NODE_CREATE", + "cluster": { + "created_at": "2016-05-24T09:25:16.000000", + "data": {}, + "desired_capacity": 2, + "domain": null, + "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "init_at": "2016-05-24T09:25:15.000000", + "max_size": -1, + "meta_data": {}, + "min_size": 0, + "name": "lion-cluster", + "next_index": 3, + "parent": null, + "policies": [ + { "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "id": "b60aa380-b164-449a-8a6a-69067eb3dd2f", - "level": "20", - "meta_data": {}, - "obj_id": "d3451489-708b-4bd0-a147-a0c02dd9cb00", - "obj_name": "node_create_d3451489", - "obj_type": "NODEACTION", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "START", - "status_reason": "The action is being processed.", - "timestamp": "2016-05-24T09:25:16", - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "action": "NODE_CREATE", - "cluster": { - "created_at": "2016-05-24T09:25:16.000000", - "data": {}, - "desired_capacity": 2, - "domain": null, - "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "init_at": "2016-05-24T09:25:15.000000", - "max_size": -1, - "meta_data": {}, - "min_size": 0, - "name": "lion-cluster", - "next_index": 3, - "parent": null, - "policies": [ - { - "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "data": null, - "enabled": true, - "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", - "last_op": "2016-05-24T09:25:18.000000", - "policy": { - "cooldown": null, - "created_at": "2016-05-24T09:25:17.000000", - "data": {}, - "domain": null, - "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "level": null, - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "priority": 100 - } - ], - "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "ERROR", - "status_reason": "Failed in creating nodes.", - "timeout": 3600, - "updated_at": "2016-05-24T09:25:18.000000", - "user": "fa465946d3aa4b4caa411da77632d6b6" + "data": null, + "enabled": true, + "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", + "last_op": "2016-05-24T09:25:18.000000", + "policy": { + "cooldown": null, + "created_at": "2016-05-24T09:25:17.000000", + "data": {}, + "domain": null, + "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "level": null, + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" + }, + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" }, + "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "priority": 100 + } + ], + "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ERROR", + "status_reason": "Failed in creating nodes.", + "timeout": 3600, + "updated_at": "2016-05-24T09:25:18.000000", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "id": "b60aa380-b164-449a-8a6a-69067eb3dd2f", + "level": "20", + "meta_data": {}, + "obj_id": "d3451489-708b-4bd0-a147-a0c02dd9cb00", + "obj_name": "node_create_d3451489", + "obj_type": "NODEACTION", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "START", + "status_reason": "The action is being processed.", + "timestamp": "2016-05-24T09:25:16", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "action": "NODE_CREATE", + "cluster": { + "created_at": "2016-05-24T09:25:16.000000", + "data": {}, + "desired_capacity": 2, + "domain": null, + "id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "init_at": "2016-05-24T09:25:15.000000", + "max_size": -1, + "meta_data": {}, + "min_size": 0, + "name": "lion-cluster", + "next_index": 3, + "parent": null, + "policies": [ + { "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "id": "f6826d83-baec-4a20-975b-3c96cfeb8dd4", - "level": "40", - "meta_data": {}, - "obj_id": "d3451489-708b-4bd0-a147-a0c02dd9cb00", - "obj_name": "node_create_d3451489", - "obj_type": "NODEACTION", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "status": "FAILED", - "status_reason": "Node creation failed.", - "timestamp": "2016-05-24T09:25:17", - "user": "fa465946d3aa4b4caa411da77632d6b6" - } - ] + "data": null, + "enabled": true, + "id": "d20e839a-1e67-4526-a2f0-f91a008f1392", + "last_op": "2016-05-24T09:25:18.000000", + "policy": { + "cooldown": null, + "created_at": "2016-05-24T09:25:17.000000", + "data": {}, + "domain": null, + "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "level": null, + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" + }, + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + "policy_id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "priority": 100 + } + ], + "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "ERROR", + "status_reason": "Failed in creating nodes.", + "timeout": 3600, + "updated_at": "2016-05-24T09:25:18.000000", + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "id": "f6826d83-baec-4a20-975b-3c96cfeb8dd4", + "level": "40", + "meta_data": {}, + "obj_id": "d3451489-708b-4bd0-a147-a0c02dd9cb00", + "obj_name": "node_create_d3451489", + "obj_type": "NODEACTION", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "status": "FAILED", + "status_reason": "Node creation failed.", + "timestamp": "2016-05-24T09:25:17", + "user": "fa465946d3aa4b4caa411da77632d6b6" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/node.json b/core-test/src/main/resources/senlin/v1/node.json index 0e9cfe479..d9c415343 100644 --- a/core-test/src/main/resources/senlin/v1/node.json +++ b/core-test/src/main/resources/senlin/v1/node.json @@ -1,22 +1,22 @@ { - "node": { - "cluster_id": null, - "created_at": "2015-02-10T12:03:16", - "data": {}, - "domain": null, - "id": "d5779bb0-f0a0-49c9-88cc-6f078adb5a0b", - "index": -1, - "init_at": "2015-02-10T12:03:13", - "metadata": {}, - "name": "node1", - "physical_id": "f41537fa-22ab-4bea-94c0-c874e19d0c80", - "profile_id": "edc63d0a-2ca4-48fa-9854-27926da76a4a", - "profile_name": "mystack", - "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", - "role": null, - "status": "ACTIVE", - "status_reason": "Creation succeeded", - "updated_at": "2015-03-04T04:58:27", - "user": "5e5bf8027826429c96af157f68dc9072" - } + "node": { + "cluster_id": null, + "created_at": "2015-02-10T12:03:16", + "data": {}, + "domain": null, + "id": "d5779bb0-f0a0-49c9-88cc-6f078adb5a0b", + "index": -1, + "init_at": "2015-02-10T12:03:13", + "metadata": {}, + "name": "node1", + "physical_id": "f41537fa-22ab-4bea-94c0-c874e19d0c80", + "profile_id": "edc63d0a-2ca4-48fa-9854-27926da76a4a", + "profile_name": "mystack", + "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", + "role": null, + "status": "ACTIVE", + "status_reason": "Creation succeeded", + "updated_at": "2015-03-04T04:58:27", + "user": "5e5bf8027826429c96af157f68dc9072" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/nodes.json b/core-test/src/main/resources/senlin/v1/nodes.json index e80cf0641..10a09245b 100644 --- a/core-test/src/main/resources/senlin/v1/nodes.json +++ b/core-test/src/main/resources/senlin/v1/nodes.json @@ -1,64 +1,64 @@ { - "nodes": [ - { - "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "created_at": null, - "data": {}, - "domain": null, - "id": "d3451489-708b-4bd0-a147-a0c02dd9cb00", - "index": 1, - "init_at": "2016-05-24T09:25:16", - "metadata": {}, - "name": "lion-node123", - "physical_id": null, - "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "profile_name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "role": "master", - "status": "ERROR", - "status_reason": "Profile failed in creating node due to: Service Unavailable", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", - "created_at": null, - "data": {}, - "domain": null, - "id": "b17c69ae-6315-4d9b-b4e5-88c288725bf5", - "index": 2, - "init_at": "2016-05-24T09:25:21", - "metadata": {}, - "name": "node-7e0c9843-002", - "physical_id": null, - "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "profile_name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "role": "", - "status": "ERROR", - "status_reason": "Profile failed in creating node due to: Service Unavailable", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "cluster_id": "b20496b9-d90c-4ad2-804d-5032624eebbc", - "created_at": null, - "data": {}, - "domain": null, - "id": "58bf0682-cc63-41bf-ab04-c3f27db2b478", - "index": 1, - "init_at": "2016-05-24T09:26:10", - "metadata": {}, - "name": "lion-node123", - "physical_id": null, - "profile_id": "4a746f95-eb4f-488f-b8dc-b1789b14cafd", - "profile_name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "role": "master", - "status": "ERROR", - "status_reason": "Profile failed in creating node due to: Service Unavailable", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - } - ] + "nodes": [ + { + "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "created_at": null, + "data": {}, + "domain": null, + "id": "d3451489-708b-4bd0-a147-a0c02dd9cb00", + "index": 1, + "init_at": "2016-05-24T09:25:16", + "metadata": {}, + "name": "lion-node123", + "physical_id": null, + "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "profile_name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "role": "master", + "status": "ERROR", + "status_reason": "Profile failed in creating node due to: Service Unavailable", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "cluster_id": "7e0c9843-54bf-4823-b545-d2f6ffb4ed25", + "created_at": null, + "data": {}, + "domain": null, + "id": "b17c69ae-6315-4d9b-b4e5-88c288725bf5", + "index": 2, + "init_at": "2016-05-24T09:25:21", + "metadata": {}, + "name": "node-7e0c9843-002", + "physical_id": null, + "profile_id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "profile_name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "role": "", + "status": "ERROR", + "status_reason": "Profile failed in creating node due to: Service Unavailable", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "cluster_id": "b20496b9-d90c-4ad2-804d-5032624eebbc", + "created_at": null, + "data": {}, + "domain": null, + "id": "58bf0682-cc63-41bf-ab04-c3f27db2b478", + "index": 1, + "init_at": "2016-05-24T09:26:10", + "metadata": {}, + "name": "lion-node123", + "physical_id": null, + "profile_id": "4a746f95-eb4f-488f-b8dc-b1789b14cafd", + "profile_name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "role": "master", + "status": "ERROR", + "status_reason": "Profile failed in creating node due to: Service Unavailable", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/policies.json b/core-test/src/main/resources/senlin/v1/policies.json index 3911f9fcf..c1e56d77f 100644 --- a/core-test/src/main/resources/senlin/v1/policies.json +++ b/core-test/src/main/resources/senlin/v1/policies.json @@ -1,211 +1,211 @@ { - "policies": [ - { - "created_at": "2016-05-24T09:25:17", - "data": {}, - "domain": null, - "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "policies": [ + { + "created_at": "2016-05-24T09:25:17", + "data": {}, + "domain": null, + "id": "be24729e-c60c-4f06-9ba4-2d3872c23199", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-24T09:26:11", - "data": {}, - "domain": null, - "id": "93f3f9d1-3a58-4b4b-90d0-c0493e0379a0", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-24T09:26:11", + "data": {}, + "domain": null, + "id": "93f3f9d1-3a58-4b4b-90d0-c0493e0379a0", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-25T08:34:11", - "data": {}, - "domain": null, - "id": "390ff9e8-8ad3-464c-9535-c895b3f1bda3", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:34:11", + "data": {}, + "domain": null, + "id": "390ff9e8-8ad3-464c-9535-c895b3f1bda3", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-25T08:38:40", - "data": {}, - "domain": null, - "id": "ee76b62b-e303-4abf-9fe4-7376318ffc92", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:38:40", + "data": {}, + "domain": null, + "id": "ee76b62b-e303-4abf-9fe4-7376318ffc92", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-25T08:45:08", - "data": {}, - "domain": null, - "id": "e7837671-cd5e-42c1-921f-68c2b90a2173", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:45:08", + "data": {}, + "domain": null, + "id": "e7837671-cd5e-42c1-921f-68c2b90a2173", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-25T08:58:55", - "data": {}, - "domain": null, - "id": "fc1965a5-043d-4678-abee-3c4a16048a6d", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:58:55", + "data": {}, + "domain": null, + "id": "fc1965a5-043d-4678-abee-3c4a16048a6d", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-26T08:29:40", - "data": {}, - "domain": null, - "id": "4a994503-b5a2-4259-9875-db9c1b93b001", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-26T08:29:40", + "data": {}, + "domain": null, + "id": "4a994503-b5a2-4259-9875-db9c1b93b001", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-27T06:34:06", - "data": {}, - "domain": null, - "id": "87c6ea84-98c9-458a-93b1-9c2752bf06b9", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-27T06:34:06", + "data": {}, + "domain": null, + "id": "87c6ea84-98c9-458a-93b1-9c2752bf06b9", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" }, - { - "created_at": "2016-05-29T07:34:36", - "data": {}, - "domain": null, - "id": "5f1dba78-4fb6-416d-bfaf-66c48d403d7d", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" - }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - } - ] + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-29T07:34:36", + "data": {}, + "domain": null, + "id": "5f1dba78-4fb6-416d-bfaf-66c48d403d7d", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" + }, + "event": "CLUSTER_SCALE_IN" + }, + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/policy.json b/core-test/src/main/resources/senlin/v1/policy.json index 5dcfa7004..ba3f05f13 100644 --- a/core-test/src/main/resources/senlin/v1/policy.json +++ b/core-test/src/main/resources/senlin/v1/policy.json @@ -1,25 +1,25 @@ { - "policy": { - "created_at": "2016-05-29T07:35:07", - "data": {}, - "domain": null, - "id": "3ad6a92c-f969-4d69-8a83-0301f319fc78", - "name": "lion-policy123", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "adjustment": { - "min_step": 1, - "number": 1, - "type": "CHANGE_IN_CAPACITY" - }, - "event": "CLUSTER_SCALE_IN" - }, - "type": "senlin.policy.scaling", - "version": "1.0" + "policy": { + "created_at": "2016-05-29T07:35:07", + "data": {}, + "domain": null, + "id": "3ad6a92c-f969-4d69-8a83-0301f319fc78", + "name": "lion-policy123", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "adjustment": { + "min_step": 1, + "number": 1, + "type": "CHANGE_IN_CAPACITY" }, - "type": "senlin.policy.scaling-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - } + "event": "CLUSTER_SCALE_IN" + }, + "type": "senlin.policy.scaling", + "version": "1.0" + }, + "type": "senlin.policy.scaling-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/policy_type.json b/core-test/src/main/resources/senlin/v1/policy_type.json index d2c514299..f02e9a794 100644 --- a/core-test/src/main/resources/senlin/v1/policy_type.json +++ b/core-test/src/main/resources/senlin/v1/policy_type.json @@ -1,42 +1,42 @@ { - "policy_type": { - "name": "senlin.policy.deletion", - "schema": { - "criteria": { - "constraints": [ - { - "constraint": [ - "OLDEST_FIRST", - "OLDEST_PROFILE_FRIST", - "YOUNGEST_FIRST", - "RANDOM" - ], - "type": "AllowedValues" - } - ], - "default": "RANDOM", - "description": "Criteria used in selecting candidates for deletion", - "required": false, - "type": "String" - }, - "destroy_after_deletion": { - "default": true, - "description": "Whether a node should be completely destroyed after deletion. Default to true", - "required": false, - "type": "Boolean" - }, - "grace_period": { - "default": 0, - "description": "Number of seconds before real deletion happens.", - "required": false, - "type": "Integer" - }, - "reduce_desired_capacity": { - "default": false, - "description": "Whether the desired capacity of the cluster should be reduced along the deletion. Default to false.", - "required": false, - "type": "Boolean" - } - } + "policy_type": { + "name": "senlin.policy.deletion", + "schema": { + "criteria": { + "constraints": [ + { + "constraint": [ + "OLDEST_FIRST", + "OLDEST_PROFILE_FRIST", + "YOUNGEST_FIRST", + "RANDOM" + ], + "type": "AllowedValues" + } + ], + "default": "RANDOM", + "description": "Criteria used in selecting candidates for deletion", + "required": false, + "type": "String" + }, + "destroy_after_deletion": { + "default": true, + "description": "Whether a node should be completely destroyed after deletion. Default to true", + "required": false, + "type": "Boolean" + }, + "grace_period": { + "default": 0, + "description": "Number of seconds before real deletion happens.", + "required": false, + "type": "Integer" + }, + "reduce_desired_capacity": { + "default": false, + "description": "Whether the desired capacity of the cluster should be reduced along the deletion. Default to false.", + "required": false, + "type": "Boolean" + } } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/policy_types.json b/core-test/src/main/resources/senlin/v1/policy_types.json index 7dcb25205..44875c5b7 100644 --- a/core-test/src/main/resources/senlin/v1/policy_types.json +++ b/core-test/src/main/resources/senlin/v1/policy_types.json @@ -1,22 +1,22 @@ { - "policy_types": [ - { - "name": "ScalingPolicy" - }, - { - "name": "PlacementPolicy" - }, - { - "name": "DeletionPolicy" - }, - { - "name": "LoadBalancingPolicy" - }, - { - "name": "HealthPolicy" - }, - { - "name": "UpdatePolicy" - } - ] + "policy_types": [ + { + "name": "ScalingPolicy" + }, + { + "name": "PlacementPolicy" + }, + { + "name": "DeletionPolicy" + }, + { + "name": "LoadBalancingPolicy" + }, + { + "name": "HealthPolicy" + }, + { + "name": "UpdatePolicy" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/profile.json b/core-test/src/main/resources/senlin/v1/profile.json index ed75edca7..3c6d6c8d9 100644 --- a/core-test/src/main/resources/senlin/v1/profile.json +++ b/core-test/src/main/resources/senlin/v1/profile.json @@ -1,94 +1,94 @@ { - "profile": { - "created_at": "2016-05-29T07:35:06", - "domain": null, - "id": "dc89e919-91f5-4733-81b0-91257c24bba1", - "metadata": {}, - "name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { - "properties": { - "context": { - "region_name": "RegionOne" + "profile": { + "created_at": "2016-05-29T07:35:06", + "domain": null, + "id": "dc89e919-91f5-4733-81b0-91257c24bba1", + "metadata": {}, + "name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "context": { + "region_name": "RegionOne" + }, + "disable_rollback": true, + "environment": {}, + "files": {}, + "parameters": { + "server_name": "my_cirros_server" + }, + "template": { + "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", + "heat_template_version": "2014-10-16", + "parameters": { + "cpu": { + "default": 4, + "description": "cpu to boot with", + "type": "string" + }, + "disk": { + "default": 128, + "description": "disk to boot with", + "type": "string" + }, + "image": { + "default": "cirros", + "description": "Name or ID of the image to use for the instance.", + "type": "string" + }, + "mem": { + "default": 16, + "description": "mem to boot with", + "type": "string" + }, + "public_net": { + "default": "provider", + "description": "ID or name of public network where floating IP to be created", + "type": "string" + }, + "server_name": { + "default": "my_server", + "description": "Name for the instance to be created", + "type": "string" + } + }, + "resources": { + "my_server": { + "properties": { + "cpu": { + "get_param": "cpu" }, - "disable_rollback": true, - "environment": {}, - "files": {}, - "parameters": { - "server_name": "my_cirros_server" + "disk": { + "get_param": "disk" }, - "template": { - "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", - "heat_template_version": "2014-10-16", - "parameters": { - "cpu": { - "default": 4, - "description": "cpu to boot with", - "type": "string" - }, - "disk": { - "default": 128, - "description": "disk to boot with", - "type": "string" - }, - "image": { - "default": "cirros", - "description": "Name or ID of the image to use for the instance.", - "type": "string" - }, - "mem": { - "default": 16, - "description": "mem to boot with", - "type": "string" - }, - "public_net": { - "default": "provider", - "description": "ID or name of public network where floating IP to be created", - "type": "string" - }, - "server_name": { - "default": "my_server", - "description": "Name for the instance to be created", - "type": "string" - } - }, - "resources": { - "my_server": { - "properties": { - "cpu": { - "get_param": "cpu" - }, - "disk": { - "get_param": "disk" - }, - "image": { - "get_param": "image" - }, - "mem": { - "get_param": "mem" - }, - "name": { - "get_param": "server_name" - }, - "networks": [ - { - "network": { - "get_param": "public_net" - } - } - ] - }, - "type": "OS::DtCenter::Server" - } - } + "image": { + "get_param": "image" }, - "timeout": 60 - }, - "type": "os.heat.stack", - "version": 1 + "mem": { + "get_param": "mem" + }, + "name": { + "get_param": "server_name" + }, + "networks": [ + { + "network": { + "get_param": "public_net" + } + } + ] + }, + "type": "OS::DtCenter::Server" + } + } }, - "type": "os.heat.stack-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - } + "timeout": 60 + }, + "type": "os.heat.stack", + "version": 1 + }, + "type": "os.heat.stack-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/profile_type.json b/core-test/src/main/resources/senlin/v1/profile_type.json index cfd6bc68e..348abef18 100644 --- a/core-test/src/main/resources/senlin/v1/profile_type.json +++ b/core-test/src/main/resources/senlin/v1/profile_type.json @@ -1,47 +1,47 @@ { - "profile_type": { - "name": "os.heat.stack", - "schema": { - "context": { - "default": {}, - "description": "A dictionary for specifying the customized context for stack operations", - "required": false, - "type": "Map" - }, - "disable_rollback": { - "default": true, - "description": "A boolean specifying whether a stack operation can be rolled back.", - "required": false, - "type": "Boolean" - }, - "environment": { - "default": {}, - "description": "A map that specifies the environment used for stack operations.", - "required": false, - "type": "Map" - }, - "files": { - "default": {}, - "description": "Contents of files referenced by the template, if any.", - "required": false, - "type": "Map" - }, - "parameters": { - "default": {}, - "description": "Parameters to be passed to Heat for stack operations.", - "required": false, - "type": "Map" - }, - "template": { - "description": "Heat stack template.", - "required": true, - "type": "Map" - }, - "timeout": { - "description": "A integer that specifies the number of minutes that a stack operation times out.", - "required": false, - "type": "Integer" - } - } + "profile_type": { + "name": "os.heat.stack", + "schema": { + "context": { + "default": {}, + "description": "A dictionary for specifying the customized context for stack operations", + "required": false, + "type": "Map" + }, + "disable_rollback": { + "default": true, + "description": "A boolean specifying whether a stack operation can be rolled back.", + "required": false, + "type": "Boolean" + }, + "environment": { + "default": {}, + "description": "A map that specifies the environment used for stack operations.", + "required": false, + "type": "Map" + }, + "files": { + "default": {}, + "description": "Contents of files referenced by the template, if any.", + "required": false, + "type": "Map" + }, + "parameters": { + "default": {}, + "description": "Parameters to be passed to Heat for stack operations.", + "required": false, + "type": "Map" + }, + "template": { + "description": "Heat stack template.", + "required": true, + "type": "Map" + }, + "timeout": { + "description": "A integer that specifies the number of minutes that a stack operation times out.", + "required": false, + "type": "Integer" + } } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/profile_types.json b/core-test/src/main/resources/senlin/v1/profile_types.json index 850dba7ef..d9b1e6e29 100644 --- a/core-test/src/main/resources/senlin/v1/profile_types.json +++ b/core-test/src/main/resources/senlin/v1/profile_types.json @@ -1,13 +1,13 @@ { - "profile_types": [ - { - "name": "os.heat.stack" - }, - { - "name": "os.heat.resource" - }, - { - "name": "os.nova.server" - } - ] + "profile_types": [ + { + "name": "os.heat.stack" + }, + { + "name": "os.heat.resource" + }, + { + "name": "os.nova.server" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/profiles.json b/core-test/src/main/resources/senlin/v1/profiles.json index abadf8305..f11275896 100644 --- a/core-test/src/main/resources/senlin/v1/profiles.json +++ b/core-test/src/main/resources/senlin/v1/profiles.json @@ -1,372 +1,372 @@ { - "profiles": [ - { - "created_at": "2016-05-24T09:25:15", - "domain": null, - "id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", - "metadata": {}, - "name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { + "profiles": [ + { + "created_at": "2016-05-24T09:25:15", + "domain": null, + "id": "ddf94acb-492a-41cb-a278-9ba7fbb31bb7", + "metadata": {}, + "name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "context": { + "region_name": "RegionOne" + }, + "disable_rollback": true, + "environment": {}, + "files": {}, + "parameters": { + "server_name": "my_cirros_server" + }, + "template": { + "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", + "heat_template_version": "2014-10-16", + "parameters": { + "cpu": { + "default": 4, + "description": "cpu to boot with", + "type": "string" + }, + "disk": { + "default": 128, + "description": "disk to boot with", + "type": "string" + }, + "image": { + "default": "cirros", + "description": "Name or ID of the image to use for the instance.", + "type": "string" + }, + "mem": { + "default": 16, + "description": "mem to boot with", + "type": "string" + }, + "public_net": { + "default": "provider", + "description": "ID or name of public network where floating IP to be created", + "type": "string" + }, + "server_name": { + "default": "my_server", + "description": "Name for the instance to be created", + "type": "string" + } + }, + "resources": { + "my_server": { "properties": { - "context": { - "region_name": "RegionOne" - }, - "disable_rollback": true, - "environment": {}, - "files": {}, - "parameters": { - "server_name": "my_cirros_server" - }, - "template": { - "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", - "heat_template_version": "2014-10-16", - "parameters": { - "cpu": { - "default": 4, - "description": "cpu to boot with", - "type": "string" - }, - "disk": { - "default": 128, - "description": "disk to boot with", - "type": "string" - }, - "image": { - "default": "cirros", - "description": "Name or ID of the image to use for the instance.", - "type": "string" - }, - "mem": { - "default": 16, - "description": "mem to boot with", - "type": "string" - }, - "public_net": { - "default": "provider", - "description": "ID or name of public network where floating IP to be created", - "type": "string" - }, - "server_name": { - "default": "my_server", - "description": "Name for the instance to be created", - "type": "string" - } - }, - "resources": { - "my_server": { - "properties": { - "cpu": { - "get_param": "cpu" - }, - "disk": { - "get_param": "disk" - }, - "image": { - "get_param": "image" - }, - "mem": { - "get_param": "mem" - }, - "name": { - "get_param": "server_name" - }, - "networks": [ - { - "network": { - "get_param": "public_net" - } - } - ] - }, - "type": "OS::DtCenter::Server" - } - } - }, - "timeout": 60 + "cpu": { + "get_param": "cpu" + }, + "disk": { + "get_param": "disk" + }, + "image": { + "get_param": "image" + }, + "mem": { + "get_param": "mem" + }, + "name": { + "get_param": "server_name" + }, + "networks": [ + { + "network": { + "get_param": "public_net" + } + } + ] }, - "type": "os.heat.stack", - "version": 1 - }, - "type": "os.heat.stack-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "OS::DtCenter::Server" + } + } + }, + "timeout": 60 }, - { - "created_at": "2016-05-24T09:26:09", - "domain": null, - "id": "4a746f95-eb4f-488f-b8dc-b1789b14cafd", - "metadata": {}, - "name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { + "type": "os.heat.stack", + "version": 1 + }, + "type": "os.heat.stack-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-24T09:26:09", + "domain": null, + "id": "4a746f95-eb4f-488f-b8dc-b1789b14cafd", + "metadata": {}, + "name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "context": { + "region_name": "RegionOne" + }, + "disable_rollback": true, + "environment": {}, + "files": {}, + "parameters": { + "server_name": "my_cirros_server" + }, + "template": { + "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", + "heat_template_version": "2014-10-16", + "parameters": { + "cpu": { + "default": 4, + "description": "cpu to boot with", + "type": "string" + }, + "disk": { + "default": 128, + "description": "disk to boot with", + "type": "string" + }, + "image": { + "default": "cirros", + "description": "Name or ID of the image to use for the instance.", + "type": "string" + }, + "mem": { + "default": 16, + "description": "mem to boot with", + "type": "string" + }, + "public_net": { + "default": "provider", + "description": "ID or name of public network where floating IP to be created", + "type": "string" + }, + "server_name": { + "default": "my_server", + "description": "Name for the instance to be created", + "type": "string" + } + }, + "resources": { + "my_server": { "properties": { - "context": { - "region_name": "RegionOne" - }, - "disable_rollback": true, - "environment": {}, - "files": {}, - "parameters": { - "server_name": "my_cirros_server" - }, - "template": { - "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", - "heat_template_version": "2014-10-16", - "parameters": { - "cpu": { - "default": 4, - "description": "cpu to boot with", - "type": "string" - }, - "disk": { - "default": 128, - "description": "disk to boot with", - "type": "string" - }, - "image": { - "default": "cirros", - "description": "Name or ID of the image to use for the instance.", - "type": "string" - }, - "mem": { - "default": 16, - "description": "mem to boot with", - "type": "string" - }, - "public_net": { - "default": "provider", - "description": "ID or name of public network where floating IP to be created", - "type": "string" - }, - "server_name": { - "default": "my_server", - "description": "Name for the instance to be created", - "type": "string" - } - }, - "resources": { - "my_server": { - "properties": { - "cpu": { - "get_param": "cpu" - }, - "disk": { - "get_param": "disk" - }, - "image": { - "get_param": "image" - }, - "mem": { - "get_param": "mem" - }, - "name": { - "get_param": "server_name" - }, - "networks": [ - { - "network": { - "get_param": "public_net" - } - } - ] - }, - "type": "OS::DtCenter::Server" - } - } - }, - "timeout": 60 + "cpu": { + "get_param": "cpu" + }, + "disk": { + "get_param": "disk" + }, + "image": { + "get_param": "image" + }, + "mem": { + "get_param": "mem" + }, + "name": { + "get_param": "server_name" + }, + "networks": [ + { + "network": { + "get_param": "public_net" + } + } + ] }, - "type": "os.heat.stack", - "version": 1 - }, - "type": "os.heat.stack-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "OS::DtCenter::Server" + } + } + }, + "timeout": 60 }, - { - "created_at": "2016-05-25T08:33:57", - "domain": null, - "id": "ae7c8828-486a-4d35-9ee7-f1985362ba81", - "metadata": {}, - "name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { + "type": "os.heat.stack", + "version": 1 + }, + "type": "os.heat.stack-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:33:57", + "domain": null, + "id": "ae7c8828-486a-4d35-9ee7-f1985362ba81", + "metadata": {}, + "name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "context": { + "region_name": "RegionOne" + }, + "disable_rollback": true, + "environment": {}, + "files": {}, + "parameters": { + "server_name": "my_cirros_server" + }, + "template": { + "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", + "heat_template_version": "2014-10-16", + "parameters": { + "cpu": { + "default": 4, + "description": "cpu to boot with", + "type": "string" + }, + "disk": { + "default": 128, + "description": "disk to boot with", + "type": "string" + }, + "image": { + "default": "cirros", + "description": "Name or ID of the image to use for the instance.", + "type": "string" + }, + "mem": { + "default": 16, + "description": "mem to boot with", + "type": "string" + }, + "public_net": { + "default": "provider", + "description": "ID or name of public network where floating IP to be created", + "type": "string" + }, + "server_name": { + "default": "my_server", + "description": "Name for the instance to be created", + "type": "string" + } + }, + "resources": { + "my_server": { "properties": { - "context": { - "region_name": "RegionOne" - }, - "disable_rollback": true, - "environment": {}, - "files": {}, - "parameters": { - "server_name": "my_cirros_server" - }, - "template": { - "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", - "heat_template_version": "2014-10-16", - "parameters": { - "cpu": { - "default": 4, - "description": "cpu to boot with", - "type": "string" - }, - "disk": { - "default": 128, - "description": "disk to boot with", - "type": "string" - }, - "image": { - "default": "cirros", - "description": "Name or ID of the image to use for the instance.", - "type": "string" - }, - "mem": { - "default": 16, - "description": "mem to boot with", - "type": "string" - }, - "public_net": { - "default": "provider", - "description": "ID or name of public network where floating IP to be created", - "type": "string" - }, - "server_name": { - "default": "my_server", - "description": "Name for the instance to be created", - "type": "string" - } - }, - "resources": { - "my_server": { - "properties": { - "cpu": { - "get_param": "cpu" - }, - "disk": { - "get_param": "disk" - }, - "image": { - "get_param": "image" - }, - "mem": { - "get_param": "mem" - }, - "name": { - "get_param": "server_name" - }, - "networks": [ - { - "network": { - "get_param": "public_net" - } - } - ] - }, - "type": "OS::DtCenter::Server" - } - } - }, - "timeout": 60 + "cpu": { + "get_param": "cpu" + }, + "disk": { + "get_param": "disk" + }, + "image": { + "get_param": "image" + }, + "mem": { + "get_param": "mem" + }, + "name": { + "get_param": "server_name" + }, + "networks": [ + { + "network": { + "get_param": "public_net" + } + } + ] }, - "type": "os.heat.stack", - "version": 1 - }, - "type": "os.heat.stack-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" + "type": "OS::DtCenter::Server" + } + } + }, + "timeout": 60 }, - { - "created_at": "2016-05-25T08:38:39", - "domain": null, - "id": "61ae5541-ccd5-45e2-8e68-05ae2af613e2", - "metadata": {}, - "name": "lion-test", - "project": "7b2171b528bb48ba8a0c180ea135e224", - "spec": { + "type": "os.heat.stack", + "version": 1 + }, + "type": "os.heat.stack-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "created_at": "2016-05-25T08:38:39", + "domain": null, + "id": "61ae5541-ccd5-45e2-8e68-05ae2af613e2", + "metadata": {}, + "name": "lion-test", + "project": "7b2171b528bb48ba8a0c180ea135e224", + "spec": { + "properties": { + "context": { + "region_name": "RegionOne" + }, + "disable_rollback": true, + "environment": {}, + "files": {}, + "parameters": { + "server_name": "my_cirros_server" + }, + "template": { + "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", + "heat_template_version": "2014-10-16", + "parameters": { + "cpu": { + "default": 4, + "description": "cpu to boot with", + "type": "string" + }, + "disk": { + "default": 128, + "description": "disk to boot with", + "type": "string" + }, + "image": { + "default": "cirros", + "description": "Name or ID of the image to use for the instance.", + "type": "string" + }, + "mem": { + "default": 16, + "description": "mem to boot with", + "type": "string" + }, + "public_net": { + "default": "provider", + "description": "ID or name of public network where floating IP to be created", + "type": "string" + }, + "server_name": { + "default": "my_server", + "description": "Name for the instance to be created", + "type": "string" + } + }, + "resources": { + "my_server": { "properties": { - "context": { - "region_name": "RegionOne" - }, - "disable_rollback": true, - "environment": {}, - "files": {}, - "parameters": { - "server_name": "my_cirros_server" - }, - "template": { - "description": "A HOT template that holds a VM instance with a Neutron port created in given private network and a floatingIP created in given external network.\n", - "heat_template_version": "2014-10-16", - "parameters": { - "cpu": { - "default": 4, - "description": "cpu to boot with", - "type": "string" - }, - "disk": { - "default": 128, - "description": "disk to boot with", - "type": "string" - }, - "image": { - "default": "cirros", - "description": "Name or ID of the image to use for the instance.", - "type": "string" - }, - "mem": { - "default": 16, - "description": "mem to boot with", - "type": "string" - }, - "public_net": { - "default": "provider", - "description": "ID or name of public network where floating IP to be created", - "type": "string" - }, - "server_name": { - "default": "my_server", - "description": "Name for the instance to be created", - "type": "string" - } - }, - "resources": { - "my_server": { - "properties": { - "cpu": { - "get_param": "cpu" - }, - "disk": { - "get_param": "disk" - }, - "image": { - "get_param": "image" - }, - "mem": { - "get_param": "mem" - }, - "name": { - "get_param": "server_name" - }, - "networks": [ - { - "network": { - "get_param": "public_net" - } - } - ] - }, - "type": "OS::DtCenter::Server" - } - } - }, - "timeout": 60 + "cpu": { + "get_param": "cpu" + }, + "disk": { + "get_param": "disk" + }, + "image": { + "get_param": "image" + }, + "mem": { + "get_param": "mem" + }, + "name": { + "get_param": "server_name" + }, + "networks": [ + { + "network": { + "get_param": "public_net" + } + } + ] }, - "type": "os.heat.stack", - "version": 1 - }, - "type": "os.heat.stack-1.0", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - } - ] + "type": "OS::DtCenter::Server" + } + } + }, + "timeout": 60 + }, + "type": "os.heat.stack", + "version": 1 + }, + "type": "os.heat.stack-1.0", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/receiver.json b/core-test/src/main/resources/senlin/v1/receiver.json index c65aa6413..3203f00cb 100644 --- a/core-test/src/main/resources/senlin/v1/receiver.json +++ b/core-test/src/main/resources/senlin/v1/receiver.json @@ -1,25 +1,25 @@ { - "receiver": { - "action": "CLUSTER_SCALE_OUT", - "actor": { - "trust_id": [ - "6dc6d336e3fc4c0a951b5698cd1236d9" - ] - }, - "channel": { - "alarm_url": "http://node1:8778/v1/webhooks/e03dd2e5-8f2e-4ec1-8c6a-74ba891e5422/trigger?V=1&count=1" - }, - "cluster_id": "ae63a10b-4a90-452c-aef1-113a0b255ee3", - "created_at": "2015-06-27T05:09:43", - "domain": "Default", - "id": "573aa1ba-bf45-49fd-907d-6b5d6e6adfd3", - "name": "cluster_inflate", - "params": { - "count": "1" - }, - "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", - "type": "webhook", - "updated_at": null, - "user": "b4ad2d6e18cc2b9c48049f6dbe8a5b3c" - } + "receiver": { + "action": "CLUSTER_SCALE_OUT", + "actor": { + "trust_id": [ + "6dc6d336e3fc4c0a951b5698cd1236d9" + ] + }, + "channel": { + "alarm_url": "http://node1:8778/v1/webhooks/e03dd2e5-8f2e-4ec1-8c6a-74ba891e5422/trigger?V=1&count=1" + }, + "cluster_id": "ae63a10b-4a90-452c-aef1-113a0b255ee3", + "created_at": "2015-06-27T05:09:43", + "domain": "Default", + "id": "573aa1ba-bf45-49fd-907d-6b5d6e6adfd3", + "name": "cluster_inflate", + "params": { + "count": "1" + }, + "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", + "type": "webhook", + "updated_at": null, + "user": "b4ad2d6e18cc2b9c48049f6dbe8a5b3c" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/receivers.json b/core-test/src/main/resources/senlin/v1/receivers.json index 5557d5571..ae4e4d0fd 100644 --- a/core-test/src/main/resources/senlin/v1/receivers.json +++ b/core-test/src/main/resources/senlin/v1/receivers.json @@ -1,109 +1,109 @@ { - "receivers": [ - { - "action": "CLUSTER_SCALE_OUT", - "actor": { - "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" - }, - "channel": { - "alarm_url": "http://10.158.247.76:8778/v1/webhooks/05f72ca7-d0cd-4e9c-9f84-caec408e7580/trigger?V=1&count=1" - }, - "cluster_id": "5938380f-6903-4322-bdd9-d0597a0b6f41", - "created_at": "2016-05-25T08:34:24", - "domain": null, - "id": "05f72ca7-d0cd-4e9c-9f84-caec408e7580", - "name": "lion-test", - "params": { - "count": "1" - }, - "project": "7b2171b528bb48ba8a0c180ea135e224", - "type": "webhook", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "action": "CLUSTER_SCALE_OUT", - "actor": { - "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" - }, - "channel": { - "alarm_url": "http://10.158.247.76:8778/v1/webhooks/18bfa817-394c-4cd2-a37a-9947add37ef5/trigger?V=1&count=1" - }, - "cluster_id": "07e2e41b-7aa7-42c8-9318-87ef94c78bd7", - "created_at": "2016-05-26T08:29:52", - "domain": null, - "id": "18bfa817-394c-4cd2-a37a-9947add37ef5", - "name": "lion-test", - "params": { - "count": "1" - }, - "project": "7b2171b528bb48ba8a0c180ea135e224", - "type": "webhook", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "action": "CLUSTER_SCALE_OUT", - "actor": { - "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" - }, - "channel": { - "alarm_url": "http://10.158.247.76:8778/v1/webhooks/2eb369be-359b-4df0-89de-bf49f3c76620/trigger?V=1&count=1" - }, - "cluster_id": "250d1077-d68d-4b1b-979b-079cf601e4a8", - "created_at": "2016-05-29T07:34:37", - "domain": null, - "id": "2eb369be-359b-4df0-89de-bf49f3c76620", - "name": "lion-test", - "params": { - "count": "1" - }, - "project": "7b2171b528bb48ba8a0c180ea135e224", - "type": "webhook", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "action": "CLUSTER_SCALE_OUT", - "actor": { - "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" - }, - "channel": { - "alarm_url": "http://10.158.247.76:8778/v1/webhooks/51575fae-a83c-44ac-9214-337663dd04f9/trigger?V=1&count=1" - }, - "cluster_id": "8c596d52-5657-4f09-a825-c6140231d961", - "created_at": "2016-05-25T08:45:10", - "domain": null, - "id": "51575fae-a83c-44ac-9214-337663dd04f9", - "name": "lion-test", - "params": { - "count": "1" - }, - "project": "7b2171b528bb48ba8a0c180ea135e224", - "type": "webhook", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - }, - { - "action": "CLUSTER_SCALE_OUT", - "actor": { - "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" - }, - "channel": { - "alarm_url": "http://10.158.247.76:8778/v1/webhooks/b23308f5-c4c3-4b30-9726-bdd1857a5db8/trigger?V=1&count=1" - }, - "cluster_id": "17192bab-aca9-4a81-98d7-822f4d62c28b", - "created_at": "2016-05-25T08:38:41", - "domain": null, - "id": "b23308f5-c4c3-4b30-9726-bdd1857a5db8", - "name": "lion-test", - "params": { - "count": "1" - }, - "project": "7b2171b528bb48ba8a0c180ea135e224", - "type": "webhook", - "updated_at": null, - "user": "fa465946d3aa4b4caa411da77632d6b6" - } - ] + "receivers": [ + { + "action": "CLUSTER_SCALE_OUT", + "actor": { + "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" + }, + "channel": { + "alarm_url": "http://10.158.247.76:8778/v1/webhooks/05f72ca7-d0cd-4e9c-9f84-caec408e7580/trigger?V=1&count=1" + }, + "cluster_id": "5938380f-6903-4322-bdd9-d0597a0b6f41", + "created_at": "2016-05-25T08:34:24", + "domain": null, + "id": "05f72ca7-d0cd-4e9c-9f84-caec408e7580", + "name": "lion-test", + "params": { + "count": "1" + }, + "project": "7b2171b528bb48ba8a0c180ea135e224", + "type": "webhook", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "action": "CLUSTER_SCALE_OUT", + "actor": { + "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" + }, + "channel": { + "alarm_url": "http://10.158.247.76:8778/v1/webhooks/18bfa817-394c-4cd2-a37a-9947add37ef5/trigger?V=1&count=1" + }, + "cluster_id": "07e2e41b-7aa7-42c8-9318-87ef94c78bd7", + "created_at": "2016-05-26T08:29:52", + "domain": null, + "id": "18bfa817-394c-4cd2-a37a-9947add37ef5", + "name": "lion-test", + "params": { + "count": "1" + }, + "project": "7b2171b528bb48ba8a0c180ea135e224", + "type": "webhook", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "action": "CLUSTER_SCALE_OUT", + "actor": { + "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" + }, + "channel": { + "alarm_url": "http://10.158.247.76:8778/v1/webhooks/2eb369be-359b-4df0-89de-bf49f3c76620/trigger?V=1&count=1" + }, + "cluster_id": "250d1077-d68d-4b1b-979b-079cf601e4a8", + "created_at": "2016-05-29T07:34:37", + "domain": null, + "id": "2eb369be-359b-4df0-89de-bf49f3c76620", + "name": "lion-test", + "params": { + "count": "1" + }, + "project": "7b2171b528bb48ba8a0c180ea135e224", + "type": "webhook", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "action": "CLUSTER_SCALE_OUT", + "actor": { + "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" + }, + "channel": { + "alarm_url": "http://10.158.247.76:8778/v1/webhooks/51575fae-a83c-44ac-9214-337663dd04f9/trigger?V=1&count=1" + }, + "cluster_id": "8c596d52-5657-4f09-a825-c6140231d961", + "created_at": "2016-05-25T08:45:10", + "domain": null, + "id": "51575fae-a83c-44ac-9214-337663dd04f9", + "name": "lion-test", + "params": { + "count": "1" + }, + "project": "7b2171b528bb48ba8a0c180ea135e224", + "type": "webhook", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + }, + { + "action": "CLUSTER_SCALE_OUT", + "actor": { + "trust_id": "b48a20f764eb40c7b2ad501f16f59fec" + }, + "channel": { + "alarm_url": "http://10.158.247.76:8778/v1/webhooks/b23308f5-c4c3-4b30-9726-bdd1857a5db8/trigger?V=1&count=1" + }, + "cluster_id": "17192bab-aca9-4a81-98d7-822f4d62c28b", + "created_at": "2016-05-25T08:38:41", + "domain": null, + "id": "b23308f5-c4c3-4b30-9726-bdd1857a5db8", + "name": "lion-test", + "params": { + "count": "1" + }, + "project": "7b2171b528bb48ba8a0c180ea135e224", + "type": "webhook", + "updated_at": null, + "user": "fa465946d3aa4b4caa411da77632d6b6" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/v1/resp_action.json b/core-test/src/main/resources/senlin/v1/resp_action.json index fb3c96c86..e590d1cd4 100644 --- a/core-test/src/main/resources/senlin/v1/resp_action.json +++ b/core-test/src/main/resources/senlin/v1/resp_action.json @@ -1,3 +1,3 @@ { - "action": "40a436b1-28d1-4de6-b2c3-0a34f478e2c9" + "action": "40a436b1-28d1-4de6-b2c3-0a34f478e2c9" } \ No newline at end of file diff --git a/core-test/src/main/resources/senlin/version.json b/core-test/src/main/resources/senlin/version.json index 243576472..fc26d1520 100644 --- a/core-test/src/main/resources/senlin/version.json +++ b/core-test/src/main/resources/senlin/version.json @@ -1,14 +1,14 @@ { - "versions": [ + "versions": [ + { + "status": "CURRENT", + "id": "v1.0", + "links": [ { - "status": "CURRENT", - "id": "v1.0", - "links": [ - { - "href": "http://192.168.12.34:8778/v1/", - "rel": "self" - } - ] + "href": "http://192.168.12.34:8778/v1/", + "rel": "self" } - ] + ] + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/containers.json b/core-test/src/main/resources/storage/containers.json index 5ae3dca12..49f4e1f8c 100644 --- a/core-test/src/main/resources/storage/containers.json +++ b/core-test/src/main/resources/storage/containers.json @@ -1,10 +1,12 @@ [ -{ - "count": 2, - "bytes": 100, - "name": "Test"}, -{ - "count": 1, - "bytes": 14, - "name": "marktwain" -}] \ No newline at end of file + { + "count": 2, + "bytes": 100, + "name": "Test" + }, + { + "count": 1, + "bytes": 14, + "name": "marktwain" + } +] \ No newline at end of file diff --git a/core-test/src/main/resources/storage/ext/services.json b/core-test/src/main/resources/storage/ext/services.json index 6990525f7..4a5490d82 100644 --- a/core-test/src/main/resources/storage/ext/services.json +++ b/core-test/src/main/resources/storage/ext/services.json @@ -1,20 +1,20 @@ { - "services": [ - { - "binary": "cinder-scheduler", - "host": "host1", - "state": "UP", - "status": "ENABLED", - "updated_at": "2012-10-29T13:42:02.000000", - "zone": "nova" - }, - { - "binary": "cinder-volume", - "host": "host1", - "state": "UP", - "status": "ENABLED", - "updated_at": "2012-10-29T13:42:05.000000", - "zone": "nova" - } - ] - } \ No newline at end of file + "services": [ + { + "binary": "cinder-scheduler", + "host": "host1", + "state": "UP", + "status": "ENABLED", + "updated_at": "2012-10-29T13:42:02.000000", + "zone": "nova" + }, + { + "binary": "cinder-volume", + "host": "host1", + "state": "UP", + "status": "ENABLED", + "updated_at": "2012-10-29T13:42:05.000000", + "zone": "nova" + } + ] +} \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v1/volume.json b/core-test/src/main/resources/storage/v1/volume.json index a0380ebbb..9b6721e4e 100644 --- a/core-test/src/main/resources/storage/v1/volume.json +++ b/core-test/src/main/resources/storage/v1/volume.json @@ -1,30 +1,32 @@ { - "volume": { - "status": "in-use", - "display_name": "vol-test", - "attachments": [{ - "host_name": "myhost", - "device": "/dev/vdd", - "server_id": "eaa6a54d-35c1-40ce-831d-bb61f991e1a9", - "id": "8a9287b7-4f4d-4213-8d75-63470f19f27c", - "volume_id": "8a9287b7-4f4d-4213-8d75-63470f19f27c" - }], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-05-25T15:03:43.104260", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "a description", - "os-volume-replication:extended_status": null, - "volume_type": "Gold", - "snapshot_id": "22222222-2222-2222-2222-222222222222", - "source_volid": "11111111-1111-1111-1111-111111111111", - "metadata": { - "readonly": "False", - "attached_mode": "rw" - }, + "volume": { + "status": "in-use", + "display_name": "vol-test", + "attachments": [ + { + "host_name": "myhost", + "device": "/dev/vdd", + "server_id": "eaa6a54d-35c1-40ce-831d-bb61f991e1a9", "id": "8a9287b7-4f4d-4213-8d75-63470f19f27c", - "size": 100 - } + "volume_id": "8a9287b7-4f4d-4213-8d75-63470f19f27c" + } + ], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-05-25T15:03:43.104260", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "a description", + "os-volume-replication:extended_status": null, + "volume_type": "Gold", + "snapshot_id": "22222222-2222-2222-2222-222222222222", + "source_volid": "11111111-1111-1111-1111-111111111111", + "metadata": { + "readonly": "False", + "attached_mode": "rw" + }, + "id": "8a9287b7-4f4d-4213-8d75-63470f19f27c", + "size": 100 + } } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v1/volumebackup.json b/core-test/src/main/resources/storage/v1/volumebackup.json index 3df5aaa6c..d26193f91 100644 --- a/core-test/src/main/resources/storage/v1/volumebackup.json +++ b/core-test/src/main/resources/storage/v1/volumebackup.json @@ -1,24 +1,27 @@ { - "backup": { - "status": "available", - "description": "by API999b49ff-a813-45cc-aef3-3ec82f089490", - "links": [{ - "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", - "rel": "self" - }, { - "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", - "rel": "bookmark" - }], - "availability_zone": "nova", - "has_dependent_backups": false, - "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", - "fail_reason": null, - "id": "735359d5-9584-4046-94d3-5ffc47be84f5", - "size": 1, - "object_count": 22, - "container": "test999b49ff-a813-45cc-aef3-3ec82f089490", - "name": "backup999b49ff-a813-45cc-aef3-3ec82f089490", - "created_at": "2016-11-22T06:23:33.000000", - "is_incremental": false - } + "backup": { + "status": "available", + "description": "by API999b49ff-a813-45cc-aef3-3ec82f089490", + "links": [ + { + "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", + "rel": "self" + }, + { + "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", + "rel": "bookmark" + } + ], + "availability_zone": "nova", + "has_dependent_backups": false, + "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", + "fail_reason": null, + "id": "735359d5-9584-4046-94d3-5ffc47be84f5", + "size": 1, + "object_count": 22, + "container": "test999b49ff-a813-45cc-aef3-3ec82f089490", + "name": "backup999b49ff-a813-45cc-aef3-3ec82f089490", + "created_at": "2016-11-22T06:23:33.000000", + "is_incremental": false + } } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v1/volumebackup_create_response.json b/core-test/src/main/resources/storage/v1/volumebackup_create_response.json index ff9a8162a..7e546ef67 100644 --- a/core-test/src/main/resources/storage/v1/volumebackup_create_response.json +++ b/core-test/src/main/resources/storage/v1/volumebackup_create_response.json @@ -1,13 +1,16 @@ { - "backup": { - "id": "7069c687-c85c-45ca-befa-aa78a971fdfe", - "links": [{ - "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", - "rel": "self" - }, { - "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", - "rel": "bookmark" - }], - "name": "backup1122" - } + "backup": { + "id": "7069c687-c85c-45ca-befa-aa78a971fdfe", + "links": [ + { + "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", + "rel": "self" + }, + { + "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", + "rel": "bookmark" + } + ], + "name": "backup1122" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v1/volumebackup_from_snapshot.json b/core-test/src/main/resources/storage/v1/volumebackup_from_snapshot.json index c61ec45a7..5335ee8c7 100644 --- a/core-test/src/main/resources/storage/v1/volumebackup_from_snapshot.json +++ b/core-test/src/main/resources/storage/v1/volumebackup_from_snapshot.json @@ -2,13 +2,16 @@ "backup": { "status": "available", "description": "by API999b49ff-a813-45cc-aef3-3ec82f089490", - "links": [{ - "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", - "rel": "self" - }, { - "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", - "rel": "bookmark" - }], + "links": [ + { + "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", + "rel": "self" + }, + { + "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", + "rel": "bookmark" + } + ], "availability_zone": "nova", "has_dependent_backups": false, "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", diff --git a/core-test/src/main/resources/storage/v1/volumebackups.json b/core-test/src/main/resources/storage/v1/volumebackups.json index dbf2f438b..31f941ce2 100644 --- a/core-test/src/main/resources/storage/v1/volumebackups.json +++ b/core-test/src/main/resources/storage/v1/volumebackups.json @@ -1,66 +1,79 @@ { - "backups": [{ - "status": "available", - "description": "by API", - "links": [{ - "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", - "rel": "self" - }, { - "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", - "rel": "bookmark" - }], - "availability_zone": "nova", - "has_dependent_backups": false, - "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", - "fail_reason": null, - "id": "7069c687-c85c-45ca-befa-aa78a971fdfe", - "size": 1, - "object_count": 22, - "container": "container1122", - "name": "backup1122", - "created_at": "2016-11-22T07:24:12.000000", - "is_incremental": false - }, { - "status": "available", - "description": "by API999b49ff-a813-45cc-aef3-3ec82f089490", - "links": [{ - "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", - "rel": "self" - }, { - "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", - "rel": "bookmark" - }], - "availability_zone": "nova", - "has_dependent_backups": false, - "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", - "fail_reason": null, - "id": "735359d5-9584-4046-94d3-5ffc47be84f5", - "size": 1, - "object_count": 22, - "container": "test999b49ff-a813-45cc-aef3-3ec82f089490", - "name": "backup999b49ff-a813-45cc-aef3-3ec82f089490", - "created_at": "2016-11-22T06:23:33.000000", - "is_incremental": false - }, { - "status": "available", - "description": "backup", - "links": [{ - "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/b1fbd1f0-6be3-470d-a645-8dd1bacca57d", - "rel": "self" - }, { - "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/b1fbd1f0-6be3-470d-a645-8dd1bacca57d", - "rel": "bookmark" - }], - "availability_zone": "nova", - "has_dependent_backups": false, - "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", - "fail_reason": null, - "id": "b1fbd1f0-6be3-470d-a645-8dd1bacca57d", - "size": 1, - "object_count": 22, - "container": "volumebackups", - "name": "backupByUI", - "created_at": "2016-11-07T06:16:27.000000", - "is_incremental": false - }] + "backups": [ + { + "status": "available", + "description": "by API", + "links": [ + { + "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", + "rel": "self" + }, + { + "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", + "rel": "bookmark" + } + ], + "availability_zone": "nova", + "has_dependent_backups": false, + "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", + "fail_reason": null, + "id": "7069c687-c85c-45ca-befa-aa78a971fdfe", + "size": 1, + "object_count": 22, + "container": "container1122", + "name": "backup1122", + "created_at": "2016-11-22T07:24:12.000000", + "is_incremental": false + }, + { + "status": "available", + "description": "by API999b49ff-a813-45cc-aef3-3ec82f089490", + "links": [ + { + "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", + "rel": "self" + }, + { + "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/735359d5-9584-4046-94d3-5ffc47be84f5", + "rel": "bookmark" + } + ], + "availability_zone": "nova", + "has_dependent_backups": false, + "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", + "fail_reason": null, + "id": "735359d5-9584-4046-94d3-5ffc47be84f5", + "size": 1, + "object_count": 22, + "container": "test999b49ff-a813-45cc-aef3-3ec82f089490", + "name": "backup999b49ff-a813-45cc-aef3-3ec82f089490", + "created_at": "2016-11-22T06:23:33.000000", + "is_incremental": false + }, + { + "status": "available", + "description": "backup", + "links": [ + { + "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/b1fbd1f0-6be3-470d-a645-8dd1bacca57d", + "rel": "self" + }, + { + "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/b1fbd1f0-6be3-470d-a645-8dd1bacca57d", + "rel": "bookmark" + } + ], + "availability_zone": "nova", + "has_dependent_backups": false, + "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", + "fail_reason": null, + "id": "b1fbd1f0-6be3-470d-a645-8dd1bacca57d", + "size": 1, + "object_count": 22, + "container": "volumebackups", + "name": "backupByUI", + "created_at": "2016-11-07T06:16:27.000000", + "is_incremental": false + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v1/volumebackups_filtered.json b/core-test/src/main/resources/storage/v1/volumebackups_filtered.json index e4a570cbc..afc8b8c82 100644 --- a/core-test/src/main/resources/storage/v1/volumebackups_filtered.json +++ b/core-test/src/main/resources/storage/v1/volumebackups_filtered.json @@ -1,24 +1,29 @@ { - "backups": [{ - "status": "available", - "description": "by API", - "links": [{ - "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", - "rel": "self" - }, { - "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", - "rel": "bookmark" - }], - "availability_zone": "nova", - "has_dependent_backups": false, - "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", - "fail_reason": null, - "id": "7069c687-c85c-45ca-befa-aa78a971fdfe", - "size": 1, - "object_count": 22, - "container": "container1122", - "name": "backup1122", - "created_at": "2016-11-22T07:24:12.000000", - "is_incremental": false - }] + "backups": [ + { + "status": "available", + "description": "by API", + "links": [ + { + "href": "https://192.168.100.3:8776/v1/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", + "rel": "self" + }, + { + "href": "https://192.168.100.3:8776/aec84f30304745c1b568593eee763eb4/backups/7069c687-c85c-45ca-befa-aa78a971fdfe", + "rel": "bookmark" + } + ], + "availability_zone": "nova", + "has_dependent_backups": false, + "volume_id": "999b49ff-a813-45cc-aef3-3ec82f089490", + "fail_reason": null, + "id": "7069c687-c85c-45ca-befa-aa78a971fdfe", + "size": 1, + "object_count": 22, + "container": "container1122", + "name": "backup1122", + "created_at": "2016-11-22T07:24:12.000000", + "is_incremental": false + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v1/volumes-bootable.json b/core-test/src/main/resources/storage/v1/volumes-bootable.json index 198372a6e..8b07cee6b 100644 --- a/core-test/src/main/resources/storage/v1/volumes-bootable.json +++ b/core-test/src/main/resources/storage/v1/volumes-bootable.json @@ -1,51 +1,54 @@ { - "volumes": [{ - "status": "in-use", - "display_name": "vol-snap-vol-test1", - "attachments": [{ - "host_name": null, - "device": "/dev/vdd", - "server_id": "108b91cd-1adc-4799-b467-a7ec6fcd8ee7", - "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", - "volume_id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc" - }], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-04-23T12:39:31.323376", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "test", - "os-volume-replication:extended_status": null, - "volume_type": "None", - "snapshot_id": "a06b0531-c14b-4a7b-8749-de1378dd1007", - "source_volid": null, - "metadata": { - "readonly": "False", - "attached_mode": "rw" - }, - "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", - "size": 1 - }, - { - "status": "available", - "display_name": "vol-test-2", - "attachments": [], - "availability_zone": "nova", - "bootable": "true", - "encrypted": true, - "created_at": "2015-04-23T11:32:01.252783", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "", - "os-volume-replication:extended_status": null, - "volume_type": "None", - "snapshot_id": null, - "source_volid": null, - "metadata": { - - }, - "id": "7f47ab73-303c-4a19-b311-6123bb115775", - "size": 1 - } ] + "volumes": [ + { + "status": "in-use", + "display_name": "vol-snap-vol-test1", + "attachments": [ + { + "host_name": null, + "device": "/dev/vdd", + "server_id": "108b91cd-1adc-4799-b467-a7ec6fcd8ee7", + "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", + "volume_id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc" + } + ], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-04-23T12:39:31.323376", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "test", + "os-volume-replication:extended_status": null, + "volume_type": "None", + "snapshot_id": "a06b0531-c14b-4a7b-8749-de1378dd1007", + "source_volid": null, + "metadata": { + "readonly": "False", + "attached_mode": "rw" + }, + "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", + "size": 1 + }, + { + "status": "available", + "display_name": "vol-test-2", + "attachments": [], + "availability_zone": "nova", + "bootable": "true", + "encrypted": true, + "created_at": "2015-04-23T11:32:01.252783", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "", + "os-volume-replication:extended_status": null, + "volume_type": "None", + "snapshot_id": null, + "source_volid": null, + "metadata": { + }, + "id": "7f47ab73-303c-4a19-b311-6123bb115775", + "size": 1 + } + ] } diff --git a/core-test/src/main/resources/storage/v1/volumes.json b/core-test/src/main/resources/storage/v1/volumes.json index d9d91706b..8edf97e77 100644 --- a/core-test/src/main/resources/storage/v1/volumes.json +++ b/core-test/src/main/resources/storage/v1/volumes.json @@ -1,72 +1,74 @@ { - "volumes": [{ - "status": "in-use", - "display_name": "vol-snap-vol-test1", - "attachments": [{ - "host_name": null, - "device": "/dev/vdd", - "server_id": "108b91cd-1adc-4799-b467-a7ec6fcd8ee7", - "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", - "volume_id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc" - }], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-04-23T12:39:31.323376", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "test", - "os-volume-replication:extended_status": null, - "volume_type": "None", - "snapshot_id": "a06b0531-c14b-4a7b-8749-de1378dd1007", - "source_volid": null, - "metadata": { - "readonly": "False", - "attached_mode": "rw" - }, - "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", - "size": 1 - }, - { - "status": "available", - "display_name": "vol-test-2", - "attachments": [], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-04-23T11:32:01.252783", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "", - "os-volume-replication:extended_status": null, - "volume_type": "None", - "snapshot_id": null, - "source_volid": null, - "metadata": { - - }, - "id": "7f47ab73-303c-4a19-b311-6123bb115775", - "size": 1 - }, - { - "status": "available", - "display_name": "vol-test-1", - "attachments": [], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-04-23T11:31:54.832436", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "", - "os-volume-replication:extended_status": null, - "volume_type": "None", - "snapshot_id": null, - "source_volid": null, - "metadata": { - - }, - "id": "b0e394e6-bb10-4bfe-960d-edf72100c810", - "size": 1 - }] + "volumes": [ + { + "status": "in-use", + "display_name": "vol-snap-vol-test1", + "attachments": [ + { + "host_name": null, + "device": "/dev/vdd", + "server_id": "108b91cd-1adc-4799-b467-a7ec6fcd8ee7", + "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", + "volume_id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc" + } + ], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-04-23T12:39:31.323376", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "test", + "os-volume-replication:extended_status": null, + "volume_type": "None", + "snapshot_id": "a06b0531-c14b-4a7b-8749-de1378dd1007", + "source_volid": null, + "metadata": { + "readonly": "False", + "attached_mode": "rw" + }, + "id": "725ee1cc-7599-42f2-a8fb-eca5ba10dadc", + "size": 1 + }, + { + "status": "available", + "display_name": "vol-test-2", + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-04-23T11:32:01.252783", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "", + "os-volume-replication:extended_status": null, + "volume_type": "None", + "snapshot_id": null, + "source_volid": null, + "metadata": { + }, + "id": "7f47ab73-303c-4a19-b311-6123bb115775", + "size": 1 + }, + { + "status": "available", + "display_name": "vol-test-1", + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-04-23T11:31:54.832436", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "", + "os-volume-replication:extended_status": null, + "volume_type": "None", + "snapshot_id": null, + "source_volid": null, + "metadata": { + }, + "id": "b0e394e6-bb10-4bfe-960d-edf72100c810", + "size": 1 + } + ] } diff --git a/core-test/src/main/resources/storage/v1/volumes_filtered.json b/core-test/src/main/resources/storage/v1/volumes_filtered.json index 1adeee0e1..4dffacb84 100644 --- a/core-test/src/main/resources/storage/v1/volumes_filtered.json +++ b/core-test/src/main/resources/storage/v1/volumes_filtered.json @@ -1,44 +1,44 @@ { - "volumes": [{ - "status": "available", - "display_name": "vol-test-1", - "attachments": [], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-04-23T11:31:54.832436", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "", - "os-volume-replication:extended_status": null, - "volume_type": "None", - "snapshot_id": null, - "source_volid": null, - "metadata": { - - }, - "id": "b0e394e6-bb10-4bfe-960d-edf72100c810", - "size": 1 - }, - { - "status": "available", - "display_name": "vol-test-1", - "attachments": [], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-04-23T11:35:12.548635", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "display_description": "", - "os-volume-replication:extended_status": null, - "volume_type": "None", - "snapshot_id": null, - "source_volid": null, - "metadata": { - - }, - "id": "a26e94e6-5656-4bfe-960d-edf72100c810", - "size": 5 - }] + "volumes": [ + { + "status": "available", + "display_name": "vol-test-1", + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-04-23T11:31:54.832436", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "", + "os-volume-replication:extended_status": null, + "volume_type": "None", + "snapshot_id": null, + "source_volid": null, + "metadata": { + }, + "id": "b0e394e6-bb10-4bfe-960d-edf72100c810", + "size": 1 + }, + { + "status": "available", + "display_name": "vol-test-1", + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-04-23T11:35:12.548635", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "display_description": "", + "os-volume-replication:extended_status": null, + "volume_type": "None", + "snapshot_id": null, + "source_volid": null, + "metadata": { + }, + "id": "a26e94e6-5656-4bfe-960d-edf72100c810", + "size": 5 + } + ] } diff --git a/core-test/src/main/resources/storage/v1/volumesnapshots.json b/core-test/src/main/resources/storage/v1/volumesnapshots.json index 9df89cc0a..01d1502c0 100644 --- a/core-test/src/main/resources/storage/v1/volumesnapshots.json +++ b/core-test/src/main/resources/storage/v1/volumesnapshots.json @@ -1,26 +1,26 @@ { - "snapshots": [{ - "status": "available", - "display_name": "snap-vol-test-1", - "created_at": "2015-04-23T11:32:28.364877", - "display_description": "", - "volume_id": "b0e394e6-bb10-4bfe-960d-edf72100c810", - "metadata": { - - }, - "id": "a06b0531-c14b-4a7b-8749-de1378dd1007", - "size": 1 - }, - { - "status": "available", - "display_name": "snap-vol-test-2", - "created_at": "2015-04-23T11:32:14.620321", - "display_description": "", - "volume_id": "7f47ab73-303c-4a19-b311-6123bb115775", - "metadata": { - - }, - "id": "6489c55f-b9f4-442e-8d0a-5a87349d2d07", - "size": 1 - }] + "snapshots": [ + { + "status": "available", + "display_name": "snap-vol-test-1", + "created_at": "2015-04-23T11:32:28.364877", + "display_description": "", + "volume_id": "b0e394e6-bb10-4bfe-960d-edf72100c810", + "metadata": { + }, + "id": "a06b0531-c14b-4a7b-8749-de1378dd1007", + "size": 1 + }, + { + "status": "available", + "display_name": "snap-vol-test-2", + "created_at": "2015-04-23T11:32:14.620321", + "display_description": "", + "volume_id": "7f47ab73-303c-4a19-b311-6123bb115775", + "metadata": { + }, + "id": "6489c55f-b9f4-442e-8d0a-5a87349d2d07", + "size": 1 + } + ] } diff --git a/core-test/src/main/resources/storage/v1/volumesnapshots_filtered.json b/core-test/src/main/resources/storage/v1/volumesnapshots_filtered.json index 03edd4bd0..35d17315f 100644 --- a/core-test/src/main/resources/storage/v1/volumesnapshots_filtered.json +++ b/core-test/src/main/resources/storage/v1/volumesnapshots_filtered.json @@ -1,14 +1,15 @@ { - "snapshots": [{ - "status": "available", - "display_name": "snap-vol-test-1", - "created_at": "2015-04-23T11:32:28.364877", - "display_description": "", - "volume_id": "b0e394e6-bb10-4bfe-960d-edf72100c810", - "metadata": { - - }, - "id": "a06b0531-c14b-4a7b-8749-de1378dd1007", - "size": 1 - }] + "snapshots": [ + { + "status": "available", + "display_name": "snap-vol-test-1", + "created_at": "2015-04-23T11:32:28.364877", + "display_description": "", + "volume_id": "b0e394e6-bb10-4bfe-960d-edf72100c810", + "metadata": { + }, + "id": "a06b0531-c14b-4a7b-8749-de1378dd1007", + "size": 1 + } + ] } diff --git a/core-test/src/main/resources/storage/v2/createVolume-muitiattach.json b/core-test/src/main/resources/storage/v2/createVolume-muitiattach.json index eba22690e..f16f5b936 100644 --- a/core-test/src/main/resources/storage/v2/createVolume-muitiattach.json +++ b/core-test/src/main/resources/storage/v2/createVolume-muitiattach.json @@ -1,12 +1,12 @@ { - "volume": { - "id" : "ac9ae248-cf21-4301-87b1-568ff20a0a02", - "status" : "creating", - "size" : 10, - "zone" : "nova", - "created" : "Wed Aug 16 13:27:14 KST 2017", - "multiattach" : true, - "metadata" : {}, - "bootable" : false - } + "volume": { + "id": "ac9ae248-cf21-4301-87b1-568ff20a0a02", + "status": "creating", + "size": 10, + "zone": "nova", + "created": "Wed Aug 16 13:27:14 KST 2017", + "multiattach": true, + "metadata": {}, + "bootable": false + } } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v2/createVolumeTypeResponse.json b/core-test/src/main/resources/storage/v2/createVolumeTypeResponse.json index 9148cda03..75056565a 100644 --- a/core-test/src/main/resources/storage/v2/createVolumeTypeResponse.json +++ b/core-test/src/main/resources/storage/v2/createVolumeTypeResponse.json @@ -1,9 +1,9 @@ { - "volume_type": { - "id": "6685584b-1eac-4da6-b5c3-555430cf68ff", - "name": "testVolume", - "extra_specs": { - "capabilities": "gpu" - } + "volume_type": { + "id": "6685584b-1eac-4da6-b5c3-555430cf68ff", + "name": "testVolume", + "extra_specs": { + "capabilities": "gpu" } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/storage/v2/volume.json b/core-test/src/main/resources/storage/v2/volume.json index 366063e18..f32c31ad1 100644 --- a/core-test/src/main/resources/storage/v2/volume.json +++ b/core-test/src/main/resources/storage/v2/volume.json @@ -1,40 +1,45 @@ { - "volume": { - "status": "in-use", - "user_id": "92ac3530a6cb4d47aa406f1c2c90fca4", - "attachments": [{ - "host_name": "myhost", - "device": "/dev/vdd", - "server_id": "eaa6a54d-35c1-40ce-831d-bb61f991e1a9", - "id": "8a9287b7-4f4d-4213-8d75-63470f19f27c", - "volume_id": "8a9287b7-4f4d-4213-8d75-63470f19f27c" - }], - "links": [{ - "href": "http://example.com.com:8776/v2/b0b5ed7ae06049688349fe43737796d4/volumes/8a9287b7-4f4d-4213-8d75-63470f19f27c", - "rel": "self" - }, { - "href": "http://example.com:8776/b0b5ed7ae06049688349fe43737796d4/volumes/8a9287b7-4f4d-4213-8d75-63470f19f27c", - "rel": "bookmark" - }], - "availability_zone": "nova", - "bootable": "false", - "encrypted": false, - "created_at": "2015-05-25T15:03:43.104260", - "description": "a description", - "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", - "os-volume-replication:driver_data": null, - "volume_type": "Gold", - "name": "test-volume", - "replication_status": "disabled", - "consistencygroup_id": null, - "source_volid": "11111111-1111-1111-1111-111111111111", - "snapshot_id": "22222222-2222-2222-2222-222222222222", - "os-volume-replication:extended_status": null, - "metadata": { - "readonly": "False", - "attached_mode": "rw" - }, + "volume": { + "status": "in-use", + "user_id": "92ac3530a6cb4d47aa406f1c2c90fca4", + "attachments": [ + { + "host_name": "myhost", + "device": "/dev/vdd", + "server_id": "eaa6a54d-35c1-40ce-831d-bb61f991e1a9", "id": "8a9287b7-4f4d-4213-8d75-63470f19f27c", - "size": 100 - } + "volume_id": "8a9287b7-4f4d-4213-8d75-63470f19f27c" + } + ], + "links": [ + { + "href": "http://example.com.com:8776/v2/b0b5ed7ae06049688349fe43737796d4/volumes/8a9287b7-4f4d-4213-8d75-63470f19f27c", + "rel": "self" + }, + { + "href": "http://example.com:8776/b0b5ed7ae06049688349fe43737796d4/volumes/8a9287b7-4f4d-4213-8d75-63470f19f27c", + "rel": "bookmark" + } + ], + "availability_zone": "nova", + "bootable": "false", + "encrypted": false, + "created_at": "2015-05-25T15:03:43.104260", + "description": "a description", + "os-vol-tenant-attr:tenant_id": "b0b5ed7ae06049688349fe43737796d4", + "os-volume-replication:driver_data": null, + "volume_type": "Gold", + "name": "test-volume", + "replication_status": "disabled", + "consistencygroup_id": null, + "source_volid": "11111111-1111-1111-1111-111111111111", + "snapshot_id": "22222222-2222-2222-2222-222222222222", + "os-volume-replication:extended_status": null, + "metadata": { + "readonly": "False", + "attached_mode": "rw" + }, + "id": "8a9287b7-4f4d-4213-8d75-63470f19f27c", + "size": 100 + } } \ No newline at end of file diff --git a/core-test/src/main/resources/tacker/v1/vim.json b/core-test/src/main/resources/tacker/v1/vim.json index 429eb41ca..1b85001e0 100644 --- a/core-test/src/main/resources/tacker/v1/vim.json +++ b/core-test/src/main/resources/tacker/v1/vim.json @@ -1,30 +1,30 @@ -{ - "vim":{ - "status":"REACHABLE", - "description":"test-vim-description", - "tenant_id":"b631e143cf734202a71b2b79e2b15037", - "name":"test-vim", - "is_default":true, - "auth_url":"http://openstack.os4j.com:35357/v3", - "placement_attr":{ - "regions":[ - "RegionOne" - ] - }, - "auth_cred":{ - "username":"admin", - "project_name":"admin", - "user_domain_name":"default", - "project_id":null, - "auth_url":"http://openstack.os4j.com:35357/v3", - "password":"***", - "project_domain_name":"default" - }, - "type":"openstack", - "id":"bad2f397-7436-4fc7-8043-726e173c5d30", - "vim_project":{ - "name":"admin", - "project_domain_name":"default" - } - } +{ + "vim": { + "status": "REACHABLE", + "description": "test-vim-description", + "tenant_id": "b631e143cf734202a71b2b79e2b15037", + "name": "test-vim", + "is_default": true, + "auth_url": "http://openstack.os4j.com:35357/v3", + "placement_attr": { + "regions": [ + "RegionOne" + ] + }, + "auth_cred": { + "username": "admin", + "project_name": "admin", + "user_domain_name": "default", + "project_id": null, + "auth_url": "http://openstack.os4j.com:35357/v3", + "password": "***", + "project_domain_name": "default" + }, + "type": "openstack", + "id": "bad2f397-7436-4fc7-8043-726e173c5d30", + "vim_project": { + "name": "admin", + "project_domain_name": "default" + } + } } \ No newline at end of file diff --git a/core-test/src/main/resources/tacker/v1/vims.json b/core-test/src/main/resources/tacker/v1/vims.json index 26f057201..459f0673e 100644 --- a/core-test/src/main/resources/tacker/v1/vims.json +++ b/core-test/src/main/resources/tacker/v1/vims.json @@ -1,32 +1,32 @@ -{ - "vims":[ - { - "status":"REACHABLE", - "description":"test-vim-description", - "tenant_id":"b631e143cf734202a71b2b79e2b15037", - "name":"test-vim", - "is_default":true, - "auth_url":"http://openstack.os4j.com:35357/v3", - "placement_attr":{ - "regions":[ - "RegionOne" - ] - }, - "auth_cred":{ - "username":"admin", - "project_name":"admin", - "user_domain_name":"default", - "project_id":null, - "auth_url":"http://openstack.os4j.com:35357/v3", - "password":"***", - "project_domain_name":"default" - }, - "type":"openstack", - "id":"bad2f397-7436-4fc7-8043-726e173c5d30", - "vim_project":{ - "name":"admin", - "project_domain_name":"default" - } - } - ] +{ + "vims": [ + { + "status": "REACHABLE", + "description": "test-vim-description", + "tenant_id": "b631e143cf734202a71b2b79e2b15037", + "name": "test-vim", + "is_default": true, + "auth_url": "http://openstack.os4j.com:35357/v3", + "placement_attr": { + "regions": [ + "RegionOne" + ] + }, + "auth_cred": { + "username": "admin", + "project_name": "admin", + "user_domain_name": "default", + "project_id": null, + "auth_url": "http://openstack.os4j.com:35357/v3", + "password": "***", + "project_domain_name": "default" + }, + "type": "openstack", + "id": "bad2f397-7436-4fc7-8043-726e173c5d30", + "vim_project": { + "name": "admin", + "project_domain_name": "default" + } + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/tacker/v1/vnf-create.json b/core-test/src/main/resources/tacker/v1/vnf-create.json index a9a37541d..bb9f9a1b4 100644 --- a/core-test/src/main/resources/tacker/v1/vnf-create.json +++ b/core-test/src/main/resources/tacker/v1/vnf-create.json @@ -1,20 +1,19 @@ -{ - "vnf":{ - "status":"PENDING_CREATE", - "description":"test-vnf-description", - "tenant_id":"b631e143cf734202a71b2b79e2b15037", - "vim_id":"f8a5d081-2aff-4382-86e1-d0830c4324a0", - "name":"test-vnf", - "instance_id":"ec47814a-eb23-4a18-ac55-67547e3f61b6", - "mgmt_url":null, - "placement_attr":{ - "vim_name":"VIM-1" - }, - "error_reason":null, - "attributes":{ - - }, - "id":"4043f4bd-a728-4ee3-91d6-a11a6bb89030", - "vnfd_id":"1363e776-6c79-4e53-8074-4e32e49f156a" - } +{ + "vnf": { + "status": "PENDING_CREATE", + "description": "test-vnf-description", + "tenant_id": "b631e143cf734202a71b2b79e2b15037", + "vim_id": "f8a5d081-2aff-4382-86e1-d0830c4324a0", + "name": "test-vnf", + "instance_id": "ec47814a-eb23-4a18-ac55-67547e3f61b6", + "mgmt_url": null, + "placement_attr": { + "vim_name": "VIM-1" + }, + "error_reason": null, + "attributes": { + }, + "id": "4043f4bd-a728-4ee3-91d6-a11a6bb89030", + "vnfd_id": "1363e776-6c79-4e53-8074-4e32e49f156a" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/tacker/v1/vnf-get.json b/core-test/src/main/resources/tacker/v1/vnf-get.json index bfea0d63c..c06af523e 100644 --- a/core-test/src/main/resources/tacker/v1/vnf-get.json +++ b/core-test/src/main/resources/tacker/v1/vnf-get.json @@ -1,19 +1,18 @@ -{ - "vnf":{ - "status":"ACTIVE", - "description":"test-vnf-description", - "tenant_id":"b631e143cf734202a71b2b79e2b15037", - "vim_id":"f8a5d081-2aff-4382-86e1-d0830c4324a0", - "instance_id":"4ddcc0c9-639a-418f-9781-a53dd5958b3b", - "mgmt_url":"{\"vdu1\": \"15.0.0.3\"}", - "placement_attr":{ - "vim_name":"VIM-1" - }, - "error_reason":null, - "attributes":{ - - }, - "id":"afbbf7f4-59c2-45ed-b158-8c4e2e1d9104", - "name":"test-vnf" - } +{ + "vnf": { + "status": "ACTIVE", + "description": "test-vnf-description", + "tenant_id": "b631e143cf734202a71b2b79e2b15037", + "vim_id": "f8a5d081-2aff-4382-86e1-d0830c4324a0", + "instance_id": "4ddcc0c9-639a-418f-9781-a53dd5958b3b", + "mgmt_url": "{\"vdu1\": \"15.0.0.3\"}", + "placement_attr": { + "vim_name": "VIM-1" + }, + "error_reason": null, + "attributes": { + }, + "id": "afbbf7f4-59c2-45ed-b158-8c4e2e1d9104", + "name": "test-vnf" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/tacker/v1/vnf-update.json b/core-test/src/main/resources/tacker/v1/vnf-update.json index 79f2d3fdc..8b24fcc6b 100644 --- a/core-test/src/main/resources/tacker/v1/vnf-update.json +++ b/core-test/src/main/resources/tacker/v1/vnf-update.json @@ -1,19 +1,19 @@ -{ - "vnf":{ - "status":"PENDING_UPDATE", - "description":"test-update-vnf-description", - "tenant_id":"b631e143cf734202a71b2b79e2b15037", - "vim_id":"f8a5d081-2aff-4382-86e1-d0830c4324a0", - "instance_id":"ec47814a-eb23-4a18-ac55-67547e3f61b6", - "mgmt_url":"{\"vdu1\": \"15.0.0.4\"}", - "placement_attr":{ - "vim_name":"VIM-1" - }, - "error_reason":null, - "attributes":{ - "config":"vdus:\n vdu1:\n auto-scaling: noop\n id: vdu1\n instance_type: m1.tiny\n network_interfaces:\n management: {management: true, network: net_mgmt}\n pkt_in: {network: net0}\n pkt_out: {network: net1}\n placement_policy: {availability_zone: nova}\n vm_image: cirros-0.3.4-x86_64-uec\n" - }, - "id":"4043f4bd-a728-4ee3-91d6-a11a6bb89030", - "name":"test-update-vnf" - } +{ + "vnf": { + "status": "PENDING_UPDATE", + "description": "test-update-vnf-description", + "tenant_id": "b631e143cf734202a71b2b79e2b15037", + "vim_id": "f8a5d081-2aff-4382-86e1-d0830c4324a0", + "instance_id": "ec47814a-eb23-4a18-ac55-67547e3f61b6", + "mgmt_url": "{\"vdu1\": \"15.0.0.4\"}", + "placement_attr": { + "vim_name": "VIM-1" + }, + "error_reason": null, + "attributes": { + "config": "vdus:\n vdu1:\n auto-scaling: noop\n id: vdu1\n instance_type: m1.tiny\n network_interfaces:\n management: {management: true, network: net_mgmt}\n pkt_in: {network: net0}\n pkt_out: {network: net1}\n placement_policy: {availability_zone: nova}\n vm_image: cirros-0.3.4-x86_64-uec\n" + }, + "id": "4043f4bd-a728-4ee3-91d6-a11a6bb89030", + "name": "test-update-vnf" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/tacker/v1/vnfd.json b/core-test/src/main/resources/tacker/v1/vnfd.json index bac59bf2f..048e1f3da 100644 --- a/core-test/src/main/resources/tacker/v1/vnfd.json +++ b/core-test/src/main/resources/tacker/v1/vnfd.json @@ -1,19 +1,19 @@ { - "vnfd" : { - "service_types": [ - { - "service_type": "vnfd", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977" - } - ], - "description": "test-vnfd-description", - "tenant_id": "b631e143cf734202a71b2b79e2b15037", - "mgmt_driver": "noop", - "infra_driver": "heat", - "attributes": { - "vnfd": "template_name: sample-vnfd\ndescription: admin-example\n\nservice_properties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n vdu1:\n id: vdu1\n vm_image: cirros-0.3.4-x86_64-uec\n instance_type: m1.tiny\n\n network_interfaces:\n management:\n network: net_mgmt\n management: true\n pkt_in:\n network: net0\n pkt_out:\n network: net1\n\n placement_policy:\n availability_zone: nova\n\n auto-scaling: noop\n\n config:\n param0: key0\n param1: key1\n" - }, - "id": "1363e776-6c79-4e53-8074-4e32e49f156a", - "name": "test-vnfd" - } + "vnfd": { + "service_types": [ + { + "service_type": "vnfd", + "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977" + } + ], + "description": "test-vnfd-description", + "tenant_id": "b631e143cf734202a71b2b79e2b15037", + "mgmt_driver": "noop", + "infra_driver": "heat", + "attributes": { + "vnfd": "template_name: sample-vnfd\ndescription: admin-example\n\nservice_properties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n vdu1:\n id: vdu1\n vm_image: cirros-0.3.4-x86_64-uec\n instance_type: m1.tiny\n\n network_interfaces:\n management:\n network: net_mgmt\n management: true\n pkt_in:\n network: net0\n pkt_out:\n network: net1\n\n placement_policy:\n availability_zone: nova\n\n auto-scaling: noop\n\n config:\n param0: key0\n param1: key1\n" + }, + "id": "1363e776-6c79-4e53-8074-4e32e49f156a", + "name": "test-vnfd" + } } \ No newline at end of file diff --git a/core-test/src/main/resources/tacker/v1/vnfs.json b/core-test/src/main/resources/tacker/v1/vnfs.json index a82d00325..b482f31f7 100644 --- a/core-test/src/main/resources/tacker/v1/vnfs.json +++ b/core-test/src/main/resources/tacker/v1/vnfs.json @@ -1,21 +1,20 @@ -{ - "vnfs":[ - { - "status":"ACTIVE", - "description":"test-vnf-description", - "tenant_id":"b631e143cf734202a71b2b79e2b15037", - "vim_id":"f8a5d081-2aff-4382-86e1-d0830c4324a0", - "instance_id":"4ddcc0c9-639a-418f-9781-a53dd5958b3b", - "mgmt_url":"{\"vdu1\": \"15.0.0.3\"}", - "placement_attr":{ - "vim_name":"VIM-1" - }, - "error_reason":null, - "attributes":{ - - }, - "id":"afbbf7f4-59c2-45ed-b158-8c4e2e1d9104", - "name":"test-vnf" - } - ] +{ + "vnfs": [ + { + "status": "ACTIVE", + "description": "test-vnf-description", + "tenant_id": "b631e143cf734202a71b2b79e2b15037", + "vim_id": "f8a5d081-2aff-4382-86e1-d0830c4324a0", + "instance_id": "4ddcc0c9-639a-418f-9781-a53dd5958b3b", + "mgmt_url": "{\"vdu1\": \"15.0.0.3\"}", + "placement_attr": { + "vim_name": "VIM-1" + }, + "error_reason": null, + "attributes": { + }, + "id": "afbbf7f4-59c2-45ed-b158-8c4e2e1d9104", + "name": "test-vnf" + } + ] } \ No newline at end of file diff --git a/core-test/src/main/resources/telemetry/alarm.json b/core-test/src/main/resources/telemetry/alarm.json index 44bbe4bd8..5644d6d70 100644 --- a/core-test/src/main/resources/telemetry/alarm.json +++ b/core-test/src/main/resources/telemetry/alarm.json @@ -1,29 +1,29 @@ { - "alarm_id" : "03757eede9c540338e732d1a7fb07966", - "enabled": false, - "name": "name_post", - "state": "ok", - "type": "gnocchi_aggregation_by_metrics_threshold", - "severity": "critical", - "ok_actions": [ - "http://something/ok" - ], - "alarm_actions": [ - "http://something/alarm" - ], - "insufficient_data_actions": [ - "http://something/no" - ], - "repeat_actions": true, - "gnocchi_aggregation_by_metrics_threshold_rule": { - "metrics": [ - "b3d9d8ab-05e8-439f-89ad-5e978dd2a5eb", - "009d4faf-c275-46f0-8f2d-670b15bac2b0" - ], - "comparison_operator": "le", - "aggregation_method": "count", - "threshold": 50, - "evaluation_periods": 3, - "granularity": 180 - } - } + "alarm_id": "03757eede9c540338e732d1a7fb07966", + "enabled": false, + "name": "name_post", + "state": "ok", + "type": "gnocchi_aggregation_by_metrics_threshold", + "severity": "critical", + "ok_actions": [ + "http://something/ok" + ], + "alarm_actions": [ + "http://something/alarm" + ], + "insufficient_data_actions": [ + "http://something/no" + ], + "repeat_actions": true, + "gnocchi_aggregation_by_metrics_threshold_rule": { + "metrics": [ + "b3d9d8ab-05e8-439f-89ad-5e978dd2a5eb", + "009d4faf-c275-46f0-8f2d-670b15bac2b0" + ], + "comparison_operator": "le", + "aggregation_method": "count", + "threshold": 50, + "evaluation_periods": 3, + "granularity": 180 + } +} diff --git a/core-test/src/main/resources/telemetry/alarms.json b/core-test/src/main/resources/telemetry/alarms.json index 9aafa9d72..54bf520dd 100644 --- a/core-test/src/main/resources/telemetry/alarms.json +++ b/core-test/src/main/resources/telemetry/alarms.json @@ -1,196 +1,236 @@ -[{ - "alarm_actions" : ["http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_out?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=800c42eb3f4a49218f45688547c77266&SignatureVersion=2&Signature=Hgbvixq0VkVKJIKEyuIIEx7a68ut2eCl0EpxoaahUVU%3D"], - "ok_actions" : [], - "name" : "sdfasdf-scale_out_WebAS-Sig-l4ue3wfz6otx", - "timestamp" : "2015-01-20T15:06:06.625000", - "enabled" : true, - "state" : "insufficient data", - "state_timestamp" : "2015-01-20T15:06:06.625000", - "threshold_rule" : { - "meter_name" : "cpu", - "evaluation_periods" : 2, - "period" : 60, - "statistic" : "avg", - "threshold" : 500.0, - "query" : [{ - "field" : "metadata.metering.metadata.stack_id", - "value" : "4bb97267-0657-4834-bbe2-eb0a5f40480d", - "op" : "eq" - }, { - "field" : "metadata.metering.metadata.resource_name", - "value" : "WebAS-OeM", - "op" : "eq" - } - ], - "comparison_operator" : "gt", - "exclude_outliers" : false - }, - "alarm_id" : "7de0effc-bf54-4ffd-bb63-dec286d4f17f", - "time_constraints" : [], - "insufficient_data_actions" : [], - "repeat_actions" : true, - "user_id" : "de2fd0ebac804ef8970e69ae5a4b4a16", - "project_id" : "3c8edb30c13d471d96c9881dee761134", - "type" : "threshold", - "description" : "scale out" - }, { - "alarm_actions" : ["http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_in?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=aca03ce06e4e4aec97aeea345b817249&SignatureVersion=2&Signature=H743x%2FSH8mLzSW%2BHmQLedflGIv69R6EFsa9VIduT6m8%3D"], - "ok_actions" : [], - "name" : "sdfasdf-scale_in_WebAS-Sig-ob3jxa7tl6ch", - "timestamp" : "2015-01-20T15:06:06.724000", - "enabled" : true, - "state" : "insufficient data", - "state_timestamp" : "2015-01-20T15:06:06.724000", - "threshold_rule" : { - "meter_name" : "cpu", - "evaluation_periods" : 2, - "period" : 60, - "statistic" : "avg", - "threshold" : 100.0, - "query" : [{ - "field" : "metadata.metering.metadata.stack_id", - "value" : "4bb97267-0657-4834-bbe2-eb0a5f40480d", - "op" : "eq" - }, { - "field" : "metadata.metering.metadata.resource_name", - "value" : "WebAS-OeM", - "op" : "eq" - } - ], - "comparison_operator" : "lt", - "exclude_outliers" : false - }, - "alarm_id" : "ca1ac89f-5dfe-4209-b92f-f9ca4f4eb85b", - "time_constraints" : [], - "insufficient_data_actions" : [], - "repeat_actions" : true, - "user_id" : "de2fd0ebac804ef8970e69ae5a4b4a16", - "project_id" : "3c8edb30c13d471d96c9881dee761134", - "type" : "threshold", - "description" : "scale in" - },{ - "alarm_id" : "02c1f1178d1942b9bbe6f6836412d89a", - "name": "added_alarm_constraint_name", - "type": "threshold", - "state": "ok", - "state_reason": "ignored", - "severity": "low", - "time_constraints": [ - { - "name": "testcons", - "start": "* 11 * * *", - "duration": 10 - }, - { - "name": "testcons", - "start": "* * * * *", - "duration": 20 - } - ], - "threshold_rule": { - "meter_name": "cpu", - "comparison_operator": "gt", - "threshold": 2.0, - "statistic": "avg", - "query": [{"field": "metadata.field", - "op": "eq", - "value": "5", - "type": "string"}], - "period": 3 - } - }, { - "alarm_id" : "03757eede9c540338e732d1a7fb07966", - "enabled": false, - "name": "name_post", - "state": "ok", - "type": "gnocchi_aggregation_by_metrics_threshold", - "severity": "critical", - "ok_actions": [ - "http://something/ok" - ], - "alarm_actions": [ - "http://something/alarm" - ], - "insufficient_data_actions": [ - "http://something/no" - ], - "repeat_actions": true, - "gnocchi_aggregation_by_metrics_threshold_rule": { - "metrics": [ - "b3d9d8ab-05e8-439f-89ad-5e978dd2a5eb", - "009d4faf-c275-46f0-8f2d-670b15bac2b0" - ], - "comparison_operator": "le", - "aggregation_method": "count", - "threshold": 50, - "evaluation_periods": 3, - "granularity": 180 - } - }, - { - "alarm_id" : "05109347b3274e73893ff41944bfa293", - "enabled": false, - "name": "gnocchi_resource_threshold", - "state": "ok", - "type": "gnocchi_resources_threshold", - "severity": "critical", - "ok_actions": ["http://something/ok"], - "alarm_actions": ["http://something/alarm"], - "insufficient_data_actions": ["http://something/no"], - "repeat_actions": true, - "gnocchi_resources_threshold_rule": { - "metric": "cpu_util", - "comparison_operator": "le", - "aggregation_method": "count", - "threshold": 50, - "evaluation_periods": 3, - "granularity": 180, - "resource_type": "instance", - "resource_id": "209ef69c-c10c-4efb-90ff-46f4b2d90d2e" - } - },{ - "alarm_id" : "0622fcb3c1b5461eab8ae74d3ba813aa", - "enabled": false, - "name": "aggregation_by_metrics", - "state": "ok", - "type": "gnocchi_aggregation_by_metrics_threshold", - "severity": "critical", - "ok_actions": ["http://something/ok"], - "alarm_actions": ["http://something/alarm"], - "insufficient_data_actions": ["http://something/no"], - "repeat_actions": true, - "gnocchi_aggregation_by_metrics_threshold_rule": { - "metrics": ["b3d9d8ab-05e8-439f-89ad-5e978dd2a5eb", - "009d4faf-c275-46f0-8f2d-670b15bac2b0"], - "comparison_operator": "le", - "aggregation_method": "count", - "threshold": 50, - "evaluation_periods": 3, - "granularity": 180 - } - },{ - "alarm_id" : "06b3a51958d74499910aabde4f3dd1b8", - "enabled": false, - "name": "gnocchi_aggregation_by_resources_threshold", - "state": "ok", - "type": "gnocchi_aggregation_by_resources_threshold", - "severity": "critical", - "ok_actions": ["http://something/ok"], - "alarm_actions": ["http://something/alarm"], - "insufficient_data_actions": ["http://something/no"], - "repeat_actions": true, - "gnocchi_aggregation_by_resources_threshold_rule": { - "metric": "ameter", - "comparison_operator": "le", - "aggregation_method": "count", - "threshold": 50, - "evaluation_periods": 3, - "granularity": 180, - "resource_type": "instance", - "query": {"field": "metadata.field", - "op": "eq", - "value": "5", - "type": "string"} - } - } +[ + { + "alarm_actions": [ + "http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_out?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=800c42eb3f4a49218f45688547c77266&SignatureVersion=2&Signature=Hgbvixq0VkVKJIKEyuIIEx7a68ut2eCl0EpxoaahUVU%3D" + ], + "ok_actions": [], + "name": "sdfasdf-scale_out_WebAS-Sig-l4ue3wfz6otx", + "timestamp": "2015-01-20T15:06:06.625000", + "enabled": true, + "state": "insufficient data", + "state_timestamp": "2015-01-20T15:06:06.625000", + "threshold_rule": { + "meter_name": "cpu", + "evaluation_periods": 2, + "period": 60, + "statistic": "avg", + "threshold": 500.0, + "query": [ + { + "field": "metadata.metering.metadata.stack_id", + "value": "4bb97267-0657-4834-bbe2-eb0a5f40480d", + "op": "eq" + }, + { + "field": "metadata.metering.metadata.resource_name", + "value": "WebAS-OeM", + "op": "eq" + } + ], + "comparison_operator": "gt", + "exclude_outliers": false + }, + "alarm_id": "7de0effc-bf54-4ffd-bb63-dec286d4f17f", + "time_constraints": [], + "insufficient_data_actions": [], + "repeat_actions": true, + "user_id": "de2fd0ebac804ef8970e69ae5a4b4a16", + "project_id": "3c8edb30c13d471d96c9881dee761134", + "type": "threshold", + "description": "scale out" + }, + { + "alarm_actions": [ + "http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_in?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=aca03ce06e4e4aec97aeea345b817249&SignatureVersion=2&Signature=H743x%2FSH8mLzSW%2BHmQLedflGIv69R6EFsa9VIduT6m8%3D" + ], + "ok_actions": [], + "name": "sdfasdf-scale_in_WebAS-Sig-ob3jxa7tl6ch", + "timestamp": "2015-01-20T15:06:06.724000", + "enabled": true, + "state": "insufficient data", + "state_timestamp": "2015-01-20T15:06:06.724000", + "threshold_rule": { + "meter_name": "cpu", + "evaluation_periods": 2, + "period": 60, + "statistic": "avg", + "threshold": 100.0, + "query": [ + { + "field": "metadata.metering.metadata.stack_id", + "value": "4bb97267-0657-4834-bbe2-eb0a5f40480d", + "op": "eq" + }, + { + "field": "metadata.metering.metadata.resource_name", + "value": "WebAS-OeM", + "op": "eq" + } + ], + "comparison_operator": "lt", + "exclude_outliers": false + }, + "alarm_id": "ca1ac89f-5dfe-4209-b92f-f9ca4f4eb85b", + "time_constraints": [], + "insufficient_data_actions": [], + "repeat_actions": true, + "user_id": "de2fd0ebac804ef8970e69ae5a4b4a16", + "project_id": "3c8edb30c13d471d96c9881dee761134", + "type": "threshold", + "description": "scale in" + }, + { + "alarm_id": "02c1f1178d1942b9bbe6f6836412d89a", + "name": "added_alarm_constraint_name", + "type": "threshold", + "state": "ok", + "state_reason": "ignored", + "severity": "low", + "time_constraints": [ + { + "name": "testcons", + "start": "* 11 * * *", + "duration": 10 + }, + { + "name": "testcons", + "start": "* * * * *", + "duration": 20 + } + ], + "threshold_rule": { + "meter_name": "cpu", + "comparison_operator": "gt", + "threshold": 2.0, + "statistic": "avg", + "query": [ + { + "field": "metadata.field", + "op": "eq", + "value": "5", + "type": "string" + } + ], + "period": 3 + } + }, + { + "alarm_id": "03757eede9c540338e732d1a7fb07966", + "enabled": false, + "name": "name_post", + "state": "ok", + "type": "gnocchi_aggregation_by_metrics_threshold", + "severity": "critical", + "ok_actions": [ + "http://something/ok" + ], + "alarm_actions": [ + "http://something/alarm" + ], + "insufficient_data_actions": [ + "http://something/no" + ], + "repeat_actions": true, + "gnocchi_aggregation_by_metrics_threshold_rule": { + "metrics": [ + "b3d9d8ab-05e8-439f-89ad-5e978dd2a5eb", + "009d4faf-c275-46f0-8f2d-670b15bac2b0" + ], + "comparison_operator": "le", + "aggregation_method": "count", + "threshold": 50, + "evaluation_periods": 3, + "granularity": 180 + } + }, + { + "alarm_id": "05109347b3274e73893ff41944bfa293", + "enabled": false, + "name": "gnocchi_resource_threshold", + "state": "ok", + "type": "gnocchi_resources_threshold", + "severity": "critical", + "ok_actions": [ + "http://something/ok" + ], + "alarm_actions": [ + "http://something/alarm" + ], + "insufficient_data_actions": [ + "http://something/no" + ], + "repeat_actions": true, + "gnocchi_resources_threshold_rule": { + "metric": "cpu_util", + "comparison_operator": "le", + "aggregation_method": "count", + "threshold": 50, + "evaluation_periods": 3, + "granularity": 180, + "resource_type": "instance", + "resource_id": "209ef69c-c10c-4efb-90ff-46f4b2d90d2e" + } + }, + { + "alarm_id": "0622fcb3c1b5461eab8ae74d3ba813aa", + "enabled": false, + "name": "aggregation_by_metrics", + "state": "ok", + "type": "gnocchi_aggregation_by_metrics_threshold", + "severity": "critical", + "ok_actions": [ + "http://something/ok" + ], + "alarm_actions": [ + "http://something/alarm" + ], + "insufficient_data_actions": [ + "http://something/no" + ], + "repeat_actions": true, + "gnocchi_aggregation_by_metrics_threshold_rule": { + "metrics": [ + "b3d9d8ab-05e8-439f-89ad-5e978dd2a5eb", + "009d4faf-c275-46f0-8f2d-670b15bac2b0" + ], + "comparison_operator": "le", + "aggregation_method": "count", + "threshold": 50, + "evaluation_periods": 3, + "granularity": 180 + } + }, + { + "alarm_id": "06b3a51958d74499910aabde4f3dd1b8", + "enabled": false, + "name": "gnocchi_aggregation_by_resources_threshold", + "state": "ok", + "type": "gnocchi_aggregation_by_resources_threshold", + "severity": "critical", + "ok_actions": [ + "http://something/ok" + ], + "alarm_actions": [ + "http://something/alarm" + ], + "insufficient_data_actions": [ + "http://something/no" + ], + "repeat_actions": true, + "gnocchi_aggregation_by_resources_threshold_rule": { + "metric": "ameter", + "comparison_operator": "le", + "aggregation_method": "count", + "threshold": 50, + "evaluation_periods": 3, + "granularity": 180, + "resource_type": "instance", + "query": { + "field": "metadata.field", + "op": "eq", + "value": "5", + "type": "string" + } + } + } ] \ No newline at end of file diff --git a/core-test/src/main/resources/telemetry/capabilities.json b/core-test/src/main/resources/telemetry/capabilities.json index fde0f5187..d4ba71040 100644 --- a/core-test/src/main/resources/telemetry/capabilities.json +++ b/core-test/src/main/resources/telemetry/capabilities.json @@ -1,29 +1,29 @@ -{ - "api":{ - "statistics:aggregation:selectable:count":true, - "samples:query:metadata":true, - "samples:query:complex":true, - "statistics:aggregation:standard":true, - "statistics:query:metadata":true, - "statistics:aggregation:selectable:sum":true, - "events:query:simple":true, - "meters:query:metadata":true, - "statistics:aggregation:selectable:stddev":true, - "resources:query:simple":true, - "resources:query:metadata":true, - "statistics:groupby":true, - "samples:query:simple":true, - "statistics:query:simple":true, - "statistics:aggregation:selectable:cardinality":true, - "statistics:aggregation:selectable:min":true, - "statistics:aggregation:selectable:max":true, - "statistics:aggregation:selectable:avg":true, - "meters:query:simple":true - }, - "storage":{ - "storage:production_ready":true - }, - "event_storage":{ - "storage:production_ready":true - } +{ + "api": { + "statistics:aggregation:selectable:count": true, + "samples:query:metadata": true, + "samples:query:complex": true, + "statistics:aggregation:standard": true, + "statistics:query:metadata": true, + "statistics:aggregation:selectable:sum": true, + "events:query:simple": true, + "meters:query:metadata": true, + "statistics:aggregation:selectable:stddev": true, + "resources:query:simple": true, + "resources:query:metadata": true, + "statistics:groupby": true, + "samples:query:simple": true, + "statistics:query:simple": true, + "statistics:aggregation:selectable:cardinality": true, + "statistics:aggregation:selectable:min": true, + "statistics:aggregation:selectable:max": true, + "statistics:aggregation:selectable:avg": true, + "meters:query:simple": true + }, + "storage": { + "storage:production_ready": true + }, + "event_storage": { + "storage:production_ready": true + } } \ No newline at end of file diff --git a/core-test/src/main/resources/telemetry/resource.json b/core-test/src/main/resources/telemetry/resource.json index da5d305d7..4cdc83bb1 100644 --- a/core-test/src/main/resources/telemetry/resource.json +++ b/core-test/src/main/resources/telemetry/resource.json @@ -1,32 +1,32 @@ -{ - "user_id":null, - "resource_id":"02748368-2b4a-4b70-ac13-b6c5fd8ed415", - "source":"openstack", - "last_sample_timestamp":"2016-06-10T02:53:02.681338", - "first_sample_timestamp":"2016-06-10T02:53:02.633042", - "project_id":"abe3797914274da482778ca158cbdbf6", - "metadata":{ - "event_type":"image.update", - "container_format":"ami", - "min_ram":"0", - "updated_at":"2016-06-10T02:53:02Z", - "owner":"abe3797914274da482778ca158cbdbf6", - "deleted_at":"None", - "id":"02748368-2b4a-4b70-ac13-b6c5fd8ed415", - "size":"25165824", - "disk_format":"ami", - "properties.kernel_id":"66e307b0-042d-4993-abf6-7c194944ec09", - "status":"active", - "tags":"[]", - "deleted":"False", - "properties.ramdisk_id":"6b9e1c10-3fa7-4daa-a7aa-6cff4734ec0c", - "host":"image.localhost", - "min_disk":"0", - "is_public":"True", - "virtual_size":"None", - "name":"cirros-0.3.4-x86_64-uec", - "checksum":"eb9139e4942121f22bbc2afc0400b2a4", - "created_at":"2016-06-10T02:53:02Z", - "protected":"False" - } - } \ No newline at end of file +{ + "user_id": null, + "resource_id": "02748368-2b4a-4b70-ac13-b6c5fd8ed415", + "source": "openstack", + "last_sample_timestamp": "2016-06-10T02:53:02.681338", + "first_sample_timestamp": "2016-06-10T02:53:02.633042", + "project_id": "abe3797914274da482778ca158cbdbf6", + "metadata": { + "event_type": "image.update", + "container_format": "ami", + "min_ram": "0", + "updated_at": "2016-06-10T02:53:02Z", + "owner": "abe3797914274da482778ca158cbdbf6", + "deleted_at": "None", + "id": "02748368-2b4a-4b70-ac13-b6c5fd8ed415", + "size": "25165824", + "disk_format": "ami", + "properties.kernel_id": "66e307b0-042d-4993-abf6-7c194944ec09", + "status": "active", + "tags": "[]", + "deleted": "False", + "properties.ramdisk_id": "6b9e1c10-3fa7-4daa-a7aa-6cff4734ec0c", + "host": "image.localhost", + "min_disk": "0", + "is_public": "True", + "virtual_size": "None", + "name": "cirros-0.3.4-x86_64-uec", + "checksum": "eb9139e4942121f22bbc2afc0400b2a4", + "created_at": "2016-06-10T02:53:02Z", + "protected": "False" + } +} \ No newline at end of file diff --git a/core-test/src/main/resources/telemetry/resources.json b/core-test/src/main/resources/telemetry/resources.json index 78ba05e79..dda90b39a 100644 --- a/core-test/src/main/resources/telemetry/resources.json +++ b/core-test/src/main/resources/telemetry/resources.json @@ -1,64 +1,64 @@ -[ - { - "user_id":null, - "resource_id":"02748368-2b4a-4b70-ac13-b6c5fd8ed415", - "source":"openstack", - "last_sample_timestamp":"2016-06-10T02:53:02.681338", - "first_sample_timestamp":"2016-06-10T02:53:02.633042", - "project_id":"abe3797914274da482778ca158cbdbf6", - "metadata":{ - "event_type":"image.update", - "container_format":"ami", - "min_ram":"0", - "updated_at":"2016-06-10T02:53:02Z", - "owner":"abe3797914274da482778ca158cbdbf6", - "deleted_at":"None", - "id":"02748368-2b4a-4b70-ac13-b6c5fd8ed415", - "size":"25165824", - "disk_format":"ami", - "properties.kernel_id":"66e307b0-042d-4993-abf6-7c194944ec09", - "status":"active", - "tags":"[]", - "deleted":"False", - "properties.ramdisk_id":"6b9e1c10-3fa7-4daa-a7aa-6cff4734ec0c", - "host":"image.localhost", - "min_disk":"0", - "is_public":"True", - "virtual_size":"None", - "name":"cirros-0.3.4-x86_64-uec", - "checksum":"eb9139e4942121f22bbc2afc0400b2a4", - "created_at":"2016-06-10T02:53:02Z", - "protected":"False" - } - }, - { - "user_id":null, - "resource_id":"358a1715-e953-46bb-abae-233384dcf1af", - "source":"openstack", - "last_sample_timestamp":"2016-06-10T03:05:26.022530", - "first_sample_timestamp":"2016-06-10T03:05:25.947459", - "project_id":"abe3797914274da482778ca158cbdbf6", - "metadata":{ - "status":"active", - "virtual_size":"None", - "event_type":"image.update", - "tags":"[]", - "deleted":"False", - "checksum":"2b50d24d1996bb871eca2a87d93b6644", - "created_at":"2016-06-10T03:05:08Z", - "size":"388709888", - "disk_format":"qcow2", - "updated_at":"2016-06-10T03:05:25Z", - "owner":"abe3797914274da482778ca158cbdbf6", - "host":"image.localhost", - "protected":"False", - "min_ram":"0", - "container_format":"bare", - "min_disk":"0", - "is_public":"True", - "deleted_at":"None", - "id":"358a1715-e953-46bb-abae-233384dcf1af", - "name":"manila-service-image-master" - } - } +[ + { + "user_id": null, + "resource_id": "02748368-2b4a-4b70-ac13-b6c5fd8ed415", + "source": "openstack", + "last_sample_timestamp": "2016-06-10T02:53:02.681338", + "first_sample_timestamp": "2016-06-10T02:53:02.633042", + "project_id": "abe3797914274da482778ca158cbdbf6", + "metadata": { + "event_type": "image.update", + "container_format": "ami", + "min_ram": "0", + "updated_at": "2016-06-10T02:53:02Z", + "owner": "abe3797914274da482778ca158cbdbf6", + "deleted_at": "None", + "id": "02748368-2b4a-4b70-ac13-b6c5fd8ed415", + "size": "25165824", + "disk_format": "ami", + "properties.kernel_id": "66e307b0-042d-4993-abf6-7c194944ec09", + "status": "active", + "tags": "[]", + "deleted": "False", + "properties.ramdisk_id": "6b9e1c10-3fa7-4daa-a7aa-6cff4734ec0c", + "host": "image.localhost", + "min_disk": "0", + "is_public": "True", + "virtual_size": "None", + "name": "cirros-0.3.4-x86_64-uec", + "checksum": "eb9139e4942121f22bbc2afc0400b2a4", + "created_at": "2016-06-10T02:53:02Z", + "protected": "False" + } + }, + { + "user_id": null, + "resource_id": "358a1715-e953-46bb-abae-233384dcf1af", + "source": "openstack", + "last_sample_timestamp": "2016-06-10T03:05:26.022530", + "first_sample_timestamp": "2016-06-10T03:05:25.947459", + "project_id": "abe3797914274da482778ca158cbdbf6", + "metadata": { + "status": "active", + "virtual_size": "None", + "event_type": "image.update", + "tags": "[]", + "deleted": "False", + "checksum": "2b50d24d1996bb871eca2a87d93b6644", + "created_at": "2016-06-10T03:05:08Z", + "size": "388709888", + "disk_format": "qcow2", + "updated_at": "2016-06-10T03:05:25Z", + "owner": "abe3797914274da482778ca158cbdbf6", + "host": "image.localhost", + "protected": "False", + "min_ram": "0", + "container_format": "bare", + "min_disk": "0", + "is_public": "True", + "deleted_at": "None", + "id": "358a1715-e953-46bb-abae-233384dcf1af", + "name": "manila-service-image-master" + } + } ] \ No newline at end of file diff --git a/core-test/src/main/resources/telemetry/sample.json b/core-test/src/main/resources/telemetry/sample.json index 6f07e26c9..8ac4720af 100644 --- a/core-test/src/main/resources/telemetry/sample.json +++ b/core-test/src/main/resources/telemetry/sample.json @@ -1,31 +1,31 @@ { - "user_id": null, - "resource_id": "8fe27948-1f4e-412d-b9f7-64bb5ffd1f53", - "timestamp": "2016-06-20T21:58:28.205082", - "meter": "image.size", - "volume": 25165824, - "source": "openstack", - "recorded_at": "2016-06-20T21:58:28.242266", - "project_id": "ae87747b1501457ea6f79dc98c84e0e8", - "type": "gauge", - "id": "1e93a890-3732-11e6-a491-005056ac9b87", - "unit": "B", - "metadata": { - "status": "active", - "name": "cirros-0.3.4-x86_64-uec", - "deleted": "False", - "checksum": "eb9139e4942121f22bbc2afc0400b2a4", - "created_at": "2016-06-10T17:49:10.000000", - "disk_format": "ami", - "updated_at": "2016-06-10T17:49:10.000000", - "properties.ramdisk_id": "3d1eaa5e-eed9-4d2b-9865-260243bc42d4", - "properties.kernel_id": "d245ae05-062c-477b-9022-876dda99f45c", - "protected": "False", - "container_format": "ami", - "min_disk": "0", - "is_public": "True", - "deleted_at": "None", - "min_ram": "0", - "size": "25165824" - } - } \ No newline at end of file + "user_id": null, + "resource_id": "8fe27948-1f4e-412d-b9f7-64bb5ffd1f53", + "timestamp": "2016-06-20T21:58:28.205082", + "meter": "image.size", + "volume": 25165824, + "source": "openstack", + "recorded_at": "2016-06-20T21:58:28.242266", + "project_id": "ae87747b1501457ea6f79dc98c84e0e8", + "type": "gauge", + "id": "1e93a890-3732-11e6-a491-005056ac9b87", + "unit": "B", + "metadata": { + "status": "active", + "name": "cirros-0.3.4-x86_64-uec", + "deleted": "False", + "checksum": "eb9139e4942121f22bbc2afc0400b2a4", + "created_at": "2016-06-10T17:49:10.000000", + "disk_format": "ami", + "updated_at": "2016-06-10T17:49:10.000000", + "properties.ramdisk_id": "3d1eaa5e-eed9-4d2b-9865-260243bc42d4", + "properties.kernel_id": "d245ae05-062c-477b-9022-876dda99f45c", + "protected": "False", + "container_format": "ami", + "min_disk": "0", + "is_public": "True", + "deleted_at": "None", + "min_ram": "0", + "size": "25165824" + } +} \ No newline at end of file diff --git a/core-test/src/main/resources/trove/datastore.json b/core-test/src/main/resources/trove/datastore.json index e6a2cfdb0..47a7b0983 100644 --- a/core-test/src/main/resources/trove/datastore.json +++ b/core-test/src/main/resources/trove/datastore.json @@ -1,29 +1,28 @@ { - "datastore": - { - "default_version": "15b7d828-49a5-4d05-af65-e974e0aca7eb", - "id": "648d260d-c346-4145-8a2d-bbd4d78aedf6", - "links": [ - { - "href": "https://127.0.0.1:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/datastores/versions/15b7d828-49a5-4d05-af65-e974e0aca7eb", - "rel": "self" - } - ], - "name": "mongodb", - "versions": [ - { - "active": 1, - "id": "15b7d828-49a5-4d05-af65-e974e0aca7eb", - "image": "af347500-b62b-46df-8d44-6e40fd2a45c0", - "links": [ - { - "href": "https://127.0.0.1:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/datastores/versions/15b7d828-49a5-4d05-af65-e974e0aca7eb", - "rel": "self" - } - ], - "name": "2.4.9", - "packages": "mongodb" - } - ] - } + "datastore": { + "default_version": "15b7d828-49a5-4d05-af65-e974e0aca7eb", + "id": "648d260d-c346-4145-8a2d-bbd4d78aedf6", + "links": [ + { + "href": "https://127.0.0.1:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/datastores/versions/15b7d828-49a5-4d05-af65-e974e0aca7eb", + "rel": "self" + } + ], + "name": "mongodb", + "versions": [ + { + "active": 1, + "id": "15b7d828-49a5-4d05-af65-e974e0aca7eb", + "image": "af347500-b62b-46df-8d44-6e40fd2a45c0", + "links": [ + { + "href": "https://127.0.0.1:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/datastores/versions/15b7d828-49a5-4d05-af65-e974e0aca7eb", + "rel": "self" + } + ], + "name": "2.4.9", + "packages": "mongodb" + } + ] + } } \ No newline at end of file diff --git a/core-test/src/main/resources/trove/datastore_version.json b/core-test/src/main/resources/trove/datastore_version.json index 98818e84d..a51c22948 100644 --- a/core-test/src/main/resources/trove/datastore_version.json +++ b/core-test/src/main/resources/trove/datastore_version.json @@ -1,6 +1,5 @@ { - "version": - { + "version": { "active": 1, "id": "15b7d828-49a5-4d05-af65-e974e0aca7eb", "image": "af347500-b62b-46df-8d44-6e40fd2a45c0", diff --git a/core-test/src/main/resources/trove/datastores.json b/core-test/src/main/resources/trove/datastores.json index 317bcd0aa..61f6dc459 100644 --- a/core-test/src/main/resources/trove/datastores.json +++ b/core-test/src/main/resources/trove/datastores.json @@ -5,8 +5,8 @@ "id": "648d260d-c346-4145-8a2d-bbd4d78aedf6", "links": [ { - "href": "https://127.0.0.1:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/datastores/versions/15b7d828-49a5-4d05-af65-e974e0aca7eb", - "rel": "self" + "href": "https://127.0.0.1:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/datastores/versions/15b7d828-49a5-4d05-af65-e974e0aca7eb", + "rel": "self" } ], "name": "mongodb", diff --git a/core-test/src/main/resources/trove/instance_flavor.json b/core-test/src/main/resources/trove/instance_flavor.json index 9558a0050..e85d93579 100644 --- a/core-test/src/main/resources/trove/instance_flavor.json +++ b/core-test/src/main/resources/trove/instance_flavor.json @@ -1,20 +1,20 @@ { - "flavor":{ - "name":"m1.tiny", - "links":[ + "flavor": { + "name": "m1.tiny", + "links": [ { - "href":"https://172.20.75.130:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/flavors/1", - "rel":"self" + "href": "https://172.20.75.130:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/flavors/1", + "rel": "self" }, { - "href":"https://172.20.75.130:8779/flavors/1", - "rel":"bookmark" + "href": "https://172.20.75.130:8779/flavors/1", + "rel": "bookmark" } ], - "ram":512, - "str_id":"1", - "id":1, - "disk":50, + "ram": 512, + "str_id": "1", + "id": 1, + "disk": 50, "vcpus": 10 } } \ No newline at end of file diff --git a/core-test/src/main/resources/trove/instance_flavors.json b/core-test/src/main/resources/trove/instance_flavors.json index df0ffb051..787f4a423 100644 --- a/core-test/src/main/resources/trove/instance_flavors.json +++ b/core-test/src/main/resources/trove/instance_flavors.json @@ -1,39 +1,39 @@ { - "flavors":[ + "flavors": [ { - "name":"m1.tiny", - "links":[ + "name": "m1.tiny", + "links": [ { - "href":"https://172.20.75.130:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/flavors/1", - "rel":"self" + "href": "https://172.20.75.130:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/flavors/1", + "rel": "self" }, { - "href":"https://172.20.75.130:8779/flavors/1", - "rel":"bookmark" + "href": "https://172.20.75.130:8779/flavors/1", + "rel": "bookmark" } ], - "ram":512, - "str_id":"1", - "id":1, - "disk":11, + "ram": 512, + "str_id": "1", + "id": 1, + "disk": 11, "vcpus": 111 }, { - "name":"test.tiny-3", - "links":[ + "name": "test.tiny-3", + "links": [ { - "href":"https://172.20.75.130:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/flavors/10", - "rel":"self" + "href": "https://172.20.75.130:8779/v1.0/d6ac65efd0e14ef3b9c9bc33f8f809fa/flavors/10", + "rel": "self" }, { - "href":"https://172.20.75.130:8779/flavors/10", - "rel":"bookmark" + "href": "https://172.20.75.130:8779/flavors/10", + "rel": "bookmark" } ], - "ram":1024, - "str_id":"2", - "id":2, - "disk":22, + "ram": 1024, + "str_id": "2", + "id": 2, + "disk": 22, "vcpus": 222 } ] diff --git a/core-test/src/main/resources/workflow/action_def.json b/core-test/src/main/resources/workflow/action_def.json index c4fb5465e..d511ba5d3 100644 --- a/core-test/src/main/resources/workflow/action_def.json +++ b/core-test/src/main/resources/workflow/action_def.json @@ -6,7 +6,10 @@ "scope": "private", "is_system": false, "created_at": "2017-05-30 10:35:16", - "tags": ["test", "custom"], + "tags": [ + "test", + "custom" + ], "input": "s1, s2", "definition": "---\nversion: '2.0'\n\nconcat:\n base: std.echo\n base-input:\n output: \"<% $.s1 %>+<% $.s2 %>\"\n input:\n - s1\n - s2\n" } diff --git a/core-test/src/main/resources/workflow/action_def_create.json b/core-test/src/main/resources/workflow/action_def_create.json index 38da6daa0..c41334c78 100644 --- a/core-test/src/main/resources/workflow/action_def_create.json +++ b/core-test/src/main/resources/workflow/action_def_create.json @@ -8,7 +8,10 @@ "scope": "private", "is_system": false, "created_at": "2017-05-30 10:35:16", - "tags": ["test", "custom"], + "tags": [ + "test", + "custom" + ], "input": "s1, s2", "definition": "---\nversion: '2.0'\n\nconcat:\n base: std.echo\n base-input:\n output: \"<% $.s1 %>+<% $.s2 %>\"\n input:\n - s1\n - s2\n" } diff --git a/core-test/src/main/resources/workflow/action_defs.json b/core-test/src/main/resources/workflow/action_defs.json index 18369ad54..998ca498c 100644 --- a/core-test/src/main/resources/workflow/action_defs.json +++ b/core-test/src/main/resources/workflow/action_defs.json @@ -8,7 +8,10 @@ "scope": "private", "is_system": false, "created_at": "2017-05-30 10:35:16", - "tags": ["test", "custom"], + "tags": [ + "test", + "custom" + ], "input": "s1, s2", "definition": "---\nversion: '2.0'\n\nconcat:\n base: std.echo\n base-input:\n output: \"<% $.s1 %>+<% $.s2 %>\"\n input:\n - s1\n - s2\n" }, diff --git a/core-test/src/main/resources/workflow/cron_trigger.json b/core-test/src/main/resources/workflow/cron_trigger.json index cca5a7282..99e385812 100644 --- a/core-test/src/main/resources/workflow/cron_trigger.json +++ b/core-test/src/main/resources/workflow/cron_trigger.json @@ -5,7 +5,7 @@ "created_at": "2017-05-30 10:35:16", "updated_at": "2017-05-30 10:35:16", "workflow_name": "my_wf", - "workflow_id" : "91fdedd9-43cd-4820-b017-a2b2fe600ef4", + "workflow_id": "91fdedd9-43cd-4820-b017-a2b2fe600ef4", "workflow_input": { "param1": "val1", "param2": "val2" diff --git a/core-test/src/main/resources/workflow/cron_trigger_create.json b/core-test/src/main/resources/workflow/cron_trigger_create.json index 4f053dbed..33326110b 100644 --- a/core-test/src/main/resources/workflow/cron_trigger_create.json +++ b/core-test/src/main/resources/workflow/cron_trigger_create.json @@ -4,7 +4,7 @@ "scope": "private", "created_at": "2017-05-30 10:35:16", "workflow_name": "my_wf", - "workflow_id" : "91fdedd9-43cd-4820-b017-a2b2fe600ef4", + "workflow_id": "91fdedd9-43cd-4820-b017-a2b2fe600ef4", "workflow_input": { "param1": "val1", "param2": "val2" diff --git a/core-test/src/main/resources/workflow/task_exec.json b/core-test/src/main/resources/workflow/task_exec.json index 06895a908..242d57dc0 100644 --- a/core-test/src/main/resources/workflow/task_exec.json +++ b/core-test/src/main/resources/workflow/task_exec.json @@ -9,8 +9,12 @@ "workflow_execution_id": "79d187f4-b8e5-4288-b2cd-ed27ee31e4b0", "state": "SUCCESS", "state_info": null, - "runtime_context": {"retry_cnt": 1}, - "published": {"my_var": "my_val"}, + "runtime_context": { + "retry_cnt": 1 + }, + "published": { + "my_var": "my_val" + }, "result": "my task result", "processed": true } diff --git a/core-test/src/main/resources/workflow/task_execs.json b/core-test/src/main/resources/workflow/task_execs.json index d8ea91bd2..d8b8021ae 100644 --- a/core-test/src/main/resources/workflow/task_execs.json +++ b/core-test/src/main/resources/workflow/task_execs.json @@ -11,8 +11,12 @@ "workflow_execution_id": "79d187f4-b8e5-4288-b2cd-ed27ee31e4b0", "state": "SUCCESS", "state_info": null, - "runtime_context": {"retry_cnt": 1}, - "published": {"my_var": "my_val"}, + "runtime_context": { + "retry_cnt": 1 + }, + "published": { + "my_var": "my_val" + }, "result": "my task result", "processed": true }, @@ -27,8 +31,12 @@ "workflow_execution_id": "79d187f4-b8e5-4288-b2cd-ed27ee31e4b0", "state": "ERROR", "state_info": "Some error info", - "runtime_context": {"retry_cnt": 1}, - "published": {"my_var": "my_val"}, + "runtime_context": { + "retry_cnt": 1 + }, + "published": { + "my_var": "my_val" + }, "result": "my task result", "processed": false } diff --git a/core-test/src/main/resources/workflow/wb_def.json b/core-test/src/main/resources/workflow/wb_def.json index 99712d120..4abf35cca 100644 --- a/core-test/src/main/resources/workflow/wb_def.json +++ b/core-test/src/main/resources/workflow/wb_def.json @@ -4,6 +4,9 @@ "created_at": "2017-05-30 08:40:29", "project_id": "", "scope": "private", - "tags": ["test", "private"], + "tags": [ + "test", + "private" + ], "definition": "---\nversion: '2.0'\n\nname: my_wb\n\nworkflows:\n with_items_40:\n tasks:\n task1:\n with-items: i in <% range(0, 40) %>\n action: std.echo output=<% $.i %>\n" } \ No newline at end of file diff --git a/core-test/src/main/resources/workflow/wb_def_create.json b/core-test/src/main/resources/workflow/wb_def_create.json index 99712d120..4abf35cca 100644 --- a/core-test/src/main/resources/workflow/wb_def_create.json +++ b/core-test/src/main/resources/workflow/wb_def_create.json @@ -4,6 +4,9 @@ "created_at": "2017-05-30 08:40:29", "project_id": "", "scope": "private", - "tags": ["test", "private"], + "tags": [ + "test", + "private" + ], "definition": "---\nversion: '2.0'\n\nname: my_wb\n\nworkflows:\n with_items_40:\n tasks:\n task1:\n with-items: i in <% range(0, 40) %>\n action: std.echo output=<% $.i %>\n" } \ No newline at end of file diff --git a/core-test/src/main/resources/workflow/wb_defs.json b/core-test/src/main/resources/workflow/wb_defs.json index 95336d421..404e337ff 100644 --- a/core-test/src/main/resources/workflow/wb_defs.json +++ b/core-test/src/main/resources/workflow/wb_defs.json @@ -6,7 +6,10 @@ "created_at": "2017-05-30 08:40:29", "project_id": "", "scope": "private", - "tags": ["test", "private"], + "tags": [ + "test", + "private" + ], "definition": "---\nversion: '2.0'\n\nparallel_join_2:\n tasks:\n join_task:\n join: all\n task_1:\n on-success: join_task\n task_2:\n on-success: join_task\n" }, { diff --git a/core-test/src/main/resources/workflow/wf_def.json b/core-test/src/main/resources/workflow/wf_def.json index 43ef2e6b7..b26c27ad4 100644 --- a/core-test/src/main/resources/workflow/wf_def.json +++ b/core-test/src/main/resources/workflow/wf_def.json @@ -1,7 +1,10 @@ { "id": "0169affc-e6a1-4013-a59e-c89dfd5523f2", "name": "parallel_join_2", - "tags": ["test", "private"], + "tags": [ + "test", + "private" + ], "project_id": "", "scope": "private", "created_at": "2016-08-17 10:33:24", diff --git a/core-test/src/main/resources/workflow/wf_def_create.json b/core-test/src/main/resources/workflow/wf_def_create.json index 7b9eea0ce..b046cc9e5 100644 --- a/core-test/src/main/resources/workflow/wf_def_create.json +++ b/core-test/src/main/resources/workflow/wf_def_create.json @@ -3,7 +3,10 @@ { "id": "68d49c72-1297-44d2-a686-0296a45241cb", "name": "with_items_40", - "tags": ["test", "private"], + "tags": [ + "test", + "private" + ], "project_id": "", "scope": "private", "created_at": "2017-05-02 09:30:21", diff --git a/core-test/src/main/resources/workflow/wf_defs.json b/core-test/src/main/resources/workflow/wf_defs.json index ff7febe99..1a55af568 100644 --- a/core-test/src/main/resources/workflow/wf_defs.json +++ b/core-test/src/main/resources/workflow/wf_defs.json @@ -3,7 +3,10 @@ { "id": "0169affc-e6a1-4013-a59e-c89dfd5523f2", "name": "parallel_join_2", - "tags": ["test", "private"], + "tags": [ + "test", + "private" + ], "project_id": "", "scope": "private", "created_at": "2016-08-17 10:33:24", diff --git a/core-test/src/main/resources/workflow/wf_exec_create.json b/core-test/src/main/resources/workflow/wf_exec_create.json index 5e6fb9b8e..d589dbc7b 100644 --- a/core-test/src/main/resources/workflow/wf_exec_create.json +++ b/core-test/src/main/resources/workflow/wf_exec_create.json @@ -4,7 +4,9 @@ "created_at": "2016-08-17 10:34:00", "workflow_id": "0169affc-e6a1-4013-a59e-c89dfd5523f2", "workflow_name": "parallel_join_2", - "params": {"env": "my_env"}, + "params": { + "env": "my_env" + }, "input": {}, "state": "RUNNING", "state_info": null, diff --git a/core-test/src/main/resources/workflow/wf_execs.json b/core-test/src/main/resources/workflow/wf_execs.json index f90dd41a2..25365e757 100644 --- a/core-test/src/main/resources/workflow/wf_execs.json +++ b/core-test/src/main/resources/workflow/wf_execs.json @@ -18,7 +18,10 @@ "description": "", "created_at": "2016-08-17 10:35:05", "updated_at": "2016-08-17 10:35:05", - "tags": ["test", "private"], + "tags": [ + "test", + "private" + ], "workflow_id": "0169affc-e6a1-4013-a59e-c89dfd5523f2", "workflow_name": "parallel_join_2", "params": {}, diff --git a/core/pom.xml b/core/pom.xml index 5f1853dd0..db0c4f2b7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1,208 +1,212 @@ - - - org.pacesys - openstack4j-parent - 3.2.1-SNAPSHOT - - 4.0.0 - openstack4j-core - OpenStack4j Core - OpenStack Java API - http://github.com/ContainX/openstack4j/ - jar + + + org.pacesys + openstack4j-parent + 3.2.1-SNAPSHOT + + 4.0.0 + openstack4j-core + OpenStack4j Core + OpenStack Java API + http://github.com/ContainX/openstack4j/ + jar - - openstack4j-core - - - org.apache.maven.plugins - maven-shade-plugin - 1.3.3 - - - package - - shade - - - true - true - true - withdeps - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - - - - !org.openstack4j.openstack.compute.internal, - !org.openstack4j.openstack.compute.internal.ext, - !org.openstack4j.openstack.heat.internal, - !org.openstack4j.openstack.identity.internal, - !org.openstack4j.openstack.image.internal, - - - - - !org.openstack4j.openstack.networking.internal, - !org.openstack4j.openstack.networking.internal.ext, - !org.openstack4j.openstack.storage.block.internal, - !org.openstack4j.openstack.storage.object.internal, - !org.openstack4j.openstack.telemetry.internal, - org.openstack4j, - org.openstack4j.* - - - org.openstack4j.openstack.compute.internal, - org.openstack4j.openstack.compute.internal.ext, - org.openstack4j.openstack.heat.internal, - org.openstack4j.openstack.identity.internal, - org.openstack4j.openstack.image.internal, - org.openstack4j.openstack.networking.internal, - org.openstack4j.openstack.networking.internal.ext, - org.openstack4j.openstack.storage.block.internal, - org.openstack4j.openstack.storage.object.internal, - org.openstack4j.openstack.telemetry.internal - - - !org.openstack*, - * - - + + !org.openstack4j.openstack.compute.internal, + !org.openstack4j.openstack.compute.internal.ext, + !org.openstack4j.openstack.heat.internal, + !org.openstack4j.openstack.identity.internal, + !org.openstack4j.openstack.image.internal, + + + + + !org.openstack4j.openstack.networking.internal, + !org.openstack4j.openstack.networking.internal.ext, + !org.openstack4j.openstack.storage.block.internal, + !org.openstack4j.openstack.storage.object.internal, + !org.openstack4j.openstack.telemetry.internal, + org.openstack4j, + org.openstack4j.* + + + org.openstack4j.openstack.compute.internal, + org.openstack4j.openstack.compute.internal.ext, + org.openstack4j.openstack.heat.internal, + org.openstack4j.openstack.identity.internal, + org.openstack4j.openstack.image.internal, + org.openstack4j.openstack.networking.internal, + org.openstack4j.openstack.networking.internal.ext, + org.openstack4j.openstack.storage.block.internal, + org.openstack4j.openstack.storage.object.internal, + org.openstack4j.openstack.telemetry.internal + + + !org.openstack*, + * + + - - osgi.serviceloader; filter:="(osgi.serviceloader=org.openstack4j.api.APIProvider)";cardinality:=multiple, - osgi.serviceloader; filter:="(osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService)";cardinality:=multiple, - osgi.serviceloader; filter:="(osgi.serviceloader=org.openstack4j.openstack.logging.LoggerFactorySupplier)";cardinality:=multiple;resolution:=optional, - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)", - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" - - - osgi.serviceloader; osgi.serviceloader=org.openstack4j.api.APIProvider - - - true - - - jackson-dataformat-yaml - - - - - - - - - maven-jar-plugin - 2.5 - - - ${project.artifactId}-${release.version} - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - org.apache.felix - maven-bundle-plugin - 2.5.3 - - - - bundle-manifest - process-classes - - manifest - - - - ${project.artifactId} - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.felix - - - maven-bundle-plugin - - - [2.5.3,) - - - manifest - - - - - - - - - - - - - - - - org.yaml - snakeyaml - 1.15 - + This bundles uses SPI to locate implementations for: + org.openstack4j.api.APIProvider + org.openstack4j.core.transport.HttpExecutorService + org.openstack4j.openstack.logging.LoggerFactorySupplier + This bundle defines an implementation for following services in META-INF-services: + org.openstack4j.api.APIProvider + --> + + osgi.serviceloader; + filter:="(osgi.serviceloader=org.openstack4j.api.APIProvider)";cardinality:=multiple, + osgi.serviceloader; + filter:="(osgi.serviceloader=org.openstack4j.core.transport.HttpExecutorService)";cardinality:=multiple, + osgi.serviceloader; + filter:="(osgi.serviceloader=org.openstack4j.openstack.logging.LoggerFactorySupplier)";cardinality:=multiple;resolution:=optional, + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)", + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + + osgi.serviceloader; osgi.serviceloader=org.openstack4j.api.APIProvider + + + true + + + jackson-dataformat-yaml + + + + + + + + + maven-jar-plugin + 2.5 + + + ${project.artifactId}-${release.version} + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + 2.5.3 + + + + bundle-manifest + process-classes + + manifest + + + + ${project.artifactId} + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.felix + + + maven-bundle-plugin + + + [2.5.3,) + + + manifest + + + + + + + + + + + + + + + + org.yaml + snakeyaml + 1.15 + - - org.testng - testng - test - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9.1 - - true - true - *.internal - docs - javadoc - -Xdoclint:none - - - - + + org.testng + testng + test + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + true + true + *.internal + docs + javadoc + -Xdoclint:none + + + + diff --git a/core/src/main/java/org/openstack4j/api/APIProvider.java b/core/src/main/java/org/openstack4j/api/APIProvider.java index 2abaa75c2..345104461 100644 --- a/core/src/main/java/org/openstack4j/api/APIProvider.java +++ b/core/src/main/java/org/openstack4j/api/APIProvider.java @@ -2,26 +2,26 @@ /** * To keep our dependencies simple in the current Openstack4J, we utilize ServiceLoader to load a provider who is responsible - * for loading the implementation for any of the defined API interfaces. This allows us to avoid pulling in extra 3rd party + * for loading the implementation for any of the defined API interfaces. This allows us to avoid pulling in extra 3rd party * dependencies such as Guice, Inject, etc. It also allows us flexibility on the provider which may be overriden and choose to bind * modules and simple delegate out the {@link #get(Class)} calls - * + * * @author Jeremy Unruh */ public interface APIProvider { - /** - * Called after the APIProvider is constructed. This allows the provider to pre-initialize or bind any interface implementations if desired - */ - void initialize(); - - /** - * Gets the implementation for the specified interface type - * - * @param the Openstack4j API type - * @param api the API interface - * @return the implementation for T - * @throws ApiNotFoundException if the API cannot be found - */ - T get(Class api); + /** + * Called after the APIProvider is constructed. This allows the provider to pre-initialize or bind any interface implementations if desired + */ + void initialize(); + + /** + * Gets the implementation for the specified interface type + * + * @param the Openstack4j API type + * @param api the API interface + * @return the implementation for T + * @throws ApiNotFoundException if the API cannot be found + */ + T get(Class api); } diff --git a/core/src/main/java/org/openstack4j/api/Apis.java b/core/src/main/java/org/openstack4j/api/Apis.java index 4357f0eae..7a6675bb8 100644 --- a/core/src/main/java/org/openstack4j/api/Apis.java +++ b/core/src/main/java/org/openstack4j/api/Apis.java @@ -15,8 +15,8 @@ import org.openstack4j.api.octavia.OctaviaService; import org.openstack4j.api.sahara.SaharaService; import org.openstack4j.api.senlin.SenlinService; -import org.openstack4j.api.trove.TroveService; import org.openstack4j.api.tacker.TackerService; +import org.openstack4j.api.trove.TroveService; import org.openstack4j.api.workflow.WorkflowService; import java.util.ServiceLoader; @@ -33,10 +33,8 @@ public class Apis { /** * Gets the API implementation based on Type * - * @param - * the API type - * @param api - * the API implementation + * @param the API type + * @param api the API implementation * @return the API implementation */ public static T get(Class api) { @@ -51,7 +49,7 @@ public static T get(Class api) { public static org.openstack4j.api.identity.v3.IdentityService getIdentityV3Services() { return get(org.openstack4j.api.identity.v3.IdentityService.class); } - + /** * Gets the identity v2 services API * @@ -96,7 +94,7 @@ public static ServiceFunctionChainService getSfcServices() { public static OctaviaService getOctaviaService() { return get(OctaviaService.class); } - + /** * Gets the Artifact services API * @@ -126,6 +124,7 @@ public static ImageService getImageService() { /** * Gets the (Glance) Image v2 services API + * * @return the image v2 services */ public static org.openstack4j.api.image.v2.ImageService getImageV2Service() { @@ -134,7 +133,7 @@ public static org.openstack4j.api.image.v2.ImageService getImageV2Service() { /** * Gets the (Heat) Orchestration services API - * + * * @return the heat services */ public static HeatService getHeatServices() { @@ -152,7 +151,7 @@ public static AppCatalogService getMuranoServices() { /** * Gets the (Sahara) Data Processing services API - * + * * @return the sahara services */ public static SaharaService getSaharaServices() { @@ -170,16 +169,17 @@ public static WorkflowService getWorkflowServices() { /** * Gets the (Manila) Shared File Systems services API - * + * * @return the share services */ public static ShareService getShareServices() { return get(ShareService.class); } - /** + /** * Gets the group based policy services API - * @return the gbp services + * + * @return the gbp services */ public static GbpService getGbpServices() { return get(GbpService.class); @@ -187,21 +187,23 @@ public static GbpService getGbpServices() { /** * Gets the trove services API + * * @return the trove services */ - public static TroveService getTroveServices(){ + public static TroveService getTroveServices() { return get(TroveService.class); } - /** - * Gets the (Senlin) Orchestration services API - * @return the Senlin services - */ - public static SenlinService getSenlinServices() { - return get(SenlinService.class); - } + /** + * Gets the (Senlin) Orchestration services API + * + * @return the Senlin services + */ + public static SenlinService getSenlinServices() { + return get(SenlinService.class); + } - /** + /** * Gets the Magnum services API * * @return the Magnum Service @@ -212,6 +214,7 @@ public static MagnumService getMagnumService() { /** * Gets the (BarbicanService) Orchestration services API + * * @return the BarbicanService services */ public static BarbicanService getBarbicanServices() { @@ -220,9 +223,12 @@ public static BarbicanService getBarbicanServices() { /** * Gets the dns services API + * * @return the dns services */ - public static DNSService getDNSService() { return get(DNSService.class); } + public static DNSService getDNSService() { + return get(DNSService.class); + } private static APIProvider initializeProvider() { diff --git a/core/src/main/java/org/openstack4j/api/Builders.java b/core/src/main/java/org/openstack4j/api/Builders.java index 21bc63103..48b49e25d 100644 --- a/core/src/main/java/org/openstack4j/api/Builders.java +++ b/core/src/main/java/org/openstack4j/api/Builders.java @@ -2,7 +2,6 @@ import org.openstack4j.model.artifact.builder.ArtifactUpdateBuilder; import org.openstack4j.model.artifact.builder.ToscaTemplatesArtifactBuilder; -import org.openstack4j.model.barbican.Secret; import org.openstack4j.model.barbican.builder.ContainerCreateBuilder; import org.openstack4j.model.barbican.builder.ContainerSecretBuilder; import org.openstack4j.model.barbican.builder.SecretCreateBuilder; @@ -11,21 +10,7 @@ import org.openstack4j.model.dns.v2.builder.DNSV2Builders; import org.openstack4j.model.dns.v2.builder.RecordsetBuilder; import org.openstack4j.model.dns.v2.builder.ZoneBuilder; -import org.openstack4j.model.gbp.builder.ExternalPolicyBuilder; -import org.openstack4j.model.gbp.builder.ExternalRoutesBuilder; -import org.openstack4j.model.gbp.builder.ExternalSegmentBuilder; -import org.openstack4j.model.gbp.builder.L2PolicyBuilder; -import org.openstack4j.model.gbp.builder.L3PolicyBuilder; -import org.openstack4j.model.gbp.builder.NatPoolBuilder; -import org.openstack4j.model.gbp.builder.NetworkServicePolicyBuilder; -import org.openstack4j.model.gbp.builder.PolicyActionCreateBuilder; -import org.openstack4j.model.gbp.builder.PolicyActionUpdateBuilder; -import org.openstack4j.model.gbp.builder.PolicyClassifierBuilder; -import org.openstack4j.model.gbp.builder.PolicyClassifierUpdateBuilder; -import org.openstack4j.model.gbp.builder.PolicyRuleBuilder; -import org.openstack4j.model.gbp.builder.PolicyRuleSetBuilder; -import org.openstack4j.model.gbp.builder.PolicyTargetBuilder; -import org.openstack4j.model.gbp.builder.PolicyTargetGroupBuilder; +import org.openstack4j.model.gbp.builder.*; import org.openstack4j.model.heat.*; import org.openstack4j.model.heat.builder.*; import org.openstack4j.model.identity.v2.builder.IdentityV2Builders; @@ -35,24 +20,19 @@ import org.openstack4j.model.image.v2.builder.TaskBuilder; import org.openstack4j.model.magnum.BaymodelBuilder; import org.openstack4j.model.manila.builder.*; -import org.openstack4j.model.murano.v1.builder.EnvironmentBuilder; import org.openstack4j.model.murano.v1.builder.AppCatalogBuilders; +import org.openstack4j.model.murano.v1.builder.EnvironmentBuilder; import org.openstack4j.model.network.builder.*; import org.openstack4j.model.network.ext.builder.*; import org.openstack4j.model.sahara.builder.*; -import org.openstack4j.model.storage.block.builder.BlockQuotaSetBuilder; -import org.openstack4j.model.storage.block.builder.StorageBuilders; -import org.openstack4j.model.storage.block.builder.VolumeBackupCreateBuilder; -import org.openstack4j.model.storage.block.builder.VolumeBuilder; -import org.openstack4j.model.storage.block.builder.VolumeSnapshotBuilder; -import org.openstack4j.model.storage.block.builder.VolumeTypeBuilder; +import org.openstack4j.model.storage.block.builder.*; import org.openstack4j.model.tacker.builder.NfvBuilders; import org.openstack4j.model.telemetry.builder.AlarmBuilder; import org.openstack4j.model.telemetry.builder.TelemetryBuilders; import org.openstack4j.model.trove.builder.DBServiceBuilders; +import org.openstack4j.model.workflow.builder.WorkflowBuilders; import org.openstack4j.openstack.artifact.domain.ArtifactUpdateModel; import org.openstack4j.openstack.artifact.domain.ToscaTemplates; -import org.openstack4j.model.workflow.builder.WorkflowBuilders; import org.openstack4j.openstack.barbican.domain.BarbicanContainer; import org.openstack4j.openstack.barbican.domain.BarbicanContainerSecret; import org.openstack4j.openstack.barbican.domain.BarbicanSecret; @@ -60,25 +40,10 @@ import org.openstack4j.openstack.compute.builder.NovaBuilders; import org.openstack4j.openstack.compute.domain.*; import org.openstack4j.openstack.compute.domain.NovaSecGroupExtension.SecurityGroupRule; -import org.openstack4j.openstack.compute.domain.NovaServerCreate; import org.openstack4j.openstack.dns.v2.builder.DesignateV2Builders; import org.openstack4j.openstack.dns.v2.domain.DesignateRecordset; import org.openstack4j.openstack.dns.v2.domain.DesignateZone; -import org.openstack4j.openstack.gbp.domain.GbpExternalPolicyCreate; -import org.openstack4j.openstack.gbp.domain.GbpExternalRoutes; -import org.openstack4j.openstack.gbp.domain.GbpExternalSegment; -import org.openstack4j.openstack.gbp.domain.GbpL2Policy; -import org.openstack4j.openstack.gbp.domain.GbpL3Policy; -import org.openstack4j.openstack.gbp.domain.GbpNatPool; -import org.openstack4j.openstack.gbp.domain.GbpNetworkServicePolicy; -import org.openstack4j.openstack.gbp.domain.GbpPolicyAction; -import org.openstack4j.openstack.gbp.domain.GbpPolicyActionUpdate; -import org.openstack4j.openstack.gbp.domain.GbpPolicyClassifier; -import org.openstack4j.openstack.gbp.domain.GbpPolicyClassifierUpdate; -import org.openstack4j.openstack.gbp.domain.GbpPolicyRule; -import org.openstack4j.openstack.gbp.domain.GbpPolicyRuleSet; -import org.openstack4j.openstack.gbp.domain.GbpPolicyTarget; -import org.openstack4j.openstack.gbp.domain.GbpPolicyTargetGroupCreate; +import org.openstack4j.openstack.gbp.domain.*; import org.openstack4j.openstack.heat.builder.HeatBuilders; import org.openstack4j.openstack.heat.domain.*; import org.openstack4j.openstack.identity.v2.builder.KeystoneV2Builders; @@ -99,11 +64,7 @@ import org.openstack4j.openstack.sahara.builder.SaharaBuilders; import org.openstack4j.openstack.sahara.domain.*; import org.openstack4j.openstack.storage.block.builder.CinderBuilders; -import org.openstack4j.openstack.storage.block.domain.CinderBlockQuotaSet; -import org.openstack4j.openstack.storage.block.domain.CinderVolume; -import org.openstack4j.openstack.storage.block.domain.CinderVolumeBackupCreate; -import org.openstack4j.openstack.storage.block.domain.CinderVolumeSnapshot; -import org.openstack4j.openstack.storage.block.domain.CinderVolumeType; +import org.openstack4j.openstack.storage.block.domain.*; import org.openstack4j.openstack.tacker.builders.TackerBuilders; import org.openstack4j.openstack.telemetry.builder.CeilometerBuilders; import org.openstack4j.openstack.telemetry.domain.CeilometerAlarm; @@ -182,7 +143,7 @@ public static NetworkBuilder network() { /** * The builder to create a Flow Classifier * - * @return the Flow Classifier builder + * @return the Flow Classifier builder */ public static FlowClassifierBuilder flowClassifier() { return NeutronFlowClassifier.builder(); @@ -262,7 +223,7 @@ public static VolumeBuilder volume() { /** * The builder to create a Volume Type - * + * * @return the volume type builder */ public static VolumeTypeBuilder volumeType() { @@ -277,13 +238,14 @@ public static VolumeTypeBuilder volumeType() { public static VolumeSnapshotBuilder volumeSnapshot() { return CinderVolumeSnapshot.builder(); } - + /** * The builder to create a Block Volume Backup + * * @return the volume backup builder */ - public static VolumeBackupCreateBuilder volumeBackupCreate(){ - return CinderVolumeBackupCreate.builder(); + public static VolumeBackupCreateBuilder volumeBackupCreate() { + return CinderVolumeBackupCreate.builder(); } /** @@ -378,6 +340,7 @@ public static StackUpdateBuilder stackUpdate() { /** * The builder to create a {@link ResourceHealth} + * * @return */ public static ResourceHealthBuilder resourceHealth() { @@ -855,7 +818,6 @@ public static NatPoolBuilder natPool() { /** * The builder which creates network service policy for gbp * - * * @return */ public static NetworkServicePolicyBuilder networkServicePolicy() { @@ -1056,7 +1018,6 @@ public static LbPoolV2Builder lbpoolV2() { /** * LbaasV2 pool update builder * - * * @return the lb pool v2 update builder */ public static LbPoolV2UpdateBuilder lbPoolV2Update() { @@ -1066,7 +1027,6 @@ public static LbPoolV2UpdateBuilder lbPoolV2Update() { /** * LbaasV2 member builder * - * * @return the member v2 builder */ public static MemberV2Builder memberV2() { @@ -1076,7 +1036,6 @@ public static MemberV2Builder memberV2() { /** * LbaasV2 member update builder * - * * @return the member v2 update builder */ public static MemberV2UpdateBuilder memberV2Update() { @@ -1086,7 +1045,6 @@ public static MemberV2UpdateBuilder memberV2Update() { /** * LbaasV2 listener builder * - * * @return the listener builder */ public static ListenerV2Builder listenerV2() { @@ -1096,7 +1054,6 @@ public static ListenerV2Builder listenerV2() { /** * LbaasV2 listener update builder * - * * @return the listener v2 update builder */ public static ListenerV2UpdateBuilder listenerV2Update() { @@ -1106,7 +1063,6 @@ public static ListenerV2UpdateBuilder listenerV2Update() { /** * LbaasV2 health monitor builder * - * * @return the health monitor v2 builder */ public static HealthMonitorV2Builder healthmonitorV2() { @@ -1116,7 +1072,6 @@ public static HealthMonitorV2Builder healthmonitorV2() { /** * LbaasV2 healthmonitor update builder * - * * @return the health monitor v2 update builder */ public static HealthMonitorV2UpdateBuilder healthMonitorV2Update() { @@ -1126,7 +1081,6 @@ public static HealthMonitorV2UpdateBuilder healthMonitorV2Update() { /** * LbaasV2 loadbalancer builder * - * * @return the loadbalancer v2 builder */ public static LoadBalancerV2Builder loadbalancerV2() { @@ -1136,7 +1090,6 @@ public static LoadBalancerV2Builder loadbalancerV2() { /** * LbaasV2 loadbalancer update builder * - * * @return the loadbalancer v2 update builder */ public static LoadBalancerV2UpdateBuilder loadBalancerV2Update() { @@ -1145,6 +1098,7 @@ public static LoadBalancerV2UpdateBuilder loadBalancerV2Update() { /** * Magnum builder + * * @return the magnum builder */ @@ -1154,6 +1108,7 @@ public static BaymodelBuilder baymodel() { /** * Barbican container builder + * * @return the container builder */ public static ContainerCreateBuilder container() { @@ -1162,6 +1117,7 @@ public static ContainerCreateBuilder container() { /** * Barbican secret builder + * * @return the secret builder */ public static ContainerSecretBuilder containerSecret() { @@ -1170,12 +1126,16 @@ public static ContainerSecretBuilder containerSecret() { /** * Barbican secret builder + * * @return the secret builder */ - public static SecretCreateBuilder secret() { return BarbicanSecret.builder(); } + public static SecretCreateBuilder secret() { + return BarbicanSecret.builder(); + } /** * The Tacker builders + * * @return the tacker builders */ public static NfvBuilders tacker() { @@ -1184,6 +1144,7 @@ public static NfvBuilders tacker() { /** * Images V2 builder + * * @return the glance v2 image builder */ public static org.openstack4j.model.image.v2.builder.ImageBuilder imageV2() { @@ -1192,6 +1153,7 @@ public static org.openstack4j.model.image.v2.builder.ImageBuilder imageV2() { /** * Image V2 task builder + * * @return the glance v2 task builder */ public static TaskBuilder taskBuilder() { @@ -1200,6 +1162,7 @@ public static TaskBuilder taskBuilder() { /** * Image V2 json patch update builder + * * @return the image patch update builder */ public static ImageUpdateBuilder imageUpdateV2() { @@ -1238,14 +1201,18 @@ public static DNSV2Builders dnsV2() { * * @return the zone builder */ - public static ZoneBuilder zone() { return DesignateZone.builder(); } + public static ZoneBuilder zone() { + return DesignateZone.builder(); + } /** * The builder to create a Recordset. * * @return the recordset builder */ - public static RecordsetBuilder recordset() { return DesignateRecordset.builder(); } + public static RecordsetBuilder recordset() { + return DesignateRecordset.builder(); + } public static WorkflowBuilders workflow() { return new MistralBuilders(); diff --git a/core/src/main/java/org/openstack4j/api/EndpointTokenProvider.java b/core/src/main/java/org/openstack4j/api/EndpointTokenProvider.java index 00ebe1714..3136b6032 100644 --- a/core/src/main/java/org/openstack4j/api/EndpointTokenProvider.java +++ b/core/src/main/java/org/openstack4j/api/EndpointTokenProvider.java @@ -4,23 +4,23 @@ /** * Provides Endpoint information for the current authorized scope - * + * * @author Jeremy Unruh */ public interface EndpointTokenProvider { - /** - * Gets the endpoint for the specified ServiceType - * - * @param service the service to obtain the endpoint for - * @return the endpoint - */ - String getEndpoint(ServiceType service); - - /** - * Gets the token identifier - * - * @return the auth token identifier - */ - String getTokenId(); + /** + * Gets the endpoint for the specified ServiceType + * + * @param service the service to obtain the endpoint for + * @return the endpoint + */ + String getEndpoint(ServiceType service); + + /** + * Gets the token identifier + * + * @return the auth token identifier + */ + String getTokenId(); } diff --git a/core/src/main/java/org/openstack4j/api/OSClient.java b/core/src/main/java/org/openstack4j/api/OSClient.java index fed6abd88..b257cd2f0 100644 --- a/core/src/main/java/org/openstack4j/api/OSClient.java +++ b/core/src/main/java/org/openstack4j/api/OSClient.java @@ -8,6 +8,7 @@ import org.openstack4j.api.gbp.GbpService; import org.openstack4j.api.heat.HeatService; import org.openstack4j.api.image.ImageService; +import org.openstack4j.api.magnum.MagnumService; import org.openstack4j.api.manila.ShareService; import org.openstack4j.api.murano.v1.AppCatalogService; import org.openstack4j.api.networking.NetworkingService; @@ -25,7 +26,6 @@ import org.openstack4j.api.workflow.WorkflowService; import org.openstack4j.model.identity.v2.Access; import org.openstack4j.model.identity.v3.Token; -import org.openstack4j.api.magnum.MagnumService; import java.util.Map; import java.util.Set; @@ -37,7 +37,7 @@ * * @author Jeremy Unruh */ -public interface OSClient< T extends OSClient> { +public interface OSClient> { /** * Specifies the region that should be used for further invocations with @@ -193,7 +193,7 @@ public interface OSClient< T extends OSClient> { * @return the artifact service */ ArtifactService artifact(); - + /** * Returns the Tacker Service API * @@ -224,6 +224,7 @@ public interface OSClient< T extends OSClient> { /** * Returns the Image V2 Service API + * * @return the image v2 service */ org.openstack4j.api.image.v2.ImageService imagesV2(); @@ -272,7 +273,7 @@ public interface OSClient< T extends OSClient> { /** * Returns the Magnum Service API - * + * * @return the Magnum Service */ MagnumService magnum(); @@ -281,61 +282,61 @@ public interface OSClient< T extends OSClient> { * OpenStack4j Client which authenticates against version V2 */ public interface OSClientV2 extends OSClient { - + /** * Returns the Identity V2 Access object assigned during authentication - * + * * @return the Access object */ Access getAccess(); - + /** * Returns the Identity Service API V2 - * + * * @return the identity service version 2 */ org.openstack4j.api.identity.v2.IdentityService identity(); - + } - + /** * OpenStack4j Client which authenticates against version V3 */ public interface OSClientV3 extends OSClient { - - + + /** * Gets the token that was assigned during authorization * * @return the authentication token */ Token getToken(); - + /** * Returns the Identity Service API V3 * * @return the identity service version 3 */ org.openstack4j.api.identity.v3.IdentityService identity(); - + } - - /** + + /** * Returns the Gbp Service API - * + * * @return the Gbp service */ - GbpService gbp(); - - /** - * Returns the Senlin Service API - * - * @return the Senlin service - */ - SenlinService senlin(); + GbpService gbp(); + + /** + * Returns the Senlin Service API + * + * @return the Senlin service + */ + SenlinService senlin(); /** - * Returns the Trove Service API + * Returns the Trove Service API * * @return the Trove service */ diff --git a/core/src/main/java/org/openstack4j/api/artifact/ArtifactService.java b/core/src/main/java/org/openstack4j/api/artifact/ArtifactService.java index a9a02807e..db103af59 100644 --- a/core/src/main/java/org/openstack4j/api/artifact/ArtifactService.java +++ b/core/src/main/java/org/openstack4j/api/artifact/ArtifactService.java @@ -1,8 +1,6 @@ package org.openstack4j.api.artifact; -import org.openstack4j.api.OSClient; import org.openstack4j.common.RestService; -import org.openstack4j.model.artifact.Artifacts; /** * OpenStack (Glare) Artifact Type diff --git a/core/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactService.java b/core/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactService.java index ecdb13043..1a7559590 100644 --- a/core/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactService.java +++ b/core/src/main/java/org/openstack4j/api/artifact/ToscaTemplatesArtifactService.java @@ -3,7 +3,6 @@ import org.openstack4j.common.RestService; import org.openstack4j.model.artifact.ArtifactUpdate; -import org.openstack4j.model.artifact.Artifacts; import org.openstack4j.model.artifact.ToscaTemplatesArtifact; import org.openstack4j.model.artifact.ToscaTemplatesArtifacts; import org.openstack4j.model.common.ActionResponse; diff --git a/core/src/main/java/org/openstack4j/api/barbican/BarbicanService.java b/core/src/main/java/org/openstack4j/api/barbican/BarbicanService.java index 39bb9f609..077a09896 100644 --- a/core/src/main/java/org/openstack4j/api/barbican/BarbicanService.java +++ b/core/src/main/java/org/openstack4j/api/barbican/BarbicanService.java @@ -4,7 +4,6 @@ /** * Barbican (Key Management) Operations API - * */ public interface BarbicanService extends RestService { @@ -12,6 +11,7 @@ public interface BarbicanService extends RestService { * @return the Container Service API */ ContainerService containers(); + /** * @return the Secrets Service API */ diff --git a/core/src/main/java/org/openstack4j/api/barbican/ContainerService.java b/core/src/main/java/org/openstack4j/api/barbican/ContainerService.java index ebb5948e0..6e7bb7f21 100644 --- a/core/src/main/java/org/openstack4j/api/barbican/ContainerService.java +++ b/core/src/main/java/org/openstack4j/api/barbican/ContainerService.java @@ -28,6 +28,7 @@ public interface ContainerService { /** * Get the specified container by ID + * * @param containerId * @return */ @@ -35,6 +36,7 @@ public interface ContainerService { /** * Delete the specified container by ID + * * @param containerId * @return */ @@ -42,6 +44,7 @@ public interface ContainerService { /** * Create a container. + * * @param container * @return */ diff --git a/core/src/main/java/org/openstack4j/api/barbican/SecretService.java b/core/src/main/java/org/openstack4j/api/barbican/SecretService.java index bd77eb24c..2bb4764da 100644 --- a/core/src/main/java/org/openstack4j/api/barbican/SecretService.java +++ b/core/src/main/java/org/openstack4j/api/barbican/SecretService.java @@ -8,13 +8,14 @@ /** * Created by reneschollmeyer on 02.08.17. - * + *

* Secret service provides CRUD capabilities for Secret(s). */ public interface SecretService { /** * Returns a list of secrets filtered by parameters. + * * @param filteringParams map (name, value) of filtering parameters * @return list of secrets filtered by filteringParameters */ @@ -29,6 +30,7 @@ public interface SecretService { /** * Get a specified secret by its ID. + * * @param secretId * @return */ @@ -36,6 +38,7 @@ public interface SecretService { /** * Delete a specified secret by its ID. + * * @param secretId * @return */ @@ -43,6 +46,7 @@ public interface SecretService { /** * Create a secret. + * * @param secret * @return */ diff --git a/core/src/main/java/org/openstack4j/api/client/CloudProvider.java b/core/src/main/java/org/openstack4j/api/client/CloudProvider.java index 456a6dbd9..31ccce59c 100644 --- a/core/src/main/java/org/openstack4j/api/client/CloudProvider.java +++ b/core/src/main/java/org/openstack4j/api/client/CloudProvider.java @@ -1,9 +1,8 @@ package org.openstack4j.api.client; /** - * Cloud Provider helps OpenStack4j handle provider specific changes or workarounds. Users who know the provider + * Cloud Provider helps OpenStack4j handle provider specific changes or workarounds. Users who know the provider * they are authenticating with should set this for more reliability - * */ public enum CloudProvider { UNKNOWN, diff --git a/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java b/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java index e68c2b61f..8830f01f4 100644 --- a/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java +++ b/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java @@ -11,7 +11,6 @@ * OpenStack4j Client Builder * * @author Jeremy Unruh - * */ public interface IOSClientBuilder> { @@ -26,7 +25,7 @@ public interface IOSClientBuilder> { /** * The authentication credentials * - * @param userId the user id to authenticate with + * @param userId the user id to authenticate with * @param password the password to authenticate with * @return self for method chaining */ @@ -53,7 +52,7 @@ public interface IOSClientBuilder> { * Allows for a specific network perspective to be used. For example to only * use AdminURL Endpoints you would want to set the {@link Facing#ADMIN} as * a facing perspective. - * + *

* NOTE: If you choose PUBLIC some features may not work that are normally * admin based configuration/functionality. If you normally are not using * these features PUBLIC works fine in most cases. @@ -65,7 +64,7 @@ public interface IOSClientBuilder> { /** * DEPRECATED: Use {@link #applyConfig(Config)} to configure SSL policies - * + *

* In some private environments self signed certificates are used. If you * are using HTTPS and using self-signed cerificates then set this to true. * Otherwise the default strict hostname and properly signed validation @@ -85,7 +84,7 @@ public interface IOSClientBuilder> { * * @return the authenticated client * @throws AuthenticationException if the credentials or default tenant is - * invalid + * invalid */ R authenticate() throws AuthenticationException; @@ -96,7 +95,7 @@ public interface V2 extends IOSClientBuilder { /** * The tenant/project to authenticate as - * + * * @param tenantName the tenant/project name * @return self for method chaining */ @@ -105,7 +104,7 @@ public interface V2 extends IOSClientBuilder { /** * The tenant/project to authenticate as (some clouds such as HP use * tenantId vs tenantName) - * + * * @param tenantId the tenant/project id * @return self for method chaining */ @@ -113,7 +112,7 @@ public interface V2 extends IOSClientBuilder { /** * Use Rackspace API Key Authentication Admin Extension to authenticate - * + * * @param raxApiKey true if enabled * @return self for method chaining */ @@ -124,7 +123,7 @@ public interface V2 extends IOSClientBuilder { * {@link #credentials(String, String)}. Note: The * {@link #tenantId(String)} or {@link #tenantName(String)} will * required when using this method for authentication. - * + * * @param tokenId the token identifier * @return self for method chaining */ @@ -142,7 +141,7 @@ public interface V3 extends IOSClientBuilder { * * @param userName the user name to authenticate with * @param password the password to authenticate with - * @param domain the domain if using "default scoped" + * @param domain the domain if using "default scoped" * @return self for method chaining */ V3 credentials(String userName, String password, Identifier domain); @@ -150,7 +149,7 @@ public interface V3 extends IOSClientBuilder { /** * DEPRECATED: Please use * {@link #credentials(String, String, Identifier) - * + *

* Authenticates against the specified domain name * * @param domainName the domain name to authenticate against @@ -162,7 +161,7 @@ public interface V3 extends IOSClientBuilder { /** * DEPRECATED: Please use * {@link #credentials(String, String, Identifier)} - * + *

* Authenticates against the specified domain identifier * * @param domainId the domain identifier to authenticate against @@ -185,7 +184,7 @@ public interface V3 extends IOSClientBuilder { * Scopes the token to a project level * * @param project the project ID or Name value - * @param domain the domain ID or Name value + * @param domain the domain ID or Name value * @return self for method chaining */ V3 scopeToProject(Identifier project, Identifier domain); diff --git a/core/src/main/java/org/openstack4j/api/compute/ComputeFloatingIPService.java b/core/src/main/java/org/openstack4j/api/compute/ComputeFloatingIPService.java index 3de2e55a5..d9079a563 100755 --- a/core/src/main/java/org/openstack4j/api/compute/ComputeFloatingIPService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ComputeFloatingIPService.java @@ -1,12 +1,12 @@ package org.openstack4j.api.compute; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.FloatingIP; import org.openstack4j.model.compute.Server; +import java.util.List; + /** * OpenStack Compute Floating-IP Operation API. * @@ -14,86 +14,90 @@ */ public interface ComputeFloatingIPService extends RestService { - /** - * List floating ips associated with current tenant. - * - * @return the list - */ - List list(); + /** + * List floating ips associated with current tenant. + * + * @return the list + */ + List list(); - /** - * Lists the current Floating IP Pool Names - * @return List of floating IP pool names - */ - List getPoolNames(); + /** + * Lists the current Floating IP Pool Names + * + * @return List of floating IP pool names + */ + List getPoolNames(); - /** - * Allocate a floating ip address to tenant. - * - * @param pool the pool - * @return the floating ip - */ - FloatingIP allocateIP(String pool); + /** + * Allocate a floating ip address to tenant. + * + * @param pool the pool + * @return the floating ip + */ + FloatingIP allocateIP(String pool); - /** - * Deallocate ip address from tenant. - * - * @param id the id of floating ip address - * @return the action response - */ - ActionResponse deallocateIP(String id); + /** + * Deallocate ip address from tenant. + * + * @param id the id of floating ip address + * @return the action response + */ + ActionResponse deallocateIP(String id); - /** - * Adds floating-ip to server. - * - * @param server the server - * @param fixedIpAddress the fixed ip address - * @param ipAddress the ip address - * @return the action response - */ - ActionResponse addFloatingIP(Server server, String fixedIpAddress, String ipAddress); + /** + * Adds floating-ip to server. + * + * @param server the server + * @param fixedIpAddress the fixed ip address + * @param ipAddress the ip address + * @return the action response + */ + ActionResponse addFloatingIP(Server server, String fixedIpAddress, String ipAddress); - /** - * Adds floating-ip to server. - * - * @param server the server - * @param ipAddress the ip address - * @return the action response - */ - ActionResponse addFloatingIP(Server server, String ipAddress); + /** + * Adds floating-ip to server. + * + * @param server the server + * @param ipAddress the ip address + * @return the action response + */ + ActionResponse addFloatingIP(Server server, String ipAddress); - /** - * Remove floating-ip from server - * - * @param server the server - * @param ipAddress the ip address - */ - ActionResponse removeFloatingIP(Server server, String ipAddress); + /** + * Remove floating-ip from server + * + * @param server the server + * @param ipAddress the ip address + */ + ActionResponse removeFloatingIP(Server server, String ipAddress); - /** - * Adds floating-ip to server. - * @param serverId the id of the server - * @param fixedIpAddress the fixed ip address - * @param ipAddress the ip address - * @return the action response - */ - ActionResponse addFloatingIP(String serverId, String fixedIpAddress, String ipAddress); + /** + * Adds floating-ip to server. + * + * @param serverId the id of the server + * @param fixedIpAddress the fixed ip address + * @param ipAddress the ip address + * @return the action response + */ + ActionResponse addFloatingIP(String serverId, String fixedIpAddress, String ipAddress); - /** - * Adds floating-ip to server. - * @param serverId the id of the server - * @param ipAddress the ip address - * @return the action response - */ - ActionResponse addFloatingIP(String serverId, String ipAddress); + /** + * Adds floating-ip to server. + * + * @param serverId the id of the server + * @param ipAddress the ip address + * @return the action response + */ + ActionResponse addFloatingIP(String serverId, String ipAddress); - /** - * Remove floating-ip from server - * @param serverId the id of the server - * @param ipAddress the ip address - * @return - */ - ActionResponse removeFloatingIP(String serverId, String ipAddress) ; + /** + * Remove floating-ip from server + * + * @param serverId the id of the server + * @param ipAddress the ip address + * @return + */ + ActionResponse removeFloatingIP(String serverId, String ipAddress); } diff --git a/core/src/main/java/org/openstack4j/api/compute/ComputeImageService.java b/core/src/main/java/org/openstack4j/api/compute/ComputeImageService.java index 483a50574..60f4a36ce 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ComputeImageService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ComputeImageService.java @@ -1,74 +1,75 @@ package org.openstack4j.api.compute; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.Image; +import java.util.List; +import java.util.Map; + /** * Provides access to Compute Images - * + * * @author Jeremy Unruh */ public interface ComputeImageService extends RestService { - /** - * Lists Images on an OpenStack Compute EndPoint. By default this method lists in "Detail" which means all - * major fields are populated for each image. This is equivalent to calling {@link #list(boolean)} with {code}true{code} - * - * @return List of Image - */ - List list(); - - /** - * Lists Images on an OpenStack Compute EndPoint. If {@code detailed} is false then only {@link Image#getId()}, {@link Image#getName()} and - * - * @param detailed true to populate all properties within each Image, false to include Id, Name and Links only (all other properties will be null) - * @return List of Image - * {@link Image#getLinks()} will be populated. True will populate all fields - */ - List list(boolean detailed); + /** + * Lists Images on an OpenStack Compute EndPoint. By default this method lists in "Detail" which means all + * major fields are populated for each image. This is equivalent to calling {@link #list(boolean)} with {code}true{code} + * + * @return List of Image + */ + List list(); + + /** + * Lists Images on an OpenStack Compute EndPoint. If {@code detailed} is false then only {@link Image#getId()}, {@link Image#getName()} and + * + * @param detailed true to populate all properties within each Image, false to include Id, Name and Links only (all other properties will be null) + * @return List of Image + * {@link Image#getLinks()} will be populated. True will populate all fields + */ + List list(boolean detailed); + + /** + * Finds an Image by the given {@code imageId}. + * + * @param imageId the image identifier + * @return the specified Image + */ + Image get(String imageId); + + /** + * Deletes an Image based on it's identifiers. Images created by another user typically cannot be deleted + * + * @param imageId the image identifier + * @return the action response + */ + ActionResponse delete(String imageId); + + /** + * Gets the metadata for an image + * + * @param imageId the image identifier + * @return the metadata as Map + */ + Map getMetaData(String imageId); + + /** + * Sets the metadata for an image + * + * @param imageId the image identifier + * @param metadata a Map containing the metadata + * @return the metadata as Map + */ + Map setMetaData(String imageId, Map metadata); - /** - * Finds an Image by the given {@code imageId}. - * @param imageId the image identifier - * @return the specified Image - */ - Image get(String imageId); - - /** - * Deletes an Image based on it's identifiers. Images created by another user typically cannot be deleted - * - * @param imageId the image identifier - * @return the action response - */ - ActionResponse delete(String imageId); - - /** - * Gets the metadata for an image - * - * @param imageId the image identifier - * @return the metadata as Map - */ - Map getMetaData(String imageId); - - /** - * Sets the metadata for an image - * - * @param imageId the image identifier - * @param metadata a Map containing the metadata - * @return the metadata as Map - */ - Map setMetaData(String imageId, Map metadata); - - /** - * Delete a metadata item from an image - * - * @param imageId the image identifier - * @param keys one or more keys/metadata names to remove - * @return the action response - */ - ActionResponse deleteMetaData(String imageId, String... keys); + /** + * Delete a metadata item from an image + * + * @param imageId the image identifier + * @param keys one or more keys/metadata names to remove + * @return the action response + */ + ActionResponse deleteMetaData(String imageId, String... keys); } diff --git a/core/src/main/java/org/openstack4j/api/compute/ComputeSecurityGroupService.java b/core/src/main/java/org/openstack4j/api/compute/ComputeSecurityGroupService.java index e55154a22..3666285b1 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ComputeSecurityGroupService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ComputeSecurityGroupService.java @@ -1,78 +1,85 @@ package org.openstack4j.api.compute; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.SecGroupExtension; import org.openstack4j.model.compute.SecGroupExtension.Rule; +import java.util.List; + /** * Provides operations against the Security Group extension in OpenStack - * + *

* Extension Mapping: (os-security-groups) - * + * * @author Jeremy Unruh */ public interface ComputeSecurityGroupService extends RestService { - /** - * List all the Security Groups - * - * @return the list of security groups - */ - List list(); - - /** - * Lists the Security Groups for the specified server - * @param serverId the server identifier - * @return the list of security groups - */ - List listServerGroups(String serverId); - - /** - * Gets the specified Security Group - * @param securityGroupId the security group identifier - * @return the security group or Null if not found - */ - SecGroupExtension get(String securityGroupId); + /** + * List all the Security Groups + * + * @return the list of security groups + */ + List list(); + + /** + * Lists the Security Groups for the specified server + * + * @param serverId the server identifier + * @return the list of security groups + */ + List listServerGroups(String serverId); + + /** + * Gets the specified Security Group + * + * @param securityGroupId the security group identifier + * @return the security group or Null if not found + */ + SecGroupExtension get(String securityGroupId); + + /** + * Creates a new Security Group + * + * @param name the name of the security group + * @param description the description of the security group + * @return the newly created security group + */ + SecGroupExtension create(String name, String description); + + /** + * Updates the Name and Description for a Security Group + * + * @param securityGroupId the security group identifier + * @param name the name of the security group + * @param description the description of the security group + * @return the newly created security group + */ + SecGroupExtension update(String securityGroupId, String name, String description); + + /** + * Deletes the specified Security Group + * + * @param securityGroupId the security group identifier + * @return the action response + */ + ActionResponse delete(String securityGroupId); + + /** + * Creates a new Security Group Rule + * + * @param rule the rule to create + * @return the newly created rule + */ + Rule createRule(Rule rule); - /** - * Creates a new Security Group - * @param name the name of the security group - * @param description the description of the security group - * @return the newly created security group - */ - SecGroupExtension create(String name, String description); + /** + * Deletes a Security Group Rule + * + * @param ruleId the rule identifier + * @return the action response + */ + ActionResponse deleteRule(String ruleId); - /** - * Updates the Name and Description for a Security Group - * @param securityGroupId the security group identifier - * @param name the name of the security group - * @param description the description of the security group - * @return the newly created security group - */ - SecGroupExtension update(String securityGroupId, String name, String description); - - /** - * Deletes the specified Security Group - * @param securityGroupId the security group identifier - * @return the action response - */ - ActionResponse delete(String securityGroupId); - - /** - * Creates a new Security Group Rule - * @param rule the rule to create - * @return the newly created rule - */ - Rule createRule(Rule rule); - - /** - * Deletes a Security Group Rule - * @param ruleId the rule identifier - * @return the action response - */ - ActionResponse deleteRule(String ruleId); - } diff --git a/core/src/main/java/org/openstack4j/api/compute/ComputeService.java b/core/src/main/java/org/openstack4j/api/compute/ComputeService.java index 0c8b8389a..7e14c0cf5 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ComputeService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ComputeService.java @@ -1,131 +1,129 @@ package org.openstack4j.api.compute; -import java.util.List; - -import org.openstack4j.api.compute.ext.FloatingIPDNSService; -import org.openstack4j.api.compute.ext.HypervisorService; -import org.openstack4j.api.compute.ext.MigrationService; -import org.openstack4j.api.compute.ext.ServicesService; -import org.openstack4j.api.compute.ext.ZoneService; +import org.openstack4j.api.compute.ext.*; import org.openstack4j.common.RestService; import org.openstack4j.model.common.Extension; +import java.util.List; + /** * Compute (Nova) Operations API - * + * * @author Jeremy Unruh */ public interface ComputeService extends RestService { - /** - * Flavor Service API - * - * @return the flavor service - */ - FlavorService flavors(); - - /** - * Image Service API - * - * @return the image service - */ - ComputeImageService images(); - - /** - * Hypervisor Service Extension API - * - * @return the hypervisor service - */ - HypervisorService hypervisors(); - - /** - * ZoneService Extension API - * - * @return the zones service - */ - ZoneService zones(); - - /** - * Server Service API - * - * @return the server service - */ - ServerService servers(); - - /** - * Quota-Set Service API - * - * @return the quota set service - */ - QuotaSetService quotaSets(); - - /** - * Compute Os-Host API - * - * @return the compute os-host service - */ - HostService host(); - - /** - * Floating IP Service API - * - * @return the floating-ip service - */ - ComputeFloatingIPService floatingIps(); - - /** - * Security Groups Extension API - * - * @return the security groups service - */ - ComputeSecurityGroupService securityGroups(); - - /** - * Keypair Management Service - * - * @return the keypair service - */ - KeypairService keypairs(); - - /** - * Administrators only - provides in-progress migrations for a region or cell - * - * @return the migration service - */ - MigrationService migrations(); - - /** - * @return a list of Extensions that have been added against the Compute service - */ - List listExtensions(); - - /** - * ServerGroup Management Service - * - * @return ServerGroup service - */ - ServerGroupService serverGroups(); - - /** - * Service that manages the extension 'os-floating-ip-dns' - * - * @return the floating IP DNS Service - */ - FloatingIPDNSService floatingIPDNS(); - /** - * Host Aggregates Management Service - */ - HostAggregateService hostAggregates(); - - /** - * Server Tag Management Service - * @return ServerTag Service - */ - ServerTagService serverTags(); - - /** - * Compute services service - * + /** + * Flavor Service API + * + * @return the flavor service + */ + FlavorService flavors(); + + /** + * Image Service API + * + * @return the image service + */ + ComputeImageService images(); + + /** + * Hypervisor Service Extension API + * + * @return the hypervisor service + */ + HypervisorService hypervisors(); + + /** + * ZoneService Extension API + * + * @return the zones service + */ + ZoneService zones(); + + /** + * Server Service API + * + * @return the server service + */ + ServerService servers(); + + /** + * Quota-Set Service API + * + * @return the quota set service + */ + QuotaSetService quotaSets(); + + /** + * Compute Os-Host API + * + * @return the compute os-host service + */ + HostService host(); + + /** + * Floating IP Service API + * + * @return the floating-ip service + */ + ComputeFloatingIPService floatingIps(); + + /** + * Security Groups Extension API + * + * @return the security groups service + */ + ComputeSecurityGroupService securityGroups(); + + /** + * Keypair Management Service + * + * @return the keypair service + */ + KeypairService keypairs(); + + /** + * Administrators only - provides in-progress migrations for a region or cell + * + * @return the migration service + */ + MigrationService migrations(); + + /** + * @return a list of Extensions that have been added against the Compute service + */ + List listExtensions(); + + /** + * ServerGroup Management Service + * + * @return ServerGroup service + */ + ServerGroupService serverGroups(); + + /** + * Service that manages the extension 'os-floating-ip-dns' + * + * @return the floating IP DNS Service + */ + FloatingIPDNSService floatingIPDNS(); + + /** + * Host Aggregates Management Service + */ + HostAggregateService hostAggregates(); + + /** + * Server Tag Management Service + * + * @return ServerTag Service + */ + ServerTagService serverTags(); + + /** + * Compute services service + * * @return ServicesService */ ServicesService services(); diff --git a/core/src/main/java/org/openstack4j/api/compute/FlavorService.java b/core/src/main/java/org/openstack4j/api/compute/FlavorService.java index e869e8ce9..bd310ff71 100644 --- a/core/src/main/java/org/openstack4j/api/compute/FlavorService.java +++ b/core/src/main/java/org/openstack4j/api/compute/FlavorService.java @@ -1,147 +1,150 @@ package org.openstack4j.api.compute; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.Flavor; import org.openstack4j.model.compute.FlavorAccess; +import java.util.List; +import java.util.Map; + /** * Flavor service provides CRUD capabilities for Flavor(s). A flavor is an available hardware configuration/template for a server - * + * * @author Jeremy Unruh, whaon */ public interface FlavorService extends RestService { - - /** - * List all Flavors with details - * - * @return List of Flavor - */ - List list(); - - /** - * Get a Flavor by it's identifier - * - * @param flavorId the flavor identifier - * @return Flavor - */ - Flavor get(String flavorId); - - /** - * Deletes a Flavor by it's identifier - * - * @param flavorId the flavor identifier - * @return the action response - */ - ActionResponse delete(String flavorId); - - /** - * Creates a new Flavor - * - * @param flavor the flavor to create - * @return the created flavor - */ - Flavor create(Flavor flavor); - - /** - * Creates a new Flavor - * - * @param name the descriptive name of the flavor - * @param ram the Memory in MB for the flavor - * @param vcpus the Number of VCPUs for the flavor - * @param disk the size of the local disk in GB - * @param the space in GB that will disappear when the VM is terminated (default is 0) [OPTIONAL] - * @param swap the Swap space in MB - * @param rxtxFactor the RX/TX factor (default is 1) [OPTIONAL] - * @return the created flavor - */ - Flavor create(String name, int ram, int vcpus, int disk, int ephemeral, int swap, float rxtxFactor, boolean isPublic); - - /** - * list extra specs - * - * @param flavorId - * @return all extra specs for this flavor - */ - Map listExtraSpecs(String flavorId); - - /** - * post a key-value map, if key exist, value will be updated, if not ,new - * extra spec created. openstack provides one api to support both create and - * update extra spec - * - * @param flavorId - * @param spec - * @return spec - */ - Map createAndUpdateExtraSpecs(String flavorId, Map spec); - - /** - * delete the extra spec with the key and flavorId - * - * @param flavorId - * @param key - */ - void deleteExtraSpecs(String flavorId, String key); - - /** - * get the extra spec's value by the key - * - * @param flavorId - * @param key - * @return value - */ - String getSpec(String flavorId, String key); - - /** - * List tenants with access to private flavor - * - * @param flavorId - * @return List tenants with access to private flavor - */ - List listFlavorAccess(String flavorId); - - /** - * Add access to private flavor - * - * @param flavorId - * @param tenantId - * @return List tenants with access to private flavor - */ - List addTenantAccess(String flavorId, String tenantId); - - /** - * Delete access from private flavor - * - * @param flavorId - * @param tenantId - * @return List tenants with access to private flavor - */ - List removeTenantAccess(String flavorId, String tenantId); - - /** - * list flavors - * @param detail is detailed - * @param filteringParams parameters affect the response data,availbed are:sort_key,sort_dir,limit,marker,minDisk,minRam,is_public - * @return - */ - List list(boolean detail, Map filteringParams); - - /** - * list flavors with detailed - * @param filteringParams - * @return - */ - List list(Map filteringParams); - - /** - * list flavors with non filtering parameters - * @param detail - * @return - */ - List list(boolean detail); - + + /** + * List all Flavors with details + * + * @return List of Flavor + */ + List list(); + + /** + * Get a Flavor by it's identifier + * + * @param flavorId the flavor identifier + * @return Flavor + */ + Flavor get(String flavorId); + + /** + * Deletes a Flavor by it's identifier + * + * @param flavorId the flavor identifier + * @return the action response + */ + ActionResponse delete(String flavorId); + + /** + * Creates a new Flavor + * + * @param flavor the flavor to create + * @return the created flavor + */ + Flavor create(Flavor flavor); + + /** + * Creates a new Flavor + * + * @param name the descriptive name of the flavor + * @param ram the Memory in MB for the flavor + * @param vcpus the Number of VCPUs for the flavor + * @param disk the size of the local disk in GB + * @param the space in GB that will disappear when the VM is terminated (default is 0) [OPTIONAL] + * @param swap the Swap space in MB + * @param rxtxFactor the RX/TX factor (default is 1) [OPTIONAL] + * @return the created flavor + */ + Flavor create(String name, int ram, int vcpus, int disk, int ephemeral, int swap, float rxtxFactor, boolean isPublic); + + /** + * list extra specs + * + * @param flavorId + * @return all extra specs for this flavor + */ + Map listExtraSpecs(String flavorId); + + /** + * post a key-value map, if key exist, value will be updated, if not ,new + * extra spec created. openstack provides one api to support both create and + * update extra spec + * + * @param flavorId + * @param spec + * @return spec + */ + Map createAndUpdateExtraSpecs(String flavorId, Map spec); + + /** + * delete the extra spec with the key and flavorId + * + * @param flavorId + * @param key + */ + void deleteExtraSpecs(String flavorId, String key); + + /** + * get the extra spec's value by the key + * + * @param flavorId + * @param key + * @return value + */ + String getSpec(String flavorId, String key); + + /** + * List tenants with access to private flavor + * + * @param flavorId + * @return List tenants with access to private flavor + */ + List listFlavorAccess(String flavorId); + + /** + * Add access to private flavor + * + * @param flavorId + * @param tenantId + * @return List tenants with access to private flavor + */ + List addTenantAccess(String flavorId, String tenantId); + + /** + * Delete access from private flavor + * + * @param flavorId + * @param tenantId + * @return List tenants with access to private flavor + */ + List removeTenantAccess(String flavorId, String tenantId); + + /** + * list flavors + * + * @param detail is detailed + * @param filteringParams parameters affect the response data,availbed are:sort_key,sort_dir,limit,marker,minDisk,minRam,is_public + * @return + */ + List list(boolean detail, Map filteringParams); + + /** + * list flavors with detailed + * + * @param filteringParams + * @return + */ + List list(Map filteringParams); + + /** + * list flavors with non filtering parameters + * + * @param detail + * @return + */ + List list(boolean detail); + } diff --git a/core/src/main/java/org/openstack4j/api/compute/HostAggregateService.java b/core/src/main/java/org/openstack4j/api/compute/HostAggregateService.java index 8c26cc153..8130933ad 100644 --- a/core/src/main/java/org/openstack4j/api/compute/HostAggregateService.java +++ b/core/src/main/java/org/openstack4j/api/compute/HostAggregateService.java @@ -1,13 +1,15 @@ package org.openstack4j.api.compute; -import java.util.List; -import java.util.Map; import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.HostAggregate; + +import java.util.List; +import java.util.Map; + /** * Host aggregate Operations API - * + * * @author liujunpeng */ public interface HostAggregateService extends RestService { @@ -21,9 +23,9 @@ public interface HostAggregateService extends RestService { /** * Returns list of Aggregates filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); @@ -36,52 +38,57 @@ public interface HostAggregateService extends RestService { */ HostAggregate get(String aggregateId); - /** - * Delete of the aggregate - * - * @param aggregateId the aggregate identifier - * @return the action response - */ - ActionResponse delete(String aggregateId); + /** + * Delete of the aggregate + * + * @param aggregateId the aggregate identifier + * @return the action response + */ + ActionResponse delete(String aggregateId); + + /** + * Create a hostAggregate + * + * @param name + * @param availabilityZone + * @return HostAggregate + */ + HostAggregate create(String name, String availabilityZone); + + /** + * Updates the name, and optionally the availability zone, for a specified aggregate. + * + * @param hostAggregateId the aggregate identifier + * @param name + * @param availabilityZone + * @return HostAggregate + */ + HostAggregate update(String hostAggregateId, String name, String availabilityZone); - /** - * Create a hostAggregate - * @param name - * @param availabilityZone - * @return HostAggregate - */ - HostAggregate create(String name,String availabilityZone); - - /** - * Updates the name, and optionally the availability zone, for a specified aggregate. - * @param hostAggregateId the aggregate identifier - * @param name - * @param availabilityZone - * @return HostAggregate - */ - HostAggregate update(String hostAggregateId,String name,String availabilityZone); + /** + * Sets metadata for an aggregate. + * + * @param hostAggregateId the aggregate identifier + * @param metadata + * @return HostAggregate + */ + HostAggregate setMetadata(String hostAggregateId, Map metadata); - /** - * Sets metadata for an aggregate. - * @param hostAggregateId the aggregate identifier - * @param metadata - * @return HostAggregate - */ - HostAggregate setMetadata(String hostAggregateId,Map metadata); + /** + * Add host to aggregate + * + * @param hostAggregateId The ID associated with an aggregate. + * @param host Host ID to add to an aggregate, which is a collection of multiple groups of hosts that share common resources like storage and network. + * @return HostAggregate + */ + HostAggregate addHost(String hostAggregateId, String host); - /** - * Add host to aggregate - * @param hostAggregateId The ID associated with an aggregate. - * @param host Host ID to add to an aggregate, which is a collection of multiple groups of hosts that share common resources like storage and network. - * @return HostAggregate - */ - HostAggregate addHost(String hostAggregateId,String host); - - /** - * remove host from aggregate - * @param hostAggregateId The ID associated with an aggregate. - * @param host Host ID to add to an aggregate, which is a collection of multiple groups of hosts that share common resources like storage and network. - * @return HostAggregate - */ - HostAggregate removeHost(String hostAggregateId,String host); + /** + * remove host from aggregate + * + * @param hostAggregateId The ID associated with an aggregate. + * @param host Host ID to add to an aggregate, which is a collection of multiple groups of hosts that share common resources like storage and network. + * @return HostAggregate + */ + HostAggregate removeHost(String hostAggregateId, String host); } diff --git a/core/src/main/java/org/openstack4j/api/compute/HostService.java b/core/src/main/java/org/openstack4j/api/compute/HostService.java index ac1d0482a..a17467757 100644 --- a/core/src/main/java/org/openstack4j/api/compute/HostService.java +++ b/core/src/main/java/org/openstack4j/api/compute/HostService.java @@ -1,30 +1,29 @@ package org.openstack4j.api.compute; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.compute.HostResource; +import java.util.List; +import java.util.Map; + /** * Nova OS Host Service - * - * @author Qin An * + * @author Qin An */ public interface HostService extends RestService { /** - * Shows details for a specified host - * - * @param hostName - * @return the Resource of the Host specified - */ - public List hostDescribe(String hostName); - - /** + * Shows details for a specified host + * + * @param hostName + * @return the Resource of the Host specified + */ + public List hostDescribe(String hostName); + + /** * List all host that the current tenant has access to - * + * * @return list of all hosts * @author Wang Ting/王婷 */ @@ -32,9 +31,9 @@ public interface HostService extends RestService { /** * Returns list of hosts filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return * @author Wang Ting/王婷 */ List list(Map filteringParams); diff --git a/core/src/main/java/org/openstack4j/api/compute/KeypairService.java b/core/src/main/java/org/openstack4j/api/compute/KeypairService.java index 008d889bc..0e953ef34 100644 --- a/core/src/main/java/org/openstack4j/api/compute/KeypairService.java +++ b/core/src/main/java/org/openstack4j/api/compute/KeypairService.java @@ -1,13 +1,12 @@ package org.openstack4j.api.compute; -import java.util.List; - -import javax.annotation.Nullable; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.Keypair; +import javax.annotation.Nullable; +import java.util.List; + /** * Keypair Service manages SSH Keys within OpenStack Compute (Nova). * @@ -15,36 +14,36 @@ */ public interface KeypairService extends RestService { - /** - * Lists keypairs that are associated with the account making the request - * - * @return the list of keypairs - */ - List list(); - - /** - * Gets the keypair by name - * - * @param name the keypair name - * @return the keypair - */ - Keypair get(String name); - - /** - * Deletes the keypair by name - * - * @param name the keypair name - * @return the action response - */ - ActionResponse delete(String name); - - /** - * Generates or imports a keypair - * - * @param name the name of the keypair - * @param publicKey the public key (optional), Null indicates one will be generated - * @return the newly created keypair - */ - Keypair create(String name, @Nullable String publicKey); - + /** + * Lists keypairs that are associated with the account making the request + * + * @return the list of keypairs + */ + List list(); + + /** + * Gets the keypair by name + * + * @param name the keypair name + * @return the keypair + */ + Keypair get(String name); + + /** + * Deletes the keypair by name + * + * @param name the keypair name + * @return the action response + */ + ActionResponse delete(String name); + + /** + * Generates or imports a keypair + * + * @param name the name of the keypair + * @param publicKey the public key (optional), Null indicates one will be generated + * @return the newly created keypair + */ + Keypair create(String name, @Nullable String publicKey); + } diff --git a/core/src/main/java/org/openstack4j/api/compute/QuotaSetService.java b/core/src/main/java/org/openstack4j/api/compute/QuotaSetService.java index 9fcea9bc0..cca86b09c 100644 --- a/core/src/main/java/org/openstack4j/api/compute/QuotaSetService.java +++ b/core/src/main/java/org/openstack4j/api/compute/QuotaSetService.java @@ -1,7 +1,5 @@ package org.openstack4j.api.compute; -import java.util.List; - import org.openstack4j.api.Builders; import org.openstack4j.common.RestService; import org.openstack4j.model.compute.Limits; @@ -9,85 +7,90 @@ import org.openstack4j.model.compute.QuotaSetUpdate; import org.openstack4j.model.compute.SimpleTenantUsage; +import java.util.List; + /** * OpenStack Quota-Set Operation API - * + * * @author Jeremy Unruh */ public interface QuotaSetService extends RestService { - /** - * Gets the QuotaSet for the given tenant ID - * - * @param tenantId the tenant id - * @return the quota set - */ - QuotaSet get(String tenantId); - - /** - * Gets the QuotaSet for the given tenant and user ID - * @param tenantId the identifier for the tenant - * @param userId the identifier of the user - * @return the quota set - */ - QuotaSet get(String tenantId, String userId); - - /** - * Updates quota for a specified class - * - * @param classId the class identifier - * @param qs the quota set - see {@link Builders#quotaSet()} - * @return the newly reflected QuotaSet - */ - QuotaSet updateForClass(String classId, QuotaSetUpdate qs); - - /** + /** + * Gets the QuotaSet for the given tenant ID + * + * @param tenantId the tenant id + * @return the quota set + */ + QuotaSet get(String tenantId); + + /** + * Gets the QuotaSet for the given tenant and user ID + * + * @param tenantId the identifier for the tenant + * @param userId the identifier of the user + * @return the quota set + */ + QuotaSet get(String tenantId, String userId); + + /** + * Updates quota for a specified class + * + * @param classId the class identifier + * @param qs the quota set - see {@link Builders#quotaSet()} + * @return the newly reflected QuotaSet + */ + QuotaSet updateForClass(String classId, QuotaSetUpdate qs); + + /** * Updates quota for a specified tenant - * + * * @param tenantId the tenant identifier - * @param qs the quota set - see {@link Builders#quotaSet()} + * @param qs the quota set - see {@link Builders#quotaSet()} * @return the newly reflected QuotaSet */ - QuotaSet updateForTenant(String tenantId, QuotaSetUpdate qs); - - /** - * Accounts may be pre-configured with a set of thresholds (or limits) to manage capacity and prevent system abuse. This call will - * return the current Rate and Absolute Limits. - * @return the system limits - */ - Limits limits(); - - /** - * Gets tenant usage information for all tenants (os-simple-tenant-usage) - * - * @return list of usage information for all tenants - */ - List listTenantUsages(); - - /** - * Gets the usage information for the specified tenant (os-simple-tenant-usage) - * - * @param tenantId the tenant identifier - * @return Tenant Usage or null if not found - */ - SimpleTenantUsage getTenantUsage(String tenantId); - - /** - * Gets tenant usage information for all tenants in a period of time (os-simple-tenant-usage) - * @param startTime eg:2015-05-05T23:59:59 - * @param endTime - * @return list of usage information for all tenants - */ - List listTenantUsages(String startTime, String endTime); - - /** - * Gets the usage information for the specified tenant in a period of time (os-simple-tenant-usage) - * - * @param tenantId the tenant identifier - * @param startTime eg:2015-05-05T23:59:59 - * @param endTime - * @return Tenant Usage or null if not found - */ - SimpleTenantUsage getTenantUsage(String tenantId, String startTime, String endTime); - + QuotaSet updateForTenant(String tenantId, QuotaSetUpdate qs); + + /** + * Accounts may be pre-configured with a set of thresholds (or limits) to manage capacity and prevent system abuse. This call will + * return the current Rate and Absolute Limits. + * + * @return the system limits + */ + Limits limits(); + + /** + * Gets tenant usage information for all tenants (os-simple-tenant-usage) + * + * @return list of usage information for all tenants + */ + List listTenantUsages(); + + /** + * Gets the usage information for the specified tenant (os-simple-tenant-usage) + * + * @param tenantId the tenant identifier + * @return Tenant Usage or null if not found + */ + SimpleTenantUsage getTenantUsage(String tenantId); + + /** + * Gets tenant usage information for all tenants in a period of time (os-simple-tenant-usage) + * + * @param startTime eg:2015-05-05T23:59:59 + * @param endTime + * @return list of usage information for all tenants + */ + List listTenantUsages(String startTime, String endTime); + + /** + * Gets the usage information for the specified tenant in a period of time (os-simple-tenant-usage) + * + * @param tenantId the tenant identifier + * @param startTime eg:2015-05-05T23:59:59 + * @param endTime + * @return Tenant Usage or null if not found + */ + SimpleTenantUsage getTenantUsage(String tenantId, String startTime, String endTime); + } diff --git a/core/src/main/java/org/openstack4j/api/compute/ServerGroupService.java b/core/src/main/java/org/openstack4j/api/compute/ServerGroupService.java index a75904769..a49c884c4 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ServerGroupService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ServerGroupService.java @@ -1,43 +1,43 @@ package org.openstack4j.api.compute; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.ServerGroup; +import java.util.List; + public interface ServerGroupService extends RestService { - - /** - * Lists serverGroups that are associated with the account making the request - * - * @return the list of serverGroups - */ - List list(); - - /** - * Gets the serverGroup by id - * - * @param name the serverGroup id - * @return the serverGroup - */ - ServerGroup get(String id); - - /** - * Deletes the serverGroup by id - * - * @param name the serverGroup id - * @return the action response - */ - ActionResponse delete(String id); - - /** - * Generates or imports a serverGroup - * - * @param name the name of the serverGroup - * @param publicKey the public key (optional), Null indicates one will be generated - * @return the newly created serverGroup - */ - ServerGroup create(String name, String policy); + + /** + * Lists serverGroups that are associated with the account making the request + * + * @return the list of serverGroups + */ + List list(); + + /** + * Gets the serverGroup by id + * + * @param name the serverGroup id + * @return the serverGroup + */ + ServerGroup get(String id); + + /** + * Deletes the serverGroup by id + * + * @param name the serverGroup id + * @return the action response + */ + ActionResponse delete(String id); + + /** + * Generates or imports a serverGroup + * + * @param name the name of the serverGroup + * @param publicKey the public key (optional), Null indicates one will be generated + * @return the newly created serverGroup + */ + ServerGroup create(String name, String policy); } diff --git a/core/src/main/java/org/openstack4j/api/compute/ServerService.java b/core/src/main/java/org/openstack4j/api/compute/ServerService.java index 1a8a8ae12..2385fcfc0 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ServerService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ServerService.java @@ -1,31 +1,24 @@ package org.openstack4j.api.compute; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - import org.openstack4j.api.compute.ext.InstanceActionsService; import org.openstack4j.api.compute.ext.InterfaceService; -import org.openstack4j.model.compute.Action; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.compute.RebootType; -import org.openstack4j.model.compute.Server; +import org.openstack4j.model.compute.*; import org.openstack4j.model.compute.Server.Status; -import org.openstack4j.model.compute.ServerCreate; -import org.openstack4j.model.compute.ServerPassword; -import org.openstack4j.model.compute.ServerUpdateOptions; -import org.openstack4j.model.compute.VNCConsole; import org.openstack4j.model.compute.VNCConsole.Type; -import org.openstack4j.model.compute.VolumeAttachment; import org.openstack4j.model.compute.actions.BackupOptions; import org.openstack4j.model.compute.actions.EvacuateOptions; import org.openstack4j.model.compute.actions.LiveMigrateOptions; import org.openstack4j.model.compute.actions.RebuildOptions; import org.openstack4j.model.compute.builder.ServerCreateBuilder; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + /** * Server Operations API - * + * * @author Jeremy Unruh */ public interface ServerService { @@ -47,14 +40,14 @@ public interface ServerService { /** * Returns list of servers filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); /** - * List all servers for all tenants (detailed / brief) + * List all servers for all tenants (detailed / brief) * * @param detail if true all attributes will be populated, false (brief) will be ID, Name and Links * @return list of all servers @@ -80,7 +73,7 @@ public interface ServerService { /** * Create (boot) a new Server * - * @param server the server to boot + * @param server the server to boot * @param maxWaitTime the max time to wait in milliseconds for the server to become ACTIVE * @return the newly created server */ @@ -88,6 +81,7 @@ public interface ServerService { /** * Delete (i.e shut down and delete the image) of the server + * * @param serverId the server identifier * @return the action response */ @@ -98,7 +92,7 @@ public interface ServerService { * all possible actions * * @param serverId the server identifier to execute the action against - * @param action the action the specified action + * @param action the action the specified action * @return the action response */ ActionResponse action(String serverId, Action action); @@ -107,17 +101,16 @@ public interface ServerService { * Reboot a server by SOFT (software-level) or HARD (hardware power cycle) * * @param serverId the server id - * @param type the type of reboot + * @param type the type of reboot * @return the action response */ ActionResponse reboot(String serverId, RebootType type); - + /** * Rebuilds the specified server - * + * * @param serverId the server id - * @param options additional options used during the rebuild. (OPTIONAL, can be null) - * + * @param options additional options used during the rebuild. (OPTIONAL, can be null) * @return the action response */ ActionResponse rebuild(String serverId, RebuildOptions options); @@ -126,7 +119,7 @@ public interface ServerService { * Resize a server's resources. Until a resize event is confirmed {@link #confirmResize(String)}, the old server * will be kept around and you'll be able to roll back to the old flavor quick with {@link #revertResize(String)}. All resizes * will be automatically confirmed after 24 hours. - * + * * @param serverId the server identifier * @param flavorId the new flavor id to resize to * @return the action response @@ -135,7 +128,7 @@ public interface ServerService { /** * Confirm that the resize worked, thus removing the original server - * + * * @param serverId the server identifier * @return the action response */ @@ -143,7 +136,7 @@ public interface ServerService { /** * Revert a previous resize, switching back to the old server - * + * * @param serverId the server identifier * @return the action response */ @@ -152,7 +145,7 @@ public interface ServerService { /** * Creates the snapshot for a Server * - * @param serverId the server id + * @param serverId the server id * @param snapshotName the snapshot name * @return the newly created snapshot UUID */ @@ -161,17 +154,17 @@ public interface ServerService { /** * Creates the snapshot from a server * - * @param serverId the UUID of the server + * @param serverId the UUID of the server * @param snapshotName the display name of the snapshot - * @param metadata the key/value properties for the snapshot + * @param metadata the key/value properties for the snapshot * @return the UUID for the resulting image snapshot */ String createSnapshot(String serverId, String snapshotName, Map metadata); /** * Associates the specified Server Group by name to the Server by it's identifier - * - * @param serverId the server identifier + * + * @param serverId the server identifier * @param secGroupName the security group name * @return the action response */ @@ -179,8 +172,8 @@ public interface ServerService { /** * Removes the specified Server Group by name from the Server by it's identifier - * - * @param serverId the server identifier + * + * @param serverId the server identifier * @param secGroupName the security group name * @return the action response */ @@ -203,36 +196,37 @@ public interface ServerService { /** * Will attempt to tail and return the last {@code numLines} from the given servers console. + * * @param serverId the server identifier * @param numLines the number of console lines to return. - * If lower or equal than zero, the whole console content will be returned. + * If lower or equal than zero, the whole console content will be returned. * @return console output as string or null */ String getConsoleOutput(String serverId, int numLines); /** * Obtains the VNC Console connection information for the given server and VNC Console Type - * + * * @param serverId the server identifier - * @param type the VNC Console type + * @param type the VNC Console type * @return VNCConsole or null if not applicable */ VNCConsole getVNCConsole(String serverId, Type type); /** - * attach the volume to the given server - * + * attach the volume to the given server + * * @param serverId the server identifier * @param volumeId the volume identifier - * @param device the device to attach the volume to, ex /dev/vda + * @param device the device to attach the volume to, ex /dev/vda * @return volumeAttachment or null if not applicable */ VolumeAttachment attachVolume(String serverId, String volumeId, String device); - + /** * Changes the admin/root password on the server - * - * @param serverId the server identifier + * + * @param serverId the server identifier * @param adminPassword the new password * @return ActionResponse */ @@ -240,106 +234,108 @@ public interface ServerService { /** * detach the volume to the given server - * @param serverId the server identifier + * + * @param serverId the server identifier * @param attachmentId the attachment identifier - * * @return the action response */ - ActionResponse detachVolume(String serverId,String attachmentId); - + ActionResponse detachVolume(String serverId, String attachmentId); + /** * Only user with admin role can do this. * Migrate a server. The new host will be selected by the scheduler. Until a resize event is confirmed {@link #confirmResize(String)}, the old server * will be kept around and you'll be able to roll back to the old host quick with {@link #revertResize(String)}. All resizes * will be automatically confirmed after 24 hours. - * + * * @param serverId the server identifier * @return the action response */ ActionResponse migrateServer(String serverId); - + /** * Live-migrates a server identified with {@code serverId} to a new host without rebooting - * + * * @param serverId the server identifier - * @param options live migration options + * @param options live migration options * @return ActionResponse */ - ActionResponse liveMigrate(String serverId, LiveMigrateOptions options); - + ActionResponse liveMigrate(String serverId, LiveMigrateOptions options); + /** * Resets the state of a server to a specified {@code state} - * + * * @param serverId the server identifier - * @param state the new server state + * @param state the new server state * @return ActionResponse */ - ActionResponse resetState(String serverId, Status state); - + ActionResponse resetState(String serverId, Status state); + /** * Sets up a new backup schedule service for the given {@code serverId} - * + * * @param serverId the server identifier - * @param options the backup options + * @param options the backup options * @return ActionResponse */ ActionResponse backupServer(String serverId, BackupOptions options); - + /** - * Will poll the Server waiting for the {@code Status} to match or an Error state occurs for the {@code maxWait} - * - * @param serverId the server identifier - * @param status the status to wait for - * @param maxWait the max wait time + * Will poll the Server waiting for the {@code Status} to match or an Error state occurs for the {@code maxWait} + * + * @param serverId the server identifier + * @param status the status to wait for + * @param maxWait the max wait time * @param maxWaitUnit the unit the max wait time was specified in - * @return the last Server polled or null. User should re-check status in case max wait was hit and the status - * was still not in the desired state. + * @return the last Server polled or null. User should re-check status in case max wait was hit and the status + * was still not in the desired state. */ Server waitForServerStatus(String serverId, Status status, int maxWait, TimeUnit maxWaitUnit); - + /** * Returns the metadata for the specified server - * + * * @param serverId the server identifier * @return Map of metadata of key and value */ Map getMetadata(String serverId); - + /** * Creates or replaces metadata items for the specified server - * + * * @param serverId the server identifier * @param metadata the metadata to create or update * @return Map of metadata as the current state on the server */ Map updateMetadata(String serverId, Map metadata); - + /** * Removes the specified metadata item via the specified {@code key} and {@code serverId} - * + * * @param serverId the server identifier - * @param key the metadata key to remove + * @param key the metadata key to remove * @return the action response */ ActionResponse deleteMetadataItem(String serverId, String key); - + /** * Updates an existing Server instance - * + * * @param serverId the server identifier - * @param options the options used to update + * @param options the options used to update * @return the updated server */ Server update(String serverId, ServerUpdateOptions options); - + /** * The interface attachment service extension (os-interface) + * * @return the interface service */ InterfaceService interfaces(); - + /** * The instance actions service extension (os-instance-actions) + * * @return the instance actions service */ InstanceActionsService instanceActions(); @@ -347,7 +343,7 @@ public interface ServerService { /** * Returns the encrypted password for the specified server which can be decrypted with * the private key - * + * * @param serverId the server identifier * @return the encrypted server password */ @@ -355,9 +351,9 @@ public interface ServerService { /** * Evacuates a server identified with {@code serverId} from a failed host to a new host - * + * * @param serverId the server identifier - * @param options evaucate options + * @param options evaucate options * @return an administrative password to access the evacuated or rebuilt instance. */ ServerPassword evacuate(String serverId, EvacuateOptions options); diff --git a/core/src/main/java/org/openstack4j/api/compute/ServerTagService.java b/core/src/main/java/org/openstack4j/api/compute/ServerTagService.java index 28849bbc9..ba29a242f 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ServerTagService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ServerTagService.java @@ -5,17 +5,17 @@ import org.openstack4j.openstack.compute.domain.NovaServerTag; public interface ServerTagService extends RestService { - - NovaServerTag list(String serverId); - - NovaServerTag replace(String serverId, NovaServerTag tag); - - ActionResponse deleteAll(String serverId); - - ActionResponse delete(String serverId, String tag); - - ActionResponse check(String serverId, String tag); - - ActionResponse addSingle(String serverId, String tag); + + NovaServerTag list(String serverId); + + NovaServerTag replace(String serverId, NovaServerTag tag); + + ActionResponse deleteAll(String serverId); + + ActionResponse delete(String serverId, String tag); + + ActionResponse check(String serverId, String tag); + + ActionResponse addSingle(String serverId, String tag); } diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSDomainService.java b/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSDomainService.java index 02456071e..84f32a6ff 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSDomainService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSDomainService.java @@ -1,49 +1,49 @@ package org.openstack4j.api.compute.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.ext.DomainEntry; +import java.util.List; + /** * Service that handles domain names for the floating IP DNS Extension - * + * * @author Jeremy Unruh */ public interface FloatingIPDNSDomainService extends RestService { /** * Return the list of available DNS domains - * + * * @return list of domain entries */ List list(); - + /** * Delete the specified {@code domainName} - * + * * @param domainName the name of the domain * @return the action response */ ActionResponse delete(String domainName); - + /** * Creates or Updates a PUBLIC domain name record - * + * * @param domainName the FQ Domain name - * @param project the project name + * @param project the project name * @return the created/updated domain entry */ DomainEntry createPublic(String domainName, String project); - + /** * Creates or Updates a PRIVATE domain name record - * - * @param domainName the FQ Domain name + * + * @param domainName the FQ Domain name * @param availabilityZone the availability zone * @return he created/updated domain entry */ DomainEntry createPrivate(String domainName, String availabilityZone); - + } diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSEntryService.java b/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSEntryService.java index e0b05fb00..199888758 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSEntryService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSEntryService.java @@ -1,63 +1,63 @@ package org.openstack4j.api.compute.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.ext.DNSEntry; import org.openstack4j.model.compute.ext.DNSRecordType; +import java.util.List; + /** * A Service which handles DNS Entries for the Floating IP DNS Extension - * + * * @author Jeremy Unruh */ public interface FloatingIPDNSEntryService extends RestService { /** * Return a list of entries for the given domain and IP Address - * + * * @param domain the FQ Domain name - * @param ip the IP Address + * @param ip the IP Address * @return List of DNS Entries */ List listByIP(String domain, String ip); - + /** * Return a list of entries for the given domain and name - * + * * @param domain the FQ Domain name - * @param name DNS entry name assigned under a domain + * @param name DNS entry name assigned under a domain * @return List of DNS Entries */ List listByName(String domain, String name); - + /** * Creates or Updates a DNS Entry - * - * @param domain the FQ Domain name - * @param name DNS entry name assigned under a domain - * @param ip the IP Address associated with the current entry - * @param type the DNS Record Type + * + * @param domain the FQ Domain name + * @param name DNS entry name assigned under a domain + * @param ip the IP Address associated with the current entry + * @param type the DNS Record Type * @return the created or modified DNSEntry */ DNSEntry create(String domain, String name, String ip, DNSRecordType type); - + /** * Modifies the IP Address for the specified domain and name - * - * @param domain the FQ Domain name - * @param name DNS entry name assigned under a domain - * @param ip the new IP Address + * + * @param domain the FQ Domain name + * @param name DNS entry name assigned under a domain + * @param ip the new IP Address * @return the modified DNSEntry */ DNSEntry modifyIP(String domain, String name, String ip); - + /** * Deletes a specified DNS entry - * - * @param domain the FQ Domain name - * @param name DNS entry name assigned under a domain + * + * @param domain the FQ Domain name + * @param name DNS entry name assigned under a domain * @return the action response */ ActionResponse delete(String domain, String name); diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSService.java b/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSService.java index ffe651437..2c1e13c55 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/FloatingIPDNSService.java @@ -2,23 +2,23 @@ /** * API Service that manages the 'os-floating-ip-dns' extension - * + * * @author Jeremy Unruh */ public interface FloatingIPDNSService { /** * Service that manages DNS Domains - * + * * @return the domain service */ FloatingIPDNSDomainService domains(); /** * Service that manages DNS Entries - * + * * @return the DNS entry service */ FloatingIPDNSEntryService entries(); - + } diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsService.java b/core/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsService.java index 5e1b9b662..059cacd59 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/InstanceActionsService.java @@ -1,13 +1,13 @@ package org.openstack4j.api.compute.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.compute.InstanceAction; +import java.util.List; + /** * API to list executed instance actions. - * + * * @author Christian Banse */ public interface InstanceActionsService extends RestService { @@ -15,8 +15,7 @@ public interface InstanceActionsService extends RestService { /** * List the executed actions on the specified {@code serverId} * - * @param serverId - * the server id + * @param serverId the server id * @return List of instance actions */ List list(String serverId); @@ -24,10 +23,8 @@ public interface InstanceActionsService extends RestService { /** * Shows information about a specified instance action * - * @param serverId - * the server id - * @param requestId - * the request identifier + * @param serverId the server id + * @param requestId the request identifier * @return the instance action */ InstanceAction get(String serverId, String requestId); diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/InterfaceService.java b/core/src/main/java/org/openstack4j/api/compute/ext/InterfaceService.java index 3080ee683..252fadf0a 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/InterfaceService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/InterfaceService.java @@ -1,50 +1,51 @@ package org.openstack4j.api.compute.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.InterfaceAttachment; +import java.util.List; + /** * API to Create, list, get details for, and delete port interfaces on a Server Instance - * + * * @author Jeremy Unruh */ public interface InterfaceService extends RestService { /** * Creates and uses a port interface to attach the port to a server instance. - * + * * @param serverId the server id - * @param portId the port id to attach + * @param portId the port id to attach * @return the attached interface */ InterfaceAttachment create(String serverId, String portId); - + /** * List the port interfaces for the specified {@code serverId} + * * @param serverId the server id * @return List of interface attachments */ List list(String serverId); - + /** * Shows information about a specified port interface - * - * @param serverId the server id + * + * @param serverId the server id * @param attachmentId the attachment identifier * @return the interface attachment */ InterfaceAttachment get(String serverId, String attachmentId); - + /** * Detaches a specified port interface - * - * @param serverId the server id + * + * @param serverId the server id * @param attachmentId the attachment identifier * @return the action response indicating success or failure */ ActionResponse detach(String serverId, String attachmentId); - + } diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/MigrationService.java b/core/src/main/java/org/openstack4j/api/compute/ext/MigrationService.java index 4fea3ebcf..37c67a9b3 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/MigrationService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/MigrationService.java @@ -1,28 +1,28 @@ package org.openstack4j.api.compute.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.compute.ext.Migration; import org.openstack4j.model.compute.ext.MigrationsFilter; +import java.util.List; + /** - * API which supports the "os-migrations" extension. - * + * API which supports the "os-migrations" extension. + * * @author Jeremy Unruh */ public interface MigrationService extends RestService { /** * Administrators only. Fetch in-progress migrations for a region or a specified cell in a region. - * + * * @return in-progress migrations or empty list */ List list(); - + /** * Administrators only. Fetch in-progress migrations for a region or a specified cell in a region with filtering options - * + * * @param filter the filter constraints * @return in-progress migrations or empty list */ diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/ServicesService.java b/core/src/main/java/org/openstack4j/api/compute/ext/ServicesService.java index e12539289..cbb46b59d 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/ServicesService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/ServicesService.java @@ -1,11 +1,11 @@ package org.openstack4j.api.compute.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.compute.ext.Service; import org.openstack4j.openstack.compute.domain.ext.ExtService; +import java.util.List; +import java.util.Map; + /** * API which supports the "os-services" extension. * @@ -15,18 +15,18 @@ public interface ServicesService { /** * List services info - * + *

* NOTE: This is an extension and not all deployments support os-services * * @return a list of nova services */ List list(); - + /** * Returns list of compute services filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return * @author Wang Ting/王婷 */ List list(Map filteringParams); @@ -35,9 +35,8 @@ public interface ServicesService { * Enables a compute services. * * @param binary the name of the service binary that you want to enable - * @param host the host name of the service that you want to enable + * @param host the host name of the service that you want to enable * @return the enabled service - * * @author Wang Ting/王婷 */ ExtService enableService(String binary, String host); @@ -46,9 +45,8 @@ public interface ServicesService { * Disables a service. * * @param binary the name of the service binary that you want to disable - * @param host the host name of the service that you want to disable + * @param host the host name of the service that you want to disable * @return the disabled service - * * @author Wang Ting/王婷 */ ExtService disableService(String binary, String host); diff --git a/core/src/main/java/org/openstack4j/api/compute/ext/ZoneService.java b/core/src/main/java/org/openstack4j/api/compute/ext/ZoneService.java index eab3bbb89..beb57d255 100644 --- a/core/src/main/java/org/openstack4j/api/compute/ext/ZoneService.java +++ b/core/src/main/java/org/openstack4j/api/compute/ext/ZoneService.java @@ -1,32 +1,32 @@ package org.openstack4j.api.compute.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.compute.ext.AvailabilityZone; +import java.util.List; + /** - * API which supports the "os-availability-zone" extension. - * + * API which supports the "os-availability-zone" extension. + * * @author octopus zhang */ public interface ZoneService extends RestService { - /** - * List availability zone info . - * - * NOTE: This is an extension and not all deployments support os-availability-zone - * - * @return the available zones in brief form - */ - List list(); - - /** + /** + * List availability zone info . + *

+ * NOTE: This is an extension and not all deployments support os-availability-zone + * + * @return the available zones in brief form + */ + List list(); + + /** * List availability zone info . - * + *

* NOTE: This is an extension and not all deployments support os-availability-zone - * + * * @param detailed if true (admin only) details information will be populated * @return the available zones resolved to the specified {@code detailed} param */ diff --git a/core/src/main/java/org/openstack4j/api/dns/v2/DNSService.java b/core/src/main/java/org/openstack4j/api/dns/v2/DNSService.java index d2f5fc6a7..bc2de105a 100644 --- a/core/src/main/java/org/openstack4j/api/dns/v2/DNSService.java +++ b/core/src/main/java/org/openstack4j/api/dns/v2/DNSService.java @@ -4,22 +4,21 @@ /** * DNS/Designate Service Operations API - * */ public interface DNSService extends RestService { - /** - * Zone Service API - * - * @return the zone service - */ - ZoneService zones(); + /** + * Zone Service API + * + * @return the zone service + */ + ZoneService zones(); - /** - * Recordset Service API - * - * @return the recordsets service - */ - RecordsetService recordsets(); + /** + * Recordset Service API + * + * @return the recordsets service + */ + RecordsetService recordsets(); } diff --git a/core/src/main/java/org/openstack4j/api/dns/v2/RecordsetService.java b/core/src/main/java/org/openstack4j/api/dns/v2/RecordsetService.java index 160f59c2b..b8c76d3e0 100644 --- a/core/src/main/java/org/openstack4j/api/dns/v2/RecordsetService.java +++ b/core/src/main/java/org/openstack4j/api/dns/v2/RecordsetService.java @@ -9,71 +9,69 @@ /** * Designate V2 Recordset Service - * */ public interface RecordsetService extends RestService { - /** - * create a new recordset - * - * @param zoneId the identifier of the zone - * @param recordSet the Recordset - * @return the newly created Recordset - */ - Recordset create(String zoneId, Recordset recordSet); + /** + * create a new recordset + * + * @param zoneId the identifier of the zone + * @param recordSet the Recordset + * @return the newly created Recordset + */ + Recordset create(String zoneId, Recordset recordSet); - /** - * create a new recordset - * - * @param zoneId the identifier for the zone - * @param name the DNS name for the recordset - * @param type the RRTYPE of the recordset - * @param records a list of data for this recordset. Each item will be a separate record in Designate These items should conform to the DNS spec for the record type - e.g. A records must be IPv4 addresses, CNAME records must be a hostname. - * - * @return the newly created Recordset - */ - Recordset create(String zoneId, String name, String type, List records); + /** + * create a new recordset + * + * @param zoneId the identifier for the zone + * @param name the DNS name for the recordset + * @param type the RRTYPE of the recordset + * @param records a list of data for this recordset. Each item will be a separate record in Designate These items should conform to the DNS spec for the record type - e.g. A records must be IPv4 addresses, CNAME records must be a hostname. + * @return the newly created Recordset + */ + Recordset create(String zoneId, String name, String type, List records); - /** - * gets detailed information about a specified recordset in a zone by id - * - * @param zoneId the uui of the zone - * @param recordsetId the uuid of the recordset - * @return the recordset - */ - Recordset get(String zoneId, String recordsetId); + /** + * gets detailed information about a specified recordset in a zone by id + * + * @param zoneId the uui of the zone + * @param recordsetId the uuid of the recordset + * @return the recordset + */ + Recordset get(String zoneId, String recordsetId); - /** - * updates an existing recordset - * - * @param zoneId the identifier of the zone - * @param recordset the recordset set to update - * @return the updated recordset - */ - Recordset update(String zoneId, Recordset recordset); + /** + * updates an existing recordset + * + * @param zoneId the identifier of the zone + * @param recordset the recordset set to update + * @return the updated recordset + */ + Recordset update(String zoneId, Recordset recordset); - /** - * delete a recordset within a zone - * - * @param zoneId the uuid of the zone - * @param recordsetId the uuid of the recordset - * @return the action response - */ - ActionResponse delete(String zoneId, String recordsetId); + /** + * delete a recordset within a zone + * + * @param zoneId the uuid of the zone + * @param recordsetId the uuid of the recordset + * @return the action response + */ + ActionResponse delete(String zoneId, String recordsetId); - /** - * list all recordsets owned by project - * - * @return list of recordsets - */ - List list(); + /** + * list all recordsets owned by project + * + * @return list of recordsets + */ + List list(); - /** - * list recordsets in a zone - * - * @param zoneId the identifier of the zone - * @return list of recordsets in a zone - */ - List list(String zoneId); + /** + * list recordsets in a zone + * + * @param zoneId the identifier of the zone + * @return list of recordsets in a zone + */ + List list(String zoneId); } diff --git a/core/src/main/java/org/openstack4j/api/dns/v2/ZoneService.java b/core/src/main/java/org/openstack4j/api/dns/v2/ZoneService.java index d62f62394..b0b4fe3f8 100644 --- a/core/src/main/java/org/openstack4j/api/dns/v2/ZoneService.java +++ b/core/src/main/java/org/openstack4j/api/dns/v2/ZoneService.java @@ -9,7 +9,6 @@ /** * Designate V2 Zone Service - * */ public interface ZoneService extends RestService { @@ -24,9 +23,8 @@ public interface ZoneService extends RestService { /** * creates a new zone * - * @param name the zone name + * @param name the zone name * @param email the e-mail for the zone - * * @return the newly created group */ Zone create(String name, String email); diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ApiNotFoundException.java b/core/src/main/java/org/openstack4j/api/exceptions/ApiNotFoundException.java index 4911abf3f..a57c6e3a6 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ApiNotFoundException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ApiNotFoundException.java @@ -2,39 +2,39 @@ /** * Exception which is thrown when an API lookup did not succeed - * + * * @author Jeremy Unruh */ public class ApiNotFoundException extends OS4JException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * Instantiates a new ApiNotFoundException. - * - * @param message the message - * @param cause the cause - */ - public ApiNotFoundException(String message, Throwable cause) { - super(message, cause); - } + /** + * Instantiates a new ApiNotFoundException. + * + * @param message the message + * @param cause the cause + */ + public ApiNotFoundException(String message, Throwable cause) { + super(message, cause); + } - /** - * Instantiates a new ApiNotFoundException. - * - * @param message the message - */ - public ApiNotFoundException(String message) { - super(message); - } + /** + * Instantiates a new ApiNotFoundException. + * + * @param message the message + */ + public ApiNotFoundException(String message) { + super(message); + } - /** - * Instantiates a new ApiNotFoundException. - * - * @param cause the cause - */ - public ApiNotFoundException(Throwable cause) { - super(cause); - } + /** + * Instantiates a new ApiNotFoundException. + * + * @param cause the cause + */ + public ApiNotFoundException(Throwable cause) { + super(cause); + } } diff --git a/core/src/main/java/org/openstack4j/api/exceptions/AuthenticationException.java b/core/src/main/java/org/openstack4j/api/exceptions/AuthenticationException.java index b699ccb8b..ea3a97b90 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/AuthenticationException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/AuthenticationException.java @@ -2,19 +2,19 @@ /** * An exception that is thrown when Credentials failed or the default tenant is invalid - * + * * @author Jeremy Unruh */ public class AuthenticationException extends ResponseException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public AuthenticationException(String message, int status, Throwable cause) { - super(message, status, cause); - } + public AuthenticationException(String message, int status, Throwable cause) { + super(message, status, cause); + } - public AuthenticationException(String message, int status) { - super(message, status); - } + public AuthenticationException(String message, int status) { + super(message, status); + } } diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java b/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java index e01f72094..1d8e9783c 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java @@ -9,35 +9,35 @@ */ public class ClientResponseException extends ResponseException { - private static final long serialVersionUID = 1L; - - private StatusCode code; - - public ClientResponseException(String message, int status, Throwable cause) { - super(message, status, cause); - code = StatusCode.fromCode(status); - } - - public ClientResponseException(String message, int status) { - super(message, status); - code = StatusCode.fromCode(status); - } - - - /** - * @return the status code mapping for the current {@link #getStatus()} - */ - public StatusCode getStatusCode() { - return code; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("message", getMessage()).add("status", getStatus()).add("status-code", code) - .toString(); - } + private static final long serialVersionUID = 1L; + + private StatusCode code; + + public ClientResponseException(String message, int status, Throwable cause) { + super(message, status, cause); + code = StatusCode.fromCode(status); + } + + public ClientResponseException(String message, int status) { + super(message, status); + code = StatusCode.fromCode(status); + } + + + /** + * @return the status code mapping for the current {@link #getStatus()} + */ + public StatusCode getStatusCode() { + return code; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("message", getMessage()).add("status", getStatus()).add("status-code", code) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ConnectionException.java b/core/src/main/java/org/openstack4j/api/exceptions/ConnectionException.java index 000f849c9..e7d01fbe2 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ConnectionException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ConnectionException.java @@ -2,15 +2,15 @@ /** * An exception which is thrown when a connection/IO exception has occurred with the remote host - * + * * @author Jeremy Unruh */ public class ConnectionException extends ResponseException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public ConnectionException(String message, int status, Throwable cause) { - super(message, status, cause); - } + public ConnectionException(String message, int status, Throwable cause) { + super(message, status, cause); + } } diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ContainerNotEmptyException.java b/core/src/main/java/org/openstack4j/api/exceptions/ContainerNotEmptyException.java index c53ce5944..f3043a993 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ContainerNotEmptyException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ContainerNotEmptyException.java @@ -2,7 +2,7 @@ /** * An exception that is thrown when an Object Storage Container is attempted to be deleted that is not empty - * + * * @author Jeremy Unruh */ public class ContainerNotEmptyException extends ResponseException { diff --git a/core/src/main/java/org/openstack4j/api/exceptions/OS4JException.java b/core/src/main/java/org/openstack4j/api/exceptions/OS4JException.java index 82d1c12ab..35c05e48c 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/OS4JException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/OS4JException.java @@ -1,8 +1,8 @@ package org.openstack4j.api.exceptions; /** - * Base OpenStackj Exception - * + * Base OpenStackj Exception + * * @author Jeremy Unruh */ public class OS4JException extends RuntimeException { @@ -12,11 +12,11 @@ public class OS4JException extends RuntimeException { public OS4JException(String message) { super(message); } - + public OS4JException(String message, Throwable cause) { super(message, cause); } - + public OS4JException(Throwable cause) { super(cause); } diff --git a/core/src/main/java/org/openstack4j/api/exceptions/RegionEndpointNotFoundException.java b/core/src/main/java/org/openstack4j/api/exceptions/RegionEndpointNotFoundException.java index 8d2b65f43..a30c46162 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/RegionEndpointNotFoundException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/RegionEndpointNotFoundException.java @@ -2,15 +2,14 @@ /** * Exception that is thrown when a Service Endpoint cannot be found for the user specified Region - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ public class RegionEndpointNotFoundException extends OS4JException { private static final long serialVersionUID = 1L; private static final String EXCEPT_FORMAT = "Endpoint for '%s' service could not be found for region: '%s'"; - + public RegionEndpointNotFoundException(String message, Throwable cause) { super(message, cause); } @@ -22,5 +21,5 @@ public RegionEndpointNotFoundException(String message) { public static RegionEndpointNotFoundException create(String region, String serviceName) { return new RegionEndpointNotFoundException(String.format(EXCEPT_FORMAT, serviceName, region)); } - + } diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java b/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java index 13bd5bec0..54574e322 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java @@ -9,42 +9,42 @@ */ public class ResponseException extends OS4JException { - private static final long serialVersionUID = 7294957362769575271L; + private static final long serialVersionUID = 7294957362769575271L; - protected int status; + protected int status; - public ResponseException(String message, int status) { - super(message); - this.status = status; - } + public ResponseException(String message, int status) { + super(message); + this.status = status; + } - public ResponseException(String message, int status, Throwable cause) { - super(message, cause); - this.status = status; - } + public ResponseException(String message, int status, Throwable cause) { + super(message, cause); + this.status = status; + } - /** - * @return the raw status code - */ - public int getStatus() { - return status; - } + /** + * @return the raw status code + */ + public int getStatus() { + return status; + } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("message", getMessage()).add("status", getStatus()) - .toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("message", getMessage()).add("status", getStatus()) + .toString(); + } - /** + /** * Maps an Exception based on the underlying status code * * @param message the message - * @param status the status + * @param status the status * @return the response exception */ public static ResponseException mapException(String message, int status) { @@ -55,13 +55,13 @@ public static ResponseException mapException(String message, int status) { * Maps an Exception based on the underlying status code * * @param message the message - * @param status the status - * @param cause the cause + * @param status the status + * @param cause the cause * @return the response exception */ public static ResponseException mapException(String message, int status, Throwable cause) { if (status == 401) - return new AuthenticationException(message, status, cause); + return new AuthenticationException(message, status, cause); if (status >= 400 && status < 499) return new ClientResponseException(message, status, cause); if (status >= 500 && status < 600) diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ServerResponseException.java b/core/src/main/java/org/openstack4j/api/exceptions/ServerResponseException.java index b77bbed98..854ae9637 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ServerResponseException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ServerResponseException.java @@ -9,35 +9,35 @@ */ public class ServerResponseException extends ResponseException { - private static final long serialVersionUID = 1L; - - private StatusCode code; - - public ServerResponseException(String message, int status) { - super(message, status); - code = StatusCode.fromCode(status); - } - - public ServerResponseException(String message, int status, Throwable cause) { - super(message, status, cause); - code = StatusCode.fromCode(status); - } - - /** - * @return the status code mapping for the current {@link #getStatus()} - */ - public StatusCode getStatusCode() { - return code; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("message", getMessage()).add("status", getStatus()).add("status-code", code) - .toString(); - } + private static final long serialVersionUID = 1L; + + private StatusCode code; + + public ServerResponseException(String message, int status) { + super(message, status); + code = StatusCode.fromCode(status); + } + + public ServerResponseException(String message, int status, Throwable cause) { + super(message, status, cause); + code = StatusCode.fromCode(status); + } + + /** + * @return the status code mapping for the current {@link #getStatus()} + */ + public StatusCode getStatusCode() { + return code; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("message", getMessage()).add("status", getStatus()).add("status-code", code) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java b/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java index 55d0c03df..fad2f88c3 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java @@ -1,84 +1,133 @@ package org.openstack4j.api.exceptions; /** - * Maps the documented API status codes into a StatusCode Enumeration Type. - * + * Maps the documented API status codes into a StatusCode Enumeration Type. + * * @author Jeremy Unruh */ -public enum StatusCode -{ - // Client Status Codes - /** The request cannot be fulfilled due to bad syntax. */ - BAD_REQUEST(400), - /** Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided */ - UNAUTHORIZED(401), - /** Reserved for future use. */ - PAYMENT_REQUIRED(402), - /** The request was a valid request, but the server is refusing to respond to it. */ - FORBIDDEN(403), - /** The requested resource could not be found but may be available again in the future */ - NOT_FOUND(404), - /** A request was made of a resource using a request method not supported by that resource */ - METHOD_NOT_ALLOWED(405), - /** The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request. */ - NOT_ACCEPTABLE(406), - /** The client must first authenticate itself with the proxy. */ - PROXY_AUTH_REQUIRED(407), - /** The server timed out waiting for the request. */ - REQUEST_TIMEOUT(408), - /** Indicates that the request could not be processed because of conflict in the request, such as an edit conflict. */ - CONFLICT(409), - /** Indicates that the resource requested is no longer available and will not be available again */ - GONE(410), - /** The request did not specify the length of its content, which is required by the requested resource */ - LENGTH_REQUIRED(411), - /** The server does not meet one of the preconditions that the requester put on the request */ - PRE_CONDITION_FAILED(412), - /** The request is larger than the server is willing or able to process. */ - REQUEST_ENTITY_TOO_LARGE(413), - /** The URI provided was too long for the server to process. */ - REQUEST_URI_TOO_LONG(414), - /** The request entity has a media type which the server or resource does not support */ - UNSUPPORTED_MEDIATYPE(415), - /** The client has asked for a portion of the file, but the server cannot supply that portion */ - REQUESTED_RANGE_NOT_SATISFIABLE(416), - /** The server cannot meet the requirements of the Expect request-header field. */ - EXPECTATION_FAILED(417), - /** The request was well-formed but was unable to be followed due to semantic errors */ - UNPROCESSABLE_ENTITY(422), - - //Server Status Code - /** A generic error message, given when no more specific message is suitable. */ - INTERNAL_SERVER_ERROR(500), - /** The server either does not recognize the request method, or it lacks the ability to fulfill the request */ - NOT_IMPLEMENTED(501), - /** The server was acting as a gateway or proxy and received an invalid response from the upstream server */ - BAD_GATEWAY(502), - /** The server is currently unavailable */ - SERVICE_UNAVAILABLE(503), - /** The server was acting as a gateway or proxy and did not receive a timely response from the upstream server. */ - GATEWAY_TIMEOUT(504), - /** The server does not support the HTTP protocol version used in the request. */ - VERSION_NOT_SUPPORTED(505), - /** Indicates the code we received is not found within this Enum */ - CODE_UNKNOWN(0) - - ; - private final int code; - private StatusCode(int code) { - this.code = code; - } - - public int getCode() { - return code; - } - - public static StatusCode fromCode(int code) { - for (StatusCode sc : StatusCode.values()) - { - if (sc.getCode() == code) - return sc; - } - return CODE_UNKNOWN; - } +public enum StatusCode { + // Client Status Codes + /** + * The request cannot be fulfilled due to bad syntax. + */ + BAD_REQUEST(400), + /** + * Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided + */ + UNAUTHORIZED(401), + /** + * Reserved for future use. + */ + PAYMENT_REQUIRED(402), + /** + * The request was a valid request, but the server is refusing to respond to it. + */ + FORBIDDEN(403), + /** + * The requested resource could not be found but may be available again in the future + */ + NOT_FOUND(404), + /** + * A request was made of a resource using a request method not supported by that resource + */ + METHOD_NOT_ALLOWED(405), + /** + * The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request. + */ + NOT_ACCEPTABLE(406), + /** + * The client must first authenticate itself with the proxy. + */ + PROXY_AUTH_REQUIRED(407), + /** + * The server timed out waiting for the request. + */ + REQUEST_TIMEOUT(408), + /** + * Indicates that the request could not be processed because of conflict in the request, such as an edit conflict. + */ + CONFLICT(409), + /** + * Indicates that the resource requested is no longer available and will not be available again + */ + GONE(410), + /** + * The request did not specify the length of its content, which is required by the requested resource + */ + LENGTH_REQUIRED(411), + /** + * The server does not meet one of the preconditions that the requester put on the request + */ + PRE_CONDITION_FAILED(412), + /** + * The request is larger than the server is willing or able to process. + */ + REQUEST_ENTITY_TOO_LARGE(413), + /** + * The URI provided was too long for the server to process. + */ + REQUEST_URI_TOO_LONG(414), + /** + * The request entity has a media type which the server or resource does not support + */ + UNSUPPORTED_MEDIATYPE(415), + /** + * The client has asked for a portion of the file, but the server cannot supply that portion + */ + REQUESTED_RANGE_NOT_SATISFIABLE(416), + /** + * The server cannot meet the requirements of the Expect request-header field. + */ + EXPECTATION_FAILED(417), + /** + * The request was well-formed but was unable to be followed due to semantic errors + */ + UNPROCESSABLE_ENTITY(422), + + //Server Status Code + /** + * A generic error message, given when no more specific message is suitable. + */ + INTERNAL_SERVER_ERROR(500), + /** + * The server either does not recognize the request method, or it lacks the ability to fulfill the request + */ + NOT_IMPLEMENTED(501), + /** + * The server was acting as a gateway or proxy and received an invalid response from the upstream server + */ + BAD_GATEWAY(502), + /** + * The server is currently unavailable + */ + SERVICE_UNAVAILABLE(503), + /** + * The server was acting as a gateway or proxy and did not receive a timely response from the upstream server. + */ + GATEWAY_TIMEOUT(504), + /** + * The server does not support the HTTP protocol version used in the request. + */ + VERSION_NOT_SUPPORTED(505), + /** + * Indicates the code we received is not found within this Enum + */ + CODE_UNKNOWN(0); + private final int code; + + private StatusCode(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + public static StatusCode fromCode(int code) { + for (StatusCode sc : StatusCode.values()) { + if (sc.getCode() == code) + return sc; + } + return CODE_UNKNOWN; + } } diff --git a/core/src/main/java/org/openstack4j/api/gbp/ExternalPolicyService.java b/core/src/main/java/org/openstack4j/api/gbp/ExternalPolicyService.java index 3cd35db21..8f42bd92d 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/ExternalPolicyService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/ExternalPolicyService.java @@ -1,34 +1,35 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.ExternalPolicy; import org.openstack4j.model.gbp.ExternalPolicyCreate; - + +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of external policies - * + * * @author vinod borole - * */ -public interface ExternalPolicyService extends RestService{ +public interface ExternalPolicyService extends RestService { /** * List all external policies - * + * * @return List of external policies */ List list(); + /** * Returns list of external policies filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified external policy by ID * @@ -36,12 +37,15 @@ public interface ExternalPolicyService extends RestService{ * @return the external policy or null if not found */ ExternalPolicy get(String id); + /** * Delete of the external policy + * * @param id the external policy id * @return the action response */ ActionResponse delete(String id); + /** * Create a new external policy * @@ -49,12 +53,13 @@ public interface ExternalPolicyService extends RestService{ * @return the newly created external policy */ ExternalPolicy create(ExternalPolicyCreate externalPolicy); + /** * Updates an existing external policy - * + * * @param external policy identifier * @param external policy that is be used to updated * @return the updated external policy */ - ExternalPolicy update(String externalPolicyId,ExternalPolicyCreate externalPolicy); + ExternalPolicy update(String externalPolicyId, ExternalPolicyCreate externalPolicy); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/ExternalSegmentService.java b/core/src/main/java/org/openstack4j/api/gbp/ExternalSegmentService.java index c88a7131f..3e3dd4ed0 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/ExternalSegmentService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/ExternalSegmentService.java @@ -1,31 +1,32 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.ExternalSegment; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of external segments - * + * * @author vinod borole - * - */ + */ public interface ExternalSegmentService { /** * List all external segment - * + * * @return List of external segment */ List list(); + /** * Returns list of external segments filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified external segment by ID * @@ -33,12 +34,15 @@ public interface ExternalSegmentService { * @return external segment or null if not found */ ExternalSegment get(String id); + /** * Delete of the external segment + * * @param id the external segment id * @return the action response */ ActionResponse delete(String id); + /** * Create a new external segment * @@ -46,12 +50,13 @@ public interface ExternalSegmentService { * @return the newly created external segment */ ExternalSegment create(ExternalSegment externalSegment); + /** * Updates an existing external segment - * + * * @param external segment identifier * @param external segment that is be used to updated * @return the updated external segment */ - ExternalSegment update(String externalSegmentId,ExternalSegment externalSegment); + ExternalSegment update(String externalSegmentId, ExternalSegment externalSegment); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/GbpService.java b/core/src/main/java/org/openstack4j/api/gbp/GbpService.java index e6c4ffe71..f5e229bd4 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/GbpService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/GbpService.java @@ -1,96 +1,108 @@ package org.openstack4j.api.gbp; import org.openstack4j.common.RestService; + /** * This interface contains all available GbpServices - * + * * @author vinod borole - * */ public interface GbpService extends RestService { /** * Service implementation which provides methods for manipulation of external Policies - * + * * @return ExternalPolicyService */ ExternalPolicyService externalPolicy(); + /** * Service implementation which provides methods for manipulation of external segments - * + * * @return ExternalSegmentService - */ + */ ExternalSegmentService externalSegment(); - + /** * Service implementation which provides methods for manipulation of groups - * + * * @return GroupService */ GroupService group(); + /** * Service implementation which provides methods for manipulation of l2policies - * + * * @return L2policyService */ L2policyService l2Policy(); + /** * Service implementation which provides methods for manipulation of l3policies - * + * * @return L3policyService */ L3policyService l3Policy(); + /** * Service implementation which provides methods for manipulation of nat pools - * + * * @return NatPoolService */ NatPoolService natPool(); + /** * Service implementation which provides methods for manipulation of network services - * + * * @return NetworkPolicyService */ NetworkPolicyService networkPolicyService(); + /** * Service implementation which provides methods for manipulation of policy actions - * + * * @return PolicyActionService */ PolicyActionService policyAction(); + /** * Service implementation which provides methods for manipulation of policy rules - * + * * @return PolicyRuleService */ PolicyRuleService policyRule(); + /** * Service implementation which provides methods for manipulation of policy rules Sets - * + * * @return PolicyRuleSetService */ PolicyRuleSetService policyRuleSet(); + /** * Service implementation which provides methods for manipulation of policy targets - * + * * @return PolicyTargetService */ PolicyTargetService policyTarget(); + /** * Service implementation which provides methods for manipulation of policy classifiers - * + * * @return PolicyClassifierService */ PolicyClassifierService policyClassifier(); + /** - * Service implementation which provides methods for manipulation of service chains - * + * Service implementation which provides methods for manipulation of service chains + * * @return ServicechainService */ ServicechainService servicechain(); + /** * Service implementation which provides methods for manipulation of service profiles - * + * * @return ServiceProfileService */ ServiceProfileService serviceProfile(); diff --git a/core/src/main/java/org/openstack4j/api/gbp/GroupService.java b/core/src/main/java/org/openstack4j/api/gbp/GroupService.java index 561a77af4..bc6362264 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/GroupService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/GroupService.java @@ -1,32 +1,33 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyTargetGroup; import org.openstack4j.model.gbp.PolicyTargetGroupCreate; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of groups - * + * * @author vinod borole - * - */ -public interface GroupService{ + */ +public interface GroupService { /** * List all policy target group - * + * * @return List of policy target group */ List list(); + /** * Returns list of policy target group filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified policy target group by ID * @@ -34,12 +35,15 @@ public interface GroupService{ * @return policy target group or null if not found */ PolicyTargetGroup get(String id); + /** * Delete of the policy target group + * * @param id the policy target group id * @return the action response */ ActionResponse delete(String id); + /** * Create a new policy target group * @@ -47,12 +51,13 @@ public interface GroupService{ * @return the newly created policy target group */ PolicyTargetGroup create(PolicyTargetGroupCreate policyTargetGroup); + /** * Updates an existing policy target group - * + * * @param policy target group identifier * @param policy target group that is be used to updated * @return the updated policy target group */ - PolicyTargetGroup update(String policyTargetGroupId,PolicyTargetGroupCreate policyTargetGroup); + PolicyTargetGroup update(String policyTargetGroupId, PolicyTargetGroupCreate policyTargetGroup); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/L2policyService.java b/core/src/main/java/org/openstack4j/api/gbp/L2policyService.java index 3c7d7317a..5afd8a336 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/L2policyService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/L2policyService.java @@ -1,31 +1,32 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.L2Policy; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of l2policy - * + * * @author vinod borole - * */ -public interface L2policyService{ +public interface L2policyService { /** * List all l2 policies - * + * * @return List of l2 policies */ List list(); + /** * Returns list of l2 policies filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified l2 policy by ID * @@ -33,12 +34,15 @@ public interface L2policyService{ * @return l2 policy or null if not found */ L2Policy get(String id); + /** * Delete of the l2 policy + * * @param id the l2 policy id * @return the action response */ ActionResponse delete(String id); + /** * Create a new l2 policy * @@ -46,12 +50,13 @@ public interface L2policyService{ * @return the newly created l2 policy */ L2Policy create(L2Policy l2Policy); + /** * Updates an existing l2 policy - * + * * @param l2 policy identifier * @param l2 policy that is be used to updated * @return the updated l2 policy */ - L2Policy update(String l2PolicyId,L2Policy l2Policy); + L2Policy update(String l2PolicyId, L2Policy l2Policy); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/L3policyService.java b/core/src/main/java/org/openstack4j/api/gbp/L3policyService.java index 48082166d..d83ff5a1a 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/L3policyService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/L3policyService.java @@ -1,31 +1,32 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.L3Policy; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of l3policy - * + * * @author vinod borole - * */ -public interface L3policyService{ +public interface L3policyService { /** * List all l3 policies - * + * * @return List of l3 policies */ List list(); + /** * Returns list of l3 policies filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified l3 policy by ID * @@ -33,12 +34,15 @@ public interface L3policyService{ * @return l3 policy or null if not found */ L3Policy get(String id); + /** * Delete of the l3 policy + * * @param id the l3 policy id * @return the action response */ ActionResponse delete(String id); + /** * Create a new l3 policy * @@ -46,12 +50,13 @@ public interface L3policyService{ * @return the newly created l3 policy */ L3Policy create(L3Policy l3Policy); + /** * Updates an existing l3 policy - * + * * @param l3 policy identifier * @param l3 policy that is be used to updated * @return the updated l3 policy */ - L3Policy update(String l3PolicyId,L3Policy l3Policy); + L3Policy update(String l3PolicyId, L3Policy l3Policy); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/NatPoolService.java b/core/src/main/java/org/openstack4j/api/gbp/NatPoolService.java index e4aeb15c6..4a55dfbc9 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/NatPoolService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/NatPoolService.java @@ -1,31 +1,32 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.NatPool; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of nat-pool - * + * * @author vinod borole - * */ public interface NatPoolService { /** * List all nat pool - * + * * @return List of nat pool */ List list(); + /** * Returns list of nat pool filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified nat pool by ID * @@ -33,12 +34,15 @@ public interface NatPoolService { * @return nat pool or null if not found */ NatPool get(String id); + /** * Delete of the nat pool + * * @param id the nat pool id * @return the action response */ ActionResponse delete(String id); + /** * Create a new nat pool * @@ -46,12 +50,13 @@ public interface NatPoolService { * @return the newly created nat pool */ NatPool create(NatPool natpool); + /** * Updates an existing nat pool - * + * * @param nat pool identifier * @param nat pool that is be used to updated * @return the updated nat pool */ - NatPool update(String natpoolId,NatPool natpool); + NatPool update(String natpoolId, NatPool natpool); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/NetworkPolicyService.java b/core/src/main/java/org/openstack4j/api/gbp/NetworkPolicyService.java index f0f37073f..f641ba913 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/NetworkPolicyService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/NetworkPolicyService.java @@ -8,14 +8,14 @@ /** * This interface defines all methods for the manipulation of network service - * + * * @author vinod borole - * */ public interface NetworkPolicyService { /** * List all gbp network service policies + * * @return */ List list(); @@ -30,6 +30,7 @@ public interface NetworkPolicyService { /** * Get a gbp network service policy specified by id + * * @param id * @return */ @@ -37,6 +38,7 @@ public interface NetworkPolicyService { /** * Create a gbp network service policy + * * @param networkServicePolicy * @return */ @@ -44,6 +46,7 @@ public interface NetworkPolicyService { /** * Delete a gbp network service policy specified by id + * * @param id * @return */ @@ -51,10 +54,11 @@ public interface NetworkPolicyService { /** * Update the gbp network service policy specified by id + * * @param gbpServicePolicyId * @param gbpServicePolicy * @return */ - NetworkServicePolicy update(String gbpServicePolicyId , NetworkServicePolicy gbpServicePolicy); + NetworkServicePolicy update(String gbpServicePolicyId, NetworkServicePolicy gbpServicePolicy); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/PolicyActionService.java b/core/src/main/java/org/openstack4j/api/gbp/PolicyActionService.java index 2b8ca533f..538b76787 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/PolicyActionService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/PolicyActionService.java @@ -1,32 +1,33 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyAction; import org.openstack4j.model.gbp.PolicyActionUpdate; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of policy actions - * + * * @author vinod borole - * */ public interface PolicyActionService { /** * List all policy actions - * + * * @return List of policy actions */ List list(); + /** * Returns list of policy actions filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified policy action by ID * @@ -34,12 +35,15 @@ public interface PolicyActionService { * @return policy action or null if not found */ PolicyAction get(String id); + /** * Delete of the policy action + * * @param id the policy action id * @return the action response */ ActionResponse delete(String id); + /** * Create a new policy action * @@ -47,12 +51,13 @@ public interface PolicyActionService { * @return the newly created policy action */ PolicyAction create(PolicyAction policyAction); + /** * Updates an existing policy action - * + * * @param policy action identifier * @param policy action that is be used to updated * @return the updated policy action */ - PolicyAction update(String policyActionId,PolicyActionUpdate policyAction); + PolicyAction update(String policyActionId, PolicyActionUpdate policyAction); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/PolicyClassifierService.java b/core/src/main/java/org/openstack4j/api/gbp/PolicyClassifierService.java index bc0a39b49..a0f92e548 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/PolicyClassifierService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/PolicyClassifierService.java @@ -1,32 +1,33 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyClassifier; import org.openstack4j.model.gbp.PolicyClassifierUpdate; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of policy classifiers - * + * * @author vinod borole - * */ public interface PolicyClassifierService { /** * List all policy classifier - * + * * @return List of policy classifier */ List list(); + /** * Returns list of policy classifier filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified policy classifier by ID * @@ -34,12 +35,15 @@ public interface PolicyClassifierService { * @return policy classifier or null if not found */ PolicyClassifier get(String id); + /** * Delete of the policy classifier + * * @param id the policy classifier id * @return the classifier response */ ActionResponse delete(String id); + /** * Create a new policy classifier * @@ -47,12 +51,13 @@ public interface PolicyClassifierService { * @return the newly created policy classifier */ PolicyClassifier create(PolicyClassifier policyClassifier); + /** * Updates an existing policy classifier - * + * * @param policy classifier identifier * @param policy classifier that is be used to updated * @return the updated policy classifier */ - PolicyClassifier update(String policyClassifierId,PolicyClassifierUpdate policyClassifier); + PolicyClassifier update(String policyClassifierId, PolicyClassifierUpdate policyClassifier); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleService.java b/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleService.java index 8e846e14d..ac2770d01 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleService.java @@ -1,31 +1,32 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyRule; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of policy rule - * + * * @author vinod borole - * */ public interface PolicyRuleService { /** * List all policy rules - * + * * @return List of policy rules */ List list(); + /** * Returns list of policy rules filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified policy rule by ID * @@ -33,12 +34,15 @@ public interface PolicyRuleService { * @return policy rule or null if not found */ PolicyRule get(String id); + /** * Delete of the policy rule + * * @param id the policy rule id * @return the rule response */ ActionResponse delete(String id); + /** * Create a new policy rule * @@ -46,12 +50,13 @@ public interface PolicyRuleService { * @return the newly created policy rule */ PolicyRule create(PolicyRule policyRule); + /** * Updates an existing policy rule - * + * * @param policy rule identifier * @param policy rule that is be used to updated * @return the updated policy rule */ - PolicyRule update(String policyRuleId,PolicyRule policyRule); + PolicyRule update(String policyRuleId, PolicyRule policyRule); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetService.java b/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetService.java index de4d37c57..29e7d1e8b 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/PolicyRuleSetService.java @@ -1,25 +1,27 @@ package org.openstack4j.api.gbp; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.gbp.PolicyRuleSet; + import java.util.List; import java.util.Map; -import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.gbp.PolicyRuleSet; - public interface PolicyRuleSetService { /** * List all policy rule set - * + * * @return List of policy rule set */ List list(); + /** * Returns list of policy rule set filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified policy rule set by ID * @@ -27,12 +29,15 @@ public interface PolicyRuleSetService { * @return policy rule set or null if not found */ PolicyRuleSet get(String id); + /** * Delete of the policy rule set + * * @param id the policy rule set id * @return the rule set response */ ActionResponse delete(String id); + /** * Create a new policy rule set * @@ -40,12 +45,13 @@ public interface PolicyRuleSetService { * @return the newly created policy rule set */ PolicyRuleSet create(PolicyRuleSet policyRuleSet); + /** * Updates an existing policy rule set - * + * * @param policy rule set identifier * @param policy rule set that is be used to updated * @return the updated policy rule set */ - PolicyRuleSet update(String policyRuleSetId,PolicyRuleSet policyRuleSet); + PolicyRuleSet update(String policyRuleSetId, PolicyRuleSet policyRuleSet); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/PolicyTargetService.java b/core/src/main/java/org/openstack4j/api/gbp/PolicyTargetService.java index c27b4ee01..89c67cbf4 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/PolicyTargetService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/PolicyTargetService.java @@ -1,31 +1,32 @@ package org.openstack4j.api.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyTarget; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of policy targets - * + * * @author vinod borole - * */ -public interface PolicyTargetService{ - /** +public interface PolicyTargetService { + /** * List all policy target - * + * * @return List of policy target */ List list(); + /** * Returns list of policy target filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Get the specified policy target by ID * @@ -33,25 +34,29 @@ public interface PolicyTargetService{ * @return policy target or null if not found */ PolicyTarget get(String id); + /** * Delete of the policy target + * * @param id the policy target id * @return the target response */ ActionResponse delete(String id); + /** * Create a new policy target * * @param policy target * @return the newly created policy target */ - PolicyTarget create(PolicyTarget policyTarget); - /** - * Updates an existing policy target - * - * @param policy target identifier - * @param policy target that is be used to updated - * @return the updated policy target - */ - PolicyTarget update(String policyTargetId,PolicyTarget policyTarget); + PolicyTarget create(PolicyTarget policyTarget); + + /** + * Updates an existing policy target + * + * @param policy target identifier + * @param policy target that is be used to updated + * @return the updated policy target + */ + PolicyTarget update(String policyTargetId, PolicyTarget policyTarget); } diff --git a/core/src/main/java/org/openstack4j/api/gbp/ServiceProfileService.java b/core/src/main/java/org/openstack4j/api/gbp/ServiceProfileService.java index 5911a182b..d674f77c1 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/ServiceProfileService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/ServiceProfileService.java @@ -2,9 +2,8 @@ /** * This interface defines all methods for the manipulation of service profiles - * + * * @author vinod borole - * */ public interface ServiceProfileService { diff --git a/core/src/main/java/org/openstack4j/api/gbp/ServicechainService.java b/core/src/main/java/org/openstack4j/api/gbp/ServicechainService.java index 8577b7674..131a89bc7 100644 --- a/core/src/main/java/org/openstack4j/api/gbp/ServicechainService.java +++ b/core/src/main/java/org/openstack4j/api/gbp/ServicechainService.java @@ -2,9 +2,8 @@ /** * This interface defines all methods for the manipulation of service chain - * + * * @author vinod borole - * */ public interface ServicechainService { diff --git a/core/src/main/java/org/openstack4j/api/heat/EventsService.java b/core/src/main/java/org/openstack4j/api/heat/EventsService.java index 07d9e270c..f9cced66c 100644 --- a/core/src/main/java/org/openstack4j/api/heat/EventsService.java +++ b/core/src/main/java/org/openstack4j/api/heat/EventsService.java @@ -1,45 +1,44 @@ package org.openstack4j.api.heat; -import java.util.List; - import org.openstack4j.model.heat.Event; +import java.util.List; + /** * This interface defines all methods for the manipulation of events - * + * * @author Octopus Zhang - * */ public interface EventsService { - - /** - * Gets a list of currently existing {@link Event}s for a specified stack. - * - * @param stackId The unique identifier for a stack - * @param stackName The name of a stack - * @return the list of {@link Event}s - */ - List list(String stackName, String stackId); - - /** - * Gets a list of currently existing {@link Event}s for a specified stack resource. - * - * @param stackId The unique identifier for a stack - * @param stackName The name of a stack - * @param resourceName The name of a resource in the stack - * @return the list of {@link Event}s - */ - List list(String stackName, String stackId, String resourceName); - - - /** - * Shows details for a specified event. - * - * @param stackId The unique identifier for a stack - * @param stackName The name of a stack - * @param resourceName The name of a resource in the stack - * @param eventId The unique identifier of an event related to the resource in the stack - * @return event details - */ - Event show(String stackName, String stackId, String resourceName, String eventId); + + /** + * Gets a list of currently existing {@link Event}s for a specified stack. + * + * @param stackId The unique identifier for a stack + * @param stackName The name of a stack + * @return the list of {@link Event}s + */ + List list(String stackName, String stackId); + + /** + * Gets a list of currently existing {@link Event}s for a specified stack resource. + * + * @param stackId The unique identifier for a stack + * @param stackName The name of a stack + * @param resourceName The name of a resource in the stack + * @return the list of {@link Event}s + */ + List list(String stackName, String stackId, String resourceName); + + + /** + * Shows details for a specified event. + * + * @param stackId The unique identifier for a stack + * @param stackName The name of a stack + * @param resourceName The name of a resource in the stack + * @param eventId The unique identifier of an event related to the resource in the stack + * @return event details + */ + Event show(String stackName, String stackId, String resourceName, String eventId); } diff --git a/core/src/main/java/org/openstack4j/api/heat/HeatService.java b/core/src/main/java/org/openstack4j/api/heat/HeatService.java index a561ac952..397d32562 100644 --- a/core/src/main/java/org/openstack4j/api/heat/HeatService.java +++ b/core/src/main/java/org/openstack4j/api/heat/HeatService.java @@ -4,43 +4,43 @@ /** * This interface containts all available HeatServices - * @author Matthias Reisser * + * @author Matthias Reisser */ public interface HeatService extends RestService { - - /** - * Service implementation which provides methods for manipulation of stacks - * - * @return StackService - */ - StackService stacks(); - - /** - * Service implementation which provides methods for validating Templates - * - * @return TemplateService - */ - TemplateService templates(); - - /** - * Service implementation which provides methods for Events - * - * @return EventsService - */ - EventsService events(); - /** - * Service implementation which provides methods for Resources - * - * @return ResourcesService - */ - ResourcesService resources(); - - /** - * Service implementation which provides methods for Software Configurations - * - * @return SoftwareConfigService - */ - SoftwareConfigService softwareConfig(); + /** + * Service implementation which provides methods for manipulation of stacks + * + * @return StackService + */ + StackService stacks(); + + /** + * Service implementation which provides methods for validating Templates + * + * @return TemplateService + */ + TemplateService templates(); + + /** + * Service implementation which provides methods for Events + * + * @return EventsService + */ + EventsService events(); + + /** + * Service implementation which provides methods for Resources + * + * @return ResourcesService + */ + ResourcesService resources(); + + /** + * Service implementation which provides methods for Software Configurations + * + * @return SoftwareConfigService + */ + SoftwareConfigService softwareConfig(); } diff --git a/core/src/main/java/org/openstack4j/api/heat/ResourcesService.java b/core/src/main/java/org/openstack4j/api/heat/ResourcesService.java index b48d20fa1..9e0e883dc 100644 --- a/core/src/main/java/org/openstack4j/api/heat/ResourcesService.java +++ b/core/src/main/java/org/openstack4j/api/heat/ResourcesService.java @@ -1,6 +1,6 @@ package org.openstack4j.api.heat; -import org.openstack4j.model.common.*; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.heat.Resource; import org.openstack4j.model.heat.ResourceHealth; @@ -10,74 +10,75 @@ /** * This interface defines all methods for the manipulation of resources - * + * * @author Octopus Zhang - * */ public interface ResourcesService { - - /** - * Gets a list of currently existing {@link Resource}s for a specified stack. - * - * @param stackId The unique identifier for a stack - * @param stackName The name of a stack - * @return the list of {@link Resource}s - */ - List list(String stackName, String stackId); - - - /** - * Gets a list of currently existing {@link Resource}s for a specified stack. - * - * @param stackNameOrId Stack name or stack id - * @return the list of {@link Resource}s - */ - List list(String stackNameOrId); - /** - * Gets a list of currently existing {@link Resource}s for a specified stack with filtern parameters. - * - * @param stackNameOrId Stack name or stack id - * @param depth The recursion level for which resources will be listed. - * @return the list of {@link Resource}s - */ - List list(String stackNameOrId, int depth); - - /** - * Gets the detail of the specified resource - * - * @param stackId The unique identifier for a stack - * @param stackName The name of a stack - * @param resourceName The name of a resource - * @return the detail of the specified resource - */ - Resource show(String stackName, String stackId, String resourceName); + /** + * Gets a list of currently existing {@link Resource}s for a specified stack. + * + * @param stackId The unique identifier for a stack + * @param stackName The name of a stack + * @return the list of {@link Resource}s + */ + List list(String stackName, String stackId); - /** - * Gets the stack resource metadata - * - * @param stackName The name of a stack - * @param stackId The unique identifier for a stack - * @param resourceName The name of a resource - * @return the metadata of the specified resource - */ - Map getMetadata(String stackName, String stackId, String resourceName); - /** - * Signals a resource - * @param stackName - * @param stackId - * @param resourceName - */ - ActionResponse signal(String stackName, String stackId, String resourceName); + /** + * Gets a list of currently existing {@link Resource}s for a specified stack. + * + * @param stackNameOrId Stack name or stack id + * @return the list of {@link Resource}s + */ + List list(String stackNameOrId); - /** - * Marks a resource unhealthy - * @param stackName - * @param stackId - * @param resourceName - * @param resourceHealth - */ - ActionResponse markUnhealthy(String stackName, String stackId, String resourceName, ResourceHealth resourceHealth); + /** + * Gets a list of currently existing {@link Resource}s for a specified stack with filtern parameters. + * + * @param stackNameOrId Stack name or stack id + * @param depth The recursion level for which resources will be listed. + * @return the list of {@link Resource}s + */ + List list(String stackNameOrId, int depth); + + /** + * Gets the detail of the specified resource + * + * @param stackId The unique identifier for a stack + * @param stackName The name of a stack + * @param resourceName The name of a resource + * @return the detail of the specified resource + */ + Resource show(String stackName, String stackId, String resourceName); + + /** + * Gets the stack resource metadata + * + * @param stackName The name of a stack + * @param stackId The unique identifier for a stack + * @param resourceName The name of a resource + * @return the metadata of the specified resource + */ + Map getMetadata(String stackName, String stackId, String resourceName); + + /** + * Signals a resource + * + * @param stackName + * @param stackId + * @param resourceName + */ + ActionResponse signal(String stackName, String stackId, String resourceName); + + /** + * Marks a resource unhealthy + * + * @param stackName + * @param stackId + * @param resourceName + * @param resourceHealth + */ + ActionResponse markUnhealthy(String stackName, String stackId, String resourceName, ResourceHealth resourceHealth); } diff --git a/core/src/main/java/org/openstack4j/api/heat/SoftwareConfigService.java b/core/src/main/java/org/openstack4j/api/heat/SoftwareConfigService.java index 0c7cd3fef..4355382cf 100644 --- a/core/src/main/java/org/openstack4j/api/heat/SoftwareConfigService.java +++ b/core/src/main/java/org/openstack4j/api/heat/SoftwareConfigService.java @@ -7,31 +7,33 @@ /** * Software Configuration Service for HEAT Orchestration - * + * * @author Jeremy Unruh */ public interface SoftwareConfigService extends RestService { /** * Creates a new Software Config. See {@link Builders#softwareConfig()} for creating the model + * * @param sc the software config to create * @return the newly created SoftwareConfig */ SoftwareConfig create(SoftwareConfig sc); - + /** * Fetches a Software Configuration by ID + * * @param configId the configuration ID * @return SoftwareConfig */ SoftwareConfig show(String configId); - + /** * Deletes a Software Config by ID - * + * * @param configId the software config ID to delete * @return the action response */ ActionResponse delete(String configId); - + } diff --git a/core/src/main/java/org/openstack4j/api/heat/StackService.java b/core/src/main/java/org/openstack4j/api/heat/StackService.java index b6bf795b0..b61f3f388 100644 --- a/core/src/main/java/org/openstack4j/api/heat/StackService.java +++ b/core/src/main/java/org/openstack4j/api/heat/StackService.java @@ -1,126 +1,115 @@ package org.openstack4j.api.heat; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.heat.AdoptStackData; import org.openstack4j.model.heat.Stack; import org.openstack4j.model.heat.StackCreate; import org.openstack4j.model.heat.StackUpdate; +import java.util.List; +import java.util.Map; + /** * This interface defines all methods for the manipulation of stacks - * + * * @author Matthias Reisser - * */ public interface StackService { - /** - * POST /v1/{tenant_id}/stacks
- * - * Creates a new {@link Stack} out of a {@link StackCreate} object - * - * @param newStack - * {@link StackCreate} object out of which stack is to be created - * @return new {@link Stack} as returned from the server - */ - Stack create(StackCreate newStack); - - /** + /** + * POST /v1/{tenant_id}/stacks
+ *

+ * Creates a new {@link Stack} out of a {@link StackCreate} object + * + * @param newStack {@link StackCreate} object out of which stack is to be created + * @return new {@link Stack} as returned from the server + */ + Stack create(StackCreate newStack); + + /** * Updates an existing Stack - * - * @param stackName the stack name - * @param stackId the specific stack identifier + * + * @param stackName the stack name + * @param stackId the specific stack identifier * @param stackUpdate the stack update options * @return the action response */ - ActionResponse update(String stackName, String stackId, StackUpdate stackUpdate); + ActionResponse update(String stackName, String stackId, StackUpdate stackUpdate); - /** - * POST /v1/{tenant_id}/stacks - * Creates a new {@link StackCreate} Object and returns a new {@link Stack} as sent from the - * server. - * - * @param name - * Name of Stack - * @param template - * Template in Json-Format or YAML format - * @param parameters - * Map of parameters - * @param disableRollback boolean to enable or disable rollback - * @param timeOutMins timeout in minutes - * @return new {@link Stack} as returned from the server - */ - Stack create(String name, String template, Map parameters, - boolean disableRollback, Long timeOutMins); + /** + * POST /v1/{tenant_id}/stacks + * Creates a new {@link StackCreate} Object and returns a new {@link Stack} as sent from the + * server. + * + * @param name Name of Stack + * @param template Template in Json-Format or YAML format + * @param parameters Map of parameters + * @param disableRollback boolean to enable or disable rollback + * @param timeOutMins timeout in minutes + * @return new {@link Stack} as returned from the server + */ + Stack create(String name, String template, Map parameters, + boolean disableRollback, Long timeOutMins); - /** + /** * returns details of a {@link Stack}. - * @param stackName - * Name of {@link Stack} + * + * @param stackName Name of {@link Stack} * @return {@link Stack} */ - Stack getStackByName(String name); - - /** - * Gets a list of currently existing {@link Stack}s. - * - * @return the list of {@link Stack}s - */ - List list(); + Stack getStackByName(String name); - /** - * Gets a list of currently existing {@link Stack} objects, filtered by parameters. - * - * @param filteringParams The parameters used to filter the stacks returned. - * - * @return the list of {@link Stack} objects. - */ - public List list(Map filteringParams); + /** + * Gets a list of currently existing {@link Stack}s. + * + * @return the list of {@link Stack}s + */ + List list(); - /** - * returns details of a {@link Stack}. - * - * @param stackName - * Name of {@link Stack} - * @param stackId - * Id of {@link Stack} - * @return - */ - Stack getDetails(String stackName, String stackId); + /** + * Gets a list of currently existing {@link Stack} objects, filtered by parameters. + * + * @param filteringParams The parameters used to filter the stacks returned. + * @return the list of {@link Stack} objects. + */ + public List list(Map filteringParams); - /** - * Deletes the specified {@link Stack} from the server. - * - * @param stackName - * Name of {@link Stack} - * @param stackId - * Id of {@link Stack} - * @return the action response - */ - ActionResponse delete(String stackName, String stackId); + /** + * returns details of a {@link Stack}. + * + * @param stackName Name of {@link Stack} + * @param stackId Id of {@link Stack} + * @return + */ + Stack getDetails(String stackName, String stackId); - /** - * Deletes a stack but leaves its resources intact, and returns data that describes the stack and its resources. - * - * @param stackName Name of {@link Stack} - * @param stackId Id of {@link Stack} - * - * @return adopt_stack_data element representing by {@link AdoptStackData} - */ - AdoptStackData abandon(String stackName, String stackId); - - /** - * Creates a stack from existing resources. - * - * @param adoptStackData Structure {@link AdoptStackData}, representing existing resources - * @param parameters Map of parameters - * @param disableRollback Enable or disable rollback - * @param timeOutMins Timeout in minutes - * @param template Template in Json-Format or YAML format. It is optional, used just in case there will be new resources (not included in adoptStackData) - * @return - */ - Stack adopt(AdoptStackData adoptStackData, Map parameters, - boolean disableRollback, Long timeOutMins, String template); + /** + * Deletes the specified {@link Stack} from the server. + * + * @param stackName Name of {@link Stack} + * @param stackId Id of {@link Stack} + * @return the action response + */ + ActionResponse delete(String stackName, String stackId); + + /** + * Deletes a stack but leaves its resources intact, and returns data that describes the stack and its resources. + * + * @param stackName Name of {@link Stack} + * @param stackId Id of {@link Stack} + * @return adopt_stack_data element representing by {@link AdoptStackData} + */ + AdoptStackData abandon(String stackName, String stackId); + + /** + * Creates a stack from existing resources. + * + * @param adoptStackData Structure {@link AdoptStackData}, representing existing resources + * @param parameters Map of parameters + * @param disableRollback Enable or disable rollback + * @param timeOutMins Timeout in minutes + * @param template Template in Json-Format or YAML format. It is optional, used just in case there will be new resources (not included in adoptStackData) + * @return + */ + Stack adopt(AdoptStackData adoptStackData, Map parameters, + boolean disableRollback, Long timeOutMins, String template); } diff --git a/core/src/main/java/org/openstack4j/api/heat/TemplateService.java b/core/src/main/java/org/openstack4j/api/heat/TemplateService.java index db0d07a8d..ef58d3418 100644 --- a/core/src/main/java/org/openstack4j/api/heat/TemplateService.java +++ b/core/src/main/java/org/openstack4j/api/heat/TemplateService.java @@ -1,65 +1,69 @@ package org.openstack4j.api.heat; -import java.util.Map; - import org.openstack4j.model.heat.Template; import org.openstack4j.model.heat.TemplateResponse; +import java.util.Map; + /** * This Interface contains a non-exhaustive list of methods for the manipulation of Heat Templates - * @author Matthias Reisser * + * @author Matthias Reisser */ public interface TemplateService { - /** - * Validates the template - * @param template to validate, passed as a {@link Template} - * @return TemplateResponse indicating valid or the error condition if not valid - */ - TemplateResponse validateTemplate(Template template); - - /** - * Validates the template - * @param template to validate, passed as {@link String} in JSON Format - * @return TemplateResponse indicating valid or the error condition if not valid - */ - TemplateResponse validateTemplate(String template); - - /** + /** + * Validates the template + * + * @param template to validate, passed as a {@link Template} + * @return TemplateResponse indicating valid or the error condition if not valid + */ + TemplateResponse validateTemplate(Template template); + + /** + * Validates the template + * + * @param template to validate, passed as {@link String} in JSON Format + * @return TemplateResponse indicating valid or the error condition if not valid + */ + TemplateResponse validateTemplate(String template); + + /** * Validates the template - * + * * @param templateURL the remote template via URL to validate * @return TemplateResponse indicating valid or the error condition if not valid */ TemplateResponse validateTemplateByURL(String templateURL); - + /** * Retrieves the original template in original String form JSON or YAML + * * @param stackName the stack name - * @param stackId the stack identifier + * @param stackId the stack identifier * @return the template * @throws ResponseException if an error occurs */ String getTemplateAsString(String stackName, String stackId); - + /** * Retrieves the original template as Map + * * @param stackName the stack name - * @param stackId the stack identifier + * @param stackId the stack identifier * @return the template * @throws ResponseException if an error occurs */ Map getTemplateAsMap(String stackName, String stackId); - + /** * Retrieves the original template as Map when you know only the stack name or stack id + * * @param stackNameOrId the stack name or stackId * @return the template * @throws ResponseException if an error occurs */ Map getTemplateAsMap(String stackNameOrId); - - - + + } diff --git a/core/src/main/java/org/openstack4j/api/identity/EndpointURLResolver.java b/core/src/main/java/org/openstack4j/api/identity/EndpointURLResolver.java index 7d759a5fd..708a03be0 100644 --- a/core/src/main/java/org/openstack4j/api/identity/EndpointURLResolver.java +++ b/core/src/main/java/org/openstack4j/api/identity/EndpointURLResolver.java @@ -4,7 +4,7 @@ /** * Resolves an Endpoint URL based on the Service Type and Facing perspective - * + * * @author Jeremy Unruh */ public interface EndpointURLResolver { @@ -18,15 +18,15 @@ public interface EndpointURLResolver { /** * Resolves the given ServiceType and Facing perspective down to a single URL used in identity v2 - * + * * @param params URLResolverParams containing mandatory and optional params * @return the URL of the Endpoint */ String findURLV2(URLResolverParams params); - + /** * Resolves the given ServiceType and Facing perspective down to a single URL used in identity v3 - * + * * @param params URLResolverParams containing mandatory and optional params * @return the URL of the Endpoint */ diff --git a/core/src/main/java/org/openstack4j/api/identity/v2/IdentityService.java b/core/src/main/java/org/openstack4j/api/identity/v2/IdentityService.java index 4fd82e49c..b6b9ae2f3 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v2/IdentityService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v2/IdentityService.java @@ -1,58 +1,58 @@ package org.openstack4j.api.identity.v2; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.Extension; import org.openstack4j.model.identity.v2.Endpoint; +import java.util.List; + /** * Identity Serivce Operations API - * + * * @author Jeremy Unruh */ public interface IdentityService extends RestService { - /** - * Tenants Service API - * - * @return the tenant service - */ - TenantService tenants(); - - /** - * Users Service API - * - * @return the user service - */ - UserService users(); - - /** - * Role Service API - * - * @return the role service - */ - RoleService roles(); - - /** - * Service Management API - * - * @return the service manager service - */ - ServiceManagerService services(); - - /** - * List extensions currently available on the OpenStack instance - * - * @return List of extensions - */ - List listExtensions(); - - /** - * Lists endpoints available for the current authenticated token - * - * @return List of endpoints - */ - List listTokenEndpoints(); - + /** + * Tenants Service API + * + * @return the tenant service + */ + TenantService tenants(); + + /** + * Users Service API + * + * @return the user service + */ + UserService users(); + + /** + * Role Service API + * + * @return the role service + */ + RoleService roles(); + + /** + * Service Management API + * + * @return the service manager service + */ + ServiceManagerService services(); + + /** + * List extensions currently available on the OpenStack instance + * + * @return List of extensions + */ + List listExtensions(); + + /** + * Lists endpoints available for the current authenticated token + * + * @return List of endpoints + */ + List listTokenEndpoints(); + } diff --git a/core/src/main/java/org/openstack4j/api/identity/v2/RoleService.java b/core/src/main/java/org/openstack4j/api/identity/v2/RoleService.java index 0ccc1b981..fc9e02be1 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v2/RoleService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v2/RoleService.java @@ -1,109 +1,110 @@ package org.openstack4j.api.identity.v2; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v2.Role; +import java.util.List; + /** * Identity Role based Operations - * + * * @author Jeremy Unruh */ public interface RoleService extends RestService { - /** - * Adds a global role to a user - * - * @param userId the user id - * @param roleId the role id to add - * @return the action response - */ - ActionResponse addUserRole(String userId, String roleId); - - /** - * Adds a tenant based role to a user - * - * @param tenantId the tenant id - * @param userId the user id - * @param roleId the role id - * @return the action response - */ - ActionResponse addUserRole(String tenantId, String userId, String roleId); + /** + * Adds a global role to a user + * + * @param userId the user id + * @param roleId the role id to add + * @return the action response + */ + ActionResponse addUserRole(String userId, String roleId); + + /** + * Adds a tenant based role to a user + * + * @param tenantId the tenant id + * @param userId the user id + * @param roleId the role id + * @return the action response + */ + ActionResponse addUserRole(String tenantId, String userId, String roleId); + + /** + * Removes a global role from a user + * + * @param userId the user id + * @param roleId the role id + * @return the action response + */ + ActionResponse removeUserRole(String userId, String roleId); + + /** + * Removes the user role from a user and the associated tenant + * + * @param tenantId the tenant id + * @param userId the user id + * @param roleId the role id + * @return the action response + */ + ActionResponse removeUserRole(String tenantId, String userId, String roleId); + + /** + * Lists the global roles + * + * @return the list + */ + List list(); + + /** + * List roles for user. + * + * @param userId the user id + * @return the list + */ + List listRolesForUser(String userId); + + /** + * List roles for user. + * + * @param userId the user id + * @param tenantId the tenant id + * @return the list + */ + List listRolesForUser(String userId, String tenantId); + + /** + * Delete a role by it's ID + * + * @param roleId the role id + * @param the action response + */ + ActionResponse delete(String roleId); + + /** + * Gets a role by ID + * + * @param roleId the role id + * @return the role + */ + Role get(String roleId); + + /** + * Gets a Role by Name + * + * @param name the name of the Role + * @return the Role or null if not found + */ + Role getByName(String name); - /** - * Removes a global role from a user - * - * @param userId the user id - * @param roleId the role id - * @return the action response - */ - ActionResponse removeUserRole(String userId, String roleId); - - /** - * Removes the user role from a user and the associated tenant - * - * @param tenantId the tenant id - * @param userId the user id - * @param roleId the role id - * @return the action response - */ - ActionResponse removeUserRole(String tenantId, String userId, String roleId); - - /** - * Lists the global roles - * - * @return the list - */ - List list(); - - /** - * List roles for user. - * - * @param userId the user id - * @return the list - */ - List listRolesForUser(String userId); - - /** - * List roles for user. - * - * @param userId the user id - * @param tenantId the tenant id - * @return the list - */ - List listRolesForUser(String userId, String tenantId); + /** + * Creates a new Role + * + * @param name the name of the role + * @return the role + */ + Role create(String name); - /** - * Delete a role by it's ID - * - * @param roleId the role id - * @param the action response - */ - ActionResponse delete(String roleId); - - /** - * Gets a role by ID - * - * @param roleId the role id - * @return the role - */ - Role get(String roleId); - - /** - * Gets a Role by Name - * @param name the name of the Role - * @return the Role or null if not found - */ - Role getByName(String name); - - /** - * Creates a new Role - * - * @param name the name of the role - * @return the role - */ - Role create(String name); - } diff --git a/core/src/main/java/org/openstack4j/api/identity/v2/ServiceManagerService.java b/core/src/main/java/org/openstack4j/api/identity/v2/ServiceManagerService.java index 42003cf45..af8bbe355 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v2/ServiceManagerService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v2/ServiceManagerService.java @@ -1,77 +1,77 @@ package org.openstack4j.api.identity.v2; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v2.Service; import org.openstack4j.model.identity.v2.ServiceEndpoint; +import java.util.List; + /** * Manages OpenStack service(s), such as Compute (Nova), Object Storage (Swift), or Image Service (Glance). - * + * * @author Jeremy Unruh */ public interface ServiceManagerService extends RestService { - /** - * List current Services on the OpenStack System - * - * @return the list - */ - List list(); - - /** - * Gets the specified Service by it's identifier - * - * @param serviceId the service id - * @return the service - */ - Service get(String serviceId); - - /** - * Creates a new Service - * - * @param name the name of the service - * @param type the type of service - * @param description the description for the service - * @return the service created - */ - Service create(String name, String type, String description); - - /** - * Deletes a Service based on it's id - * - * @param serviceId the service id - * @return the action response - */ - ActionResponse delete(String serviceId); - - /** - * Queries for service related Endpoints (endpoints mapped against services) - * - * @return List of ServiceEndpoint(s) - */ - List listEndpoints(); - - /** - * Creates a new Endpoint associated to a service identifier - * - * @param region the endpoint region - * @param serviceId the service identifier the endpoint is associated with - * @param publicURL the public URL - * @param adminURL the admin URL - * @param internalURL the internal URL - * @return the create service endpoint - */ - ServiceEndpoint createEndpoint(String region, String serviceId, String publicURL, String adminURL, String internalURL); - - /** - * Deletes an Endpoint - * - * @param endpointId the endpoint identifier - * @return the action response - */ - ActionResponse deleteEndpoint(String endpointId); - + /** + * List current Services on the OpenStack System + * + * @return the list + */ + List list(); + + /** + * Gets the specified Service by it's identifier + * + * @param serviceId the service id + * @return the service + */ + Service get(String serviceId); + + /** + * Creates a new Service + * + * @param name the name of the service + * @param type the type of service + * @param description the description for the service + * @return the service created + */ + Service create(String name, String type, String description); + + /** + * Deletes a Service based on it's id + * + * @param serviceId the service id + * @return the action response + */ + ActionResponse delete(String serviceId); + + /** + * Queries for service related Endpoints (endpoints mapped against services) + * + * @return List of ServiceEndpoint(s) + */ + List listEndpoints(); + + /** + * Creates a new Endpoint associated to a service identifier + * + * @param region the endpoint region + * @param serviceId the service identifier the endpoint is associated with + * @param publicURL the public URL + * @param adminURL the admin URL + * @param internalURL the internal URL + * @return the create service endpoint + */ + ServiceEndpoint createEndpoint(String region, String serviceId, String publicURL, String adminURL, String internalURL); + + /** + * Deletes an Endpoint + * + * @param endpointId the endpoint identifier + * @return the action response + */ + ActionResponse deleteEndpoint(String endpointId); + } diff --git a/core/src/main/java/org/openstack4j/api/identity/v2/TenantService.java b/core/src/main/java/org/openstack4j/api/identity/v2/TenantService.java index bda5737f0..0de5ea53a 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v2/TenantService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v2/TenantService.java @@ -1,71 +1,72 @@ package org.openstack4j.api.identity.v2; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v2.Tenant; import org.openstack4j.model.identity.v2.TenantUser; +import java.util.List; + /** * Identity Tenant based Operations - * + * * @author Jeremy Unruh */ public interface TenantService extends RestService { - /** - * Lists tenants to which the specified token has access. - * - * @return List of Tenants - */ - List list(); - - /** - * Gets detailed information about a specified tenant by ID - * - * @param tenantId the tenant id - * @return the tenant - */ - Tenant get(String tenantId); - - /** - * Gets detailed information about a specified tenant by name - * - * @param tenantName the tenant name - * @return the tenant - */ - Tenant getByName(String tenantName); - - /** - * Creates a new Tenant - * - * @param tenant the tenant to create - * @return the newly created tenant and it's assigned ID - */ - Tenant create(Tenant tenant); - - /** - * Deletes the specified tenant by ID - * - * @param tenantId the tenant id - * @return the action response - */ - ActionResponse delete(String tenantId); - - /** - * Updates the tenant (ID must be set within the inbound tenant) - * - * @param tenant the tenant - * @return the tenant - */ - Tenant update(Tenant tenant); - - /** - * Returns a list of users associated by the {@code tenantId} - * @param tenantId the tenant id to query users for - * @return List of TenantUser - */ - List listUsers(String tenantId); - + /** + * Lists tenants to which the specified token has access. + * + * @return List of Tenants + */ + List list(); + + /** + * Gets detailed information about a specified tenant by ID + * + * @param tenantId the tenant id + * @return the tenant + */ + Tenant get(String tenantId); + + /** + * Gets detailed information about a specified tenant by name + * + * @param tenantName the tenant name + * @return the tenant + */ + Tenant getByName(String tenantName); + + /** + * Creates a new Tenant + * + * @param tenant the tenant to create + * @return the newly created tenant and it's assigned ID + */ + Tenant create(Tenant tenant); + + /** + * Deletes the specified tenant by ID + * + * @param tenantId the tenant id + * @return the action response + */ + ActionResponse delete(String tenantId); + + /** + * Updates the tenant (ID must be set within the inbound tenant) + * + * @param tenant the tenant + * @return the tenant + */ + Tenant update(Tenant tenant); + + /** + * Returns a list of users associated by the {@code tenantId} + * + * @param tenantId the tenant id to query users for + * @return List of TenantUser + */ + List listUsers(String tenantId); + } diff --git a/core/src/main/java/org/openstack4j/api/identity/v2/UserService.java b/core/src/main/java/org/openstack4j/api/identity/v2/UserService.java index 8c9562ddc..71a9f4352 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v2/UserService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v2/UserService.java @@ -1,14 +1,14 @@ package org.openstack4j.api.identity.v2; -import java.util.List; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v2.Role; import org.openstack4j.model.identity.v2.User; +import java.util.List; + /** * Identity User based Operations - * + * * @author Jeremy Unruh */ public interface UserService { @@ -21,7 +21,8 @@ public interface UserService { */ User get(String userId); - /**API added by @ Sandeep Kumar Singh + /** + * API added by @ Sandeep Kumar Singh * Gets detailed information about a specified user by name * * @param userName the user name @@ -48,16 +49,17 @@ public interface UserService { * Creates a new User * * @param tenantId the tenant id - * @param name the name of the user + * @param name the name of the user * @param password the password for the user - * @param email the email address of the user - * @param enabled if true the user will be immediately enabled + * @param email the email address of the user + * @param enabled if true the user will be immediately enabled * @return the newly created user */ User create(String tenantId, String name, String password, String email, boolean enabled); /** * Creates a User + * * @param user the user to create * @return the newly created user */ @@ -69,12 +71,12 @@ public interface UserService { * @param userId the user id * @return the action response */ - ActionResponse delete(String userId); + ActionResponse delete(String userId); /** * Enables/Disables a user by ID * - * @param userId the user id + * @param userId the user id * @param enabled true to enable the user * @return the updated User */ @@ -91,7 +93,7 @@ public interface UserService { /** * Changes a password for the specified user by ID * - * @param userId the user id + * @param userId the user id * @param password the new password * @return the action response */ @@ -114,9 +116,9 @@ public interface UserService { List listRoles(User user); /** - * Lists the tenant roles for a specified user. + * Lists the tenant roles for a specified user. * - * @param userId the user id + * @param userId the user id * @param tenantId the tenant id * @return List of Role */ diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/CredentialService.java b/core/src/main/java/org/openstack4j/api/identity/v3/CredentialService.java index baeb9d178..6baf91b10 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/CredentialService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/CredentialService.java @@ -1,14 +1,13 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Credential; +import java.util.List; + /** * Identity V3 Credential service - * */ public interface CredentialService extends RestService { @@ -23,10 +22,10 @@ public interface CredentialService extends RestService { /** * Create a new credential * - * @param blob the credential itself as serialized blob - * @param type the credential type such as 'ec2', 'cert', .. + * @param blob the credential itself as serialized blob + * @param type the credential type such as 'ec2', 'cert', .. * @param projectId the id of the associated project - * @param userId the id of the user who owns the credential + * @param userId the id of the user who owns the credential * @return */ Credential create(String blob, String type, String projectId, String userId); diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/DomainService.java b/core/src/main/java/org/openstack4j/api/identity/v3/DomainService.java index 8c66d460b..f2499571a 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/DomainService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/DomainService.java @@ -1,14 +1,13 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.identity.v3.Domain; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.identity.v3.Domain; + +import java.util.List; /** * Identity V3 Domain Service - * */ public interface DomainService extends RestService { @@ -23,9 +22,9 @@ public interface DomainService extends RestService { /** * Creates a new domain * - * @param name the name of the new domain + * @param name the name of the new domain * @param description the description of the new domain - * @param enabled the enabled status of the new domain + * @param enabled the enabled status of the new domain * @return the new domain */ Domain create(String name, String description, boolean enabled); diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/GroupService.java b/core/src/main/java/org/openstack4j/api/identity/v3/GroupService.java index 898613c24..53a73bb89 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/GroupService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/GroupService.java @@ -1,17 +1,16 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Group; import org.openstack4j.model.identity.v3.Role; import org.openstack4j.model.identity.v3.User; +import java.util.List; + /** * Identity V3 Group Service - * */ public interface GroupService extends RestService { @@ -35,7 +34,7 @@ public interface GroupService extends RestService { * get detailed information about groups matching specified by name and domain * * @param groupName the group name - * @param domainId the domain id + * @param domainId the domain id * @return the of list groups matching the name in a specific domain or null if not found */ Group getByName(String groupName, String domainId); @@ -67,10 +66,9 @@ public interface GroupService extends RestService { /** * creates a new group * - * @param domainId the domain id - * @param name the group name + * @param domainId the domain id + * @param name the group name * @param description the description - * * @return the newly created group */ Group create(String domainId, String name, String description); @@ -92,7 +90,7 @@ public interface GroupService extends RestService { /** * list role for group on a project * - * @param groupId the group id + * @param groupId the group id * @param projectId the project id * @return the list of project roles for the group */ @@ -101,7 +99,7 @@ public interface GroupService extends RestService { /** * list roles for a group on a domain * - * @param groupId the group id + * @param groupId the group id * @param domainId the domain id * @return the list of domain roles for a group */ @@ -111,7 +109,7 @@ public interface GroupService extends RestService { * adds an existing user to a group * * @param groupId the group id - * @param userId the user id + * @param userId the user id * @return the ActionResponse */ ActionResponse addUserToGroup(String groupId, String userId); @@ -120,7 +118,7 @@ public interface GroupService extends RestService { * removes a user from a group * * @param groupId the group id - * @param userId the user id + * @param userId the user id * @return the ActionResponse */ ActionResponse removeUserFromGroup(String groupId, String userId); @@ -129,7 +127,7 @@ public interface GroupService extends RestService { * check whether a user belongs to a group * * @param groupId the group id - * @param userId the user id + * @param userId the user id * @return the ActionResponse */ ActionResponse checkGroupUser(String groupId, String userId); diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/IdentityService.java b/core/src/main/java/org/openstack4j/api/identity/v3/IdentityService.java index b0cd6776c..e6f721246 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/IdentityService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/IdentityService.java @@ -1,13 +1,12 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.Extension; +import java.util.List; + /** * Identity v3 Service Operations API - * */ public interface IdentityService extends RestService { @@ -52,10 +51,10 @@ public interface IdentityService extends RestService { * @return the group service */ GroupService groups(); - + /** * Token Service API - * + * * @return the token service */ TokenService tokens(); @@ -80,7 +79,7 @@ public interface IdentityService extends RestService { * @return the region service */ RegionService regions(); - + /** * List extensions currently available on the OpenStack instance * diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/PolicyService.java b/core/src/main/java/org/openstack4j/api/identity/v3/PolicyService.java index 30ab37766..e9c938c9a 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/PolicyService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/PolicyService.java @@ -1,10 +1,10 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.identity.v3.Policy; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.identity.v3.Policy; + +import java.util.List; public interface PolicyService extends RestService { @@ -19,10 +19,10 @@ public interface PolicyService extends RestService { /** * Create a policy * - * @param blob the policy rule itself as a serialized blob - * @param type the MIME media type of the serialized policy blob + * @param blob the policy rule itself as a serialized blob + * @param type the MIME media type of the serialized policy blob * @param projectId the uuid for the associated project - * @param userId the id of the user who owns the policy + * @param userId the id of the user who owns the policy * @return the newly created policy */ Policy create(String blob, String type, String projectId, String userId); @@ -47,7 +47,7 @@ public interface PolicyService extends RestService { * Delete a policy * * @param policyId the policy id - * @return the ActionResponse + * @return the ActionResponse */ ActionResponse delete(String policyId); diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/ProjectService.java b/core/src/main/java/org/openstack4j/api/identity/v3/ProjectService.java index c68e7c529..e21c68cd6 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/ProjectService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/ProjectService.java @@ -1,82 +1,81 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.identity.v3.Project; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.identity.v3.Project; + +import java.util.List; /** * Identity Project Service - * */ public interface ProjectService extends RestService { - /** - * Creates a new Project - * - * @param project the project to create - * @return the new Project including it's id - */ - Project create(Project project); + /** + * Creates a new Project + * + * @param project the project to create + * @return the new Project including it's id + */ + Project create(Project project); - /** - * Creates a new Project - * - * @param domainId the domain id - * @param name the name of the new project - * @param description the description of the new project - * @param enabled the enabled status of the new project - * @return the newly created project - */ - Project create(String domainId, String name, String description, boolean enabled); + /** + * Creates a new Project + * + * @param domainId the domain id + * @param name the name of the new project + * @param description the description of the new project + * @param enabled the enabled status of the new project + * @return the newly created project + */ + Project create(String domainId, String name, String description, boolean enabled); - /** - * get detailed information on a project - * - * @param projectId the project id - * @return the project - */ - Project get(String projectId); + /** + * get detailed information on a project + * + * @param projectId the project id + * @return the project + */ + Project get(String projectId); - /** - * get detailed information about projects machting specified name across all domains - * - * @param projectName the project name - * @return the list of projects matching the name across all domains - */ - List getByName(String projectName); + /** + * get detailed information about projects machting specified name across all domains + * + * @param projectName the project name + * @return the list of projects matching the name across all domains + */ + List getByName(String projectName); - /** + /** * get detailed information about a project specified by project name and domain id - * - * @param projectName the project name - * @param domainId the domain id - * @return the project or null if not found - */ - Project getByName(String projectName, String domainId); + * + * @param projectName the project name + * @param domainId the domain id + * @return the project or null if not found + */ + Project getByName(String projectName, String domainId); - /** - * updates an existing project - * - * @param project the project set to update - * @return the updated project - */ - Project update(Project project); + /** + * updates an existing project + * + * @param project the project set to update + * @return the updated project + */ + Project update(Project project); - /** - * delete a project by id - * - * @param projectId the project id - * @return the ActionResponse - */ - ActionResponse delete(String projectId); + /** + * delete a project by id + * + * @param projectId the project id + * @return the ActionResponse + */ + ActionResponse delete(String projectId); - /** - * list all projects the current token has access to - * - * @return list of projects - */ - List list(); + /** + * list all projects the current token has access to + * + * @return list of projects + */ + List list(); } diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/RegionService.java b/core/src/main/java/org/openstack4j/api/identity/v3/RegionService.java index 626a5baa5..1034e0834 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/RegionService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/RegionService.java @@ -1,14 +1,13 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.identity.v3.Region; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.identity.v3.Region; + +import java.util.List; /** * Identity V3 Region operations - * */ public interface RegionService extends RestService { @@ -23,8 +22,8 @@ public interface RegionService extends RestService { /** * Create a new region * - * @param regionId the user-defined region id - * @param description the description of the region + * @param regionId the user-defined region id + * @param description the description of the region * @param parentRegionId the region id of the parent region * @return the newly created region */ diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/RoleService.java b/core/src/main/java/org/openstack4j/api/identity/v3/RoleService.java index b6d41e852..276b66fbf 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/RoleService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/RoleService.java @@ -1,15 +1,14 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.identity.v3.Role; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.identity.v3.Role; import org.openstack4j.model.identity.v3.RoleAssignment; +import java.util.List; + /** * Identity Role based Operations - * */ public interface RoleService extends RestService { @@ -81,8 +80,8 @@ public interface RoleService extends RestService { * grants a role to a specified user in project context * * @param projectId the project id - * @param userId the user id - * @param roleId the role id + * @param userId the user id + * @param roleId the role id * @return the action response */ ActionResponse grantProjectUserRole(String projectId, String userId, String roleId); @@ -91,8 +90,8 @@ public interface RoleService extends RestService { * revokes a role to a specified user in project context * * @param projectId the project id - * @param userId the user id - * @param roleId the role id + * @param userId the user id + * @param roleId the role id * @return the action response */ ActionResponse revokeProjectUserRole(String projectId, String userId, String roleId); @@ -101,8 +100,8 @@ public interface RoleService extends RestService { * checks if a user has a specific role in a given project-context * * @param projectId the project id - * @param userId the user id - * @param roleId the role id + * @param userId the user id + * @param roleId the role id * @return the ActionResponse */ ActionResponse checkProjectUserRole(String projectId, String userId, String roleId); @@ -111,8 +110,8 @@ public interface RoleService extends RestService { * grants a role to a specified user in domain context * * @param domainId the domain id - * @param userId the user id - * @param roleId the role id + * @param userId the user id + * @param roleId the role id * @return the action response */ ActionResponse grantDomainUserRole(String domainId, String userId, String roleId); @@ -121,8 +120,8 @@ public interface RoleService extends RestService { * revokes a role to a specified user in domain context * * @param domainId the domain id - * @param userId the user id - * @param roleId the role id + * @param userId the user id + * @param roleId the role id * @return the action response */ ActionResponse revokeDomainUserRole(String domainId, String userId, String roleId); @@ -131,8 +130,8 @@ public interface RoleService extends RestService { * checks if a user has a specific role in a given domain-context * * @param domainId the domain id - * @param userId the user id - * @param roleId the role id + * @param userId the user id + * @param roleId the role id * @return the ActionResponse */ ActionResponse checkDomainUserRole(String domainId, String userId, String roleId); @@ -141,8 +140,8 @@ public interface RoleService extends RestService { * grants a role to a specified group in project context * * @param projectId the project id - * @param groupId the group id - * @param roleId the role id + * @param groupId the group id + * @param roleId the role id * @return the ActionResponse */ ActionResponse grantProjectGroupRole(String projectId, String groupId, String roleId); @@ -151,8 +150,8 @@ public interface RoleService extends RestService { * revokes a role from a specified group in project context * * @param projectId the project id - * @param groupId the group id - * @param roleId the role id + * @param groupId the group id + * @param roleId the role id * @return the ActionResponse */ ActionResponse revokeProjectGroupRole(String projectId, String groupId, String roleId); @@ -161,8 +160,8 @@ public interface RoleService extends RestService { * check if a group has a specific role in a given project * * @param projectId the project id - * @param groupId the group id - * @param roleId the role id + * @param groupId the group id + * @param roleId the role id * @return the ActionResponse */ ActionResponse checkProjectGroupRole(String projectId, String groupId, String roleId); @@ -171,8 +170,8 @@ public interface RoleService extends RestService { * grant a role to a specified group in domain context * * @param domainId the domain id - * @param groupId the group id - * @param roleId the role id + * @param groupId the group id + * @param roleId the role id * @return the ActionResponse */ ActionResponse grantDomainGroupRole(String domainId, String groupId, String roleId); @@ -181,8 +180,8 @@ public interface RoleService extends RestService { * revoke a role from a specified group in domain context * * @param domainId the domain id - * @param groupId the group id - * @param roleId the role id + * @param groupId the group id + * @param roleId the role id * @return the ActionResponse */ ActionResponse revokeDomainGroupRole(String domainId, String groupId, String roleId); @@ -191,8 +190,8 @@ public interface RoleService extends RestService { * checks if a group has a specific role in a given domain * * @param domainId the domain id - * @param groupId the group id - * @param roleId the role id + * @param groupId the group id + * @param roleId the role id * @return the ActionResponse */ ActionResponse checkDomainGroupRole(String domainId, String groupId, String roleId); diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/ServiceEndpointService.java b/core/src/main/java/org/openstack4j/api/identity/v3/ServiceEndpointService.java index b3cf8ec25..9e17460c0 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/ServiceEndpointService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/ServiceEndpointService.java @@ -1,17 +1,16 @@ package org.openstack4j.api.identity.v3; -import java.net.URL; -import java.util.List; - import org.openstack4j.api.types.Facing; import org.openstack4j.common.RestService; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Endpoint; import org.openstack4j.model.identity.v3.Service; -import org.openstack4j.model.common.ActionResponse; + +import java.net.URL; +import java.util.List; /** * Identity V3 ServiceManager - * */ public interface ServiceEndpointService extends RestService { @@ -26,10 +25,10 @@ public interface ServiceEndpointService extends RestService { /** * Creates a new service * - * @param type the type of the service - * @param name the name of the service + * @param type the type of the service + * @param name the name of the service * @param description the description of the service - * @param enabled the enabled status of the service + * @param enabled the enabled status of the service * @return the created service */ Service create(String type, String name, String description, boolean enabled); @@ -66,7 +65,6 @@ public interface ServiceEndpointService extends RestService { List list(); - /** * Lists available endpoints * @@ -85,12 +83,12 @@ public interface ServiceEndpointService extends RestService { /** * Creates a new endpoint * - * @param name the name of the endpoint - * @param url the url of the endpont - * @param iface the interface type of the endpoint - * @param regionId the region id of the region that contains the endpoint + * @param name the name of the endpoint + * @param url the url of the endpont + * @param iface the interface type of the endpoint + * @param regionId the region id of the region that contains the endpoint * @param serviceId the service id of the service the endpoint belongs to - * @param enabled the enabled status of the endpoint + * @param enabled the enabled status of the endpoint * @return */ Endpoint createEndpoint(String name, URL url, Facing iface, String regionId, String serviceId, boolean enabled); diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/TokenService.java b/core/src/main/java/org/openstack4j/api/identity/v3/TokenService.java index 2b1d61f37..f591b1a0b 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/TokenService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/TokenService.java @@ -11,29 +11,28 @@ /** * Identity V3 Token operations - * */ public interface TokenService extends RestService { - + /*** * Validates and shows information for a token. - * + * * @param tokenId the identifier of the token that is subject to be checked * @return the token if valid */ Token get(String tokenId); - + /** * Validates a token. - * + * * @param tokenId the identifier of the token that is subject to be checked * @return the ActionResponse */ ActionResponse check(String tokenId); - + /** * Revokes a token. - * + * * @param tokenId the identifier of the token that is going to be deleted * @return the ActionResponse */ @@ -57,8 +56,9 @@ public interface TokenService extends RestService { /** * Get available domain scopes for specified token - * @param tokenId the identifier of the token in question - * @return list of domains that are available to be scoped to + * + * @param tokenId the identifier of the token in question + * @return list of domains that are available to be scoped to */ List getDomainScopes(String tokenId); diff --git a/core/src/main/java/org/openstack4j/api/identity/v3/UserService.java b/core/src/main/java/org/openstack4j/api/identity/v3/UserService.java index b8adc1cd0..2d0190a70 100644 --- a/core/src/main/java/org/openstack4j/api/identity/v3/UserService.java +++ b/core/src/main/java/org/openstack4j/api/identity/v3/UserService.java @@ -1,46 +1,41 @@ package org.openstack4j.api.identity.v3; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.identity.v3.Domain; -import org.openstack4j.model.identity.v3.Group; -import org.openstack4j.model.identity.v3.Project; -import org.openstack4j.model.identity.v3.Role; -import org.openstack4j.model.identity.v3.User; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.identity.v3.*; + +import java.util.List; /** * identity/v3 User operations - * */ public interface UserService extends RestService { - /** - * gets detailed information about a specified user by id - * - * @param userId the user id - * @return the user - */ - User get(String userId); - - /** - * get detailed information about users matching specified name across all domains - * - * @param userName the user name - * @return the of list users matching the name across all domains - */ - List getByName(String userName); - - /** + /** + * gets detailed information about a specified user by id + * + * @param userId the user id + * @return the user + */ + User get(String userId); + + /** + * get detailed information about users matching specified name across all domains + * + * @param userName the user name + * @return the of list users matching the name across all domains + */ + List getByName(String userName); + + /** * get detailed information about a user specified by username and domain id * * @param userName the user name * @param domainId the domain identifier * @return the user or null if not found */ - User getByName(String userName, String domainId); + User getByName(String userName, String domainId); /** * delete a user by id @@ -48,89 +43,89 @@ public interface UserService extends RestService { * @param userid the userId * @return the action response */ - ActionResponse delete(String userId); - - /** - * updates the password for or enables or disables a specified user. - * - * @param user the user set to update - * @return the updated user - */ - User update(User user); - - /** - * create a new user - * - * @param user the user - * @return the newly created user - */ - User create(User user); - - /** - * creates a new user - * - * @param domainId the domain id - * @param name the name of the new user - * @param password the password of the new user - * @param email the email of the new user - * @param enabled the enabled of the new user - * @return the newly created user - */ - User create(String domainId, String name, String password, String email, boolean enabled); - - /** - * @param userId the user id - * @return the domain of the user - */ - Domain getUserDomain(String userId); - - /** - * lists groups for a specified user - * - * @param userId the user id - * @return list of groups for a user - */ - List listUserGroups(String userId); - - /** - * lists projects for a specified user - * - * @param user the user - * @return list of projects for a user - */ - List listUserProjects(String userId); - - /** - * list role assignments for specified user in project context - * - * @param userId the user id - * @param scope the scope (project,domain) - * @return list of role assignments for specified user - */ - List listProjectUserRoles(String userId, String projectId); - - /** - * list role assignment for specified user in domain context - * - * @param userId the user identifier - * @param domainId the domain identifier - * @return list of role assignments for specified user and domain - */ - List listDomainUserRoles(String userId, String domainId); - - /** - * lists users. - * - * @return list of users - */ - List list(); - - /** + ActionResponse delete(String userId); + + /** + * updates the password for or enables or disables a specified user. + * + * @param user the user set to update + * @return the updated user + */ + User update(User user); + + /** + * create a new user + * + * @param user the user + * @return the newly created user + */ + User create(User user); + + /** + * creates a new user + * + * @param domainId the domain id + * @param name the name of the new user + * @param password the password of the new user + * @param email the email of the new user + * @param enabled the enabled of the new user + * @return the newly created user + */ + User create(String domainId, String name, String password, String email, boolean enabled); + + /** + * @param userId the user id + * @return the domain of the user + */ + Domain getUserDomain(String userId); + + /** + * lists groups for a specified user + * + * @param userId the user id + * @return list of groups for a user + */ + List listUserGroups(String userId); + + /** + * lists projects for a specified user + * + * @param user the user + * @return list of projects for a user + */ + List listUserProjects(String userId); + + /** + * list role assignments for specified user in project context + * + * @param userId the user id + * @param scope the scope (project,domain) + * @return list of role assignments for specified user + */ + List listProjectUserRoles(String userId, String projectId); + + /** + * list role assignment for specified user in domain context + * + * @param userId the user identifier + * @param domainId the domain identifier + * @return list of role assignments for specified user and domain + */ + List listDomainUserRoles(String userId, String domainId); + + /** + * lists users. + * + * @return list of users + */ + List list(); + + /** * change password for user. * - * @param userId the user identifier + * @param userId the user identifier * @param originalPassword the original password - * @param password the new password + * @param password the new password * @return the action response */ ActionResponse changePassword(String userId, String originalPassword, String password); diff --git a/core/src/main/java/org/openstack4j/api/image/ImageService.java b/core/src/main/java/org/openstack4j/api/image/ImageService.java index d3f9e675d..e96b15c00 100644 --- a/core/src/main/java/org/openstack4j/api/image/ImageService.java +++ b/core/src/main/java/org/openstack4j/api/image/ImageService.java @@ -14,7 +14,7 @@ /** * OpenStack (Glance) Image based Operations - * + * * @author Jeremy Unruh */ public interface ImageService extends RestService { @@ -27,37 +27,38 @@ public interface ImageService extends RestService { List listChachedImages(); /** - * Lists public VM images by the default page size defined by openstack - * + * Lists public VM images by the default page size defined by openstack + * * @return list of images or empty */ List list(); /** * * Returns list of public VM images filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); + /** * Lists all public VM images - * + * * @return list of images or empty */ List listAll(); /** * * Returns list of public VM images filtered by parameters when the result greater than the default page size defined by openstack - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List listAll(Map filteringParams); /** * Gets an Image by ID - * + * * @param imageId the image identifier * @return the image or null if not found */ @@ -65,7 +66,7 @@ public interface ImageService extends RestService { /** * Deletes an Image by ID - * + * * @param imageId the image identifier * @return the action response */ @@ -73,7 +74,7 @@ public interface ImageService extends RestService { /** * Updates an Image. The image must have the id set or a validation exception will be thrown - * + * * @param image the image to update * @return the updated image */ @@ -81,14 +82,16 @@ public interface ImageService extends RestService { /** * Return the image date for the image by ID + * * @param imageId the image identifier * @return the input stream or null if not found */ InputStream getAsStream(String imageId); /** - * Creates a new Image - * @param image the image to create + * Creates a new Image + * + * @param image the image to create * @param payload the payload (image data to upload). Note: if the payload is null then {@link #reserve(Image)} will be called internally * @return the updated data from the newly stored image */ @@ -96,7 +99,7 @@ public interface ImageService extends RestService { /** * Reserves a new image to be uploaded later. See {@link #upload(String, Payload, Image)} - * + * * @param image the image to reserve * @return the updated data from the newly stored image */ @@ -109,16 +112,17 @@ public interface ImageService extends RestService { * image data can be added using this method. If the image already as data * associated with it (e.g. not in the queued state), then you will receive a * 409 Conflict exception - * + * * @param imageId the image identifier of the previously reserved image * @param payload the playload to upload - * @param image the optional Image which will be used to update meta data during this transaction + * @param image the optional Image which will be used to update meta data during this transaction * @return */ Image upload(String imageId, Payload payload, @Nullable Image image); /** * List of the other system tenants that may access a given virtual machine image that the Glance server knows about. + * * @param imageId the image identifer * @return List of ImageMember or empty */ @@ -126,8 +130,8 @@ public interface ImageService extends RestService { /** * Authorize a tenant to access a private image - * - * @param imageId the image identifier + * + * @param imageId the image identifier * @param tenantId the tenant * @return true if successful */ @@ -135,8 +139,8 @@ public interface ImageService extends RestService { /** * Authorize a tenant to access a private image - * - * @param imageId the image identifier + * + * @param imageId the image identifier * @param tenantId the tenant * @param canShare both existing and new memberships will have `can_share` set to the provided value * @return true if successful @@ -145,7 +149,8 @@ public interface ImageService extends RestService { /** * Revoke a tenant's right to access a private image. - * @param imageId the image identifier + * + * @param imageId the image identifier * @param tenantId the tenant to remove (identifier) * @return true if successful */ diff --git a/core/src/main/java/org/openstack4j/api/image/v2/ImageService.java b/core/src/main/java/org/openstack4j/api/image/v2/ImageService.java index 14f2fd6c3..96050a615 100644 --- a/core/src/main/java/org/openstack4j/api/image/v2/ImageService.java +++ b/core/src/main/java/org/openstack4j/api/image/v2/ImageService.java @@ -15,12 +15,14 @@ /** * OpenStack (Glance) Image V2 support + * * @author emjburns */ public interface ImageService extends RestService { /** * List all available operating system images + * * @return list of images */ List list(); @@ -29,21 +31,23 @@ public interface ImageService extends RestService { * Returns list of images filtered by parameters. * For filtering guidelines, see http://developer.openstack.org/api-ref/image/v2/index.html#show-images * To paginate, use "limit" and "marker" parameters + * * @param filteringParams map (name, value) of filtering parameters * @return list of images fitered by filteringParams */ List list(Map filteringParams); - + /** * List images currently in the glance image cache. * * @return list of cached images or empty list if the cache is empty or null if the cache is not enabled. */ - List listCachedImages() ; + List listCachedImages(); /** * Show details for an image by imageid. * The image must exist + * * @param imageId * @return the image */ @@ -51,6 +55,7 @@ public interface ImageService extends RestService { /** * Creates a catalog record for an operating system disk image. + * * @param image * @return Image */ @@ -58,6 +63,7 @@ public interface ImageService extends RestService { /** * Update image by providing the changed image object. + * * @param image * @return image */ @@ -67,6 +73,7 @@ public interface ImageService extends RestService { * Update an image by building the string of json operations * that represent the json transformation * instead of the building the whole image + * * @param imageId * @param imageUpdate * @return Image @@ -76,6 +83,7 @@ public interface ImageService extends RestService { /** * Deletes an image. * You cannot delete images with the protected attribute set to true (boolean). + * * @param imageId */ ActionResponse delete(String imageId); @@ -84,12 +92,14 @@ public interface ImageService extends RestService { * Deactivate an image * If you try to download a deactivated image, you will receive a 403 (Forbidden) response code. * Additionally, only administrative users can view image locations for deactivated images. + * * @param imageId */ ActionResponse deactivate(String imageId); /** * Reactivate an image + * * @param imageId * @return */ @@ -98,6 +108,7 @@ public interface ImageService extends RestService { /** * List members of a particular image. * These members are projects or tenants that can see the image. + * * @param imageId * @return List of members */ @@ -106,6 +117,7 @@ public interface ImageService extends RestService { /** * List members of a particular image. * These members are projects or tenants that can see the image. + * * @param imageId * @return List of members */ @@ -114,14 +126,16 @@ public interface ImageService extends RestService { /** * The image must exist, be private, and be owned by the author of the request. * Otherwise, this will fail. - * @param imageId the image to share + * + * @param imageId the image to share * @param memberId - * @return member + * @return member */ Member createMember(String imageId, String memberId); /** * Get details about a member + * * @param imageId * @param memberId * @return member @@ -131,6 +145,7 @@ public interface ImageService extends RestService { /** * Change status of an image member * For more details see http://specs.openstack.org/openstack/glance-specs/specs/api/v2/sharing-image-api-v2.html + * * @param imageId * @param memberId * @param memberStatus @@ -140,6 +155,7 @@ public interface ImageService extends RestService { /** * You must be the owner of the image to delete the member + * * @param imageId * @param memberId */ @@ -148,6 +164,7 @@ public interface ImageService extends RestService { /** * Add tag to image. * Can also be done with ImagesService#update(image) + * * @param imageId * @param tag * @return @@ -157,6 +174,7 @@ public interface ImageService extends RestService { /** * Delete tag from image. * Can also be done with ImagesService#update(image) + * * @param imageId * @param tag * @return @@ -165,6 +183,7 @@ public interface ImageService extends RestService { /** * Uploads binary image data + * * @param imageId * @param payload * @param image @@ -174,6 +193,7 @@ public interface ImageService extends RestService { /** * Downloads binary image data + * * @param imageId * @param filename * @return diff --git a/core/src/main/java/org/openstack4j/api/image/v2/TaskService.java b/core/src/main/java/org/openstack4j/api/image/v2/TaskService.java index eb79b70df..4391547ee 100644 --- a/core/src/main/java/org/openstack4j/api/image/v2/TaskService.java +++ b/core/src/main/java/org/openstack4j/api/image/v2/TaskService.java @@ -8,11 +8,13 @@ /** * Image (Glance) V2 Tasks Api + * * @author emjburns */ public interface TaskService extends RestService { /** * List tasks + * * @return a list of tasks. */ List list(); @@ -21,6 +23,7 @@ public interface TaskService extends RestService { * List tasks filtering by parameters. * Use these parameters to do pagination as described in * http://developer.openstack.org/api-ref/image/v2/index.html#list-tasks + * * @param filteringParams * @return a list of tasks */ @@ -28,6 +31,7 @@ public interface TaskService extends RestService { /** * Show details for a task. + * * @param taskId * @return a specific task */ @@ -35,6 +39,7 @@ public interface TaskService extends RestService { /** * Create a task + * * @return the task */ Task create(Task task); diff --git a/core/src/main/java/org/openstack4j/api/magnum/MagnumService.java b/core/src/main/java/org/openstack4j/api/magnum/MagnumService.java index 407b0aefb..2462d56ca 100644 --- a/core/src/main/java/org/openstack4j/api/magnum/MagnumService.java +++ b/core/src/main/java/org/openstack4j/api/magnum/MagnumService.java @@ -1,45 +1,36 @@ package org.openstack4j.api.magnum; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.magnum.Bay; -import org.openstack4j.model.magnum.Baymodel; -import org.openstack4j.model.magnum.Carequest; -import org.openstack4j.model.magnum.Certificate; -import org.openstack4j.model.magnum.Cluster; -import org.openstack4j.model.magnum.Clustertemplate; -import org.openstack4j.model.magnum.Container; -import org.openstack4j.model.magnum.Mservice; -import org.openstack4j.model.magnum.Pod; +import org.openstack4j.model.magnum.*; + +import java.util.List; /** * OpenStack Container Infrastructure Management service (Magnum) APIs - * - * @author Sohan Sangwan * + * @author Sohan Sangwan */ public interface MagnumService extends RestService { /** * Lists all Magnum Services: container infrastructure service status * details - * + * * @return list of Magnum Services */ List listMservices(); /** * Lists all Baymodels - * + * * @return list of Baymodels */ List listBaymodels(); /** * Creates a new baymodel - * + * * @param baymodel * @return */ @@ -47,7 +38,7 @@ public interface MagnumService extends RestService { /** * Deletes a baymodel - * + * * @param id * @return */ @@ -55,33 +46,31 @@ public interface MagnumService extends RestService { /** * Gets all information of a baymodel - * + * * @param id - * * @return baymodel information */ Baymodel showBaymodel(String id); /** * Updates baymodel attributes - * + * * @param id * @param operations - * * @return updated baymodel */ Baymodel updateBaymodel(String id, String operations); /** * Lists all Bays/clusters - * + * * @return list of Bays */ List listBays(); /** * Creates a new bay - * + * * @param bay * @return newly created bay */ @@ -89,23 +78,23 @@ public interface MagnumService extends RestService { /** * Deletes a bay - * + * * @param id * @return */ ActionResponse deleteBay(String id); - + /** * Show a bay - * + * * @param id - * @return bay + * @return bay */ Bay showBay(String id); - + /** * Update bay - * + * * @param id * @param operations * @return @@ -113,16 +102,17 @@ public interface MagnumService extends RestService { Bay updateBay(String id, String operations); // Containers + /** * Lists all Containers - * + * * @return list of Containers */ List listContainers(); /** * Creates a new Container - * + * * @param baymodel * @return newly created Container */ @@ -130,7 +120,7 @@ public interface MagnumService extends RestService { /** * Deletes a Container - * + * * @param id * @return success/failure response */ @@ -138,7 +128,7 @@ public interface MagnumService extends RestService { /** * Execute command in a Container - * + * * @param id * @param cmd * @return output of the command @@ -147,7 +137,7 @@ public interface MagnumService extends RestService { /** * Get logs of a Container - * + * * @param id * @return logs */ @@ -155,7 +145,7 @@ public interface MagnumService extends RestService { /** * Pause a Container - * + * * @param id * @return paused Container */ @@ -163,7 +153,7 @@ public interface MagnumService extends RestService { /** * Unpause a Container - * + * * @param id * @return paused Container */ @@ -171,7 +161,7 @@ public interface MagnumService extends RestService { /** * Reboot a Container - * + * * @param id * @return rebooted Container */ @@ -179,7 +169,7 @@ public interface MagnumService extends RestService { /** * Start a Container - * + * * @param id * @return Container */ @@ -187,177 +177,177 @@ public interface MagnumService extends RestService { /** * Stop a Container - * + * * @param id * @return Container */ Container stopContainer(String id); - + /** * Show a Container - * + * * @param id * @return Container */ Container showContainer(String id); - + /** * Update a container - * + * * @param id * @param operations * @return */ Container updateContainer(String id, String operations); - + /** * Gets certificate - * + * * @param uuid of a bay or cluster * @return certificate */ Certificate getCertificate(String uuid); - + /** * Generates certificate - * - * @param ca request + * + * @param ca request * @return certificate */ Certificate signCertificate(Carequest ca); - + /** - * Rotate the CA certificate for a bay/cluster and + * Rotate the CA certificate for a bay/cluster and * invalidate all user certificates. - * + * * @param uuid of a bay or cluster * @return status */ ActionResponse rotateCertificate(String uuid); - + //New clusters APIs - + /** * Create new cluster based on cluster template - * + * * @param cluster * @return */ Cluster createCluster(Cluster cluster); - + /** * List all clusters - * + * * @return */ List listClusters(); - + /** * Get all information of a cluster in Magnum - * + * * @param id of the cluster * @return cluster */ Cluster showCluster(String id); - + /** * Delete a cluster. - * + * * @param id of the cluster * @return success status */ ActionResponse deleteCluster(String id); - + /** * Update information of one cluster attributes using operations - * including: ``add``, ``replace`` or ``remove``. + * including: ``add``, ``replace`` or ``remove``. * The attributes to ``add`` and * ``replace`` in the form of ``key=value`` while ``remove`` only needs the keys. - * + * * @param id * @param operations * @return updated cluster */ Cluster updateCluster(String id, String operations); - + //Cluster templates + /** * Create new cluster template + * * @param template * @return newly created cluster template */ Clustertemplate createClustertemplate(Clustertemplate template); - + /** * List all cluster templates - * + * * @return list of cluster templates */ List listClustertemplate(); - + /** * Delete a cluster template - * - * @param id of the clustertemplate + * + * @param id of the clustertemplate * @return status */ ActionResponse deleteClustertemplate(String id); - + /** * Update information of one cluster template attributes using operations * including: ``add``, ``replace`` or ``remove``. The attributes to ``add`` and * ``replace`` in the form of ``key=value`` while ``remove`` only needs the keys. - * + * * @param cluster template - * * @return updated clustser template */ Clustertemplate updateClustertemplate(String id, String operations); - + // Pod (group of containers) APIs - + /** * List all pods - * + * * @return list of pods */ List listPods(String bayUuid); - + /** * Create a pod - * + * * @param pod * @return pod */ Pod createPod(Pod pod); - + /** * Delete a pod - * + * * @param bayUuid * @param id * @return status */ ActionResponse deletePod(String bayUuid, String id); - + /** * Show a pod - * + * * @param bayUuid * @param id * @return pod */ Pod showPod(String bayUuid, String id); - + /** * Update a pod - * + * * @param bayUuid * @param id * @return pod */ Pod updatePod(String bayUuid, String id, String operations); - - + } diff --git a/core/src/main/java/org/openstack4j/api/manila/QuotaSetService.java b/core/src/main/java/org/openstack4j/api/manila/QuotaSetService.java index b392d09db..9c620ce9a 100644 --- a/core/src/main/java/org/openstack4j/api/manila/QuotaSetService.java +++ b/core/src/main/java/org/openstack4j/api/manila/QuotaSetService.java @@ -23,7 +23,7 @@ public interface QuotaSetService extends RestService { * Shows quotas for a user in a tenant. * * @param tenantId the UUID for the tenant for which you want to show quotas - * @param userId the UUID of the user + * @param userId the UUID of the user * @return the quota set */ QuotaSet get(String tenantId, String userId); @@ -41,34 +41,34 @@ public interface QuotaSetService extends RestService { * Updates quotas for a user in a tenant. * * @param tenantId the UUID for the tenant for which you want to update quotas - * @param userId the UUID of the user + * @param userId the UUID of the user * @param options the options to update * @return the updated quota set */ QuotaSet update(String tenantId, String userId, QuotaSetUpdateOptions options); - /** - * Deletes quotas for a tenant. The quota reverts to the default quota. - * - * @param tenantId the UUID for the tenant for which you want to delete quotas - * @return the action response - */ - ActionResponse delete(String tenantId); + /** + * Deletes quotas for a tenant. The quota reverts to the default quota. + * + * @param tenantId the UUID for the tenant for which you want to delete quotas + * @return the action response + */ + ActionResponse delete(String tenantId); - /** - * Deletes quotas for a user in a tenant. The quota reverts to the default quota. - * - * @param tenantId the UUID for the tenant for which you want to delete quotas - * @param userId the UUID of the user - * @return the action response - */ - ActionResponse delete(String tenantId, String userId); + /** + * Deletes quotas for a user in a tenant. The quota reverts to the default quota. + * + * @param tenantId the UUID for the tenant for which you want to delete quotas + * @param userId the UUID of the user + * @return the action response + */ + ActionResponse delete(String tenantId, String userId); - /** - * Shows default quotas for a tenant. - * - * @param tenantId the UUID for the tenant for which you want to show default quotas - * @return the default quota set - */ + /** + * Shows default quotas for a tenant. + * + * @param tenantId the UUID for the tenant for which you want to show default quotas + * @return the default quota set + */ QuotaSet getDefault(String tenantId); } diff --git a/core/src/main/java/org/openstack4j/api/manila/SchedulerStatsService.java b/core/src/main/java/org/openstack4j/api/manila/SchedulerStatsService.java index d8e7d9081..ef0f50f42 100644 --- a/core/src/main/java/org/openstack4j/api/manila/SchedulerStatsService.java +++ b/core/src/main/java/org/openstack4j/api/manila/SchedulerStatsService.java @@ -20,6 +20,7 @@ public interface SchedulerStatsService extends RestService { /** * Lists all storage pools for a back end, with details. + * * @return a list of all back-end storage pools with details */ List poolsDetail(); diff --git a/core/src/main/java/org/openstack4j/api/manila/SecurityServiceService.java b/core/src/main/java/org/openstack4j/api/manila/SecurityServiceService.java index c2069a235..772bfc19a 100644 --- a/core/src/main/java/org/openstack4j/api/manila/SecurityServiceService.java +++ b/core/src/main/java/org/openstack4j/api/manila/SecurityServiceService.java @@ -48,7 +48,7 @@ public interface SecurityServiceService extends RestService { /** * Updates a security service. * - * @param securityServiceId the security service id + * @param securityServiceId the security service id * @param securityServiceUpdateOptions the options to update on the security service * @return the updated security service */ diff --git a/core/src/main/java/org/openstack4j/api/manila/ShareInstanceService.java b/core/src/main/java/org/openstack4j/api/manila/ShareInstanceService.java index a8aa673c8..d2eeea0b9 100644 --- a/core/src/main/java/org/openstack4j/api/manila/ShareInstanceService.java +++ b/core/src/main/java/org/openstack4j/api/manila/ShareInstanceService.java @@ -31,7 +31,7 @@ public interface ShareInstanceService extends RestService { * Administrator only. Explicitly updates the state of a share instance. * * @param shareInstanceId the share instance ID - * @param status the status to set + * @param status the status to set * @return the action response */ ActionResponse resetState(String shareInstanceId, ShareInstance.Status status); diff --git a/core/src/main/java/org/openstack4j/api/manila/ShareNetworkService.java b/core/src/main/java/org/openstack4j/api/manila/ShareNetworkService.java index 3dba5391e..7ad7772b1 100644 --- a/core/src/main/java/org/openstack4j/api/manila/ShareNetworkService.java +++ b/core/src/main/java/org/openstack4j/api/manila/ShareNetworkService.java @@ -49,7 +49,7 @@ public interface ShareNetworkService extends RestService { /** * Updates a share network. * - * @param shareNetworkId the share network ID + * @param shareNetworkId the share network ID * @param shareNetworkUpdateOptions the options to update on the share network * @return the updated share network */ @@ -66,7 +66,7 @@ public interface ShareNetworkService extends RestService { /** * Adds a security service to a share network. * - * @param shareNetworkId the share network ID + * @param shareNetworkId the share network ID * @param securityServiceId the security service ID * @return the share network the security service was added to */ @@ -75,7 +75,7 @@ public interface ShareNetworkService extends RestService { /** * Removes a security service from a share network. * - * @param shareNetworkId the share network ID + * @param shareNetworkId the share network ID * @param securityServiceId the security service ID * @return the share network the security service was removed from */ diff --git a/core/src/main/java/org/openstack4j/api/manila/ShareService.java b/core/src/main/java/org/openstack4j/api/manila/ShareService.java index 3df52c34b..27835aea0 100644 --- a/core/src/main/java/org/openstack4j/api/manila/ShareService.java +++ b/core/src/main/java/org/openstack4j/api/manila/ShareService.java @@ -1,8 +1,8 @@ package org.openstack4j.api.manila; import org.openstack4j.common.RestService; -import org.openstack4j.model.common.Extension; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.common.Extension; import org.openstack4j.model.manila.*; import org.openstack4j.openstack.manila.domain.ManilaService; @@ -75,7 +75,7 @@ public interface ShareService extends RestService { * Enables a service. * * @param binary the name of the service binary that you want to enable - * @param host the host name of the service that you want to enable + * @param host the host name of the service that you want to enable * @return the status of the enabled service */ ManilaService.ServiceStatus enableService(String binary, String host); @@ -84,7 +84,7 @@ public interface ShareService extends RestService { * Disables a service. * * @param binary the name of the service binary that you want to disable - * @param host the host name of the service that you want to disable + * @param host the host name of the service that you want to disable * @return the status of the disabled service */ ManilaService.ServiceStatus disableService(String binary, String host); diff --git a/core/src/main/java/org/openstack4j/api/manila/ShareSnapshotService.java b/core/src/main/java/org/openstack4j/api/manila/ShareSnapshotService.java index bd1ad2c9c..fed3a6d6a 100644 --- a/core/src/main/java/org/openstack4j/api/manila/ShareSnapshotService.java +++ b/core/src/main/java/org/openstack4j/api/manila/ShareSnapshotService.java @@ -47,7 +47,7 @@ public interface ShareSnapshotService extends RestService { /** * Updates a share snapshot. * - * @param snapshotId the snapshot ID + * @param snapshotId the snapshot ID * @param snapshotUpdateOptions the options to update on the snapshot * @return the snapshot */ @@ -65,7 +65,7 @@ public interface ShareSnapshotService extends RestService { * Administrator only. Explicitly updates the state of a share snapshot. * * @param snapshotId the snapshot ID - * @param status the status to set + * @param status the status to set * @return the action response */ ActionResponse resetState(String snapshotId, ShareSnapshot.Status status); diff --git a/core/src/main/java/org/openstack4j/api/manila/ShareTypeService.java b/core/src/main/java/org/openstack4j/api/manila/ShareTypeService.java index 340f9e3b9..5d8f3cc47 100644 --- a/core/src/main/java/org/openstack4j/api/manila/ShareTypeService.java +++ b/core/src/main/java/org/openstack4j/api/manila/ShareTypeService.java @@ -65,7 +65,7 @@ public interface ShareTypeService extends RestService { /** * Unsets an extra specification for the share type. * - * @param shareTypeId the share type ID + * @param shareTypeId the share type ID * @param extraSpecKey the key of the extra specification to unset * @return the action response */ @@ -75,7 +75,7 @@ public interface ShareTypeService extends RestService { * Adds share type access for a project. * * @param shareTypeId the share type ID - * @param projectId the project ID + * @param projectId the project ID * @return the action response */ ActionResponse addShareTypeAccess(String shareTypeId, String projectId); @@ -84,7 +84,7 @@ public interface ShareTypeService extends RestService { * Removes share type access from a project. * * @param shareTypeId the share type ID - * @param projectId the project ID + * @param projectId the project ID * @return the action response */ ActionResponse removeShareTypeAccess(String shareTypeId, String projectId); diff --git a/core/src/main/java/org/openstack4j/api/manila/SharesService.java b/core/src/main/java/org/openstack4j/api/manila/SharesService.java index e21734f5d..850173f60 100644 --- a/core/src/main/java/org/openstack4j/api/manila/SharesService.java +++ b/core/src/main/java/org/openstack4j/api/manila/SharesService.java @@ -51,7 +51,7 @@ public interface SharesService extends RestService { /** * Updates a share. * - * @param shareId the share ID + * @param shareId the share ID * @param shareUpdateOptions the options to update on the share * @return the updated share */ @@ -68,7 +68,7 @@ public interface SharesService extends RestService { /** * Deletes a share. * - * @param shareId the share ID + * @param shareId the share ID * @param consistencyGroupId the UUID of the consistency group where the share was created * @return the action response */ @@ -85,7 +85,7 @@ public interface SharesService extends RestService { /** * Updates the metadata for a share. * - * @param shareId the share ID + * @param shareId the share ID * @param metadata the metadata to update * @return the updated metadata */ @@ -94,7 +94,7 @@ public interface SharesService extends RestService { /** * Sets the metadata on a share. * - * @param shareId the share ID + * @param shareId the share ID * @param metadata the metadata to set * @return the updated metadata */ @@ -103,7 +103,7 @@ public interface SharesService extends RestService { /** * Unsets the metadata on a share. * - * @param shareId the share ID + * @param shareId the share ID * @param metadataKey the metadata key to unset * @return the action response */ @@ -121,14 +121,14 @@ public interface SharesService extends RestService { /** * Revokes access from a share. * - * @param shareId the share ID + * @param shareId the share ID * @param accessId the access ID to revoke * @return the action response */ ActionResponse revokeAccess(String shareId, String accessId); /** - * List access rules for a share. + * List access rules for a share. * * @param shareId the share ID * @return a list fo all access rules for the given share @@ -137,8 +137,9 @@ public interface SharesService extends RestService { /** * Administrators only. Explicitly updates the state of a share. + * * @param shareId the share ID - * @param status the status to set + * @param status the status to set * @return the action response */ ActionResponse resetState(String shareId, Share.Status status); diff --git a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoActionService.java b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoActionService.java index 1f537bd1e..3848a8023 100644 --- a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoActionService.java +++ b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoActionService.java @@ -14,17 +14,18 @@ public interface MuranoActionService extends RestService { /** * List all actions in current environment * - * @param envId the environment identifier + * @param envId the environment identifier * @param serviceId the service identifier * @return list of actions or null. */ List list(String envId, String serviceId); + List list(String envId); /** * List action in current environment by its ID. * - * @param envId the environment identifier + * @param envId the environment identifier * @param actionId the action identifier * @return Action instance or null */ @@ -34,7 +35,7 @@ public interface MuranoActionService extends RestService { * Tries to find action with specific name. * Returns the first occurrence of given action name. * - * @param envId the environment identifier + * @param envId the environment identifier * @param actionName the name of action * @return Action instance */ @@ -43,7 +44,7 @@ public interface MuranoActionService extends RestService { /** * Tries to find all actions with given name. * - * @param envId the environment identifier + * @param envId the environment identifier * @param actionName the name of action * @return Action list or empty list in case of not found */ @@ -52,18 +53,20 @@ public interface MuranoActionService extends RestService { /** * Send signal to run the action and return the taskId * - * @param envId environment identifier + * @param envId environment identifier * @param actionId action identifier * @return String with taskId */ String cast(String envId, String actionId); + String cast(String envId, String actionId, String jsonString); + String cast(String envId, String actionId, Map arguments); /** * Gets the result of running action. * - * @param envId environment identifier + * @param envId environment identifier * @param taskId task id * @return Action result instance */ @@ -74,11 +77,13 @@ public interface MuranoActionService extends RestService { * cast() -> getResult() * Starts an action and wait for the result. * - * @param envId environment identifier + * @param envId environment identifier * @param actionId action identifier * @return Action result instance */ ActionResult run(String envId, String actionId); + ActionResult run(String envId, String actionId, String jsonString); + ActionResult run(String envId, String actionId, Map arguments); } diff --git a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoApplicationService.java b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoApplicationService.java index 9e81d9d07..ad87c30a9 100644 --- a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoApplicationService.java +++ b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoApplicationService.java @@ -15,7 +15,7 @@ public interface MuranoApplicationService extends RestService { * List all services * * @param environmentId the environment identifier - * @param sessionId the session identifier + * @param sessionId the session identifier * @return list of environments or empty list */ List list(String environmentId, String sessionId); @@ -24,9 +24,10 @@ public interface MuranoApplicationService extends RestService { /** * Gets services by environmentId + * * @param environmentId the environment identifier - * @param path the path identifier - * @param sessionId the session identifier + * @param path the path identifier + * @param sessionId the session identifier * @return the list of requested services (this is a general case for services().get() ) */ List get(String environmentId, String path, String sessionId); @@ -37,14 +38,13 @@ public interface MuranoApplicationService extends RestService { * Creates a new service * * @param environmentId the environment to create - * @param sessionId session identifier - * @param data service data structure (object model) + * @param sessionId session identifier + * @param data service data structure (object model) * @return the created service */ Application create(String environmentId, String sessionId, Map data); /** - * * @param jsonString raw String containing the apps configuration. * @return the list of created services. */ @@ -54,19 +54,20 @@ public interface MuranoApplicationService extends RestService { * Updates services * * @param environmentId environment identifier - * @param sessionId session identifier - * @param data service data structure (object model) + * @param sessionId session identifier + * @param data service data structure (object model) * @return create service */ Application update(String environmentId, String sessionId, Map data); + List update(String environmentId, String sessionId, String jsonString); /** * Deletes the specified service * * @param environmentId the environment identifier - * @param path the path identifier - * @param sessionId the session identifier + * @param path the path identifier + * @param sessionId the session identifier * @return the action response */ ActionResponse delete(String environmentId, String path, String sessionId); diff --git a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoDeploymentService.java b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoDeploymentService.java index ab51848a4..23427ad3d 100644 --- a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoDeploymentService.java +++ b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoDeploymentService.java @@ -22,10 +22,11 @@ public interface MuranoDeploymentService extends RestService { * Get the reports (deployment logs) of the specified deployment. * * @param environmentId environment id. - * @param deploymentId deployment id. - * @param serviceIds (optional) list of service ids. + * @param deploymentId deployment id. + * @param serviceIds (optional) list of service ids. * @return Report list. */ List reports(String environmentId, String deploymentId, List serviceIds); + List reports(String environmentId, String deploymentId); } diff --git a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoEnvironmentService.java b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoEnvironmentService.java index eb2aa7aae..b55ccc4cc 100644 --- a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoEnvironmentService.java +++ b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoEnvironmentService.java @@ -25,6 +25,7 @@ public interface MuranoEnvironmentService extends RestService { /** * Gets an environment by ID + * * @param id the environment identifier * @return the cluster or null if not found */ diff --git a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoSessionService.java b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoSessionService.java index c92141dca..2131bc090 100644 --- a/core/src/main/java/org/openstack4j/api/murano/v1/MuranoSessionService.java +++ b/core/src/main/java/org/openstack4j/api/murano/v1/MuranoSessionService.java @@ -20,7 +20,7 @@ public interface MuranoSessionService extends RestService { * Gets session details. * * @param environmentId environment identifier. - * @param sessionId session identifier. + * @param sessionId session identifier. * @return Session object. */ AppCatalogSession get(String environmentId, String sessionId); @@ -29,7 +29,7 @@ public interface MuranoSessionService extends RestService { * Sends signal to deploy to OpenStack. * * @param environmentId environment identifier. - * @param sessionId session identifier. + * @param sessionId session identifier. * @return ActionResponse (status 200 in case of success) */ ActionResponse deploy(String environmentId, String sessionId); @@ -38,7 +38,7 @@ public interface MuranoSessionService extends RestService { * Deletes a configuration session. * * @param environmentId environment identifier. - * @param sessionId session identifier. + * @param sessionId session identifier. * @return ActionResponse (status 200 in case of success) */ ActionResponse delete(String environmentId, String sessionId); diff --git a/core/src/main/java/org/openstack4j/api/networking/AvailabilityZoneService.java b/core/src/main/java/org/openstack4j/api/networking/AvailabilityZoneService.java index a8442055a..1ac57d486 100644 --- a/core/src/main/java/org/openstack4j/api/networking/AvailabilityZoneService.java +++ b/core/src/main/java/org/openstack4j/api/networking/AvailabilityZoneService.java @@ -1,22 +1,21 @@ package org.openstack4j.api.networking; -import java.util.List; import org.openstack4j.common.RestService; import org.openstack4j.model.network.AvailabilityZone; -import org.openstack4j.openstack.networking.domain.NeutronAvailabilityZone; + +import java.util.List; /** * Neutron Availability Zone Service - * - * @author Taemin * + * @author Taemin */ public interface AvailabilityZoneService extends RestService { - /** + /** * List all availability zone that the current neutron has. - * + * * @return list of all availability zones * @author Taemin */ diff --git a/core/src/main/java/org/openstack4j/api/networking/NetFloatingIPService.java b/core/src/main/java/org/openstack4j/api/networking/NetFloatingIPService.java index 0efe46b34..2c6a6eb0e 100644 --- a/core/src/main/java/org/openstack4j/api/networking/NetFloatingIPService.java +++ b/core/src/main/java/org/openstack4j/api/networking/NetFloatingIPService.java @@ -1,12 +1,12 @@ package org.openstack4j.api.networking; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.NetFloatingIP; +import java.util.List; +import java.util.Map; + /** * Provides Neutron-based FloatingIP services. @@ -15,63 +15,63 @@ */ public interface NetFloatingIPService extends RestService { - /** - * Returns list of floating IPs. - * - * @return List of NetFloatingIPs or empty - */ - List list(); - - /** - * Returns list of floating IPs filtered by parameters. - * - * @param filteringParams map (name, value) of filtering parameters - * @return - */ - List list(Map filteringParams); - - /** - * Gets a NetFloatingIP by id. - * - * @param id the floating-ip identifier - * @return the NetFloatingIP - */ - NetFloatingIP get(String id); - - - /** - * Deletes NetFloatingIP by id. - * - * @param id the id - * @return the action response - */ - ActionResponse delete(String id); - - - /** - * Creates a new Floating IP - * - * @param floatingIp the floating ip - * @return the net floating ip - */ - NetFloatingIP create(NetFloatingIP floatingIp); - - - /** - * Associates a Floating IP to a Port. - * - * @param floatingIp the floating ip - * @return the net floating ip - */ - NetFloatingIP associateToPort(String id, String portId); - - - /** - * Deassociate's from port. - * - * @param floatingIp the floating ip - * @return the net floating ip - */ - NetFloatingIP disassociateFromPort(String id); - + /** + * Returns list of floating IPs. + * + * @return List of NetFloatingIPs or empty + */ + List list(); + + /** + * Returns list of floating IPs filtered by parameters. + * + * @param filteringParams map (name, value) of filtering parameters + * @return + */ + List list(Map filteringParams); + + /** + * Gets a NetFloatingIP by id. + * + * @param id the floating-ip identifier + * @return the NetFloatingIP + */ + NetFloatingIP get(String id); + + + /** + * Deletes NetFloatingIP by id. + * + * @param id the id + * @return the action response + */ + ActionResponse delete(String id); + + + /** + * Creates a new Floating IP + * + * @param floatingIp the floating ip + * @return the net floating ip + */ + NetFloatingIP create(NetFloatingIP floatingIp); + + + /** + * Associates a Floating IP to a Port. + * + * @param floatingIp the floating ip + * @return the net floating ip + */ + NetFloatingIP associateToPort(String id, String portId); + + + /** + * Deassociate's from port. + * + * @param floatingIp the floating ip + * @return the net floating ip + */ + NetFloatingIP disassociateFromPort(String id); + } diff --git a/core/src/main/java/org/openstack4j/api/networking/NetworkService.java b/core/src/main/java/org/openstack4j/api/networking/NetworkService.java index bceada78f..2690e0bde 100644 --- a/core/src/main/java/org/openstack4j/api/networking/NetworkService.java +++ b/core/src/main/java/org/openstack4j/api/networking/NetworkService.java @@ -1,69 +1,68 @@ package org.openstack4j.api.networking; -import java.util.List; -import java.util.Map; - import org.openstack4j.api.Builders; import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.Network; import org.openstack4j.model.network.NetworkUpdate; +import java.util.List; +import java.util.Map; + /** * OpenStack (Neutron) Network based Operations - * + * * @author Jeremy Unruh */ public interface NetworkService extends RestService { - - /** - * @author HY(huangyi813 @ qq.com) - * Lists the networks to which the current authorized tenant has access - * @param filteringParams map (name, value) of filtering parameters - * - * @return List of Network - */ - List list(Map filteringParams); - - /** - * Lists the networks to which the current authorized tenant has access - * - * @return List of Network - */ - List list(); - - /** - * Gets the network by ID - * - * @param networkId the network identifier - * @return the Network or null if not found - */ - Network get(String networkId); - - /** - * Updates a network associated by the specified {@code networkId} - * - * @param networkId the network identifier - * @param network the network options to update (see {@link Builders#networkUpdate()} - * @return the updated network - */ - Network update(String networkId, NetworkUpdate network); - - /** - * Deletes a specified network and its associated resources - * - * @param networkId the network identifier - * @return the action response - */ - ActionResponse delete(String networkId); + /** + * @param filteringParams map (name, value) of filtering parameters + * @return List of Network + * @author HY(huangyi813 @ qq.com) + * Lists the networks to which the current authorized tenant has access + */ + List list(Map filteringParams); + + + /** + * Lists the networks to which the current authorized tenant has access + * + * @return List of Network + */ + List list(); + + /** + * Gets the network by ID + * + * @param networkId the network identifier + * @return the Network or null if not found + */ + Network get(String networkId); + + /** + * Updates a network associated by the specified {@code networkId} + * + * @param networkId the network identifier + * @param network the network options to update (see {@link Builders#networkUpdate()} + * @return the updated network + */ + Network update(String networkId, NetworkUpdate network); + + /** + * Deletes a specified network and its associated resources + * + * @param networkId the network identifier + * @return the action response + */ + ActionResponse delete(String networkId); + + /** + * Creates a new Network + * + * @param network the network to create + * @return the newly created network + */ + Network create(Network network); - /** - * Creates a new Network - * - * @param network the network to create - * @return the newly created network - */ - Network create(Network network); - } diff --git a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java index 296d07ec0..9d4fb9e50 100644 --- a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java +++ b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java @@ -1,15 +1,11 @@ package org.openstack4j.api.networking; -import org.openstack4j.api.networking.ext.AgentService; -import org.openstack4j.api.networking.ext.FirewallAsService; -import org.openstack4j.api.networking.ext.LbaasV2Service; -import org.openstack4j.api.networking.ext.LoadBalancerService; -import org.openstack4j.api.networking.ext.NetQuotaService; +import org.openstack4j.api.networking.ext.*; import org.openstack4j.common.RestService; /** * OpenStack Networking Operations API - * + * * @author Jeremy Unruh */ public interface NetworkingService extends RestService { @@ -40,13 +36,11 @@ public interface NetworkingService extends RestService { NetFloatingIPService floatingip(); /** - * * @return the Security Group Service API */ SecurityGroupService securitygroup(); /** - * * @return the Security Group Rule Service API */ SecurityGroupRuleService securityrule(); @@ -55,14 +49,13 @@ public interface NetworkingService extends RestService { * @return the network quota service */ NetQuotaService quotas(); - + /** * @return the LBaaS service */ LoadBalancerService loadbalancers(); - + /** - * * @return the Neutron agent API */ AgentService agent(); @@ -74,11 +67,11 @@ public interface NetworkingService extends RestService { /** *

OpenStack Firewall As a Service (FwaaS) : Firewall Operations API

- * + * * @return the FwaaS service */ FirewallAsService firewalls(); - + /** * @return the Availability Zone Service API */ diff --git a/core/src/main/java/org/openstack4j/api/networking/PortService.java b/core/src/main/java/org/openstack4j/api/networking/PortService.java index 89562efb2..e6c08628a 100644 --- a/core/src/main/java/org/openstack4j/api/networking/PortService.java +++ b/core/src/main/java/org/openstack4j/api/networking/PortService.java @@ -1,68 +1,71 @@ package org.openstack4j.api.networking; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.Port; import org.openstack4j.model.network.options.PortListOptions; +import java.util.List; + /** * OpenStack (Neutron) Port based Operations - * + * * @author Jeremy Unruh */ public interface PortService extends RestService { - /** - * Lists all Ports authorized by the current Tenant - * - * @return the list of ports - */ - List list(); + /** + * Lists all Ports authorized by the current Tenant + * + * @return the list of ports + */ + List list(); - /** + /** * Lists all Ports authorized by the current Tenant * * @param options filtering options * @return the list of ports */ List list(PortListOptions options); - - /** - * Gets the Port by ID - * - * @param portId the port identifier - * @return the port or null if not found - */ - Port get(String portId); - - /** - * Delete a Port by ID - * - * @param portId the port identifier to delete - * @return the action response - */ - ActionResponse delete(String portId); - - /** - * Creates a new Port - * @param port the port to create - * @return the newly create Port - */ - Port create(Port port); - /** - * Creates new Ports - * @param ports the ports to create - * @return the newly created Ports - */ - List create(List ports); - - /** - * Updates an existing Port. The Port identifier must be set on the port object to be successful - * @param port the port to update - * @return the updated port - */ - Port update(Port port); + /** + * Gets the Port by ID + * + * @param portId the port identifier + * @return the port or null if not found + */ + Port get(String portId); + + /** + * Delete a Port by ID + * + * @param portId the port identifier to delete + * @return the action response + */ + ActionResponse delete(String portId); + + /** + * Creates a new Port + * + * @param port the port to create + * @return the newly create Port + */ + Port create(Port port); + + /** + * Creates new Ports + * + * @param ports the ports to create + * @return the newly created Ports + */ + List create(List ports); + + /** + * Updates an existing Port. The Port identifier must be set on the port object to be successful + * + * @param port the port to update + * @return the updated port + */ + Port update(Port port); } diff --git a/core/src/main/java/org/openstack4j/api/networking/RouterService.java b/core/src/main/java/org/openstack4j/api/networking/RouterService.java index 10b2b85da..d641015ac 100644 --- a/core/src/main/java/org/openstack4j/api/networking/RouterService.java +++ b/core/src/main/java/org/openstack4j/api/networking/RouterService.java @@ -1,95 +1,99 @@ package org.openstack4j.api.networking; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.AttachInterfaceType; import org.openstack4j.model.network.Router; import org.openstack4j.model.network.RouterInterface; +import java.util.List; + /** * Provides Neutron Router based Service Operations - * + * * @author Jeremy Unruh */ public interface RouterService extends RestService { - /** - * This operation returns a list of routers to which the tenant has access. Default policy settings return only those routers - * that are owned by the tenant who submits the request, unless the request is submitted by an user with administrative rights. - * - * @return List of Routers or empty list - */ - List list(); - - /** - * Gets a Router by ID - * - * @param routerId the router identifier - * @return Router or null if not found - */ - Router get(String routerId); - - /** - * Deletes the specified Router by ID - * - * @param routerId the router identifier to delete - * @return the action response - */ - ActionResponse delete(String routerId); + /** + * This operation returns a list of routers to which the tenant has access. Default policy settings return only those routers + * that are owned by the tenant who submits the request, unless the request is submitted by an user with administrative rights. + * + * @return List of Routers or empty list + */ + List list(); + + /** + * Gets a Router by ID + * + * @param routerId the router identifier + * @return Router or null if not found + */ + Router get(String routerId); + + /** + * Deletes the specified Router by ID + * + * @param routerId the router identifier to delete + * @return the action response + */ + ActionResponse delete(String routerId); + + /** + * Creates a basic router with minimal params + * + * @param name the name of the router + * @param adminStateUp the initial administrative state + * @return the newly create router + */ + Router create(String name, boolean adminStateUp); + + /** + * Creates a Router + * + * @param router the router to create + * @return the newly created router + */ + Router create(Router router); + + /** + * Updates a Router. Based on the OpenStack API documentation only [ name, admin_state_up and external_gateway_info ] will be updated. + *

+ * NOTE: The router identifier must be set in the {@code router}. See {@link Router#setId(String)} + * + * @param router the router to update + * @return the updated router + */ + Router update(Router router); + + /** + * Toggles the Administrative state by Router ID + * + * @param routerId the router identifier + * @param adminStateUp true to enable the administrative state up + * @return the updated router + */ + Router toggleAdminStateUp(String routerId, boolean adminStateUp); + + /** + * Attaches a Subnet or Port to the specified router + * + * @param routerId the router identifier + * @param type the type of {@code portOrSubnetId} identifier + * @param portOrSubnetId the port or subnet identifier + * @return the newly created router interface + */ + RouterInterface attachInterface(String routerId, AttachInterfaceType type, String portOrSubnetId); - /** - * Creates a basic router with minimal params - * - * @param name the name of the router - * @param adminStateUp the initial administrative state - * @return the newly create router - */ - Router create(String name, boolean adminStateUp); - - /** - * Creates a Router - * @param router the router to create - * @return the newly created router - */ - Router create(Router router); - - /** - * Updates a Router. Based on the OpenStack API documentation only [ name, admin_state_up and external_gateway_info ] will be updated. - * - * NOTE: The router identifier must be set in the {@code router}. See {@link Router#setId(String)} - * @param router the router to update - * @return the updated router - */ - Router update(Router router); - - /** - * Toggles the Administrative state by Router ID - * @param routerId the router identifier - * @param adminStateUp true to enable the administrative state up - * @return the updated router - */ - Router toggleAdminStateUp(String routerId, boolean adminStateUp); - - /** - * Attaches a Subnet or Port to the specified router - * @param routerId the router identifier - * @param type the type of {@code portOrSubnetId} identifier - * @param portOrSubnetId the port or subnet identifier - * @return the newly created router interface - */ - RouterInterface attachInterface(String routerId, AttachInterfaceType type, String portOrSubnetId); - - /** - * Removes an internal router interface, which detaches a subnet from the router. Either a subnet or port is allowed to be set and or both. At least one - * subnet or port identifier must be set or else a validation exception will be thrown. - * - * @param routerId the router identifier - * @param subnetId the subnet identifier - * @param portId the port identifier - * @return the router interface that was detached - * @throws ClientResponseException if one of the specified identifiers does not exist - */ - RouterInterface detachInterface(String routerId, String subnetId, String portId); + /** + * Removes an internal router interface, which detaches a subnet from the router. Either a subnet or port is allowed to be set and or both. At least one + * subnet or port identifier must be set or else a validation exception will be thrown. + * + * @param routerId the router identifier + * @param subnetId the subnet identifier + * @param portId the port identifier + * @return the router interface that was detached + * @throws ClientResponseException if one of the specified identifiers does not exist + */ + RouterInterface detachInterface(String routerId, String subnetId, String portId); } diff --git a/core/src/main/java/org/openstack4j/api/networking/SecurityGroupRuleService.java b/core/src/main/java/org/openstack4j/api/networking/SecurityGroupRuleService.java index 3442f5f9e..bde64032d 100644 --- a/core/src/main/java/org/openstack4j/api/networking/SecurityGroupRuleService.java +++ b/core/src/main/java/org/openstack4j/api/networking/SecurityGroupRuleService.java @@ -1,11 +1,11 @@ package org.openstack4j.api.networking; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.network.SecurityGroupRule; +import java.util.List; +import java.util.Map; + /** * Provides Neutron-based Security Group Rule services. @@ -13,43 +13,43 @@ * @author Nathan Anderson */ public interface SecurityGroupRuleService extends RestService { - - /** - * List security group rules accessible by current Tenant. - * - * @return the list - */ - List list(); - - /** - * Gets the Security Group rule by id - * - * @param id the id - * @return the security group rule - */ - SecurityGroupRule get(String id); - - /** - * Delete security group rule by id. - * - * @param id the id - */ - void delete(String id); - - /** - * Creates a security group rule. - * - * @param rule the rule - * @return the security group rule - */ - SecurityGroupRule create(SecurityGroupRule rule); - - /** - * List security group rules accessible by current Tenant. - * @param filteringParams map (name, value) of filtering parameters - * - * @return the list - */ - List list(Map filteringParams); - + + /** + * List security group rules accessible by current Tenant. + * + * @return the list + */ + List list(); + + /** + * Gets the Security Group rule by id + * + * @param id the id + * @return the security group rule + */ + SecurityGroupRule get(String id); + + /** + * Delete security group rule by id. + * + * @param id the id + */ + void delete(String id); + + /** + * Creates a security group rule. + * + * @param rule the rule + * @return the security group rule + */ + SecurityGroupRule create(SecurityGroupRule rule); + + /** + * List security group rules accessible by current Tenant. + * + * @param filteringParams map (name, value) of filtering parameters + * @return the list + */ + List list(Map filteringParams); + } diff --git a/core/src/main/java/org/openstack4j/api/networking/SecurityGroupService.java b/core/src/main/java/org/openstack4j/api/networking/SecurityGroupService.java index 573c1c0ec..bb93039c1 100644 --- a/core/src/main/java/org/openstack4j/api/networking/SecurityGroupService.java +++ b/core/src/main/java/org/openstack4j/api/networking/SecurityGroupService.java @@ -1,14 +1,14 @@ package org.openstack4j.api.networking; -import java.util.List; -import java.util.Map; - import org.openstack4j.api.Builders; import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.SecurityGroup; import org.openstack4j.model.network.SecurityGroupUpdate; +import java.util.List; +import java.util.Map; + /** * Provides Neutron-based Security Group services. @@ -58,8 +58,8 @@ public interface SecurityGroupService extends RestService { /** * Get list of security groups accessible by the current tenant - * @param filteringParams map (name, value) of filtering parameters * + * @param filteringParams map (name, value) of filtering parameters * @return the list */ List list(Map filteringParams); diff --git a/core/src/main/java/org/openstack4j/api/networking/SubnetService.java b/core/src/main/java/org/openstack4j/api/networking/SubnetService.java index 543a8c0c0..440d6cca7 100644 --- a/core/src/main/java/org/openstack4j/api/networking/SubnetService.java +++ b/core/src/main/java/org/openstack4j/api/networking/SubnetService.java @@ -1,14 +1,14 @@ package org.openstack4j.api.networking; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.Subnet; +import java.util.List; + /** * OpenStack (Neutron) Subnet based Operations - * + * * @author Jeremy Unruh */ public interface SubnetService extends RestService { @@ -22,7 +22,7 @@ public interface SubnetService extends RestService { /** * Gets a Subnet by ID - * + * * @param subnetId the subnet identifier * @return the Subnet or null if not found */ @@ -30,7 +30,7 @@ public interface SubnetService extends RestService { /** * Delete a Subnet by ID - * + * * @param subnetId the subnet identifier to delete * @return the action response */ @@ -38,29 +38,29 @@ public interface SubnetService extends RestService { /** * Creates a new Subnet - * + * * @param subnet the subnet to create * @return the newly created subnet */ Subnet create(Subnet subnet); /** - * Updates a Subnet. + * Updates a Subnet. *

* Example:
* Subnet updateSN = update(existingSubnet.toBuilder().someChange(change).build()); - * + * * @param subnet the subnet to update * @return the new subnet info */ Subnet update(Subnet subnet); - + /** * This method is needed if you are updating a subnet without pre-fetching the subnet prior. * See example at {@linkplain #update(Subnet)} - * + * * @param subnetId the subnet identifier to update - * @param subnet the subnet to update + * @param subnet the subnet to update * @return the updated subnet */ Subnet update(String subnetId, Subnet subnet); diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/AgentService.java b/core/src/main/java/org/openstack4j/api/networking/ext/AgentService.java index 7d2436bad..8c4ef4808 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/AgentService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/AgentService.java @@ -1,10 +1,11 @@ package org.openstack4j.api.networking.ext; -import java.util.List; import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.Agent; +import java.util.List; + /** * Networking (Neutron) Agent Extension API * @@ -31,23 +32,25 @@ public interface AgentService extends RestService { * Sets the admin_state_up. * * @param agentId the id of the agent to set state for - * @param state the state to set + * @param state the state to set * @return a new reference to the updated agent */ Agent setAdminStateUp(String agentId, boolean state); - + /** * Schedules the network to that the specified DHCP agent. - * @param agentId the id of agent with type DHCP - * @param networkId the id of network + * + * @param agentId the id of agent with type DHCP + * @param networkId the id of network * @return the action response */ ActionResponse attachNetworkToDhcpAgent(String agentId, String networkId); - + /** * Removes the network from that the specified DHCP agent. - * @param agentId the id of agent with type DHCP - * @param networkId the id of network + * + * @param agentId the id of agent with type DHCP + * @param networkId the id of network * @return the action response */ ActionResponse detachNetworkToDhcpAgent(String agentId, String networkId); diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallAsService.java b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallAsService.java index 40d8e60ba..c30284048 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallAsService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallAsService.java @@ -4,64 +4,64 @@ /** *

OpenStack Firewall As a Service (FwaaS) Operations API.

- * + * *

- * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: - *

    - *
  • Apply firewall rules on traffic entering and leaving tenant networks.
  • - *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • - *
  • Creation and sharing of firewall policies which hold an ordered collection of the firewall rules.
  • - *
  • Audit firewall rules and policies.
  • - *
+ * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: + *
    + *
  • Apply firewall rules on traffic entering and leaving tenant networks.
  • + *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • + *
  • Creation and sharing of firewall policies which hold an ordered collection of the firewall rules.
  • + *
  • Audit firewall rules and policies.
  • + *
*

- * + * *

- * This extension introduces these resources: - *

    - *
  • Firewall: represents a logical firewall resource that a tenant can instantiate and manage. - * A firewall is associated with one firewall policy. - *
  • - *
  • Firewall Policy: is an ordered collection of firewall_rules. - * A firewall policy can be shared across tenants. Thus it can also be made part of an audit workflow wherein the - * firewall policy can be audited by the relevant entity that is authorized (and can be different from the tenants - * which create or use the firewall policy). - *
  • - *
  • Firewall Rule: represents a collection of attributes like ports, - * ip addresses which define match criteria and action (allow, or deny) that needs to be taken on the matched data traffic. - *
  • - *
+ * This extension introduces these resources: + *
    + *
  • Firewall: represents a logical firewall resource that a tenant can instantiate and manage. + * A firewall is associated with one firewall policy. + *
  • + *
  • Firewall Policy: is an ordered collection of firewall_rules. + * A firewall policy can be shared across tenants. Thus it can also be made part of an audit workflow wherein the + * firewall policy can be audited by the relevant entity that is authorized (and can be different from the tenants + * which create or use the firewall policy). + *
  • + *
  • Firewall Rule: represents a collection of attributes like ports, + * ip addresses which define match criteria and action (allow, or deny) that needs to be taken on the matched data traffic. + *
  • + *
*

- * + * * @author Vishvesh Deshmukh */ public interface FirewallAsService extends RestService { /** *

OpenStack Firewall As a Service (FwaaS) : Firewall Operations API

- * + * *

Represents a logical firewall resource that a tenant can instantiate and manage. A firewall is associated with one firewall policy.

- * + * * @return the Firewall Service API */ FirewallService firewall(); /** *

OpenStack Firewall As a Service (FwaaS) : Firewall Rule Operations API

- * - *

Represents a collection of attributes like ports, ip addresses which define match - * criteria and action (allow, or deny) that needs to be taken on the matched data traffic

- * + * + *

Represents a collection of attributes like ports, ip addresses which define match + * criteria and action (allow, or deny) that needs to be taken on the matched data traffic

+ * * @return the Firewall Rule Service API */ - FirewallRuleService firewallrule(); + FirewallRuleService firewallrule(); /** *

OpenStack Firewall As a Service (FwaaS) : Firewall Policy Operations API

- * - *

Represents an ordered collection of firewall rules. A firewall policy can be shared across tenants. - * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the - * relevant entity that is authorized (and can be different from the tenants which create or use the firewall policy). - * + * + *

Represents an ordered collection of firewall rules. A firewall policy can be shared across tenants. + * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the + * relevant entity that is authorized (and can be different from the tenants which create or use the firewall policy). + * * @return the Firewall Policy Service API */ FirewallPolicyService firewallpolicy(); diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallPolicyService.java b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallPolicyService.java index 4470e9238..2b7e244e8 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallPolicyService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallPolicyService.java @@ -1,32 +1,32 @@ package org.openstack4j.api.networking.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.FirewallPolicy; import org.openstack4j.model.network.ext.FirewallPolicyUpdate; import org.openstack4j.openstack.networking.domain.ext.FirewallRuleStrategy.RuleInsertStrategyType; +import java.util.List; +import java.util.Map; + /** *

Networking (Neutron) FwaaS FirewallPolicy Policy Extension API

- * - *

Represents an ordered collection of FirewallPolicy rules. A FirewallPolicy policy can be shared across tenants. - * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the - * relevant entity that is authorized (and can be different from the tenants which create or use the FirewallPolicy policy). + * + *

Represents an ordered collection of FirewallPolicy rules. A FirewallPolicy policy can be shared across tenants. + * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the + * relevant entity that is authorized (and can be different from the tenants which create or use the FirewallPolicy policy). *

- * + * *

- * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: - *

    - *
  • Apply FirewallPolicy rules on traffic entering and leaving tenant networks.
  • - *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • - *
  • Creation and sharing of FirewallPolicy policies which hold an ordered collection of the FirewallPolicy rules.
  • - *
  • Audit FirewallPolicy rules and policies.
  • - *
+ * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: + *
    + *
  • Apply FirewallPolicy rules on traffic entering and leaving tenant networks.
  • + *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • + *
  • Creation and sharing of FirewallPolicy policies which hold an ordered collection of the FirewallPolicy rules.
  • + *
  • Audit FirewallPolicy rules and policies.
  • + *
*

- * + * * @author Vishvesh Deshmukh */ public interface FirewallPolicyService extends RestService { @@ -39,7 +39,7 @@ public interface FirewallPolicyService extends RestService { /** * Returns list of FirewallPolicy(s) filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters * @return filtered list of FirewallPolicy(s) */ @@ -52,24 +52,27 @@ public interface FirewallPolicyService extends RestService { * @return the FirewallPolicy or null if not found */ FirewallPolicy get(String firewallPolicyId); - + /** * Delete the specified FirewallPolicy by ID + * * @param firewallPolicyId the FirewallPolicy identifier * @return the action response */ ActionResponse delete(String firewallPolicyId); - + /** * Create a FirewallPolicy - * @param FirewallPolicy + * + * @param FirewallPolicy * @return FirewallPolicy */ FirewallPolicy create(FirewallPolicy firewallPolicy); - + /** * Update a FirewallPolicy - * @param firewallPolicyId the FirewallPolicy identifier + * + * @param firewallPolicyId the FirewallPolicy identifier * @param firewallPolicyUpdate FirewallUpdate * @return FirewallPolicy */ @@ -77,20 +80,22 @@ public interface FirewallPolicyService extends RestService { /** * Inserts a firewall rule in a firewall policy relative to the position of other rules. - * @param firewallPolicyId rule inserted in FirewallPolicy - * @param firewallRuleId rule to be inserted - * @param type {@link RuleInsertStrategyType} + * + * @param firewallPolicyId rule inserted in FirewallPolicy + * @param firewallRuleId rule to be inserted + * @param type {@link RuleInsertStrategyType} * @param insertAfterOrBeforeRuleId rule id where the new firewallRule will be inserted/switched from * @return FirewallPolicy */ - FirewallPolicy insertFirewallRuleInPolicy(String firewallPolicyId, String firewallRuleId, - RuleInsertStrategyType type, String insertAfterOrBeforeRuleId); + FirewallPolicy insertFirewallRuleInPolicy(String firewallPolicyId, String firewallRuleId, + RuleInsertStrategyType type, String insertAfterOrBeforeRuleId); /** * Removes a firewall rule from a firewall policy. + * * @param firewallPolicyId - * @param firewallRuleId rule to be deleted. + * @param firewallRuleId rule to be deleted. * @return FirewallPolicy */ - FirewallPolicy removeFirewallRuleFromPolicy(String firewallPolicyId, String firewallRuleId); + FirewallPolicy removeFirewallRuleFromPolicy(String firewallPolicyId, String firewallRuleId); } diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallRuleService.java b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallRuleService.java index 394331c22..9e314bff5 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallRuleService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallRuleService.java @@ -1,29 +1,29 @@ package org.openstack4j.api.networking.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.FirewallRule; import org.openstack4j.model.network.ext.FirewallRuleUpdate; +import java.util.List; +import java.util.Map; + /** *

Networking (Neutron) FwaaS FirewallRule Rule Extension API

- * - *

Represents a collection of attributes like ports, ip addresses which define match - * criteria and action (allow, or deny) that needs to be taken on the matched data traffic.

- * + * + *

Represents a collection of attributes like ports, ip addresses which define match + * criteria and action (allow, or deny) that needs to be taken on the matched data traffic.

+ * *

- * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: - *

    - *
  • Apply FirewallRule rules on traffic entering and leaving tenant networks.
  • - *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • - *
  • Creation and sharing of FirewallRule policies which hold an ordered collection of the FirewallRule rules.
  • - *
  • Audit FirewallRule rules and policies.
  • - *
+ * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: + *
    + *
  • Apply FirewallRule rules on traffic entering and leaving tenant networks.
  • + *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • + *
  • Creation and sharing of FirewallRule policies which hold an ordered collection of the FirewallRule rules.
  • + *
  • Audit FirewallRule rules and policies.
  • + *
*

- * + * * @author Vishvesh Deshmukh */ public interface FirewallRuleService extends RestService { @@ -36,7 +36,7 @@ public interface FirewallRuleService extends RestService { /** * Returns list of FirewallRules(s) filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters * @return filtered list of FirewallRules(s) */ @@ -49,24 +49,27 @@ public interface FirewallRuleService extends RestService { * @return the FirewallRule or null if not found */ FirewallRule get(String firewallRuleId); - + /** * Delete the specified FirewallRule by ID + * * @param firewallRuleId the FirewallRule identifier * @return the action response */ ActionResponse delete(String firewallRuleId); - + /** * Create a FirewallRule + * * @param firewallRule * @return FirewallRule */ FirewallRule create(FirewallRule firewallRule); - + /** * Update a FirewallRule - * @param firewallRuleId the FirewallRule identifier + * + * @param firewallRuleId the FirewallRule identifier * @param firewallRuleUpdate firewallRuleUpdate * @return FirewallRule */ diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallService.java b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallService.java index 1c8d96ec0..9c5cb38aa 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/FirewallService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/FirewallService.java @@ -1,28 +1,28 @@ package org.openstack4j.api.networking.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.Firewall; import org.openstack4j.model.network.ext.FirewallUpdate; +import java.util.List; +import java.util.Map; + /** *

Networking (Neutron) FwaaS Firewall Extension API.

- * + * *

Represents a logical firewall resource that a tenant can instantiate and manage. A firewall is associated with one firewall policy.

- * + * *

- * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: - *

    - *
  • Apply firewall rules on traffic entering and leaving tenant networks.
  • - *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • - *
  • Creation and sharing of firewall policies which hold an ordered collection of the firewall rules.
  • - *
  • Audit firewall rules and policies.
  • - *
+ * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: + *
    + *
  • Apply firewall rules on traffic entering and leaving tenant networks.
  • + *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • + *
  • Creation and sharing of firewall policies which hold an ordered collection of the firewall rules.
  • + *
  • Audit firewall rules and policies.
  • + *
*

- * + * * @author Vishvesh Deshmukh */ public interface FirewallService extends RestService { @@ -35,7 +35,7 @@ public interface FirewallService extends RestService { /** * Returns list of Firewall(s) filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters * @return filtered list of Firewall(s) */ @@ -48,24 +48,27 @@ public interface FirewallService extends RestService { * @return the Firewall or null if not found */ Firewall get(String firewallId); - + /** * Delete the specified Firewall by ID + * * @param firewallId the Firewall identifier * @return the action response */ ActionResponse delete(String firewallId); - + /** * Create a Firewall - * @param firewall + * + * @param firewall * @return Firewall */ Firewall create(Firewall firewall); - + /** * Update a Firewall - * @param firewallId the Firewall identifier + * + * @param firewallId the Firewall identifier * @param firewallUpdate FirewallUpdate * @return Firewall */ diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/FlowClassifierService.java b/core/src/main/java/org/openstack4j/api/networking/ext/FlowClassifierService.java index b03a24450..5a27989e4 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/FlowClassifierService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/FlowClassifierService.java @@ -1,17 +1,15 @@ package org.openstack4j.api.networking.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.FlowClassifier; +import java.util.List; + /** - * * Flow Classifier Service * * @author Dmitry Gerenrot - * */ public interface FlowClassifierService extends RestService { diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorService.java b/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorService.java index ad215dbe1..5e60c27ee 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorService.java @@ -1,15 +1,17 @@ package org.openstack4j.api.networking.ext; -import java.util.List; -import java.util.Map; import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.HealthMonitor; import org.openstack4j.model.network.ext.HealthMonitorUpdate; + +import java.util.List; +import java.util.Map; + /** * Networking (Neutron) Lbaas healthmonitor Extension API - * @author liujunpeng * + * @author liujunpeng */ public interface HealthMonitorService extends RestService { /** @@ -21,9 +23,9 @@ public interface HealthMonitorService extends RestService { /** * Returns list of healthMonitor filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); @@ -35,24 +37,29 @@ public interface HealthMonitorService extends RestService { * @return the healthMonitor or null if not found */ HealthMonitor get(String healthMonitorId); - + /** * Delete the specified healthMonitor by ID + * * @param healthMonitorId the healthMonitor identifier * @return the action response */ ActionResponse delete(String healthMonitorId); + /** * Create a healthMonitor - * @param healthMonitor + * + * @param healthMonitor * @return HealthMonitor */ HealthMonitor create(HealthMonitor healthMonitor); + /** * Update a healthMonitor + * * @param healthMonitorId the healthMonitor identifier - * @param healthMonitor HealthMonitorUpdate + * @param healthMonitor HealthMonitorUpdate * @return HealthMonitor */ - HealthMonitor update(String healthMonitorId,HealthMonitorUpdate healthMonitor); + HealthMonitor update(String healthMonitorId, HealthMonitorUpdate healthMonitor); } diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorV2Service.java b/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorV2Service.java index 24ec40f3d..26a6be249 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorV2Service.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/HealthMonitorV2Service.java @@ -2,14 +2,15 @@ import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.network.ext.HealthMonitorV2Update; import org.openstack4j.model.network.ext.HealthMonitorV2; +import org.openstack4j.model.network.ext.HealthMonitorV2Update; import java.util.List; import java.util.Map; /** * Networking (Neutron Lbaas) V2 healthmonitor Extention API + * * @author emjburns */ public interface HealthMonitorV2Service extends RestService { @@ -38,6 +39,7 @@ public interface HealthMonitorV2Service extends RestService { /** * Delete the specified healthMonitor by ID + * * @param healthMonitorId the healthMonitorV2 identifier * @return the action response */ @@ -45,6 +47,7 @@ public interface HealthMonitorV2Service extends RestService { /** * Create a healthMonitorV2 + * * @param healthMonitor * @return HealthMonitorV2 */ @@ -52,8 +55,9 @@ public interface HealthMonitorV2Service extends RestService { /** * Update a healthMonitorV2 + * * @param healthMonitorId the healthMonitorV2 identifier - * @param healthMonitor HealthMonitorV2Update + * @param healthMonitor HealthMonitorV2Update * @return HealthMonitorV2 */ HealthMonitorV2 update(String healthMonitorId, HealthMonitorV2Update healthMonitor); diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolService.java b/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolService.java index c9b8b81ae..c4e8c66f5 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolService.java @@ -1,116 +1,99 @@ package org.openstack4j.api.networking.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.network.ext.HealthMonitor; -import org.openstack4j.model.network.ext.HealthMonitorAssociate; -import org.openstack4j.model.network.ext.LbPool; -import org.openstack4j.model.network.ext.LbPoolStats; -import org.openstack4j.model.network.ext.LbPoolUpdate; +import org.openstack4j.model.network.ext.*; + +import java.util.List; +import java.util.Map; /** * Networking (Neutron) Lbaas pool Extension API - * - * @author liujunpeng * + * @author liujunpeng */ public interface LbPoolService extends RestService { - /** - * List all lb pools that the current tenant has access to - * - * @return list of all lb pools - */ - List list(); + /** + * List all lb pools that the current tenant has access to + * + * @return list of all lb pools + */ + List list(); + + /** + * Returns list of lb pools filtered by parameters. + * + * @param filteringParams map (name, value) of filtering parameters + * @return List + */ + List list(Map filteringParams); - /** - * Returns list of lb pools filtered by parameters. - * - * @param filteringParams - * map (name, value) of filtering parameters - * @return List - */ - List list(Map filteringParams); + /** + * Get the specified lb pool by ID + * + * @param lbPoolId the lb pool identifier + * @return the lbPool or null if not found + */ + LbPool get(String lbPoolId); - /** - * Get the specified lb pool by ID - * - * @param lbPoolId - * the lb pool identifier - * @return the lbPool or null if not found - */ - LbPool get(String lbPoolId); + /** + * Delete the specified lb Pool by ID + * + * @param lbPoolId the lb pool identifier + * @return the action response + */ + ActionResponse delete(String lbPoolId); - /** - * Delete the specified lb Pool by ID - * - * @param lbPoolId - * the lb pool identifier - * @return the action response - */ - ActionResponse delete(String lbPoolId); + /** + * Create a lb Pool + * + * @param lbPool LbPool + * @return Member + */ + LbPool create(LbPool lbPool); - /** - * Create a lb Pool - * - * @param lbPool - * LbPool - * @return Member - */ - LbPool create(LbPool lbPool); + /** + * Update a lb pool + * + * @param lbPoolId the lb pool identifier + * @param lbPool LbPoolUpdate + * @return LbPool + */ + LbPool update(String lbPoolId, LbPoolUpdate lbPool); - /** - * Update a lb pool - * - * @param lbPoolId - * the lb pool identifier - * @param lbPool - * LbPoolUpdate - * @return LbPool - */ - LbPool update(String lbPoolId, LbPoolUpdate lbPool); + /** + * Get the LbPool Stats by ID + * + * @param lbPoolId, the lb pool identifier + */ + LbPoolStats stats(String lbPoolId); - /** - * Get the LbPool Stats by ID - * - * @param lbPoolId, the lb pool identifier - */ - LbPoolStats stats(String lbPoolId); + /** + * Associates a health monitor with a specified pool. + * + * @param lbPoolId the lb pool identifier + * @param associate HealthMonitorAssociate + * @return HealthMonitor + */ + HealthMonitor associateHealthMonitor(String lbPoolId, + HealthMonitorAssociate associate); - /** - * Associates a health monitor with a specified pool. - * - * @param lbPoolId - * the lb pool identifier - * @param associate - * HealthMonitorAssociate - * @return HealthMonitor - */ - HealthMonitor associateHealthMonitor(String lbPoolId, - HealthMonitorAssociate associate); - - /** + /** * Associates a health monitor with a specified pool. - * - * @param lbPoolId - * the lb pool identifier - * @param associate - * HealthMonitorAssociate + * + * @param lbPoolId the lb pool identifier + * @param associate HealthMonitorAssociate * @return HealthMonitor */ HealthMonitor associateHealthMonitor(String lbPoolId, String healthMonitorId); - /** - * Disassociates a specified health monitor from a pool. - * - * @param lbPoolId - * the lb pool identifier - * @param healthMonitorId - * the healthMonitor identifier - * @return ActionResponse - */ - ActionResponse disAssociateHealthMonitor(String lbPoolId, - String healthMonitorId); + /** + * Disassociates a specified health monitor from a pool. + * + * @param lbPoolId the lb pool identifier + * @param healthMonitorId the healthMonitor identifier + * @return ActionResponse + */ + ActionResponse disAssociateHealthMonitor(String lbPoolId, + String healthMonitorId); } diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolV2Service.java b/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolV2Service.java index 71cfb51c4..ed42cd24e 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolV2Service.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/LbPoolV2Service.java @@ -12,6 +12,7 @@ /** * Networking (Neutron) Lbaas V2 pool Extension API + * * @author emjburns */ public interface LbPoolV2Service extends RestService { @@ -25,8 +26,7 @@ public interface LbPoolV2Service extends RestService { /** * Returns list of lb v2 pools filtered by parameters. * - * @param filteringParams - * map (name, value) of filtering parameters + * @param filteringParams map (name, value) of filtering parameters * @return List */ List list(Map filteringParams); @@ -34,8 +34,7 @@ public interface LbPoolV2Service extends RestService { /** * Get the specified lb pool by ID * - * @param lbPoolId - * the lb v2 pool identifier + * @param lbPoolId the lb v2 pool identifier * @return the lbPoolV2 or null if not found */ LbPoolV2 get(String lbPoolId); @@ -43,8 +42,7 @@ public interface LbPoolV2Service extends RestService { /** * Delete the specified lb Pool by ID * - * @param lbPoolId - * the lb pool identifier + * @param lbPoolId the lb pool identifier * @return the action response */ ActionResponse delete(String lbPoolId); @@ -52,8 +50,7 @@ public interface LbPoolV2Service extends RestService { /** * Create a lb Pool * - * @param lbPool - * LbPool + * @param lbPool LbPool * @return lbPoolV2 */ LbPoolV2 create(LbPoolV2 lbPool); @@ -61,10 +58,8 @@ public interface LbPoolV2Service extends RestService { /** * Update a lb pool * - * @param lbPoolId - * the lb pool identifier - * @param lbPool - * LbPoolV2Update + * @param lbPoolId the lb pool identifier + * @param lbPool LbPoolV2Update * @return LbPoolV2 */ LbPoolV2 update(String lbPoolId, LbPoolV2Update lbPool); @@ -80,7 +75,7 @@ public interface LbPoolV2Service extends RestService { /** * Returns list of member filtered by parameters. * - * @param lbPoolId the load balancer pool + * @param lbPoolId the load balancer pool * @param filteringParams map (name, value) of filtering parameters * @return */ @@ -98,14 +93,16 @@ public interface LbPoolV2Service extends RestService { /** * Create a member + * * @param lbPoolId the load balancer pool - * @param member Member + * @param member Member * @return Member */ MemberV2 createMember(String lbPoolId, MemberV2 member); /** * Delete the specified member by ID + * * @param lbPoolId the load balancer pool * @param memberId the member identifier * @return the action response @@ -114,9 +111,10 @@ public interface LbPoolV2Service extends RestService { /** * Update a member + * * @param lbPoolId the load balancer pool * @param memberId the member identifier - * @param member MemberUpdate + * @param member MemberUpdate * @return Member */ MemberV2 updateMember(String lbPoolId, String memberId, MemberV2Update member); diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/LbaasV2Service.java b/core/src/main/java/org/openstack4j/api/networking/ext/LbaasV2Service.java index 8b0db04b7..2f2439731 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/LbaasV2Service.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/LbaasV2Service.java @@ -2,6 +2,7 @@ /** * LBaaS (Load Balancer as a Service) V2 support + * * @author emjburns */ public interface LbaasV2Service { diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/ListenerV2Service.java b/core/src/main/java/org/openstack4j/api/networking/ext/ListenerV2Service.java index a57f0ae10..69429a79d 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/ListenerV2Service.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/ListenerV2Service.java @@ -10,11 +10,13 @@ /** * Networking (Neutron) Lbaas V2 listener Extension API + * * @author emjburns */ public interface ListenerV2Service extends RestService { /** * List all listeners that the current tenant has access to + * * @return list of all listeners */ List list(); diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerService.java b/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerService.java index c00439952..1a0b67e78 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerService.java @@ -6,7 +6,6 @@ public interface LoadBalancerService { /** - * * @return the Lbaas member Service API */ MemberService member(); @@ -15,12 +14,12 @@ public interface LoadBalancerService { * @return the Lbaas vip Service API */ VipService vip(); - + /** * @return the Lbaas healthmonitor Service API */ HealthMonitorService healthMonitor(); - + /** * @return the Lbaas pool Service API diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerV2Service.java b/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerV2Service.java index d5f271570..12b3dfdc6 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerV2Service.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/LoadBalancerV2Service.java @@ -12,6 +12,7 @@ /** * Networking (Neutron Lbaas) V2 loadbalancer Extention API + * * @author emjburns */ public interface LoadBalancerV2Service extends RestService { @@ -40,26 +41,32 @@ public interface LoadBalancerV2Service extends RestService { /** * Delete the specified loadbalancer by ID + * * @param loadbalancerId the loadbalancer identifier * @return the action response */ ActionResponse delete(String loadbalancerId); + /** * Create a loadbalancer + * * @param loadbalancer * @return loadbalancer */ LoadBalancerV2 create(LoadBalancerV2 loadbalancer); + /** * Update a loadbalancer + * * @param loadbalancerId the loadbalancer identifier - * @param loadbalancer LoadBalancerV2Update + * @param loadbalancer LoadBalancerV2Update * @return loadbalancer */ LoadBalancerV2 update(String loadbalancerId, LoadBalancerV2Update loadbalancer); /** * Retrieve statistics on a loadbalancer + * * @param loadbalancerId * @return LoadBalancerV2Stats */ @@ -67,6 +74,7 @@ public interface LoadBalancerV2Service extends RestService { /** * Retrieve the status tree of a loadbalancer + * * @param loadbalancerId * @return status */ diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/MemberService.java b/core/src/main/java/org/openstack4j/api/networking/ext/MemberService.java index a1b5b4c08..761eca511 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/MemberService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/MemberService.java @@ -1,16 +1,17 @@ package org.openstack4j.api.networking.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.Member; import org.openstack4j.model.network.ext.MemberUpdate; + +import java.util.List; +import java.util.Map; + /** * Networking (Neutron) Lbaas member Extension API - * @author liujunpeng * + * @author liujunpeng */ public interface MemberService extends RestService { /** @@ -22,9 +23,9 @@ public interface MemberService extends RestService { /** * Returns list of member filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters - * @return + * @return */ List list(Map filteringParams); @@ -36,24 +37,29 @@ public interface MemberService extends RestService { * @return the member or null if not found */ Member get(String memberId); - + /** * Delete the specified member by ID + * * @param memberId the member identifier * @return the action response */ ActionResponse delete(String memberId); + /** * Create a member + * * @param member Member * @return Member */ Member create(Member member); + /** * Update a member + * * @param memberId the member identifier - * @param member MemberUpdate + * @param member MemberUpdate * @return Member */ - Member update(String memberId,MemberUpdate member); + Member update(String memberId, MemberUpdate member); } diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/NetQuotaService.java b/core/src/main/java/org/openstack4j/api/networking/ext/NetQuotaService.java index e9c7116c1..bb3676554 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/NetQuotaService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/NetQuotaService.java @@ -1,62 +1,63 @@ package org.openstack4j.api.networking.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.NetQuota; import org.openstack4j.model.network.builder.NetQuotaBuilder; +import java.util.List; + /** * Networking (Neutron) Quota Extension API - * + * * @author Jeremy Unruh */ public interface NetQuotaService extends RestService { - + /** * Lists quotas for tenants who have non-default quota values, and lists, updates, and resets quotas for a tenan - * + * * @return the list of quotas */ List get(); - + /** * Fetches the network quotas for the specified tenant - * + * * @param tenantId the tenant identifier * @return the tenants quota */ NetQuota get(String tenantId); - + /** * Updates the network quotas for the current tenant - * + * * @param netQuota the net quota to update * @return the updated network quota * @see NetQuotaBuilder */ NetQuota update(NetQuota netQuota); - + /** * Updates the network quotas for the specified tenant - * + * * @param tenantId the tenant identifier * @param netQuota the net quota to update * @return the updated network quota * @see NetQuotaBuilder */ NetQuota updateForTenant(String tenantId, NetQuota netQuota); - + /** * Resets the current network quota for the current tenant back to defaults + * * @return the action response */ ActionResponse reset(); /** * Resets the current network quota for the current tenant back to defaults - * + * * @param netQuota the net quota to update * @return the action response */ diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/PortChainService.java b/core/src/main/java/org/openstack4j/api/networking/ext/PortChainService.java index 878792013..dde568adc 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/PortChainService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/PortChainService.java @@ -1,17 +1,16 @@ package org.openstack4j.api.networking.ext; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.PortChain; +import java.util.List; + /** -* Port Chain Service -* -* @author Dmitry Gerenrot -* -*/ + * Port Chain Service + * + * @author Dmitry Gerenrot + */ public interface PortChainService extends RestService { /** diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/PortPairGroupService.java b/core/src/main/java/org/openstack4j/api/networking/ext/PortPairGroupService.java index ad026d9c4..47b70be38 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/PortPairGroupService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/PortPairGroupService.java @@ -1,15 +1,14 @@ package org.openstack4j.api.networking.ext; -import java.util.List; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.PortPairGroup; +import java.util.List; + /** * Port Pair Group Service * * @author Dmitry Gerenrot - * */ public interface PortPairGroupService { @@ -22,6 +21,7 @@ public interface PortPairGroupService { /** * Get a port pair group by id. + * * @param id * @return PortPairGroup */ diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/PortPairService.java b/core/src/main/java/org/openstack4j/api/networking/ext/PortPairService.java index 64cef67f9..86ea8255a 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/PortPairService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/PortPairService.java @@ -1,16 +1,14 @@ package org.openstack4j.api.networking.ext; -import java.util.List; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.PortPair; +import java.util.List; + /** - * * Service Port Pair Service * * @author Dmitry Gerenrot - * */ public interface PortPairService { @@ -24,6 +22,7 @@ public interface PortPairService { /** * Get a Port Pair by id. + * * @param portPairId * @return PortPair */ diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/ServiceFunctionChainService.java b/core/src/main/java/org/openstack4j/api/networking/ext/ServiceFunctionChainService.java index 8c27e2b14..e05a5191c 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/ServiceFunctionChainService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/ServiceFunctionChainService.java @@ -6,27 +6,26 @@ * Service Function Chain Operations API * * @author Dmitry Gerenrot - * */ public interface ServiceFunctionChainService extends RestService { - - /** - * @return the Flow Classifier Service API - */ - FlowClassifierService flowclassifiers(); - - /** - * @return the Port Pair Service API - */ - PortPairService portpairs(); - /** - * @return the Port Pair Service API - */ - PortPairGroupService portpairgroups(); + /** + * @return the Flow Classifier Service API + */ + FlowClassifierService flowclassifiers(); + + /** + * @return the Port Pair Service API + */ + PortPairService portpairs(); + + /** + * @return the Port Pair Service API + */ + PortPairGroupService portpairgroups(); /** * @return the Port Chain Service API */ PortChainService portchains(); -} +} diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/VipService.java b/core/src/main/java/org/openstack4j/api/networking/ext/VipService.java index 02f60cb5b..c559488a1 100644 --- a/core/src/main/java/org/openstack4j/api/networking/ext/VipService.java +++ b/core/src/main/java/org/openstack4j/api/networking/ext/VipService.java @@ -1,15 +1,17 @@ package org.openstack4j.api.networking.ext; -import java.util.List; -import java.util.Map; import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.Vip; import org.openstack4j.model.network.ext.VipUpdate; + +import java.util.List; +import java.util.Map; + /** * Networking (Neutron) Lbaas vip Extension API - * @author liujunpeng * + * @author liujunpeng */ public interface VipService extends RestService { /** @@ -21,7 +23,7 @@ public interface VipService extends RestService { /** * Returns list of vip filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters * @return list of vip fitered by filteringParams */ @@ -35,24 +37,29 @@ public interface VipService extends RestService { * @return the vip or null if not found */ Vip get(String vipId); - + /** * Delete the specified vip by ID + * * @param vipId the vip identifier * @return the action response */ ActionResponse delete(String vipId); + /** * Create a vip + * * @param vip vip * @return Vip */ Vip create(Vip vip); + /** * Update a vip + * * @param vipId the vip identifier - * @param vip VipUpdate + * @param vip VipUpdate * @return Vip */ - Vip update(String vipId,VipUpdate vip); + Vip update(String vipId, VipUpdate vip); } diff --git a/core/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Service.java b/core/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Service.java index 1b74d6c8f..c714c0505 100644 --- a/core/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Service.java +++ b/core/src/main/java/org/openstack4j/api/octavia/HealthMonitorV2Service.java @@ -10,6 +10,7 @@ /** * Octavia V2 healthmonitor Extention API + * * @author wei */ public interface HealthMonitorV2Service extends RestService { @@ -38,6 +39,7 @@ public interface HealthMonitorV2Service extends RestService { /** * Delete the specified healthMonitor by ID + * * @param healthMonitorId the healthMonitorV2 identifier * @return the action response */ @@ -45,6 +47,7 @@ public interface HealthMonitorV2Service extends RestService { /** * Create a healthMonitorV2 + * * @param healthMonitor * @return HealthMonitorV2 */ @@ -52,8 +55,9 @@ public interface HealthMonitorV2Service extends RestService { /** * Update a healthMonitorV2 + * * @param healthMonitorId the healthMonitorV2 identifier - * @param healthMonitor HealthMonitorV2Update + * @param healthMonitor HealthMonitorV2Update * @return HealthMonitorV2 */ HealthMonitorV2 update(String healthMonitorId, HealthMonitorV2Update healthMonitor); diff --git a/core/src/main/java/org/openstack4j/api/octavia/LbPoolV2Service.java b/core/src/main/java/org/openstack4j/api/octavia/LbPoolV2Service.java index 800902c8b..dc44ecf61 100644 --- a/core/src/main/java/org/openstack4j/api/octavia/LbPoolV2Service.java +++ b/core/src/main/java/org/openstack4j/api/octavia/LbPoolV2Service.java @@ -12,6 +12,7 @@ /** * Octavia V2 pool Extension API + * * @author wei */ public interface LbPoolV2Service extends RestService { @@ -25,8 +26,7 @@ public interface LbPoolV2Service extends RestService { /** * Returns list of lb v2 pools filtered by parameters. * - * @param filteringParams - * map (name, value) of filtering parameters + * @param filteringParams map (name, value) of filtering parameters * @return List */ List list(Map filteringParams); @@ -34,8 +34,7 @@ public interface LbPoolV2Service extends RestService { /** * Get the specified lb pool by ID * - * @param lbPoolId - * the lb v2 pool identifier + * @param lbPoolId the lb v2 pool identifier * @return the lbPoolV2 or null if not found */ LbPoolV2 get(String lbPoolId); @@ -43,8 +42,7 @@ public interface LbPoolV2Service extends RestService { /** * Delete the specified lb Pool by ID * - * @param lbPoolId - * the lb pool identifier + * @param lbPoolId the lb pool identifier * @return the action response */ ActionResponse delete(String lbPoolId); @@ -52,8 +50,7 @@ public interface LbPoolV2Service extends RestService { /** * Create a lb Pool * - * @param lbPool - * LbPool + * @param lbPool LbPool * @return lbPoolV2 */ LbPoolV2 create(LbPoolV2 lbPool); @@ -61,10 +58,8 @@ public interface LbPoolV2Service extends RestService { /** * Update a lb pool * - * @param lbPoolId - * the lb pool identifier - * @param lbPool - * LbPoolV2Update + * @param lbPoolId the lb pool identifier + * @param lbPool LbPoolV2Update * @return LbPoolV2 */ LbPoolV2 update(String lbPoolId, LbPoolV2Update lbPool); @@ -80,7 +75,7 @@ public interface LbPoolV2Service extends RestService { /** * Returns list of member filtered by parameters. * - * @param lbPoolId the load balancer pool + * @param lbPoolId the load balancer pool * @param filteringParams map (name, value) of filtering parameters * @return */ @@ -98,14 +93,16 @@ public interface LbPoolV2Service extends RestService { /** * Create a member + * * @param lbPoolId the load balancer pool - * @param member Member + * @param member Member * @return Member */ MemberV2 createMember(String lbPoolId, MemberV2 member); /** * Delete the specified member by ID + * * @param lbPoolId the load balancer pool * @param memberId the member identifier * @return the action response @@ -114,9 +111,10 @@ public interface LbPoolV2Service extends RestService { /** * Update a member + * * @param lbPoolId the load balancer pool * @param memberId the member identifier - * @param member MemberUpdate + * @param member MemberUpdate * @return Member */ MemberV2 updateMember(String lbPoolId, String memberId, MemberV2Update member); diff --git a/core/src/main/java/org/openstack4j/api/octavia/ListenerV2Service.java b/core/src/main/java/org/openstack4j/api/octavia/ListenerV2Service.java index eedc93b92..63cd1d640 100644 --- a/core/src/main/java/org/openstack4j/api/octavia/ListenerV2Service.java +++ b/core/src/main/java/org/openstack4j/api/octavia/ListenerV2Service.java @@ -10,11 +10,13 @@ /** * Octavia V2 listener Extension API + * * @author wei */ public interface ListenerV2Service extends RestService { /** * List all listeners that the current tenant has access to + * * @return list of all listeners */ List list(); diff --git a/core/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Service.java b/core/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Service.java index c578555ce..81c9cb441 100644 --- a/core/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Service.java +++ b/core/src/main/java/org/openstack4j/api/octavia/LoadBalancerV2Service.java @@ -12,6 +12,7 @@ /** * Octavia V2 loadbalancer Extention API + * * @author wei */ public interface LoadBalancerV2Service extends RestService { @@ -40,6 +41,7 @@ public interface LoadBalancerV2Service extends RestService { /** * Delete the specified loadbalancer by ID + * * @param loadbalancerId the loadbalancer identifier * @return the action response */ @@ -47,6 +49,7 @@ public interface LoadBalancerV2Service extends RestService { /** * Cascade delete the specified loadbalancer by ID + * * @param loadbalancerId the loadbalancer identifier * @return the action response */ @@ -54,6 +57,7 @@ public interface LoadBalancerV2Service extends RestService { /** * Create a loadbalancer + * * @param loadbalancer * @return loadbalancer */ @@ -61,14 +65,16 @@ public interface LoadBalancerV2Service extends RestService { /** * Update a loadbalancer + * * @param loadbalancerId the loadbalancer identifier - * @param loadbalancer LoadBalancerV2Update + * @param loadbalancer LoadBalancerV2Update * @return loadbalancer */ LoadBalancerV2 update(String loadbalancerId, LoadBalancerV2Update loadbalancer); /** * Retrieve statistics on a loadbalancer + * * @param loadbalancerId * @return LoadBalancerV2Stats */ @@ -76,6 +82,7 @@ public interface LoadBalancerV2Service extends RestService { /** * Retrieve the status tree of a loadbalancer + * * @param loadbalancerId * @return status */ diff --git a/core/src/main/java/org/openstack4j/api/octavia/OctaviaService.java b/core/src/main/java/org/openstack4j/api/octavia/OctaviaService.java index e4ddac6c4..a6abd9103 100644 --- a/core/src/main/java/org/openstack4j/api/octavia/OctaviaService.java +++ b/core/src/main/java/org/openstack4j/api/octavia/OctaviaService.java @@ -4,7 +4,7 @@ /** * OpenStack Octavia Operations API - * + * * @author wei */ public interface OctaviaService extends RestService { diff --git a/core/src/main/java/org/openstack4j/api/sahara/ClusterService.java b/core/src/main/java/org/openstack4j/api/sahara/ClusterService.java index c9bfd9d53..b54de8a67 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/ClusterService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/ClusterService.java @@ -1,67 +1,68 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.Cluster; import org.openstack4j.model.sahara.NodeGroup; +import java.util.List; + /** * Sahara Data Processing Operations - * + * * @author Ekasit Kijsipongse */ public interface ClusterService extends RestService { /** * List all clusters - * + * * @return list of images or empty */ - List list(); + List list(); /** * Get a cluster by ID + * * @param clusterId the cluster identifier * @return the cluster or null if not found */ - Cluster get(String clusterId); + Cluster get(String clusterId); /** * Create a new cluster - * + * * @param cluster the cluster to create * @return the created cluster */ - Cluster create(Cluster cluster); + Cluster create(Cluster cluster); /** - * Delete the specified cluster - * + * Delete the specified cluster + * * @param clusterId the cluster identifier * @return the action response */ - ActionResponse delete(String clusterId); + ActionResponse delete(String clusterId); /** - * Resize a node group in the specified cluster - * + * Resize a node group in the specified cluster + * * @param clusterId the cluster identifier * @param groupName the name of the node group - * @param count the number of instances in the node group + * @param count the number of instances in the node group * @return the updated cluster */ - Cluster resizeNodeGroup(String clusterId, String groupName, int count); + Cluster resizeNodeGroup(String clusterId, String groupName, int count); /** - * Add a new node group in the specified cluster - * + * Add a new node group in the specified cluster + * * @param clusterId the cluster identifier * @param nodeGroup the new node group * @return the updated cluster */ - Cluster addNodeGroup(String clusterId, NodeGroup nodeGroup); + Cluster addNodeGroup(String clusterId, NodeGroup nodeGroup); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/ClusterTemplateService.java b/core/src/main/java/org/openstack4j/api/sahara/ClusterTemplateService.java index 3602e55f1..e3749cdc5 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/ClusterTemplateService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/ClusterTemplateService.java @@ -1,46 +1,47 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.ClusterTemplate; +import java.util.List; + /** * Sahara Data Processing Operations - * + * * @author Ekasit Kijsipongse */ public interface ClusterTemplateService extends RestService { /** * List all cluster templates - * + * * @return list of cluster templates or empty */ - List list(); + List list(); /** * Get a cluster template by ID + * * @param templateId the template identifier * @return the cluster template or null if not found */ - ClusterTemplate get(String templateId); + ClusterTemplate get(String templateId); /** * Create a new cluster template - * + * * @param template the cluster template to create * @return the created cluster template */ - ClusterTemplate create(ClusterTemplate template); + ClusterTemplate create(ClusterTemplate template); /** * Delete the specified cluster template - * + * * @param templateId the template identifier * @return the action response */ - ActionResponse delete(String templateId); + ActionResponse delete(String templateId); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/DataSourceService.java b/core/src/main/java/org/openstack4j/api/sahara/DataSourceService.java index bae4c9119..389b60588 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/DataSourceService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/DataSourceService.java @@ -1,11 +1,11 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.DataSource; +import java.util.List; + /** * Sahara Data Processing Operations * @@ -15,17 +15,18 @@ public interface DataSourceService extends RestService { /** * List all data sources - * + * * @return list of data sources or empty */ - List list(); + List list(); /** * Get a data source by ID + * * @param datasourceId the data source identifier * @return the data source or null if not found */ - DataSource get(String datasourceId); + DataSource get(String datasourceId); /** * Create a new data source @@ -33,14 +34,14 @@ public interface DataSourceService extends RestService { * @param datasource the data source to create * @return the created data source */ - DataSource create(DataSource datasource); + DataSource create(DataSource datasource); /** - * Delete the specified data source - * + * Delete the specified data source + * * @param datasourceId the data source identifier * @return the action response */ - ActionResponse delete(String datasourceId); + ActionResponse delete(String datasourceId); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/JobBinaryInternalService.java b/core/src/main/java/org/openstack4j/api/sahara/JobBinaryInternalService.java index 4827491b6..3021bd99b 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/JobBinaryInternalService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/JobBinaryInternalService.java @@ -1,14 +1,14 @@ package org.openstack4j.api.sahara; -import java.io.File; -import java.io.InputStream; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.common.Payload; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.common.Payload; import org.openstack4j.model.sahara.JobBinaryInternal; +import java.io.File; +import java.io.InputStream; +import java.util.List; + /** * Sahara Data Processing Operations * @@ -18,17 +18,18 @@ public interface JobBinaryInternalService extends RestService { /** * List all job binary internals - * + * * @return list of job binary internals or empty */ - List list(); + List list(); /** * Get a job binary internal by ID + * * @param jobBinaryInternalId the job binary internal identifier * @return the job binary internal or null if not found */ - JobBinaryInternal get(String jobBinaryInternalId); + JobBinaryInternal get(String jobBinaryInternalId); /** * Create a new job binary internal @@ -36,21 +37,21 @@ public interface JobBinaryInternalService extends RestService { * @param payload the payload to create a new job binary internal * @return the created job binary internal */ - JobBinaryInternal create(Payload payload); + JobBinaryInternal create(Payload payload); /** * Delete the specified job binary internal - * + * * @param jobBinaryInternalId the job binary internal identifier * @return the action response */ - ActionResponse delete(String jobBinaryInternalId); - - /** - * Retrieves data of specified job binary internal object - * - * @param jobBinaryInternalId the job binary internal identifier - * @return Job Binary Internal data - */ - Payload getData(String jobBinaryInternalId); + ActionResponse delete(String jobBinaryInternalId); + + /** + * Retrieves data of specified job binary internal object + * + * @param jobBinaryInternalId the job binary internal identifier + * @return Job Binary Internal data + */ + Payload getData(String jobBinaryInternalId); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/JobBinaryService.java b/core/src/main/java/org/openstack4j/api/sahara/JobBinaryService.java index 3e75ba097..08573b638 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/JobBinaryService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/JobBinaryService.java @@ -1,13 +1,13 @@ package org.openstack4j.api.sahara; -import java.io.InputStream; -import java.util.List; - import org.openstack4j.common.RestService; -import org.openstack4j.model.common.Payload; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.common.Payload; import org.openstack4j.model.sahara.JobBinary; +import java.io.InputStream; +import java.util.List; + /** * Sahara Data Processing Operations * @@ -17,18 +17,18 @@ public interface JobBinaryService extends RestService { /** * List all job binaries - * + * * @return list of job binaries or empty */ - List list(); + List list(); /** * Get a job binary by ID - * + * * @param JobBinaryId the job binary identifier * @return the job binary or null if not found */ - JobBinary get(String JobBinaryId); + JobBinary get(String JobBinaryId); /** * Create a new job binary @@ -36,21 +36,21 @@ public interface JobBinaryService extends RestService { * @param jobBinary the job binary to create * @return the created job binary */ - JobBinary create(JobBinary jobBinary); + JobBinary create(JobBinary jobBinary); /** * Delete the specified job binary - * + * * @param JobBinaryId the job binary identifier * @return the action response */ - ActionResponse delete(String JobBinaryId); - - /** - * Retrieves data of specified job binary object - * - * @param JobBinaryId the job binary identifier - * @return Job Binary data - */ - Payload getData(String JobBinaryId); + ActionResponse delete(String JobBinaryId); + + /** + * Retrieves data of specified job binary object + * + * @param JobBinaryId the job binary identifier + * @return Job Binary data + */ + Payload getData(String JobBinaryId); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/JobExecutionService.java b/core/src/main/java/org/openstack4j/api/sahara/JobExecutionService.java index 0189c3afc..685f6ccb1 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/JobExecutionService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/JobExecutionService.java @@ -1,11 +1,11 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.JobExecution; +import java.util.List; + /** * Sahara Data Processing Operations * @@ -15,7 +15,7 @@ public interface JobExecutionService extends RestService { /** * Create a new job execution - * + * * @param jobExecution the job execution to create * @return the created job execution */ @@ -23,14 +23,14 @@ public interface JobExecutionService extends RestService { /** * List all job executions - * + * * @return list of job executions or empty */ List list(); /** * Get a job execution by ID - * + * * @param jobExecutionId the job execution identifier * @return the job execution or null if not found */ @@ -38,15 +38,15 @@ public interface JobExecutionService extends RestService { /** * Refresh the status of a job execution by ID - * - * @param jobExecutionId the job execution identifier + * + * @param jobExecutionId the job execution identifier * @return the refreshed job execution or null if not found */ JobExecution refreshStatus(String jobExecutionId); /** * Cancel a job execution by ID - * + * * @param jobExecutionId the job execution identifier * @return the canceled job execution or null if not found */ @@ -54,7 +54,7 @@ public interface JobExecutionService extends RestService { /** * Delete a job execution by ID - * + * * @param jobExecutionId the job execution identifier * @return the action response */ diff --git a/core/src/main/java/org/openstack4j/api/sahara/JobService.java b/core/src/main/java/org/openstack4j/api/sahara/JobService.java index f86a18e99..6896155ad 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/JobService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/JobService.java @@ -1,12 +1,12 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.Job; import org.openstack4j.model.sahara.JobConfigHint; +import java.util.List; + /** * Sahara Data Processing Operations * @@ -16,17 +16,18 @@ public interface JobService extends RestService { /** * List all jobs - * + * * @return list of jobs or empty */ - List list(); + List list(); /** * Get a job by ID + * * @param JobId the job identifier * @return the job or null if not found */ - Job get(String JobId); + Job get(String JobId); /** * Create a new job @@ -34,21 +35,21 @@ public interface JobService extends RestService { * @param jobBinary the job to create * @return the created job */ - Job create(Job jobBinary); + Job create(Job jobBinary); /** * Delete the specified job - * + * * @param JobId the job identifier * @return the action response */ - ActionResponse delete(String JobId); - - /** - * Get Job Configuration Hints - * - * @param type the job type - * @return the job configuration hints - */ - JobConfigHint getConfigHint(String type); + ActionResponse delete(String JobId); + + /** + * Get Job Configuration Hints + * + * @param type the job type + * @return the job configuration hints + */ + JobConfigHint getConfigHint(String type); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/NodeGroupTemplateService.java b/core/src/main/java/org/openstack4j/api/sahara/NodeGroupTemplateService.java index 723c31963..f5d7b7f5c 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/NodeGroupTemplateService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/NodeGroupTemplateService.java @@ -1,46 +1,47 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.NodeGroupTemplate; +import java.util.List; + /** * Sahara Data Processing Operations - * + * * @author Ekasit Kijsipongse */ public interface NodeGroupTemplateService extends RestService { /** * List all node group templates - * + * * @return list of node group templates or empty */ - List list(); + List list(); /** * Get a node group template by ID + * * @param templateId the template identifier * @return the node group template or null if not found */ - NodeGroupTemplate get(String templateId); + NodeGroupTemplate get(String templateId); /** * Create a new node group template - * + * * @param template the node group template to create * @return the created node group template */ - NodeGroupTemplate create(NodeGroupTemplate template); + NodeGroupTemplate create(NodeGroupTemplate template); /** * Delete the specified node group template - * + * * @param templateId the template identifier * @return the action response */ - ActionResponse delete(String templateId); + ActionResponse delete(String templateId); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/SaharaImageService.java b/core/src/main/java/org/openstack4j/api/sahara/SaharaImageService.java index afce25e0a..3a9e75667 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/SaharaImageService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/SaharaImageService.java @@ -1,71 +1,72 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.Image; +import java.util.List; + /** * Sahara Data Processing Operations - * + * * @author ekasit.kijsipongse@nectec.or.th */ public interface SaharaImageService extends RestService { /** * List all images - * + * * @return list of images or empty */ - List list(); + List list(); /** * List images with specified tag(s) * - * @param tags one or more tags + * @param tags one or more tags * @return list of images or empty */ - List list(String... tags); + List list(String... tags); /** * Get an image by ID + * * @param imageId the image identifier * @return the image or null if not found */ - Image get(String imageId); + Image get(String imageId); /** * Register a new image into Sahara image registry - * - * @param imageId the image to register - * @param username the username + * + * @param imageId the image to register + * @param username the username * @param description the description * @return the registered image */ - Image register(String imageId, String username, String description); + Image register(String imageId, String username, String description); /** * Unregister the specified image from Sahara image registry - * + * * @param imageId the image identifier * @return the action response */ - ActionResponse unregister(String imageId); + ActionResponse unregister(String imageId); /** * Add Tag(s) to image - * + * * @param tags one or more tags to add * @return the image */ - Image tag(String imageId, String... tags); + Image tag(String imageId, String... tags); /** * Remove Tag(s) from image - * + * * @param tags one or more tags to remove * @return the image */ - Image untag(String imageId, String... tags); + Image untag(String imageId, String... tags); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/SaharaPluginService.java b/core/src/main/java/org/openstack4j/api/sahara/SaharaPluginService.java index e82a90ae6..0d5992e1d 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/SaharaPluginService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/SaharaPluginService.java @@ -1,50 +1,52 @@ package org.openstack4j.api.sahara; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.Payload; import org.openstack4j.model.sahara.ClusterTemplate; import org.openstack4j.model.sahara.Plugin; +import java.util.List; + /** * Sahara Data Processing Operations - * + * * @author ekasit.kijsipongse@nectec.or.th */ public interface SaharaPluginService extends RestService { /** * List all plugins - * + * * @return list of plugins registered in Sahara or empty */ - List list(); + List list(); /** * Get a plugin by name + * * @param name the plugin name * @return the plugin or null if not found */ - Plugin get(String name); + Plugin get(String name); /** * Get a specific plugin with all details by name and version - * @param name the plugin name + * + * @param name the plugin name * @param version the plugin version * @return the plugin or null if not found */ - Plugin get(String name, String version); + Plugin get(String name, String version); /** * Convert plugin specific config file into cluster template - * - * @param name the plugin name - * @param version the plugin version + * + * @param name the plugin name + * @param version the plugin version * @param templateName the cluster template name - * @param payload the config file for the specific plugin - * @return the cluster template + * @param payload the config file for the specific plugin + * @return the cluster template */ - ClusterTemplate convertConfig(String name, String version, String templateName, Payload payload); + ClusterTemplate convertConfig(String name, String version, String templateName, Payload payload); } diff --git a/core/src/main/java/org/openstack4j/api/sahara/SaharaService.java b/core/src/main/java/org/openstack4j/api/sahara/SaharaService.java index 40179bb41..8d1e99406 100644 --- a/core/src/main/java/org/openstack4j/api/sahara/SaharaService.java +++ b/core/src/main/java/org/openstack4j/api/sahara/SaharaService.java @@ -4,7 +4,7 @@ /** * (Sahara) Data Processing Operations API - * + * * @author Ekasit Kijsipongse */ public interface SaharaService extends RestService { @@ -15,7 +15,7 @@ public interface SaharaService extends RestService { * @return the cluster service */ ClusterService clusters(); - + /** * Node Group Template Service API * @@ -56,7 +56,7 @@ public interface SaharaService extends RestService { * * @return the job binary internal service */ - JobBinaryInternalService jobBinaryInternals(); + JobBinaryInternalService jobBinaryInternals(); /** * Job Binary Service API diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinActionService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinActionService.java index 19f1fb492..742203fb7 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinActionService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinActionService.java @@ -6,25 +6,23 @@ /** * This interface defines all methods for the manipulation of Action - * + * * @author lion - * */ public interface SenlinActionService { - - /** - * Gets a list of currently existing {@link Action}s. - * - * @return the list of {@link Action}s - */ - List list(); - /** - * returns details of a {@link Action}. - * - * @param actionID - * Id of {@link Action} - * @return Action - */ - Action get(String actionID); + /** + * Gets a list of currently existing {@link Action}s. + * + * @return the list of {@link Action}s + */ + List list(); + + /** + * returns details of a {@link Action}. + * + * @param actionID Id of {@link Action} + * @return Action + */ + Action get(String actionID); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinBuildInfoService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinBuildInfoService.java index 2773bb4e9..326d94965 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinBuildInfoService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinBuildInfoService.java @@ -4,16 +4,15 @@ /** * This interface defines all methods for the manipulation of BuildInfo - * + * * @author lion - * */ public interface SenlinBuildInfoService { - /** - * returns details of a {@link BuildInfo}. - * - * @return BuildInfo - */ - BuildInfo get(); + /** + * returns details of a {@link BuildInfo}. + * + * @return BuildInfo + */ + BuildInfo get(); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterPolicyService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterPolicyService.java index 843d889b2..3c3bb49df 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterPolicyService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterPolicyService.java @@ -6,27 +6,24 @@ /** * This interface defines all methods for the manipulation of ClusterPolicy - * + * * @author lion - * */ public interface SenlinClusterPolicyService { - - /** - * Gets a list of currently existing {@link ClusterPolicy}s. - * - * @return the list of {@link ClusterPolicy}s - */ - List list(String clusterID); - /** - * returns details of a {@link ClusterPolicy}. - * - * @param clusterID - * Id of Cluster - * @param policyID - * Id of {@link ClusterPolicy} - * @return ClusterPolicy - */ - ClusterPolicy get(String clusterID, String policyID); + /** + * Gets a list of currently existing {@link ClusterPolicy}s. + * + * @return the list of {@link ClusterPolicy}s + */ + List list(String clusterID); + + /** + * returns details of a {@link ClusterPolicy}. + * + * @param clusterID Id of Cluster + * @param policyID Id of {@link ClusterPolicy} + * @return ClusterPolicy + */ + ClusterPolicy get(String clusterID, String policyID); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterService.java index 1ae3287f6..420634157 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinClusterService.java @@ -10,65 +10,59 @@ /** * This interface defines all methods for the manipulation of Cluster - * + * * @author lion - * */ public interface SenlinClusterService { - - /** - * Gets a list of currently existing {@link Cluster}s. - * - * @return the list of {@link Cluster}s - */ - List list(); - /** - * returns details of a {@link Cluster}. - * - * @param clusterID - * Id of {@link Cluster} - * @return Cluster - */ - Cluster get(String clusterID); + /** + * Gets a list of currently existing {@link Cluster}s. + * + * @return the list of {@link Cluster}s + */ + List list(); - /** - * POST /v1/clusters
- * - * Creates a new {@link Cluster} out of a {@link ClusterCreate} object - * - * @param newCluster - * {@link ClusterCreate} object out of which cluster is to be created - * @return new {@link Cluster} as returned from the server - */ - Cluster create(ClusterCreate newCluster); + /** + * returns details of a {@link Cluster}. + * + * @param clusterID Id of {@link Cluster} + * @return Cluster + */ + Cluster get(String clusterID); - /** - * Deletes the specified {@link Cluster} from the server. - * - * @param clusterID - * Id of {@link Cluster} - * @return the action response - */ - ActionResponse delete(String clusterID); + /** + * POST /v1/clusters
+ *

+ * Creates a new {@link Cluster} out of a {@link ClusterCreate} object + * + * @param newCluster {@link ClusterCreate} object out of which cluster is to be created + * @return new {@link Cluster} as returned from the server + */ + Cluster create(ClusterCreate newCluster); - /** - * PATCH /v1/clusters/​{cluster_id}​
- * - * Update a {@link Cluster} out of a {@link ClusterCreate} object - * - * @param clusterID - * Id of {@link Cluster} - * @param newCluster - * {@link ClusterCreate} object out of which stack is to be update - * @return new {@link Cluster} as returned from the server - */ - Cluster update(String clusterID, ClusterCreate newCluster); + /** + * Deletes the specified {@link Cluster} from the server. + * + * @param clusterID Id of {@link Cluster} + * @return the action response + */ + ActionResponse delete(String clusterID); - /** - * Service implementation which provides methods for manipulation of action - * - * @return Action - */ - ActionID action(String clusterID, ClusterActionCreate newClusterAction); + /** + * PATCH /v1/clusters/​{cluster_id}​
+ *

+ * Update a {@link Cluster} out of a {@link ClusterCreate} object + * + * @param clusterID Id of {@link Cluster} + * @param newCluster {@link ClusterCreate} object out of which stack is to be update + * @return new {@link Cluster} as returned from the server + */ + Cluster update(String clusterID, ClusterCreate newCluster); + + /** + * Service implementation which provides methods for manipulation of action + * + * @return Action + */ + ActionID action(String clusterID, ClusterActionCreate newClusterAction); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinEventService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinEventService.java index 0db90b578..9464c6a5f 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinEventService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinEventService.java @@ -6,25 +6,23 @@ /** * This interface defines all methods for the manipulation of Event - * + * * @author lion - * */ public interface SenlinEventService { - - /** - * Gets a list of currently existing {@link Event}s. - * - * @return the list of {@link Event}s - */ - List list(); - /** - * returns details of a {@link Event}. - * - * @param eventID - * Id of {@link Event} - * @return Event - */ - Event get(String eventID); + /** + * Gets a list of currently existing {@link Event}s. + * + * @return the list of {@link Event}s + */ + List list(); + + /** + * returns details of a {@link Event}. + * + * @param eventID Id of {@link Event} + * @return Event + */ + Event get(String eventID); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinNodeService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinNodeService.java index b559169a0..3a51894b0 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinNodeService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinNodeService.java @@ -10,73 +10,68 @@ /** * This interface defines all methods for the manipulation of Node - * + * * @author lion - * */ public interface SenlinNodeService { - - /** - * Gets a list of currently existing {@link Node}s. - * - * @return the list of {@link Node}s - */ - List list(); - /** - * POST /v1/nodes
- * - * Creates a new {@link Node} out of a {@link NodeCreate} object - * - * @param newNode - * {@link NodeCreate} object out of which node is to be created - * @return new {@link Node} as returned from the server - */ - Node create(NodeCreate newNode); + /** + * Gets a list of currently existing {@link Node}s. + * + * @return the list of {@link Node}s + */ + List list(); - /** - * returns details of a {@link Node}. - * - * @param nodeID - * Id of {@link Node} - * @return Node - */ - Node get(String nodeID); + /** + * POST /v1/nodes
+ *

+ * Creates a new {@link Node} out of a {@link NodeCreate} object + * + * @param newNode {@link NodeCreate} object out of which node is to be created + * @return new {@link Node} as returned from the server + */ + Node create(NodeCreate newNode); - /** - * returns details of a {@link Node} - * @param nodeID Id of {@link Node} - * @param showDetails {@literal true} to retrieve the properties about the physical object that backs the node - * @return Node - */ - Node get(String nodeID, boolean showDetails); + /** + * returns details of a {@link Node}. + * + * @param nodeID Id of {@link Node} + * @return Node + */ + Node get(String nodeID); - /** - * Deletes the specified {@link Node} from the server. - * - * @param nodeID - * Id of {@link Node} - * @return the action response - */ - ActionResponse delete(String nodeID); + /** + * returns details of a {@link Node} + * + * @param nodeID Id of {@link Node} + * @param showDetails {@literal true} to retrieve the properties about the physical object that backs the node + * @return Node + */ + Node get(String nodeID, boolean showDetails); - /** - * PATCH /v1/nodes/​{node_id}​
- * - * Update a {@link Node} out of a {@link NodeCreate} object - * - * @param nodeID - * Id of {@link Node} - * @param newNode - * {@link NodeCreate} object out of which stack is to be update - * @return new {@link Node} as returned from the server - */ - Node update(String nodeID, NodeCreate newNode); + /** + * Deletes the specified {@link Node} from the server. + * + * @param nodeID Id of {@link Node} + * @return the action response + */ + ActionResponse delete(String nodeID); - /** - * Service implementation which provides methods for manipulation of action - * - * @return Action - */ - ActionID action(String nodeID, NodeActionCreate newNodeAction); + /** + * PATCH /v1/nodes/​{node_id}​
+ *

+ * Update a {@link Node} out of a {@link NodeCreate} object + * + * @param nodeID Id of {@link Node} + * @param newNode {@link NodeCreate} object out of which stack is to be update + * @return new {@link Node} as returned from the server + */ + Node update(String nodeID, NodeCreate newNode); + + /** + * Service implementation which provides methods for manipulation of action + * + * @return Action + */ + ActionID action(String nodeID, NodeActionCreate newNodeAction); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyService.java index 1986e52bb..91d3f173c 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyService.java @@ -8,58 +8,52 @@ /** * This interface defines all methods for the manipulation of Policy - * + * * @author lion - * */ public interface SenlinPolicyService { - - /** - * Gets a list of currently existing {@link Policy}s. - * - * @return the list of {@link Policy}s - */ - List list(); - /** - * POST /v1/policies
- * - * Creates a new {@link Policy} out of a {@link PolicyCreate} object - * - * @param newPolicy - * {@link PolicyCreate} object out of which policy is to be created - * @return new {@link Policy} as returned from the server - */ - Policy create(PolicyCreate newPolicy); + /** + * Gets a list of currently existing {@link Policy}s. + * + * @return the list of {@link Policy}s + */ + List list(); - /** - * returns details of a {@link Policy}. - * - * @param policyID - * Id of {@link Policy} - * @return Policy - */ - Policy get(String policyID); + /** + * POST /v1/policies
+ *

+ * Creates a new {@link Policy} out of a {@link PolicyCreate} object + * + * @param newPolicy {@link PolicyCreate} object out of which policy is to be created + * @return new {@link Policy} as returned from the server + */ + Policy create(PolicyCreate newPolicy); - /** - * PATCH /v1/policies/​{policy_id}​
- * - * Update a {@link Policy} out of a {@link PolicyCreate} object - * - * @param policyID - * Id of {@link Policy} - * @param newPolicy - * {@link PolicyCreate} object out of which stack is to be update - * @return new {@link Policy} as returned from the server - */ - Policy update(String policyID, PolicyCreate newPolicy); + /** + * returns details of a {@link Policy}. + * + * @param policyID Id of {@link Policy} + * @return Policy + */ + Policy get(String policyID); - /** - * Deletes the specified {@link Policy} from the server. - * - * @param policyID - * Id of {@link Policy} - * @return the action response - */ - ActionResponse delete(String policyID); + /** + * PATCH /v1/policies/​{policy_id}​
+ *

+ * Update a {@link Policy} out of a {@link PolicyCreate} object + * + * @param policyID Id of {@link Policy} + * @param newPolicy {@link PolicyCreate} object out of which stack is to be update + * @return new {@link Policy} as returned from the server + */ + Policy update(String policyID, PolicyCreate newPolicy); + + /** + * Deletes the specified {@link Policy} from the server. + * + * @param policyID Id of {@link Policy} + * @return the action response + */ + ActionResponse delete(String policyID); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyTypeService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyTypeService.java index 44b201819..be6ef6bd7 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyTypeService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinPolicyTypeService.java @@ -6,25 +6,23 @@ /** * This interface defines all methods for the manipulation of PolicyType - * + * * @author lion - * */ public interface SenlinPolicyTypeService { - - /** - * Gets a list of currently existing {@link PolicyType}s. - * - * @return the list of {@link PolicyType}s - */ - List list(); - /** - * returns details of a {@link PolicyType}. - * - * @param policyTypeName - * Name of {@link PolicyType} - * @return PolicyType - */ - PolicyType get(String policyTypeName); + /** + * Gets a list of currently existing {@link PolicyType}s. + * + * @return the list of {@link PolicyType}s + */ + List list(); + + /** + * returns details of a {@link PolicyType}. + * + * @param policyTypeName Name of {@link PolicyType} + * @return PolicyType + */ + PolicyType get(String policyTypeName); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileService.java index a4e390238..197aa5039 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileService.java @@ -8,58 +8,52 @@ /** * This interface defines all methods for the manipulation of Profile - * + * * @author lion - * */ public interface SenlinProfileService { - /** - * Gets a list of currently existing {@link Profile}s. - * - * @return the list of {@link Profile}s - */ - List list(); - - /** - * POST /v1/profiles
- * - * Creates a new {@link Profile} out of a {@link ProfileCreate} object - * - * @param newProfile - * {@link ProfileCreate} object out of which stack is to be created - * @return new {@link Profile} as returned from the server - */ - Profile create(ProfileCreate newProfile); - - /** - * returns details of a {@link Profile}. - * - * @param profileID - * Id of {@link Profile} - * @return Profile - */ - Profile get(String profileID); - - /** - * PATCH /v1/profiles/​{profile_id}
- * - * Update a {@link Profile} out of a {@link ProfileCreate} object - * - * @param profileID - * Id of {@link Profile} - * @param newProfile - * {@link ProfileCreate} object out of which stack is to be update - * @return new {@link Profile} as returned from the server - */ - Profile update(String profileID, ProfileCreate newProfile); - - /** - * Deletes the specified {@link ActionResponse} from the server. - * - * @param profileID - * Id of {@link ActionResponse} - * @return the action response - */ - ActionResponse delete(String profileID); + /** + * Gets a list of currently existing {@link Profile}s. + * + * @return the list of {@link Profile}s + */ + List list(); + + /** + * POST /v1/profiles
+ *

+ * Creates a new {@link Profile} out of a {@link ProfileCreate} object + * + * @param newProfile {@link ProfileCreate} object out of which stack is to be created + * @return new {@link Profile} as returned from the server + */ + Profile create(ProfileCreate newProfile); + + /** + * returns details of a {@link Profile}. + * + * @param profileID Id of {@link Profile} + * @return Profile + */ + Profile get(String profileID); + + /** + * PATCH /v1/profiles/​{profile_id}
+ *

+ * Update a {@link Profile} out of a {@link ProfileCreate} object + * + * @param profileID Id of {@link Profile} + * @param newProfile {@link ProfileCreate} object out of which stack is to be update + * @return new {@link Profile} as returned from the server + */ + Profile update(String profileID, ProfileCreate newProfile); + + /** + * Deletes the specified {@link ActionResponse} from the server. + * + * @param profileID Id of {@link ActionResponse} + * @return the action response + */ + ActionResponse delete(String profileID); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileTypeService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileTypeService.java index 626e787cf..186f671d9 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileTypeService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinProfileTypeService.java @@ -6,25 +6,23 @@ /** * This interface defines all methods for the manipulation of ProfileType - * + * * @author lion - * */ public interface SenlinProfileTypeService { - /** - * Gets a list of currently existing {@link ProfileType}s. - * - * @return the list of {@link ProfileType}s - */ - List list(); + /** + * Gets a list of currently existing {@link ProfileType}s. + * + * @return the list of {@link ProfileType}s + */ + List list(); - /** - * returns details of a {@link ProfileType}. - * - * @param profileTypeName - * Name of {@link ProfileType} - * @return ProfileType - */ - ProfileType get(String profileTypeName); + /** + * returns details of a {@link ProfileType}. + * + * @param profileTypeName Name of {@link ProfileType} + * @return ProfileType + */ + ProfileType get(String profileTypeName); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinReceiverService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinReceiverService.java index e4143639b..9071033b7 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinReceiverService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinReceiverService.java @@ -8,45 +8,41 @@ /** * This interface defines all methods for the manipulation of Receiver - * + * * @author lion - * */ public interface SenlinReceiverService { - - /** - * Gets a list of currently existing {@link Receiver}s. - * - * @return the list of {@link Receiver}s - */ - List list(); - /** - * POST /v1/receivers
- * - * Creates a new {@link Receiver} out of a {@link ReceiverCreate} object - * - * @param newReceiver - * {@link ReceiverCreate} object out of which Receiver is to be created - * @return new {@link Receiver} as returned from the server - */ - Receiver create(ReceiverCreate newReceiver); + /** + * Gets a list of currently existing {@link Receiver}s. + * + * @return the list of {@link Receiver}s + */ + List list(); - /** - * returns details of a {@link Receiver}. - * - * @param receiverID - * Id of {@link Receiver} - * @return - */ - Receiver get(String receiverID); + /** + * POST /v1/receivers
+ *

+ * Creates a new {@link Receiver} out of a {@link ReceiverCreate} object + * + * @param newReceiver {@link ReceiverCreate} object out of which Receiver is to be created + * @return new {@link Receiver} as returned from the server + */ + Receiver create(ReceiverCreate newReceiver); - /** - * Deletes the specified {@link Receiver} from the server. - * - * @param receiverID - * Id of {@link Receiver} - * @return the action response - */ - ActionResponse delete(String receiverID); + /** + * returns details of a {@link Receiver}. + * + * @param receiverID Id of {@link Receiver} + * @return + */ + Receiver get(String receiverID); + + /** + * Deletes the specified {@link Receiver} from the server. + * + * @param receiverID Id of {@link Receiver} + * @return the action response + */ + ActionResponse delete(String receiverID); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinService.java index d54c61cdc..48b26eab9 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinService.java @@ -4,100 +4,100 @@ /** * This interface containts all available senlinServices - * @author lion * + * @author lion */ public interface SenlinService extends RestService { - - /** - * Service implementation which provides methods for manipulation of policy - * - * @return PolicyService - */ - SenlinPolicyService policy(); - - /** - * Service implementation which provides methods for manipulation of action - * - * @return ActionService - */ - SenlinActionService action(); - - /** - * Service implementation which provides methods for manipulation of buildInfo - * - * @return BuildInfoService - */ - SenlinBuildInfoService buildInfo(); - - /** - * Service implementation which provides methods for manipulation of cluster - * - * @return ClusterService - */ - SenlinClusterService cluster(); - - /** - * Service implementation which provides methods for manipulation of clusterPolicy - * - * @return ClusterPolicyService - */ - SenlinClusterPolicyService clusterPolicy(); - - /** - * Service implementation which provides methods for manipulation of event - * - * @return EventService - */ - SenlinEventService event(); - - /** - * Service implementation which provides methods for manipulation of node - * - * @return NodeService - */ - SenlinNodeService node(); - - /** - * Service implementation which provides methods for manipulation of profile - * - * @return ProfileService - */ - SenlinProfileService profile(); - - /** - * Service implementation which provides methods for manipulation of profileType - * - * @return ProfileTypeService - */ - SenlinProfileTypeService profileType(); - - /** - * Service implementation which provides methods for manipulation of policyType - * - * @return PolicyTypeService - */ - SenlinPolicyTypeService policyType(); - - /** - * Service implementation which provides methods for manipulation of receiver - * - * @return ReceiverService - */ - SenlinReceiverService receiver(); - - /** - * Service implementation which provides methods for manipulation of webHook - * - * @return WebHookService - */ - SenlinWebHookService webHook(); - - /** - * Service implementation which provides methods for manipulation of Version - * - * @return Version - */ - SenlinVersionService version(); + + /** + * Service implementation which provides methods for manipulation of policy + * + * @return PolicyService + */ + SenlinPolicyService policy(); + + /** + * Service implementation which provides methods for manipulation of action + * + * @return ActionService + */ + SenlinActionService action(); + + /** + * Service implementation which provides methods for manipulation of buildInfo + * + * @return BuildInfoService + */ + SenlinBuildInfoService buildInfo(); + + /** + * Service implementation which provides methods for manipulation of cluster + * + * @return ClusterService + */ + SenlinClusterService cluster(); + + /** + * Service implementation which provides methods for manipulation of clusterPolicy + * + * @return ClusterPolicyService + */ + SenlinClusterPolicyService clusterPolicy(); + + /** + * Service implementation which provides methods for manipulation of event + * + * @return EventService + */ + SenlinEventService event(); + + /** + * Service implementation which provides methods for manipulation of node + * + * @return NodeService + */ + SenlinNodeService node(); + + /** + * Service implementation which provides methods for manipulation of profile + * + * @return ProfileService + */ + SenlinProfileService profile(); + + /** + * Service implementation which provides methods for manipulation of profileType + * + * @return ProfileTypeService + */ + SenlinProfileTypeService profileType(); + + /** + * Service implementation which provides methods for manipulation of policyType + * + * @return PolicyTypeService + */ + SenlinPolicyTypeService policyType(); + + /** + * Service implementation which provides methods for manipulation of receiver + * + * @return ReceiverService + */ + SenlinReceiverService receiver(); + + /** + * Service implementation which provides methods for manipulation of webHook + * + * @return WebHookService + */ + SenlinWebHookService webHook(); + + /** + * Service implementation which provides methods for manipulation of Version + * + * @return Version + */ + SenlinVersionService version(); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinVersionService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinVersionService.java index 2d0864d30..2e26804ab 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinVersionService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinVersionService.java @@ -7,17 +7,16 @@ /** * This interface defines all methods for the manipulation of version - * + * * @author lion - * */ public interface SenlinVersionService { - /** - * Service implementation which provides methods for manipulation of version - * - * @return Version - */ - List list(); + /** + * Service implementation which provides methods for manipulation of version + * + * @return Version + */ + List list(); } diff --git a/core/src/main/java/org/openstack4j/api/senlin/SenlinWebHookService.java b/core/src/main/java/org/openstack4j/api/senlin/SenlinWebHookService.java index 8fd8491a9..a1193b47b 100644 --- a/core/src/main/java/org/openstack4j/api/senlin/SenlinWebHookService.java +++ b/core/src/main/java/org/openstack4j/api/senlin/SenlinWebHookService.java @@ -4,16 +4,15 @@ /** * This interface defines all methods for the manipulation of WebHook - * + * * @author lion - * */ public interface SenlinWebHookService { - /** - * Service implementation which provides methods for manipulation of action - * - * @return Action - */ - ActionID action(String webHookUrl); + /** + * Service implementation which provides methods for manipulation of action + * + * @return Action + */ + ActionID action(String webHookUrl); } diff --git a/core/src/main/java/org/openstack4j/api/storage/BlockQuotaSetService.java b/core/src/main/java/org/openstack4j/api/storage/BlockQuotaSetService.java index 3327b7c5d..00b8bdcc9 100644 --- a/core/src/main/java/org/openstack4j/api/storage/BlockQuotaSetService.java +++ b/core/src/main/java/org/openstack4j/api/storage/BlockQuotaSetService.java @@ -7,14 +7,14 @@ /** * Quota-Set Extension API for Block Storage - * + * * @author Jeremy Unruh */ public interface BlockQuotaSetService extends RestService { /** * Gets default quotas for a tenant - * + * * @param tenantId the tenant identifier * @return the default quotas */ @@ -22,24 +22,24 @@ public interface BlockQuotaSetService extends RestService { /** * Gets quotas for a tenant - * + * * @param tenantId the tenant identifier * @return the quotas for a tenant */ BlockQuotaSet get(String tenantId); - + /** * Updates quotas for a tenant - * + * * @param tenantId the tenant identifier - * @param quota the quota-set to update + * @param quota the quota-set to update * @return the updated quotas */ BlockQuotaSet updateForTenant(String tenantId, BlockQuotaSet quota); - + /** * Deletes quotas for a tenant so the quotas revert to default values - * + * * @param tenantId the tenant identifier * @return the action response */ @@ -47,19 +47,19 @@ public interface BlockQuotaSetService extends RestService { /** * Gets details for quotas for a specified tenant - * + * * @param tenantId the tenant identifier * @return the quota usage details */ BlockQuotaSetUsage usageForTenant(String tenantId); - + /** * Gets details for quotas for a specified tenant and user. - * + * * @param tenantId the tenant identifier - * @param userId the user identifier + * @param userId the user identifier * @return the quota usage details */ BlockQuotaSetUsage usageForUser(String tenantId, String userId); - + } diff --git a/core/src/main/java/org/openstack4j/api/storage/BlockStorageService.java b/core/src/main/java/org/openstack4j/api/storage/BlockStorageService.java index d9fd74185..5f7081960 100644 --- a/core/src/main/java/org/openstack4j/api/storage/BlockStorageService.java +++ b/core/src/main/java/org/openstack4j/api/storage/BlockStorageService.java @@ -6,53 +6,53 @@ /** * Block Storage (Cinder) Service Operation API - * + * * @author Jeremy Unruh */ public interface BlockStorageService extends RestService { - /** - * @return the Volume Service API - */ - BlockVolumeService volumes(); - - /** - * @return the Volume Snapshot Service API - */ - BlockVolumeSnapshotService snapshots(); - - CinderZoneService zones(); - - /** - * Gets the Absolute limits used by this tenant - * - * @return the absolute limits - */ - BlockLimits getLimits(); - - /** - * The block storage quota-set service. - * - * @return the quota-set service - */ - BlockQuotaSetService quotaSets(); - - /** - * The block storage get_pools service. - * - * @return the scheduler stats service - */ - SchedulerStatsGetPoolService schedulerStatsPools(); - - /** - * @return the Volume Service API - */ - BlockVolumeBackupService backups(); - - /** - * The block storage service service - * - * @return ServiceService - */ - BlockStorageServiceService services(); + /** + * @return the Volume Service API + */ + BlockVolumeService volumes(); + + /** + * @return the Volume Snapshot Service API + */ + BlockVolumeSnapshotService snapshots(); + + CinderZoneService zones(); + + /** + * Gets the Absolute limits used by this tenant + * + * @return the absolute limits + */ + BlockLimits getLimits(); + + /** + * The block storage quota-set service. + * + * @return the quota-set service + */ + BlockQuotaSetService quotaSets(); + + /** + * The block storage get_pools service. + * + * @return the scheduler stats service + */ + SchedulerStatsGetPoolService schedulerStatsPools(); + + /** + * @return the Volume Service API + */ + BlockVolumeBackupService backups(); + + /** + * The block storage service service + * + * @return ServiceService + */ + BlockStorageServiceService services(); } diff --git a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeBackupService.java b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeBackupService.java index 42e4388d0..589c04201 100644 --- a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeBackupService.java +++ b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeBackupService.java @@ -1,71 +1,74 @@ package org.openstack4j.api.storage; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.VolumeBackup; import org.openstack4j.model.storage.block.VolumeBackupCreate; import org.openstack4j.model.storage.block.VolumeBackupRestore; - + +import java.util.List; +import java.util.Map; /** * A backup is a full copy of a volume stored in an external service. A backup * can subsequently be restored from the external service to either the same * volume that the backup was originally taken from or to a new volume. - * {@link http://developer.openstack.org/api-ref/block-storage/v2/} - * - * @author Huang Yi + * {@link http://developer.openstack.org/api-ref/block-storage/v2/} * + * @author Huang Yi */ -public interface BlockVolumeBackupService extends RestService { - /** - * Lists detailed information for all Block Storage backups that the tenant who submits the request can access. - * - * @return List of VolumeBackup - */ - List list(); - - /** - * Returns list of Block Storage backups filtered by parameters. - * @param filteringParams map (name, value) of filtering parameters - * @return - */ - List list(Map filteringParams); - - /** - * Shows information for a specified backup. - * @param id the backup identifier - * @return the volume backup or null - */ - VolumeBackup get(String backupId ); - - /** - * Delete a specified volume backup - * @param backupId the backup identifier - * @return the action response - */ - ActionResponse delete(String backupId); - - /** - * Create volume backup - * @param vbc the input for backup creation - * @return the volume backup created. - */ - VolumeBackup create(VolumeBackupCreate vbc) ; - - /** - * Restore volume from a a specified backup. - * If volumeId is provided, the backup will be restored to existng volume specified by the volume id. - * Otherwise, a new volume will be created from the backup with assigned volume name. - * @param backupId the backup identifier - * @param name the volume name - * @param volumeId the identified of existing volume - * @return - */ - VolumeBackupRestore restore( String backupId , String name, String volumeId) ; - +public interface BlockVolumeBackupService extends RestService { + /** + * Lists detailed information for all Block Storage backups that the tenant who submits the request can access. + * + * @return List of VolumeBackup + */ + List list(); + + /** + * Returns list of Block Storage backups filtered by parameters. + * + * @param filteringParams map (name, value) of filtering parameters + * @return + */ + List list(Map filteringParams); + + /** + * Shows information for a specified backup. + * + * @param id the backup identifier + * @return the volume backup or null + */ + VolumeBackup get(String backupId); + + /** + * Delete a specified volume backup + * + * @param backupId the backup identifier + * @return the action response + */ + ActionResponse delete(String backupId); + + /** + * Create volume backup + * + * @param vbc the input for backup creation + * @return the volume backup created. + */ + VolumeBackup create(VolumeBackupCreate vbc); + + /** + * Restore volume from a a specified backup. + * If volumeId is provided, the backup will be restored to existng volume specified by the volume id. + * Otherwise, a new volume will be created from the backup with assigned volume name. + * + * @param backupId the backup identifier + * @param name the volume name + * @param volumeId the identified of existing volume + * @return + */ + VolumeBackupRestore restore(String backupId, String name, String volumeId); + } diff --git a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeService.java b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeService.java index 3529c1ebb..340f1aeb6 100644 --- a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeService.java +++ b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeService.java @@ -1,8 +1,5 @@ package org.openstack4j.api.storage; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.Volume; @@ -10,186 +7,190 @@ import org.openstack4j.model.storage.block.VolumeUploadImage; import org.openstack4j.model.storage.block.options.UploadImageData; +import java.util.List; +import java.util.Map; + /** * Manages Volumes and Volume Type based operations against Block Storage (Cinder) - * + * * @author Jeremy Unruh */ public interface BlockVolumeService extends RestService { - /** - * The volume type defines the characteristics of a volume - * - * @return List of VolumeType entities - */ - List listVolumeTypes(); + /** + * The volume type defines the characteristics of a volume + * + * @return List of VolumeType entities + */ + List listVolumeTypes(); /** * Deletes the specified VolumeType - * - * @param volumeTypeId - * the volume type identifier + * + * @param volumeTypeId the volume type identifier */ void deleteVolumeType(String volumeTypeId); /** * Creates a new volume type with the specified name - * - * @param volumeType - * the volumeType for create + * + * @param volumeType the volumeType for create * @return the created volume type */ VolumeType createVolumeType(VolumeType volumeType); - /** - * Lists summary information for all Block Storage volumes that the tenant who submits the request can access. - * - * @return List of Volumes - */ - List list(); - - /** - * Returns list of Block Storage volumes filtered by parameters. - * - * @param filteringParams map (name, value) of filtering parameters - * @return - */ - List list(Map filteringParams); - - /** - * Gets a Block Storage volume by ID - * @param volumeId the volume identifier - * @return the volume or null if not found - */ - Volume get(String volumeId); - - /** - * Deletes the specified volume - * - * @param volumeId the volume identifier - * @return the action response - */ - ActionResponse delete(String volumeId); - - /** - * Attempt forced removal of volume, regardless of the state. - * It's dangerous but useful. It's not 100% success. - * - * @param volumeId the volume id - * @return the action response - */ - ActionResponse forceDelete(String volumeId); - - /** - * Resets the specified volume status. - * - * @param volumeId the volume id - * @param status new volume status - * @return the action response - */ - ActionResponse resetState(String volumeId, Volume.Status status); - - /** - * Extends the specified volume size. - * - * @param volumeId the volume id - * @param newSize new volume size - * @return the action response - */ - ActionResponse extend(String volumeId, Integer newSize); - - /** - * Creates a new Block Storage Volume - * @param volume the volume for create - * @return the created volume - */ - Volume create(Volume volume); - - /** - * Uploads a volume to the image service - * - * @param volumeId the volume identifier to upload - * @param data the data about the volume being uploaded (required) - * @return the volume upload image containing the current status - */ - VolumeUploadImage uploadToImage(String volumeId, UploadImageData data); - - /** - * OpenStack only allows name or description to be updated. This call enforces that based on the API docs. - * - * @param volumeId the volume id - * @param name the name to update (null indicates no name update) - * @param description the description to update (null indicates no description update) - * @return the action response - */ - ActionResponse update(String volumeId, String name, String description); - - /** - * migrate a volume to another host and service - * - * @param volumeId the volume id - * @param forceHostCopy - * @param hostService the destination host and service ,like kvmnode002021.cnsuning.com@lvmdriver - * @return the action response - */ - ActionResponse migrate(String volumeId, String hostService, boolean forceHostCopy); - - /** - * Returns the API used to transfer a Volume from one tenant/project to another - * - * @return the volume transfer service - */ - BlockVolumeTransferService transfer(); - - /** - * Updates volume read-only access-mode flag - * - * @param volumeId ID of volume to update - * @param readonly enables or disables update of volume to read-only access mode - * @return the action response - */ - ActionResponse readOnlyModeUpdate(String volumeId, boolean readonly); - - /** - * - *
Description:Attaches a volume to a server. - * You should set instance_uuid or host_name. - * Volume status must be available. - *

Author:Wang Ting/王婷

- * @param volumeId - * @param instanceId - * @param mountpoint - * @param hostName - * @return - */ - ActionResponse attach(String volumeId, String instanceId,String mountpoint,String hostName ); - - /** - * - *
Description:Forces a volume to detach. - *

Author:Wang Ting/王婷

- * @param volumeId - * @param initiator - * @param attachmentId - * @return - */ - ActionResponse forceDetach(String volumeId, String initiator,String attachmentId ); - - /** - * Detach volume from server - * @author capitek-xuning(首信科技-徐宁) - * @param volumeId - * @param attachmentId - * @return - */ - ActionResponse detach(String volumeId, String attachmentId); - - /** - * Update volume bootable status. - * - * @param volumeId the volume id - * @param bootable Enables or disables the bootable attribute - * @return the action response - */ - ActionResponse bootable(String volumeId, Boolean bootable); + /** + * Lists summary information for all Block Storage volumes that the tenant who submits the request can access. + * + * @return List of Volumes + */ + List list(); + + /** + * Returns list of Block Storage volumes filtered by parameters. + * + * @param filteringParams map (name, value) of filtering parameters + * @return + */ + List list(Map filteringParams); + + /** + * Gets a Block Storage volume by ID + * + * @param volumeId the volume identifier + * @return the volume or null if not found + */ + Volume get(String volumeId); + + /** + * Deletes the specified volume + * + * @param volumeId the volume identifier + * @return the action response + */ + ActionResponse delete(String volumeId); + + /** + * Attempt forced removal of volume, regardless of the state. + * It's dangerous but useful. It's not 100% success. + * + * @param volumeId the volume id + * @return the action response + */ + ActionResponse forceDelete(String volumeId); + + /** + * Resets the specified volume status. + * + * @param volumeId the volume id + * @param status new volume status + * @return the action response + */ + ActionResponse resetState(String volumeId, Volume.Status status); + + /** + * Extends the specified volume size. + * + * @param volumeId the volume id + * @param newSize new volume size + * @return the action response + */ + ActionResponse extend(String volumeId, Integer newSize); + + /** + * Creates a new Block Storage Volume + * + * @param volume the volume for create + * @return the created volume + */ + Volume create(Volume volume); + + /** + * Uploads a volume to the image service + * + * @param volumeId the volume identifier to upload + * @param data the data about the volume being uploaded (required) + * @return the volume upload image containing the current status + */ + VolumeUploadImage uploadToImage(String volumeId, UploadImageData data); + + /** + * OpenStack only allows name or description to be updated. This call enforces that based on the API docs. + * + * @param volumeId the volume id + * @param name the name to update (null indicates no name update) + * @param description the description to update (null indicates no description update) + * @return the action response + */ + ActionResponse update(String volumeId, String name, String description); + + /** + * migrate a volume to another host and service + * + * @param volumeId the volume id + * @param forceHostCopy + * @param hostService the destination host and service ,like kvmnode002021.cnsuning.com@lvmdriver + * @return the action response + */ + ActionResponse migrate(String volumeId, String hostService, boolean forceHostCopy); + + /** + * Returns the API used to transfer a Volume from one tenant/project to another + * + * @return the volume transfer service + */ + BlockVolumeTransferService transfer(); + + /** + * Updates volume read-only access-mode flag + * + * @param volumeId ID of volume to update + * @param readonly enables or disables update of volume to read-only access mode + * @return the action response + */ + ActionResponse readOnlyModeUpdate(String volumeId, boolean readonly); + + /** + *
Description:Attaches a volume to a server. + * You should set instance_uuid or host_name. + * Volume status must be available. + *

Author:Wang Ting/王婷

+ * + * @param volumeId + * @param instanceId + * @param mountpoint + * @param hostName + * @return + */ + ActionResponse attach(String volumeId, String instanceId, String mountpoint, String hostName); + + /** + *
Description:Forces a volume to detach. + *

Author:Wang Ting/王婷

+ * + * @param volumeId + * @param initiator + * @param attachmentId + * @return + */ + ActionResponse forceDetach(String volumeId, String initiator, String attachmentId); + + /** + * Detach volume from server + * + * @param volumeId + * @param attachmentId + * @return + * @author capitek-xuning(首信科技-徐宁) + */ + ActionResponse detach(String volumeId, String attachmentId); + + /** + * Update volume bootable status. + * + * @param volumeId the volume id + * @param bootable Enables or disables the bootable attribute + * @return the action response + */ + ActionResponse bootable(String volumeId, Boolean bootable); } diff --git a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeSnapshotService.java b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeSnapshotService.java index 5095c0a4e..c74758f66 100644 --- a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeSnapshotService.java +++ b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeSnapshotService.java @@ -1,12 +1,12 @@ package org.openstack4j.api.storage; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.VolumeSnapshot; +import java.util.List; +import java.util.Map; + /** * OpenStack (Cinder) Volume Snapshot Operations API. * @@ -14,55 +14,55 @@ */ public interface BlockVolumeSnapshotService extends RestService { - /** - * Lists detailed information for all Block Storage snapshots that the tenant who submits the request can access. - * - * @return List of VolumeSnapshot - */ - List list(); + /** + * Lists detailed information for all Block Storage snapshots that the tenant who submits the request can access. + * + * @return List of VolumeSnapshot + */ + List list(); + + /** + * Returns list of Block Storage snapshots filtered by parameters. + * + * @param filteringParams map (name, value) of filtering parameters + * @return + */ + List list(Map filteringParams); + + /** + * Shows information for a specified snapshot. + * + * @param snapshotId the snapshot identifier + * @return the volume snapshot or null + */ + VolumeSnapshot get(String snapshotId); + + /** + * Deletes a specified snapshot + * + * @param snapshotId the snapshot identifier + * @return the action response + */ + ActionResponse delete(String snapshotId); + + /** + * Updates the Name and/or Description for the specified snapshot + * + * @param snapshotId the snapshot identifier + * @param name the new name + * @param description the new description + * @return the action response + */ + ActionResponse update(String snapshotId, String name, String description); - /** - * Returns list of Block Storage snapshots filtered by parameters. - * - * @param filteringParams map (name, value) of filtering parameters - * @return - */ - List list(Map filteringParams); + /** + * Creates a snapshot, which is a point-in-time copy of a volume. You can create a volume from the snapshot. + *

+ * NOTE: the volume ID within the snapshot must be set or an NullPointerException will be thrown + * + * @param snapshot the snapshot to create + * @return the newly created snapshot + */ + VolumeSnapshot create(VolumeSnapshot snapshot); - /** - * Shows information for a specified snapshot. - * - * @param snapshotId the snapshot identifier - * @return the volume snapshot or null - */ - VolumeSnapshot get(String snapshotId); - - /** - * Deletes a specified snapshot - * - * @param snapshotId the snapshot identifier - * @return the action response - */ - ActionResponse delete(String snapshotId); - - /** - * Updates the Name and/or Description for the specified snapshot - * - * @param snapshotId the snapshot identifier - * @param name the new name - * @param description the new description - * @return the action response - */ - ActionResponse update(String snapshotId, String name, String description); - - /** - * Creates a snapshot, which is a point-in-time copy of a volume. You can create a volume from the snapshot. - * - * NOTE: the volume ID within the snapshot must be set or an NullPointerException will be thrown - * - * @param snapshot the snapshot to create - * @return the newly created snapshot - */ - VolumeSnapshot create(VolumeSnapshot snapshot); - } diff --git a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeTransferService.java b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeTransferService.java index a9f04e1e4..3c73fa24d 100644 --- a/core/src/main/java/org/openstack4j/api/storage/BlockVolumeTransferService.java +++ b/core/src/main/java/org/openstack4j/api/storage/BlockVolumeTransferService.java @@ -1,55 +1,55 @@ package org.openstack4j.api.storage; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.VolumeTransfer; +import java.util.List; + /** * Related services for managing volume transfers (os-volume-transfer). This service is used to transfer a volume from one tenant - * to another. In OpenStack4j you would create the request authenticated against one tenant and accept the request from the receiving + * to another. In OpenStack4j you would create the request authenticated against one tenant and accept the request from the receiving * tenant - * + * * @author Jeremy Unruh */ public interface BlockVolumeTransferService extends RestService { /** * Gets ALL volume transfers in detailed form - * + * * @return List of Volume Transfers */ List list(); - + /** * Gets ALL volume transfers - * + * * @param detailed if true all fields are populated otherwise just id, volumeId and name * @return List of Volume Transfers */ List list(boolean detailed); - + /** * Gets details about a specific transfer - * + * * @param transferId the transfer identifier * @return the transfer details or null */ VolumeTransfer get(String transferId); - + /** * Deletes a specific transfer - * + * * @param transferId the transfer identifier to delete * @return the action response */ ActionResponse delete(String transferId); - - + + /** * Creates a new Volume Transfer - * + * * @param volumeId the identifier of the volume to transfer * @return the created volume transfer containing the authorization key */ @@ -57,18 +57,18 @@ public interface BlockVolumeTransferService extends RestService { /** * Creates a new Volume Transfer - * + * * @param volumeId the identifier of the volume to transfer - * @param name the name of the transfer (optional) + * @param name the name of the transfer (optional) * @return the created volume transfer containing the authorization key */ VolumeTransfer create(String volumeId, String name); - + /** * Accepts a pending volume transfer - * + * * @param transferId the identifier of the transfer to accept - * @param authKey the auth key of the transfer + * @param authKey the auth key of the transfer * @return VolumeTransfer detailing the name and volume identifier that was transfer */ VolumeTransfer accept(String transferId, String authKey); diff --git a/core/src/main/java/org/openstack4j/api/storage/CinderZoneService.java b/core/src/main/java/org/openstack4j/api/storage/CinderZoneService.java index a2489f4a0..935aca7ea 100644 --- a/core/src/main/java/org/openstack4j/api/storage/CinderZoneService.java +++ b/core/src/main/java/org/openstack4j/api/storage/CinderZoneService.java @@ -1,15 +1,15 @@ package org.openstack4j.api.storage; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.openstack.storage.block.domain.AvailabilityZone; +import java.util.List; + /** - * @author Jeff Hu - * list all available cinder zones - */ + * @author Jeff Hu + * list all available cinder zones + */ public interface CinderZoneService extends RestService { - List list(); + List list(); } diff --git a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageAccountService.java b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageAccountService.java index bc2bfe92d..a63921498 100644 --- a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageAccountService.java +++ b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageAccountService.java @@ -1,13 +1,13 @@ package org.openstack4j.api.storage; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.storage.object.SwiftAccount; +import java.util.Map; + /** * The Object Storage Account based services - * + * * @author Jeremy Unruh */ public interface ObjectStorageAccountService extends RestService { @@ -18,28 +18,28 @@ public interface ObjectStorageAccountService extends RestService { * @return The {@link SwiftAccount} object. */ SwiftAccount get(); - + /** * Creates or updates the {@link SwiftAccount} metadata. - * + * * @param metadata the metadata to create or update. - * @return true if the metadata was created or updated successfully, - * false if not + * @return true if the metadata was created or updated successfully, + * false if not */ boolean updateMetadata(Map metadata); - + /** * Deletes the {@link SwiftAccount} metadata. - * + * * @param metadata the metadata to delete. - * @return true if the metadata was deleted successfully, - * false if not + * @return true if the metadata was deleted successfully, + * false if not */ boolean deleteMetadata(Map metadata); - + /** * Replaces the temporary URL key for the {@link SwiftAccount} - * + * * @param temporaryUrlKey the temporary URL key * @return true if the update was successful */ diff --git a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageContainerService.java b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageContainerService.java index 8527b7aef..5cf91438a 100644 --- a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageContainerService.java +++ b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageContainerService.java @@ -1,103 +1,103 @@ package org.openstack4j.api.storage; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.object.SwiftContainer; import org.openstack4j.model.storage.object.options.ContainerListOptions; import org.openstack4j.model.storage.object.options.CreateUpdateContainerOptions; +import java.util.List; +import java.util.Map; + /** * Provides access to the OpenStack Object Storage (Swift) Container API features. - * + * * @author Jeremy Unruh */ public interface ObjectStorageContainerService extends RestService { /** * Listing of all containers associated with the Account (max result size is 10,000); - * + * * @return List of containers ordered by name */ List list(); - + /** * Listing of all containers with the associated options used in the query - * + * * @param options the query based options * @return List of containers ordered by name */ List list(ContainerListOptions options); - + /** * Creates a new container with the specified {@code name} - * + * * @param name the name of the new container * @return the action response */ ActionResponse create(String name); - + /** * Creates a pseudo path aka directory for the specified {@code containerName} - * + * * @param containerName the name of the container - * @param path the path to create + * @param path the path to create * @return the ETAG checksum of the new path */ String createPath(String containerName, String path); - + /** * Creates a new container with the specified {@code name} with options - * - * @param name the name of the new container + * + * @param name the name of the new container * @param options the options to use when creating a container * @return the action response */ ActionResponse create(String name, CreateUpdateContainerOptions options); - + /** * Updates a container with the specified {@code name} with options - * - * @param name the name of the container to update + * + * @param name the name of the container to update * @param options the options to use when updating a container - * @param the action response + * @param the action response */ ActionResponse update(String name, CreateUpdateContainerOptions options); - + /** * Deletes an empty container with the specified {@code name} - * + * * @param name the name of the container to delete * @return the action response (true if successfully deleted) */ ActionResponse delete(String name); - + /** * Gets the Metadata for a given container - * + * * @param name the container name * @return Map of key to value metadata */ Map getMetadata(String name); - + /** * Creates or Updates metadata items for the specified container {@code name} - * - * @param name the name of the container + * + * @param name the name of the container * @param metadata the metadata to create/update for this container * @return true if the create/update was successful, false if not */ boolean updateMetadata(String name, Map metadata); /** - * Deletes metadata items from the specified container {@code name} - * - * @param name the name of the container + * Deletes metadata items from the specified container {@code name} + * + * @param name the name of the container * @param metadata the metadata items to remove from the container's metadata * @return true if the removal of items was successful, false if not */ boolean deleteMetadata(String name, Map metadata); - + } diff --git a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageObjectService.java b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageObjectService.java index 8136e879e..713cd5c63 100644 --- a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageObjectService.java +++ b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageObjectService.java @@ -1,164 +1,165 @@ package org.openstack4j.api.storage; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.common.DLPayload; import org.openstack4j.model.common.Payload; -import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.options.DownloadOptions; import org.openstack4j.model.storage.object.SwiftObject; +import org.openstack4j.model.storage.object.options.ObjectDeleteOptions; import org.openstack4j.model.storage.object.options.ObjectListOptions; import org.openstack4j.model.storage.object.options.ObjectLocation; -import org.openstack4j.model.storage.object.options.ObjectDeleteOptions; import org.openstack4j.model.storage.object.options.ObjectPutOptions; +import java.util.List; +import java.util.Map; + /** * A service responsible for maintaining directory and file objects within containers for * an Object Service within OpenStack - * + * * @author Jeremy Unruh */ public interface ObjectStorageObjectService extends RestService { /** * Lists all objects for the given container name - * + * * @param containerName the container name * @return List of File objects including Directories */ List list(String containerName); - + /** * Lists all objects for the given container name and list options - * + * * @param containerName the container name - * @param options additional filter based options + * @param options additional filter based options * @return List of File objects including Directories */ List list(String containerName, ObjectListOptions options); - + /** * Gets the specified object based on the ObjectLocation {@code location} - * + * * @param location the object location * @return SwiftObject or null if not found */ SwiftObject get(ObjectLocation location); - + /** * Gets the specified object based on the {@code containerName} and {@code name} of the object - * + * * @param containerName the objects container name - * @param name the name of the object + * @param name the name of the object * @return SwiftObject or null if not found */ SwiftObject get(String containerName, String name); - + /** * Adds/Updates a file to the specified container - * + * * @param containerName the container name - * @param name the name of the file - * @param payload the file payload + * @param name the name of the file + * @param payload the file payload * @return the ETAG checksum */ String put(String containerName, String name, Payload payload); - + /** * Adds/Updates a file to the specified container - * + * * @param containerName the container name - * @param name the name of the file - * @param payload the file payload - * @param options extended options to associate with this object + * @param name the name of the file + * @param payload the file payload + * @param options extended options to associate with this object * @return the ETAG checksum */ String put(String containerName, String name, Payload payload, ObjectPutOptions options); - + /** * Retrieves the Payload for the data backing the given {@code containerName} and {@code name} - * + * * @param containerName the container name - * @param name the object name + * @param name the object name * @return the download payload */ DLPayload download(String containerName, String name); - + /** * Retrieves the Payload for the data backing the given {@code containerName} and {@code name} - * + * * @param containerName the container name - * @param name the object name - * @param options the download options + * @param name the object name + * @param options the download options * @return the download payload */ DLPayload download(String containerName, String name, DownloadOptions options); - + /** * Retrieves the Payload for the data backing the given {@code location} - * + * * @param location the object location - * @param options the download options + * @param options the download options * @return the download payload */ DLPayload download(ObjectLocation location, DownloadOptions options); - + /** * Deletes an Object from the specified container - * + * * @param containerName the container name - * @param name the name of the object (full path if directories are used) + * @param name the name of the object (full path if directories are used) * @return the action response */ ActionResponse delete(String containerName, String name); - + /** * Deletes an Object from the specified container - * + * * @param location location containing container name and object name * @return the action response */ ActionResponse delete(ObjectLocation location); - + /** * Deletes an Object from the specified container - * + * * @param location location containing container name and object name - * @param options the deleting options + * @param options the deleting options * @return the action response */ ActionResponse delete(ObjectLocation location, ObjectDeleteOptions options); - + /** * Copies an object to another object in the object store - * + * * @param source the source container and object name - * @param dest the destination container and object name + * @param dest the destination container and object name * @return the ETAG checksum if successful */ String copy(ObjectLocation source, ObjectLocation dest); - + /** * Gets the metadata for the specified object location + * * @param location the object location * @return Map of Key to Value metadata */ Map getMetadata(ObjectLocation location); - + /** - * See {@link #getMetadata(ObjectLocation)} - * + * See {@link #getMetadata(ObjectLocation)} + * * @param containerName the container name - * @param name the object name + * @param name the object name * @return Map of Key to Value metadata */ Map getMetadata(String containerName, String name); - + /** * Creates or Updates the given metadata for the specified object location - * + * * @param location the location of the object to create/update metadata * @param metadata the metadata * @return true if successful diff --git a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageService.java b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageService.java index 43a00533b..fbb82367c 100644 --- a/core/src/main/java/org/openstack4j/api/storage/ObjectStorageService.java +++ b/core/src/main/java/org/openstack4j/api/storage/ObjectStorageService.java @@ -4,28 +4,28 @@ /** * OpenStack Object Storage service - * + * * @author Jeremy Unruh */ public interface ObjectStorageService extends RestService { /** * The Object Storage Account Service - * + * * @return the account service */ ObjectStorageAccountService account(); - + /** * The Object Storage Container Service - * + * * @return the container service */ ObjectStorageContainerService containers(); - + /** * The Object Storage file and directory service - * + * * @return the object service */ ObjectStorageObjectService objects(); diff --git a/core/src/main/java/org/openstack4j/api/storage/ext/BlockStorageServiceService.java b/core/src/main/java/org/openstack4j/api/storage/ext/BlockStorageServiceService.java index d5360a913..1023530bb 100644 --- a/core/src/main/java/org/openstack4j/api/storage/ext/BlockStorageServiceService.java +++ b/core/src/main/java/org/openstack4j/api/storage/ext/BlockStorageServiceService.java @@ -1,9 +1,9 @@ package org.openstack4j.api.storage.ext; -import java.util.List; - import org.openstack4j.model.storage.block.ext.Service; +import java.util.List; + /** * API which supports the "os-services" extension. * @@ -11,12 +11,12 @@ */ public interface BlockStorageServiceService { - /** - * List services info - * - * NOTE: This is an extension and not all deployments support os-services - * - * @return a list of block storage services - */ - List list(); + /** + * List services info + *

+ * NOTE: This is an extension and not all deployments support os-services + * + * @return a list of block storage services + */ + List list(); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/api/tacker/TackerService.java b/core/src/main/java/org/openstack4j/api/tacker/TackerService.java index 51be8eee0..ff7a986bb 100644 --- a/core/src/main/java/org/openstack4j/api/tacker/TackerService.java +++ b/core/src/main/java/org/openstack4j/api/tacker/TackerService.java @@ -3,22 +3,21 @@ import org.openstack4j.common.RestService; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public interface TackerService extends RestService { - - /** + + /** * @return the Vnfd Service API */ VnfdService vnfd(); - + /** * @return the Vnf Service API */ VnfService vnf(); - + /** * @return the Vim Service API */ diff --git a/core/src/main/java/org/openstack4j/api/tacker/TackerServiceImpl.java b/core/src/main/java/org/openstack4j/api/tacker/TackerServiceImpl.java index d76c27aaa..bec4489b1 100644 --- a/core/src/main/java/org/openstack4j/api/tacker/TackerServiceImpl.java +++ b/core/src/main/java/org/openstack4j/api/tacker/TackerServiceImpl.java @@ -3,24 +3,23 @@ import org.openstack4j.api.Apis; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public class TackerServiceImpl implements TackerService { - @Override - public VnfdService vnfd() { - return Apis.get(VnfdService.class); - } + @Override + public VnfdService vnfd() { + return Apis.get(VnfdService.class); + } - @Override - public VnfService vnf() { - return Apis.get(VnfService.class); - } + @Override + public VnfService vnf() { + return Apis.get(VnfService.class); + } - @Override - public VimService vim() { - return Apis.get(VimService.class); - } + @Override + public VimService vim() { + return Apis.get(VimService.class); + } } diff --git a/core/src/main/java/org/openstack4j/api/tacker/VimService.java b/core/src/main/java/org/openstack4j/api/tacker/VimService.java index a0c4e77a3..31afee1d9 100644 --- a/core/src/main/java/org/openstack4j/api/tacker/VimService.java +++ b/core/src/main/java/org/openstack4j/api/tacker/VimService.java @@ -1,53 +1,52 @@ package org.openstack4j.api.tacker; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.tacker.Vim; +import java.util.List; +import java.util.Map; + /** *

Tacker - OpenStack NFV Orchestration

- * - *

Tacker is an official OpenStack project building a Generic VIM Manager (VIMM) and a NFV Orchestrator (NFVO) to deploy and operate - * Network Services and Virtual Network Functions (VIMs) on an NFV infrastructure platform like OpenStack. + * + *

Tacker is an official OpenStack project building a Generic VIM Manager (VIMM) and a NFV Orchestrator (NFVO) to deploy and operate + * Network Services and Virtual Network Functions (VIMs) on an NFV infrastructure platform like OpenStack. * It is based on ETSI MANO Architectural Framework and provides a functional stack to Orchestrate Network Services end-to-end using VIMs.

* *

- * NFVO: - *

    - *
  • Templatized end-to-end Network Service deployment using decomposed VIMs.
  • - *
  • VIM placement policy – ensure efficient placement of VIMs.
  • - *
  • VIMs connected using an SFC - described in a VIM Forwarding Graph Descriptor.
  • - *
  • VIM Resource Checks and Resource Allocation.
  • - *
  • Ability to orchestrate VIMs across Multiple VIMs and Multiple Sites (POPs).
  • - *
+ * NFVO: + *
    + *
  • Templatized end-to-end Network Service deployment using decomposed VIMs.
  • + *
  • VIM placement policy – ensure efficient placement of VIMs.
  • + *
  • VIMs connected using an SFC - described in a VIM Forwarding Graph Descriptor.
  • + *
  • VIM Resource Checks and Resource Allocation.
  • + *
  • Ability to orchestrate VIMs across Multiple VIMs and Multiple Sites (POPs).
  • + *
*

- * - * @see Official Tacker Documentation - * @see Official GitHub Tacker Reference - * + * * @author Vishvesh Deshmukh * @date Aug 18, 2016 + * @see Official Tacker Documentation + * @see Official GitHub Tacker Reference */ public interface VimService extends RestService { - - /** + + /** * List vims - Lists instantiated vims in VIM Manager * * @return list of all Vim(s) */ List list(); - + /** * List vims - Lists instantiated vims in VIM Manager filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters * @return filtered list of Vim(s) */ List list(Map filteringParams); - + /** * Show Vim - Show information for a specified vimId. * @@ -55,21 +54,23 @@ public interface VimService extends RestService { * @return the Vim or null if not found */ Vim show(String vimId); - + /** * Delete Vim - Deletes a specified vimId from the VIM catalog. + * * @param vimId the Vim identifier * @return the action response */ ActionResponse delete(String vimId); - + /** * Create Vim - Register a Vim entry based on the Vim template. - * @param Vim + * + * @param Vim * @return Vim */ Vim register(Vim vim); - + /** * Update vim - Update a vim based on user config file or data. * @param vimId the Vim identifier diff --git a/core/src/main/java/org/openstack4j/api/tacker/VnfService.java b/core/src/main/java/org/openstack4j/api/tacker/VnfService.java index 2a3727ed0..d20e68190 100644 --- a/core/src/main/java/org/openstack4j/api/tacker/VnfService.java +++ b/core/src/main/java/org/openstack4j/api/tacker/VnfService.java @@ -1,56 +1,55 @@ package org.openstack4j.api.tacker; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.tacker.Vnf; import org.openstack4j.model.tacker.VnfUpdate; +import java.util.List; +import java.util.Map; + /** *

Tacker - OpenStack NFV Orchestration

- * - *

Tacker is an official OpenStack project building a Generic VNF Manager (VNFM) and a NFV Orchestrator (NFVO) to deploy and operate - * Network Services and Virtual Network Functions (VNFs) on an NFV infrastructure platform like OpenStack. + * + *

Tacker is an official OpenStack project building a Generic VNF Manager (VNFM) and a NFV Orchestrator (NFVO) to deploy and operate + * Network Services and Virtual Network Functions (VNFs) on an NFV infrastructure platform like OpenStack. * It is based on ETSI MANO Architectural Framework and provides a functional stack to Orchestrate Network Services end-to-end using VNFs.

- * + * *

Vnf Stands for Virtual Network Functions. This is the VNF Management API Service which is used to Deploy VNFs..

- * + * *

- * VNFM: - *

    - *
  • Basic life-cycle of VNF (create/update/delete).
  • - *
  • Enhanced platform-aware (EPA) placement of high-performance NFV workloads.
  • - *
  • Health monitoring of deployed VNFs.
  • - *
  • Auto Healing / Auto Scaling VNFs based on Policy.
  • - *
  • Facilitate initial configuration of VNF.
  • - *
+ * VNFM: + *
    + *
  • Basic life-cycle of VNF (create/update/delete).
  • + *
  • Enhanced platform-aware (EPA) placement of high-performance NFV workloads.
  • + *
  • Health monitoring of deployed VNFs.
  • + *
  • Auto Healing / Auto Scaling VNFs based on Policy.
  • + *
  • Facilitate initial configuration of VNF.
  • + *
*

- * - * @see Official Tacker Documentation - * @see Official GitHub Tacker Reference - * + * * @author Vishvesh Deshmukh * @date Aug 11, 2016 + * @see Official Tacker Documentation + * @see Official GitHub Tacker Reference */ public interface VnfService extends RestService { - - /** + + /** * List vnfs - Lists instantiated vnfs in VNF Manager * * @return list of all Vnf(s) */ List list(); - + /** * List vnfs - Lists instantiated vnfs in VNF Manager filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters * @return filtered list of Vnf(s) */ List list(Map filteringParams); - + /** * Show Vnf - Show information for a specified VnfId. * @@ -58,24 +57,27 @@ public interface VnfService extends RestService { * @return the Vnf or null if not found */ Vnf get(String vnfId); - + /** * Delete Vnf - Deletes a specified VnfId from the VNF catalog. + * * @param VnfId the Vnf identifier * @return the action response */ ActionResponse delete(String vnfId); - + /** * Create Vnf - Create a Vnf entry based on the Vnf template. - * @param Vnf + * + * @param Vnf * @return Vnf */ Vnf create(Vnf vnf); - + /** * Update vnf - Update a vnf based on user config file or data. - * @param vnfId the Vnf identifier + * + * @param vnfId the Vnf identifier * @param vnfUpdate VnfUpdate * @return Vnf */ diff --git a/core/src/main/java/org/openstack4j/api/tacker/VnfdService.java b/core/src/main/java/org/openstack4j/api/tacker/VnfdService.java index 2b9326bff..b10853873 100644 --- a/core/src/main/java/org/openstack4j/api/tacker/VnfdService.java +++ b/core/src/main/java/org/openstack4j/api/tacker/VnfdService.java @@ -1,53 +1,52 @@ package org.openstack4j.api.tacker; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.tacker.Vnfd; +import java.util.List; +import java.util.Map; + /** *

Tacker - OpenStack NFV Orchestration

- * - *

Tacker is an official OpenStack project building a Generic VNF Manager (VNFM) and a NFV Orchestrator (NFVO) to deploy and operate - * Network Services and Virtual Network Functions (VNFs) on an NFV infrastructure platform like OpenStack. + * + *

Tacker is an official OpenStack project building a Generic VNF Manager (VNFM) and a NFV Orchestrator (NFVO) to deploy and operate + * Network Services and Virtual Network Functions (VNFs) on an NFV infrastructure platform like OpenStack. * It is based on ETSI MANO Architectural Framework and provides a functional stack to Orchestrate Network Services end-to-end using VNFs.

- * + * *

VNFD Stands for Virtual Network Functions Descriptor. This is the VNF Catalog Management (TOSCA-YAML Template) API Service..

- * + * *

- * NFV Catalog: - *

    - *
  • VNF Descriptors.
  • - *
  • Network Services Decriptors.
  • - *
  • VNF Forwarding Graph Descriptors.
  • - *
+ * NFV Catalog: + *
    + *
  • VNF Descriptors.
  • + *
  • Network Services Decriptors.
  • + *
  • VNF Forwarding Graph Descriptors.
  • + *
*

- * - * @see Official Tacker Documentation - * @see Official GitHub Tacker Reference - * + * * @author Vishvesh Deshmukh * @date Aug 11, 2016 + * @see Official Tacker Documentation + * @see Official GitHub Tacker Reference */ public interface VnfdService extends RestService { - - /** + + /** * List vnfs - Lists instantiated vnfs in VNF Manager * * @return list of all Vnfd(s) */ List list(); - + /** * List vnfs - Lists instantiated vnfs in VNF Manager filtered by parameters. - * + * * @param filteringParams map (name, value) of filtering parameters * @return filtered list of Vnfd(s) */ List list(Map filteringParams); - + /** * Show vnfd - Show information for a specified vnfdId. * @@ -55,17 +54,19 @@ public interface VnfdService extends RestService { * @return the Vnfd or null if not found */ Vnfd get(String vnfdId); - + /** * Delete vnfd - Deletes a specified vnfdId from the VNF catalog. + * * @param vnfdId the Vnfd identifier * @return the action response */ ActionResponse delete(String vnfdId); - + /** * Create vnfd - Create a vnfd entry based on the vnfd template. - * @param vnfd + * + * @param vnfd * @return Vnfd */ Vnfd create(Vnfd vnfd); diff --git a/core/src/main/java/org/openstack4j/api/telemetry/AlarmAodhService.java b/core/src/main/java/org/openstack4j/api/telemetry/AlarmAodhService.java index 8944cfdf9..42328bd92 100644 --- a/core/src/main/java/org/openstack4j/api/telemetry/AlarmAodhService.java +++ b/core/src/main/java/org/openstack4j/api/telemetry/AlarmAodhService.java @@ -1,7 +1,6 @@ package org.openstack4j.api.telemetry; /** - * * @author zhangjianweibj */ public interface AlarmAodhService extends AlarmService { diff --git a/core/src/main/java/org/openstack4j/api/telemetry/AlarmService.java b/core/src/main/java/org/openstack4j/api/telemetry/AlarmService.java index d0cf4e734..15992d567 100644 --- a/core/src/main/java/org/openstack4j/api/telemetry/AlarmService.java +++ b/core/src/main/java/org/openstack4j/api/telemetry/AlarmService.java @@ -1,47 +1,44 @@ package org.openstack4j.api.telemetry; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.telemetry.Alarm; +import java.util.List; + /** * Provides alarms within an OpenStack deployment - * + * * @author Massimiliano Romano */ public interface AlarmService extends RestService { - /** - * Return all alarms. - * - * @return list of all alarms - */ - List list(); - - /** - * Return a specified alarm - * - * @return the alarm - */ - Alarm getById(String id); - - /** - * Update a specified alarm - * - */ - void update(String id, Alarm a); - - /** - * Create an alarm - * - */ - Alarm create(Alarm alarm); - - /** - * Delete a specified alarm - * - */ - ActionResponse delete(String id); + /** + * Return all alarms. + * + * @return list of all alarms + */ + List list(); + + /** + * Return a specified alarm + * + * @return the alarm + */ + Alarm getById(String id); + + /** + * Update a specified alarm + */ + void update(String id, Alarm a); + + /** + * Create an alarm + */ + Alarm create(Alarm alarm); + + /** + * Delete a specified alarm + */ + ActionResponse delete(String id); } diff --git a/core/src/main/java/org/openstack4j/api/telemetry/EventService.java b/core/src/main/java/org/openstack4j/api/telemetry/EventService.java index 8421d417c..e4e3f817f 100644 --- a/core/src/main/java/org/openstack4j/api/telemetry/EventService.java +++ b/core/src/main/java/org/openstack4j/api/telemetry/EventService.java @@ -10,7 +10,7 @@ /** * OpenStack (Ceilometer) Event based Operations - * + * * @author Miroslav Lacina */ public interface EventService extends RestService { @@ -27,7 +27,7 @@ public interface EventService extends RestService { * Return all Events matching the query filters * * @param eventCriteria the event query criteria for filtering results - * @param limit maximum number of samples to be returned + * @param limit maximum number of samples to be returned * @return list of Events */ List list(EventCriteria eventCriteria, int limit); diff --git a/core/src/main/java/org/openstack4j/api/telemetry/MeterService.java b/core/src/main/java/org/openstack4j/api/telemetry/MeterService.java index 1cc3f87d4..b3509d642 100644 --- a/core/src/main/java/org/openstack4j/api/telemetry/MeterService.java +++ b/core/src/main/java/org/openstack4j/api/telemetry/MeterService.java @@ -1,79 +1,79 @@ package org.openstack4j.api.telemetry; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.telemetry.Meter; import org.openstack4j.model.telemetry.MeterSample; import org.openstack4j.model.telemetry.SampleCriteria; import org.openstack4j.model.telemetry.Statistics; +import java.util.List; + /** * Provides Measurements against Meters within an OpenStack deployment - * + * * @author Jeremy Unruh */ public interface MeterService extends RestService { - /** - * Return all known meters, based on the data recorded so far. - * - * @return list of all known meters - */ - List list(); - - /** - * Returns samples for the specified Meter - * @param meterName the name of the meter to fetch samples from - * - * @return List of Samples - */ - List samples(String meterName); - - /** + /** + * Return all known meters, based on the data recorded so far. + * + * @return list of all known meters + */ + List list(); + + /** * Returns samples for the specified Meter + * * @param meterName the name of the meter to fetch samples from - * @param criteria the sample query criteria for filtering results - * + * @return List of Samples + */ + List samples(String meterName); + + /** + * Returns samples for the specified Meter + * + * @param meterName the name of the meter to fetch samples from + * @param criteria the sample query criteria for filtering results * @return List of Samples */ List samples(String meterName, SampleCriteria criteria); - - /** - * Returns computed statistics for the given meterName - * @param meterName the name of the meter to fetch statistics for - * - * @return List of Statistics - */ - List statistics(String meterName); - - /** + + /** + * Returns computed statistics for the given meterName + * + * @param meterName the name of the meter to fetch statistics for + * @return List of Statistics + */ + List statistics(String meterName); + + /** * Returns computed statistics for the given meterName - * + * * @param meterName the name of the meter to fetch statistics for - * @param criteria additional query criteria + * @param criteria additional query criteria * @return List of Statistics */ List statistics(String meterName, SampleCriteria criteria); - + /** * Returns computed statistics for the given meterName - * + * * @param meterName the name of the meter to fetch statistics for - * @param criteria additional query criteria - * @param period the result will be statistics for a period long of that number of seconds + * @param criteria additional query criteria + * @param period the result will be statistics for a period long of that number of seconds * @return List of Statistics */ List statistics(String meterName, SampleCriteria criteria, int period); - - /** - * Returns computed statistics for the given meterName for the given time range - * - * @param meterName the name of the meter to fetch statistics for - * @param period the result will be statistics for a period long of that number of seconds - * @return List of Statistics - */ - List statistics(String meterName, int period); - - void putSamples(List sampleList, String meterName); + + /** + * Returns computed statistics for the given meterName for the given time range + * + * @param meterName the name of the meter to fetch statistics for + * @param period the result will be statistics for a period long of that number of seconds + * @return List of Statistics + */ + List statistics(String meterName, int period); + + void putSamples(List sampleList, String meterName); } diff --git a/core/src/main/java/org/openstack4j/api/telemetry/ResourceService.java b/core/src/main/java/org/openstack4j/api/telemetry/ResourceService.java index 3e149488b..fc2e7259a 100644 --- a/core/src/main/java/org/openstack4j/api/telemetry/ResourceService.java +++ b/core/src/main/java/org/openstack4j/api/telemetry/ResourceService.java @@ -1,9 +1,9 @@ package org.openstack4j.api.telemetry; -import java.util.List; - import org.openstack4j.model.telemetry.Resource; +import java.util.List; + public interface ResourceService { List list(); diff --git a/core/src/main/java/org/openstack4j/api/telemetry/SampleService.java b/core/src/main/java/org/openstack4j/api/telemetry/SampleService.java index b940586a9..ff8527774 100644 --- a/core/src/main/java/org/openstack4j/api/telemetry/SampleService.java +++ b/core/src/main/java/org/openstack4j/api/telemetry/SampleService.java @@ -1,17 +1,17 @@ package org.openstack4j.api.telemetry; -import java.util.List; - import org.openstack4j.common.RestService; import org.openstack4j.model.telemetry.Sample; import org.openstack4j.model.telemetry.SampleCriteria; +import java.util.List; + + +public interface SampleService extends RestService { + + List list(); -public interface SampleService extends RestService{ - - List list(); + List list(SampleCriteria criteria); - List list(SampleCriteria criteria); - - Sample get(String sampleId); + Sample get(String sampleId); } diff --git a/core/src/main/java/org/openstack4j/api/telemetry/TelemetryService.java b/core/src/main/java/org/openstack4j/api/telemetry/TelemetryService.java index a7feaf515..1b478edbc 100644 --- a/core/src/main/java/org/openstack4j/api/telemetry/TelemetryService.java +++ b/core/src/main/java/org/openstack4j/api/telemetry/TelemetryService.java @@ -4,14 +4,14 @@ /** * Telemetry allows collection of Alarms and Measurements. - * + * * @author Jeremy Unruh */ public interface TelemetryService extends RestService { /** * Access to Metering (Measurements) API - * + * * @return the Meter Service API */ MeterService meters(); @@ -32,21 +32,21 @@ public interface TelemetryService extends RestService { /** * Access to Samples API - * + * * @return the Sample Service API */ SampleService samples(); /** * Access to resource API - * + * * @return the Resource service API */ ResourceService resources(); /** * Access to capabilities service API - * + * * @return the capabilities service API */ CapabilitiesService capabilities(); diff --git a/core/src/main/java/org/openstack4j/api/trove/DatabaseService.java b/core/src/main/java/org/openstack4j/api/trove/DatabaseService.java index e631089b9..1f2879559 100644 --- a/core/src/main/java/org/openstack4j/api/trove/DatabaseService.java +++ b/core/src/main/java/org/openstack4j/api/trove/DatabaseService.java @@ -16,6 +16,7 @@ public interface DatabaseService { /** * Gets the database specified by ID + * * @param instanceId * @return the database or null if not found */ @@ -23,6 +24,7 @@ public interface DatabaseService { /** * Create a new database + * * @param id * @param databases * @return the action response @@ -31,6 +33,7 @@ public interface DatabaseService { /** * Deletes the database + * * @param instanceId * @param name * @return the action response diff --git a/core/src/main/java/org/openstack4j/api/trove/DatastoreService.java b/core/src/main/java/org/openstack4j/api/trove/DatastoreService.java index 2f482695e..c84e4efb0 100644 --- a/core/src/main/java/org/openstack4j/api/trove/DatastoreService.java +++ b/core/src/main/java/org/openstack4j/api/trove/DatastoreService.java @@ -15,12 +15,14 @@ public interface DatastoreService { /** * Returns list of available datastores + * * @return the list of datastores */ List list(); /** * Gets a datastore specified by ID + * * @param id * @return the datastore or null if not found */ @@ -28,6 +30,7 @@ public interface DatastoreService { /** * Returns list of all datastore versions + * * @param datasoreId * @return list of datastore versions */ @@ -35,6 +38,7 @@ public interface DatastoreService { /** * Get the datastore version specified by ID + * * @param datastoreId * @param versionId * @return the datastore version or null if not found diff --git a/core/src/main/java/org/openstack4j/api/trove/InstanceFlavorService.java b/core/src/main/java/org/openstack4j/api/trove/InstanceFlavorService.java index 2f2d561c3..732f2f652 100644 --- a/core/src/main/java/org/openstack4j/api/trove/InstanceFlavorService.java +++ b/core/src/main/java/org/openstack4j/api/trove/InstanceFlavorService.java @@ -14,12 +14,14 @@ public interface InstanceFlavorService { /** * Returns all the available database instance flavors + * * @return the list of available flavors */ List list(); /** * Get the instance flavor specified by ID + * * @param id * @return the flavor or null if not found */ diff --git a/core/src/main/java/org/openstack4j/api/trove/InstanceService.java b/core/src/main/java/org/openstack4j/api/trove/InstanceService.java index f9b105498..265b5eb1a 100644 --- a/core/src/main/java/org/openstack4j/api/trove/InstanceService.java +++ b/core/src/main/java/org/openstack4j/api/trove/InstanceService.java @@ -1,11 +1,11 @@ package org.openstack4j.api.trove; -import java.util.List; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.trove.Instance; import org.openstack4j.model.trove.InstanceCreate; +import java.util.List; + public interface InstanceService { List list(); diff --git a/core/src/main/java/org/openstack4j/api/trove/TroveService.java b/core/src/main/java/org/openstack4j/api/trove/TroveService.java index dc06dd2e9..9b68d8528 100644 --- a/core/src/main/java/org/openstack4j/api/trove/TroveService.java +++ b/core/src/main/java/org/openstack4j/api/trove/TroveService.java @@ -6,7 +6,6 @@ * This interface contains all available Trove Services * * @author sumit gandhi - * */ public interface TroveService extends RestService { diff --git a/core/src/main/java/org/openstack4j/api/trove/UserService.java b/core/src/main/java/org/openstack4j/api/trove/UserService.java index 4042414f5..2ac3626e4 100644 --- a/core/src/main/java/org/openstack4j/api/trove/UserService.java +++ b/core/src/main/java/org/openstack4j/api/trove/UserService.java @@ -18,6 +18,7 @@ public interface UserService { /** * Returns list of all users for the database instance + * * @param instanceId * @return the list of users for the database instance */ @@ -25,6 +26,7 @@ public interface UserService { /** * Returns list of all databases which the user has access to on the database instance + * * @param instanceId * @param userName * @return the list of databases for a user @@ -33,6 +35,7 @@ public interface UserService { /** * Create a user for the database instance + * * @param instanceId * @param databaseUsers * @return the action response @@ -41,6 +44,7 @@ public interface UserService { /** * Deletes a user for the database instance + * * @param instanceId * @param userName * @return the action response @@ -49,6 +53,7 @@ public interface UserService { /** * Grant user access to a database on the database instance + * * @param instanceId * @param userName * @param databases @@ -58,6 +63,7 @@ public interface UserService { /** * Revoke user access to a database on the database instance + * * @param instanceId * @param userName * @param dbName diff --git a/core/src/main/java/org/openstack4j/api/types/Facing.java b/core/src/main/java/org/openstack4j/api/types/Facing.java index 918bc955a..bd77f7539 100644 --- a/core/src/main/java/org/openstack4j/api/types/Facing.java +++ b/core/src/main/java/org/openstack4j/api/types/Facing.java @@ -5,29 +5,28 @@ /** * Defines the URL perspective in which the API is accessing data from within an OpenStack deployment. For example: admin, public, internal + * * @author Jeremy Unruh */ public enum Facing { - INTERNAL, - ADMIN, - PUBLIC - ; - @JsonValue - public String value() { - return name().toLowerCase(); - } - - @JsonCreator - public static Facing value(String facing) { - if (facing == null || facing.isEmpty()) return PUBLIC; - try - { - return valueOf(facing.toUpperCase()); - } - catch (IllegalArgumentException e) { - return PUBLIC; - } - } - + INTERNAL, + ADMIN, + PUBLIC; + + @JsonValue + public String value() { + return name().toLowerCase(); + } + + @JsonCreator + public static Facing value(String facing) { + if (facing == null || facing.isEmpty()) return PUBLIC; + try { + return valueOf(facing.toUpperCase()); + } catch (IllegalArgumentException e) { + return PUBLIC; + } + } + } diff --git a/core/src/main/java/org/openstack4j/api/types/ServiceType.java b/core/src/main/java/org/openstack4j/api/types/ServiceType.java index 7f068b812..d14942be8 100644 --- a/core/src/main/java/org/openstack4j/api/types/ServiceType.java +++ b/core/src/main/java/org/openstack4j/api/types/ServiceType.java @@ -1,69 +1,65 @@ package org.openstack4j.api.types; import java.util.regex.Pattern; + public enum ServiceType { - IDENTITY("keystone", "identity"), - APP_CATALOG("murano", "application-catalog"), - COMPUTE("nova", "compute"), - IMAGE("glance", "image"), - BLOCK_STORAGE("cinder", "volume"), - OBJECT_STORAGE("object-store", "object-store"), - NETWORK("neutron", "network"), - OCTAVIA("octavia", "load-balancer"), - EC2("ec2", "ec2"), - TELEMETRY("ceilometer", "metering"), - TELEMETRY_AODH("aodh", "alarming"), - ORCHESTRATION("heat", "orchestration"), - CLUSTERING("senlin", "clustering"), - SAHARA("sahara", "data_processing"), - SHARE("manila", "share"), - DATABASE("trove","database"), - BARBICAN("barbican", "key-manager"), - TACKER("tacker", "nfv-orchestration"), - ARTIFACT("glare", "artifact"), - MAGNUM("magnum", "container"), - DNS("designate", "dns"), - WORKFLOW("mistral", "workflow"), - UNKNOWN("NA", "NA") - ; + IDENTITY("keystone", "identity"), + APP_CATALOG("murano", "application-catalog"), + COMPUTE("nova", "compute"), + IMAGE("glance", "image"), + BLOCK_STORAGE("cinder", "volume"), + OBJECT_STORAGE("object-store", "object-store"), + NETWORK("neutron", "network"), + OCTAVIA("octavia", "load-balancer"), + EC2("ec2", "ec2"), + TELEMETRY("ceilometer", "metering"), + TELEMETRY_AODH("aodh", "alarming"), + ORCHESTRATION("heat", "orchestration"), + CLUSTERING("senlin", "clustering"), + SAHARA("sahara", "data_processing"), + SHARE("manila", "share"), + DATABASE("trove", "database"), + BARBICAN("barbican", "key-manager"), + TACKER("tacker", "nfv-orchestration"), + ARTIFACT("glare", "artifact"), + MAGNUM("magnum", "container"), + DNS("designate", "dns"), + WORKFLOW("mistral", "workflow"), + UNKNOWN("NA", "NA"); - private final String serviceName; - private final String type; + private final String serviceName; + private final String type; private final Pattern servicePattern; private static final String SERVICE_PATTERN_SUFFIX = "[v|\\d|\\.]*"; - ServiceType(String serviceName, String type) { - this.serviceName = serviceName; - this.type = type; + ServiceType(String serviceName, String type) { + this.serviceName = serviceName; + this.type = type; this.servicePattern = Pattern.compile(Pattern.quote(serviceName) + SERVICE_PATTERN_SUFFIX + "|" + Pattern.quote(type) + SERVICE_PATTERN_SUFFIX + "|" + Pattern.quote(this.name()) + SERVICE_PATTERN_SUFFIX , Pattern.CASE_INSENSITIVE); } - public String getServiceName() { - return this.serviceName; - } + public String getServiceName() { + return this.serviceName; + } - public String getType() { - return this.type; - } + public String getType() { + return this.type; + } - private Pattern getServicePattern() - { + private Pattern getServicePattern() { return this.servicePattern; } - public static ServiceType forName(String name) - { - if (name == null || name.isEmpty()) - { + public static ServiceType forName(String name) { + if (name == null || name.isEmpty()) { return ServiceType.UNKNOWN; } - for (ServiceType s : ServiceType.values()) - { - if(s.getServicePattern().matcher(name).matches()) + for (ServiceType s : ServiceType.values()) { + if (s.getServicePattern().matcher(name).matches()) return s; } return ServiceType.UNKNOWN; diff --git a/core/src/main/java/org/openstack4j/api/workflow/ActionDefinitionService.java b/core/src/main/java/org/openstack4j/api/workflow/ActionDefinitionService.java index fcb687f02..644963fcf 100644 --- a/core/src/main/java/org/openstack4j/api/workflow/ActionDefinitionService.java +++ b/core/src/main/java/org/openstack4j/api/workflow/ActionDefinitionService.java @@ -10,7 +10,7 @@ /** * Service that provides CRUD operations for action definitions. - * + * * @author Renat Akhmerov */ public interface ActionDefinitionService extends RestService { @@ -26,7 +26,7 @@ public interface ActionDefinitionService extends RestService { * Create a new action definition. * * @param actionText Text in YAML format (Mistral language) with one or more action definitions. - * @param scope Scope of newly created workflows. + * @param scope Scope of newly created workflows. * @return Created action definition. */ List create(InputStream actionText, Scope scope); diff --git a/core/src/main/java/org/openstack4j/api/workflow/WorkbookDefinitionService.java b/core/src/main/java/org/openstack4j/api/workflow/WorkbookDefinitionService.java index 9f2479946..6af7ffdcc 100644 --- a/core/src/main/java/org/openstack4j/api/workflow/WorkbookDefinitionService.java +++ b/core/src/main/java/org/openstack4j/api/workflow/WorkbookDefinitionService.java @@ -10,7 +10,7 @@ /** * Service that provides CRUD operations for workbook definitions. - * + * * @author Renat Akhmerov */ public interface WorkbookDefinitionService extends RestService { @@ -25,7 +25,7 @@ public interface WorkbookDefinitionService extends RestService { * Create a new workbook definition. * * @param wbText Text in YAML format (Mistral language) with a workbook definition. - * @param scope Scope of newly created workbook. + * @param scope Scope of newly created workbook. * @return Created workbook definition. */ WorkbookDefinition create(InputStream wbText, Scope scope); diff --git a/core/src/main/java/org/openstack4j/api/workflow/WorkflowDefinitionService.java b/core/src/main/java/org/openstack4j/api/workflow/WorkflowDefinitionService.java index 2e67fe038..b8754109c 100644 --- a/core/src/main/java/org/openstack4j/api/workflow/WorkflowDefinitionService.java +++ b/core/src/main/java/org/openstack4j/api/workflow/WorkflowDefinitionService.java @@ -10,7 +10,7 @@ /** * Service that provides CRUD operations for workflow definitions. - * + * * @author Renat Akhmerov */ public interface WorkflowDefinitionService extends RestService { @@ -26,7 +26,7 @@ public interface WorkflowDefinitionService extends RestService { * Create one or more workflow definitions. * * @param wfText Text in YAML format (Mistral language) with one or more workflow definitions. - * @param scope Scope of newly created workflows. + * @param scope Scope of newly created workflows. * @return Created workflow definitions. */ List create(InputStream wfText, Scope scope); diff --git a/core/src/main/java/org/openstack4j/api/workflow/WorkflowService.java b/core/src/main/java/org/openstack4j/api/workflow/WorkflowService.java index 8a6e37ae1..04c851444 100644 --- a/core/src/main/java/org/openstack4j/api/workflow/WorkflowService.java +++ b/core/src/main/java/org/openstack4j/api/workflow/WorkflowService.java @@ -4,26 +4,26 @@ /** * Workflow Service (Mistral) API - * + *

* TODO: add 'services' and 'resources'. * * @author Renat Akhmerov */ public interface WorkflowService extends RestService { - /** - * Workflow definition Service API. - * - * @return The workflow definition service. - */ - WorkflowDefinitionService workflowDefinitions(); + /** + * Workflow definition Service API. + * + * @return The workflow definition service. + */ + WorkflowDefinitionService workflowDefinitions(); - /** - * Action definition Service API. - * - * @return The action definition service. - */ - ActionDefinitionService actionDefinitions(); + /** + * Action definition Service API. + * + * @return The action definition service. + */ + ActionDefinitionService actionDefinitions(); /** * Workbook definition Service API diff --git a/core/src/main/java/org/openstack4j/common/Buildable.java b/core/src/main/java/org/openstack4j/common/Buildable.java index 4fda71c67..8a4cfbd55 100644 --- a/core/src/main/java/org/openstack4j/common/Buildable.java +++ b/core/src/main/java/org/openstack4j/common/Buildable.java @@ -2,37 +2,36 @@ /** - * Model classes decorated with this interface are compatible for write/update operations and can be created via the Builder API. - * + * Model classes decorated with this interface are compatible for write/update operations and can be created via the Builder API. + * * @author Jeremy Unruh */ public interface Buildable { - B toBuilder(); - - /** - * Builder used to create/build corresponding Model Entity - * - * @param The Builder providing the creation of M - * @param The ouput IModelEntity type - * - * @author Jeremy Unruh - */ - public interface Builder, M extends Buildable> { + B toBuilder(); - /** - * Creates and return the Model Entity M - * - * @return M instance - */ - M build(); - - /** - * Creates a Builder using the param M as the default values - * - * @param The Model M - * @return Builder - */ - T from(M in); - } + /** + * Builder used to create/build corresponding Model Entity + * + * @param The Builder providing the creation of M + * @param The ouput IModelEntity type + * @author Jeremy Unruh + */ + public interface Builder, M extends Buildable> { + + /** + * Creates and return the Model Entity M + * + * @return M instance + */ + M build(); + + /** + * Creates a Builder using the param M as the default values + * + * @param The Model M + * @return Builder + */ + T from(M in); + } } diff --git a/core/src/main/java/org/openstack4j/common/RestService.java b/core/src/main/java/org/openstack4j/common/RestService.java index b94009f6b..fcb5a4d1f 100644 --- a/core/src/main/java/org/openstack4j/common/RestService.java +++ b/core/src/main/java/org/openstack4j/common/RestService.java @@ -2,7 +2,7 @@ /** * An API decorator which is a rest consumer - * + * * @author Jeremy Unruh */ public interface RestService { diff --git a/core/src/main/java/org/openstack4j/core/transport/ClientConstants.java b/core/src/main/java/org/openstack4j/core/transport/ClientConstants.java index 7516e85bf..d253e7475 100644 --- a/core/src/main/java/org/openstack4j/core/transport/ClientConstants.java +++ b/core/src/main/java/org/openstack4j/core/transport/ClientConstants.java @@ -31,7 +31,7 @@ public final class ClientConstants { public static final String CONTENT_TYPE_TEXT_HTML = "text/html"; public static final String CONTENT_TYPE_IMAGE_V2_PATCH = "application/openstack-images-v2.1-json-patch"; public static final String CONTENT_TYPE_ARTIFACT_PATCH = "application/json-patch+json"; - + public static final String X_OPENSTACK_REQUEST_ID = "x-openstack-request-id"; public static final String X_COMPUTE_REQUEST_ID = "X-Compute-Request-Id"; diff --git a/core/src/main/java/org/openstack4j/core/transport/Config.java b/core/src/main/java/org/openstack4j/core/transport/Config.java index 22c68c1d6..f11a8bca7 100644 --- a/core/src/main/java/org/openstack4j/core/transport/Config.java +++ b/core/src/main/java/org/openstack4j/core/transport/Config.java @@ -1,11 +1,11 @@ package org.openstack4j.core.transport; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLContext; - import org.openstack4j.api.identity.EndpointURLResolver; import org.openstack4j.model.common.resolvers.ServiceVersionResolver; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; + /** * OpenStack4j Configuration - options that are configured with OpenStack4j clients. * @@ -47,7 +47,7 @@ public Config withResolver(ServiceVersionResolver resolver) { this.resolver = resolver; return this; } - + /** * Sets the Endpoint URL resolver for providing the URL resolution strategy * @@ -55,8 +55,8 @@ public Config withResolver(ServiceVersionResolver resolver) { * @return Config */ public Config withEndpointURLResolver(EndpointURLResolver endpointURLResolver) { - this.endpointURLResolver = endpointURLResolver; - return this; + this.endpointURLResolver = endpointURLResolver; + return this; } @@ -163,7 +163,7 @@ public Config withHostnameVerifier(HostnameVerifier hostnameVerifier) { /** * If no SSL Context has been specified and this SSL Verification is disabled we will by pass certificate checks (useful for self signed certificates). - * + *

* NOTE: This property used to be known as "useNonStrictSSL" in previous releases * * @return Config @@ -176,13 +176,13 @@ public Config withSSLVerificationDisabled() { public ServiceVersionResolver getResolver() { return resolver; } - + public ServiceVersionResolver getV2Resolver() { return resolver; } - + public EndpointURLResolver getEndpointURLResolver() { - return endpointURLResolver; + return endpointURLResolver; } public int getConnectTimeout() { @@ -270,21 +270,21 @@ public boolean equals(Object obj) { return false; } else if (!proxy.equals(other.proxy)) return false; - if(sslContext == null) { - if(other.getSslContext() != null) { - return false; - } - } else if(!sslContext.equals(other.getSslContext())) { - return false; + if (sslContext == null) { + if (other.getSslContext() != null) { + return false; + } + } else if (!sslContext.equals(other.getSslContext())) { + return false; } - if(hostNameVerifier == null) { - if(other.getHostNameVerifier() != null) { - return false; - } - } else if(!hostNameVerifier.equals(other.getHostNameVerifier())) { - return false; + if (hostNameVerifier == null) { + if (other.getHostNameVerifier() != null) { + return false; + } + } else if (!hostNameVerifier.equals(other.getHostNameVerifier())) { + return false; } - + return true; } diff --git a/core/src/main/java/org/openstack4j/core/transport/ExecutionOptions.java b/core/src/main/java/org/openstack4j/core/transport/ExecutionOptions.java index ef233be31..cce1c2cd3 100644 --- a/core/src/main/java/org/openstack4j/core/transport/ExecutionOptions.java +++ b/core/src/main/java/org/openstack4j/core/transport/ExecutionOptions.java @@ -4,48 +4,49 @@ /** * HTTP Execution Options - * - * @author Jeremy Unruh + * * @param + * @author Jeremy Unruh */ public class ExecutionOptions { private Function parser; private PropagateResponse propagateResponse; - + private ExecutionOptions(Function parser, PropagateResponse propagateResponse) { this.parser = parser; this.propagateResponse = propagateResponse; } - + public static ExecutionOptions create(Function parser) { return new ExecutionOptions(parser, null); } - + public static ExecutionOptions create(PropagateResponse propagateResponse) { return new ExecutionOptions(null, propagateResponse); } - + public static ExecutionOptions create(Function parser, PropagateResponse propagateResponse) { return new ExecutionOptions(parser, propagateResponse); } - + /** * @return the result function parser or null */ public Function getParser() { return parser; } - + /** * @return true if a result parser is associated with these options */ public boolean hasParser() { return parser != null; } - + /** * If a PropagateResponse is associated with these options then it will be invoked otherwise a no-op + * * @param response the HttpResponse */ public void propagate(HttpResponse response) { diff --git a/core/src/main/java/org/openstack4j/core/transport/Handle.java b/core/src/main/java/org/openstack4j/core/transport/Handle.java index 36ccd6e42..95bae8b24 100644 --- a/core/src/main/java/org/openstack4j/core/transport/Handle.java +++ b/core/src/main/java/org/openstack4j/core/transport/Handle.java @@ -2,76 +2,75 @@ /** * A handle which is used to visit entity handling conditions and to determine if the workflow is satisfied - * - * @author Jeremy Unruh * * @param + * @author Jeremy Unruh */ public class Handle { - private final HttpResponse response; - private final Class returnType; - private final ExecutionOptions options; - private final boolean requiresVoidBodyHandling; - private T returnObject; + private final HttpResponse response; + private final Class returnType; + private final ExecutionOptions options; + private final boolean requiresVoidBodyHandling; + private T returnObject; + + private boolean complete; + + private Handle(HttpResponse response, Class returnType, ExecutionOptions options, boolean requiresVoidBodyHandling) { + this.response = response; + this.returnType = returnType; + this.options = options; + this.requiresVoidBodyHandling = requiresVoidBodyHandling; + } + + static Handle create(HttpResponse response, Class returnType, ExecutionOptions options, boolean requiresVoidBodyHandling) { + return new Handle(response, returnType, options, requiresVoidBodyHandling); + } + + /** + * Stops handling workflow and sets the resulting return object + * + * @param returnObject the return object + * @return the handle + */ + Handle complete(T returnObject) { + this.complete = true; + this.returnObject = returnObject; + return this; + } + + /** + * Handler did not satisfy the conditions it was after so this method lets the workflow know to continue the visiting process + * to the next handler + * + * @return the handle + */ + Handle continueHandling() { + this.complete = false; + return this; + } + + public T getReturnObject() { + return returnObject; + } - private boolean complete; - - private Handle(HttpResponse response, Class returnType, ExecutionOptions options, boolean requiresVoidBodyHandling) { - this.response = response; - this.returnType = returnType; - this.options = options; - this.requiresVoidBodyHandling = requiresVoidBodyHandling; - } - - static Handle create(HttpResponse response, Class returnType, ExecutionOptions options, boolean requiresVoidBodyHandling) { - return new Handle(response, returnType, options, requiresVoidBodyHandling); - } - - /** - * Stops handling workflow and sets the resulting return object - * - * @param returnObject the return object - * @return the handle - */ - Handle complete(T returnObject) { - this.complete = true; - this.returnObject = returnObject; - return this; - } - - /** - * Handler did not satisfy the conditions it was after so this method lets the workflow know to continue the visiting process - * to the next handler - * - * @return the handle - */ - Handle continueHandling() { - this.complete = false; - return this; - } - - public T getReturnObject() { - return returnObject; - } + public boolean isComplete() { + return complete; + } - public boolean isComplete() { - return complete; - } - - public HttpResponse getResponse() { - return response; - } + public HttpResponse getResponse() { + return response; + } - public Class getReturnType() { - return returnType; - } + public Class getReturnType() { + return returnType; + } - public ExecutionOptions getOptions() { - return options; - } + public ExecutionOptions getOptions() { + return options; + } - public boolean isRequiresVoidBodyHandling() { - return requiresVoidBodyHandling; - } + public boolean isRequiresVoidBodyHandling() { + return requiresVoidBodyHandling; + } } diff --git a/core/src/main/java/org/openstack4j/core/transport/HttpEntityHandler.java b/core/src/main/java/org/openstack4j/core/transport/HttpEntityHandler.java index 25f7d3e48..93cbbe794 100644 --- a/core/src/main/java/org/openstack4j/core/transport/HttpEntityHandler.java +++ b/core/src/main/java/org/openstack4j/core/transport/HttpEntityHandler.java @@ -26,7 +26,7 @@ public static T handle(HttpResponse response, Class returnType, Execution @SuppressWarnings("unchecked") public static T handle(HttpResponse response, Class returnType, ExecutionOptions options, - boolean requiresVoidBodyHandling) { + boolean requiresVoidBodyHandling) { try { Handle handle = Handle.create(response, returnType, options, requiresVoidBodyHandling); diff --git a/core/src/main/java/org/openstack4j/core/transport/HttpExceptionHandler.java b/core/src/main/java/org/openstack4j/core/transport/HttpExceptionHandler.java index 5088c742c..44525cb98 100644 --- a/core/src/main/java/org/openstack4j/core/transport/HttpExceptionHandler.java +++ b/core/src/main/java/org/openstack4j/core/transport/HttpExceptionHandler.java @@ -7,7 +7,7 @@ /** * Exception Handles for common Http messages and status codes - * + * * @author Jeremy Unruh */ public class HttpExceptionHandler { @@ -16,7 +16,7 @@ public class HttpExceptionHandler { * Maps an Exception based on the underlying status code * * @param message the message - * @param status the status + * @param status the status * @return the response exception */ public static ResponseException mapException(String message, int status) { @@ -27,8 +27,8 @@ public static ResponseException mapException(String message, int status) { * Maps an Exception based on the underlying status code * * @param message the message - * @param status the status - * @param cause the cause + * @param status the status + * @param cause the cause * @return the response exception */ public static ResponseException mapException(String message, int status, Throwable cause) { @@ -41,5 +41,5 @@ public static ResponseException mapException(String message, int status, Throwab return new ResponseException(message, status, cause); } - + } diff --git a/core/src/main/java/org/openstack4j/core/transport/HttpExecutorService.java b/core/src/main/java/org/openstack4j/core/transport/HttpExecutorService.java index d060bc5c9..fc8b876fe 100644 --- a/core/src/main/java/org/openstack4j/core/transport/HttpExecutorService.java +++ b/core/src/main/java/org/openstack4j/core/transport/HttpExecutorService.java @@ -2,22 +2,22 @@ /** * A Service which is responsible of execution an HttpRequest - * + * * @author Jeremy Unruh */ public interface HttpExecutorService { - /** - * Executes the given request and returns the {@code HttpResponse} result from the server - * - * @param the underlying return entity type - * @param request the request to execute - * @return HttpResponse from the server - */ - HttpResponse execute(HttpRequest request); - - /** - * @return the executors display friendly name. useful for logging or tests - */ - String getExecutorDisplayName(); + /** + * Executes the given request and returns the {@code HttpResponse} result from the server + * + * @param the underlying return entity type + * @param request the request to execute + * @return HttpResponse from the server + */ + HttpResponse execute(HttpRequest request); + + /** + * @return the executors display friendly name. useful for logging or tests + */ + String getExecutorDisplayName(); } diff --git a/core/src/main/java/org/openstack4j/core/transport/HttpMethod.java b/core/src/main/java/org/openstack4j/core/transport/HttpMethod.java index 6ee1862fc..2d77fe894 100644 --- a/core/src/main/java/org/openstack4j/core/transport/HttpMethod.java +++ b/core/src/main/java/org/openstack4j/core/transport/HttpMethod.java @@ -2,9 +2,9 @@ /** * Supported Http Client Methods - * + * * @author Jeremy Unruh */ public enum HttpMethod { - HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE + HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE } diff --git a/core/src/main/java/org/openstack4j/core/transport/HttpRequest.java b/core/src/main/java/org/openstack4j/core/transport/HttpRequest.java index d7c34b374..4e744f272 100644 --- a/core/src/main/java/org/openstack4j/core/transport/HttpRequest.java +++ b/core/src/main/java/org/openstack4j/core/transport/HttpRequest.java @@ -13,399 +13,406 @@ import java.util.Map; /** - * A Request Delegate which aids in building the request that is compatible with the OpenStack Rest API. The request is used to encoding as well as keeping reference to + * A Request Delegate which aids in building the request that is compatible with the OpenStack Rest API. The request is used to encoding as well as keeping reference to * the return type - * + * * @param the entity return type * @author Jeremy Unruh */ public class HttpRequest { - String endpoint; - String path; - Class returnType; - Object entity; - String contentType = ClientConstants.CONTENT_TYPE_JSON; - HttpMethod method = HttpMethod.GET; - String json; - private Config config; - private Map> queryParams; - private Map headers = new HashMap(); - private Function endpointFunc; - public HttpRequest() { } - - /** - * Creates a new HttpRequest - * - * @param endpoint the endpoint URI - * @param path the path which will be appended to the endpoint URI - * @param method the method the method type to invoke - * @param entity the entity (used for posts) - * @param returnType the expected return type - */ - public HttpRequest(String endpoint, String path, HttpMethod method, ModelEntity entity, Class returnType) { - this.endpoint = endpoint; - this.path = path; - this.method = method; - this.entity = entity; - } - - /** - * A build for creating HttpRequest objects - * - * @return the request builder - */ - public static RequestBuilder builder() { - return new RequestBuilder(Void.class); - } - - /** - * A build for creating HttpRequest objects - * - * @param the expected return type - * @param returnType the return type - * @return the request builder - */ - public static RequestBuilder builder(Class returnType) { - return new RequestBuilder(returnType); - } - - /** - * @return the method this request will use - */ - public HttpMethod getMethod() { - return method; - } - - /** - * @return the content type for the request - */ - public String getContentType() { - return contentType; - } - - /** - * @return the endpoint URI - */ - public String getEndpoint() { - if (endpointFunc != null) - return endpointFunc.apply(endpoint); - return endpoint; - } - - /** - * @return the http path - */ - public String getPath() { - return path; - } - - /** - * If JSON is explicitly set vs an entity then this method will return a JSON String otherwise Empty - * @return JSON String form or Empty - */ - public String getJson() { - return (json == null) ? "" : json; - } - - /** - * @return true, if a JSON Object has been set - */ - public boolean hasJson() { - return (json != null); - } - - /** - * @return the return type expected after invocation - */ - public Class getReturnType() { - return returnType; - } - - /** - * @return the entity to post - */ - public Object getEntity() { - return entity; - } - - /** - * @return true, if query params have been added - */ - public boolean hasQueryParams() { - return queryParams != null && !queryParams.isEmpty(); - } - - /** - * @return the request query params - */ - public Map> getQueryParams() { - return queryParams; - } - - /** - * @return the headers to apply - */ - public Map getHeaders() { - return headers; - } - - /** - * @return true, if headers have been added - */ - public boolean hasHeaders() { - return !headers.isEmpty(); - } - - public RequestBuilder toBuilder() { - return new RequestBuilder(this); - } - - /** - * @return the client configuration associated with this request - */ - public Config getConfig() { - return config != null ? config : Config.DEFAULT; - } - - public static final class RequestBuilder { - - HttpRequest request; - EndpointTokenProvider provider; - ServiceType service; - - public RequestBuilder(HttpRequest request) { - this.request = request; - } - - public RequestBuilder(Class returnType) { - request = new HttpRequest(); - request.returnType = returnType; - } - - /** - * @see HttpRequest#getEndpoint() - */ - public RequestBuilder endpoint(String endpoint) { - request.endpoint = endpoint; - return this; - } - - /** - * @see HttpRequest#getPath() - */ - public RequestBuilder path(String path) { - request.path = path; - return this; - } - - /** - * @see HttpRequest#getMethod() - */ - public RequestBuilder method(HttpMethod method) { - request.method = method; - return this; - } - - /** - * A Function which allows manipulation of the endpoint depending on the service API utilizing it - * @param endpointFunc the function to modify the current endpoint into a resulting endpoint - * @return this - */ - public RequestBuilder endpointFunction(Function endpointFunc) { - request.endpointFunc = endpointFunc; - return this; - } - - /** - * Flags the request method as PUT - * - * @return the request builder - */ - public RequestBuilder methodPut() { - request.method = HttpMethod.PUT; - return this; - } - - /** - * Flags the request method as GET - * - * @return the request builder - */ - public RequestBuilder methodGet() { - request.method = HttpMethod.GET; - return this; - } - - /** - * Flags the request method as DELETE - * - * @return the request builder - */ - public RequestBuilder methodDelete() { - request.method = HttpMethod.DELETE; - return this; - } - - /** - * Flags the request method as POST - * - * @return the request builder - */ - public RequestBuilder methodPost() { - request.method = HttpMethod.POST; - return this; - } - - /** - * @see HttpRequest#getEntity() - */ - public RequestBuilder entity(ModelEntity entity) { - request.entity = entity; - return this; - } - - /** - * @see HttpRequest#getEntity() - */ - public RequestBuilder entity(Payload entity) { - if (entity != null) - request.entity = entity.open(); - return this; - } - - /** + String endpoint; + String path; + Class returnType; + Object entity; + String contentType = ClientConstants.CONTENT_TYPE_JSON; + HttpMethod method = HttpMethod.GET; + String json; + private Config config; + private Map> queryParams; + private Map headers = new HashMap(); + private Function endpointFunc; + + public HttpRequest() { + } + + /** + * Creates a new HttpRequest + * + * @param endpoint the endpoint URI + * @param path the path which will be appended to the endpoint URI + * @param method the method the method type to invoke + * @param entity the entity (used for posts) + * @param returnType the expected return type + */ + public HttpRequest(String endpoint, String path, HttpMethod method, ModelEntity entity, Class returnType) { + this.endpoint = endpoint; + this.path = path; + this.method = method; + this.entity = entity; + } + + /** + * A build for creating HttpRequest objects + * + * @return the request builder + */ + public static RequestBuilder builder() { + return new RequestBuilder(Void.class); + } + + /** + * A build for creating HttpRequest objects + * + * @param the expected return type + * @param returnType the return type + * @return the request builder + */ + public static RequestBuilder builder(Class returnType) { + return new RequestBuilder(returnType); + } + + /** + * @return the method this request will use + */ + public HttpMethod getMethod() { + return method; + } + + /** + * @return the content type for the request + */ + public String getContentType() { + return contentType; + } + + /** + * @return the endpoint URI + */ + public String getEndpoint() { + if (endpointFunc != null) + return endpointFunc.apply(endpoint); + return endpoint; + } + + /** + * @return the http path + */ + public String getPath() { + return path; + } + + /** + * If JSON is explicitly set vs an entity then this method will return a JSON String otherwise Empty + * + * @return JSON String form or Empty + */ + public String getJson() { + return (json == null) ? "" : json; + } + + /** + * @return true, if a JSON Object has been set + */ + public boolean hasJson() { + return (json != null); + } + + /** + * @return the return type expected after invocation + */ + public Class getReturnType() { + return returnType; + } + + /** + * @return the entity to post + */ + public Object getEntity() { + return entity; + } + + /** + * @return true, if query params have been added + */ + public boolean hasQueryParams() { + return queryParams != null && !queryParams.isEmpty(); + } + + /** + * @return the request query params + */ + public Map> getQueryParams() { + return queryParams; + } + + /** + * @return the headers to apply + */ + public Map getHeaders() { + return headers; + } + + /** + * @return true, if headers have been added + */ + public boolean hasHeaders() { + return !headers.isEmpty(); + } + + public RequestBuilder toBuilder() { + return new RequestBuilder(this); + } + + /** + * @return the client configuration associated with this request + */ + public Config getConfig() { + return config != null ? config : Config.DEFAULT; + } + + public static final class RequestBuilder { + + HttpRequest request; + EndpointTokenProvider provider; + ServiceType service; + + public RequestBuilder(HttpRequest request) { + this.request = request; + } + + public RequestBuilder(Class returnType) { + request = new HttpRequest(); + request.returnType = returnType; + } + + /** + * @see HttpRequest#getEndpoint() + */ + public RequestBuilder endpoint(String endpoint) { + request.endpoint = endpoint; + return this; + } + + /** + * @see HttpRequest#getPath() + */ + public RequestBuilder path(String path) { + request.path = path; + return this; + } + + /** + * @see HttpRequest#getMethod() + */ + public RequestBuilder method(HttpMethod method) { + request.method = method; + return this; + } + + /** + * A Function which allows manipulation of the endpoint depending on the service API utilizing it + * + * @param endpointFunc the function to modify the current endpoint into a resulting endpoint + * @return this + */ + public RequestBuilder endpointFunction(Function endpointFunc) { + request.endpointFunc = endpointFunc; + return this; + } + + /** + * Flags the request method as PUT + * + * @return the request builder + */ + public RequestBuilder methodPut() { + request.method = HttpMethod.PUT; + return this; + } + + /** + * Flags the request method as GET + * + * @return the request builder + */ + public RequestBuilder methodGet() { + request.method = HttpMethod.GET; + return this; + } + + /** + * Flags the request method as DELETE + * + * @return the request builder + */ + public RequestBuilder methodDelete() { + request.method = HttpMethod.DELETE; + return this; + } + + /** + * Flags the request method as POST + * + * @return the request builder + */ + public RequestBuilder methodPost() { + request.method = HttpMethod.POST; + return this; + } + + /** + * @see HttpRequest#getEntity() + */ + public RequestBuilder entity(ModelEntity entity) { + request.entity = entity; + return this; + } + + /** + * @see HttpRequest#getEntity() + */ + public RequestBuilder entity(Payload entity) { + if (entity != null) + request.entity = entity.open(); + return this; + } + + /** * Sets a client configuration to use with this session */ public RequestBuilder config(Config config) { request.config = config; return this; } - - /** - * Pushes the Map of Headers into the existing headers for this request - * @param headers the headers to append - * @return the request builder - */ - public RequestBuilder headers(Map headers) { - request.getHeaders().putAll(headers); - return this; - } - - /** - * Adds a new Header to the request - * @param name the header name - * @param value the header value - * @return the request builder - */ - public RequestBuilder header(String name, Object value) { - request.getHeaders().put(name, value); - return this; - } - - /** - * The endpoint Service Type - * - * @param service the service type - * @return the request builder - */ - public RequestBuilder serviceType(ServiceType service) { - this.service = service; - return this; - } - - /** - * Adds a Key/Value based Query Param - * - * @param key the key - * @param value the value - * @return the request builder - */ - public RequestBuilder queryParam(String key, Object value) { - if (value == null) - return this; - - if (request.queryParams == null) - request.queryParams = Maps.newHashMap(); - - if (request.queryParams.containsKey(key)) { - List values = request.queryParams.get(key); - values.add(value); - } else { - List values = new ArrayList(); - values.add(value); - request.queryParams.put(key, values); - } - return this; - } + + /** + * Pushes the Map of Headers into the existing headers for this request + * + * @param headers the headers to append + * @return the request builder + */ + public RequestBuilder headers(Map headers) { + request.getHeaders().putAll(headers); + return this; + } + + /** + * Adds a new Header to the request + * + * @param name the header name + * @param value the header value + * @return the request builder + */ + public RequestBuilder header(String name, Object value) { + request.getHeaders().put(name, value); + return this; + } + + /** + * The endpoint Service Type + * + * @param service the service type + * @return the request builder + */ + public RequestBuilder serviceType(ServiceType service) { + this.service = service; + return this; + } + + /** + * Adds a Key/Value based Query Param + * + * @param key the key + * @param value the value + * @return the request builder + */ + public RequestBuilder queryParam(String key, Object value) { + if (value == null) + return this; + + if (request.queryParams == null) + request.queryParams = Maps.newHashMap(); + + if (request.queryParams.containsKey(key)) { + List values = request.queryParams.get(key); + values.add(value); + } else { + List values = new ArrayList(); + values.add(value); + request.queryParams.put(key, values); + } + return this; + } + /** - * Updates a Key/Value based Query Param + * Updates a Key/Value based Query Param * - * @param key the key + * @param key the key * @param value the value * @return the request builder */ public RequestBuilder updateQueryParam(String key, Object value) { if (value == null) return this; - + if (request.queryParams == null) request.queryParams = Maps.newHashMap(); List values = new ArrayList(); values.add(value); request.queryParams.put(key, values); - + return this; } - /** - * A Provider which will return the current Authorization Token - * - * @param provider the provider - * @return the request builder - */ - public RequestBuilder endpointTokenProvider(EndpointTokenProvider provider) { - this.provider = provider; - return this; - } - - /** - * AdHoc JSON object to Post/Put - * - * @param json the JSON object in String form - * @return the request builder - */ - public RequestBuilder json(String json) { - request.json = json; - return this; - } - - /** - * Overrides the default content type for the request - * - * @param contentType the content type to use in the request - * @return the request builder - */ - public RequestBuilder contentType(String contentType) { - if (contentType != null) - request.contentType = contentType; - return this; - } - - /** - * Builds the HttpRequest - * - * @return HttpRequest - */ - public HttpRequest build() { - if (provider != null) - { - request.endpoint = provider.getEndpoint(service); - if (provider.getTokenId() != null) - request.getHeaders().put(ClientConstants.HEADER_X_AUTH_TOKEN, provider.getTokenId()); - } - return request; - } - } + + /** + * A Provider which will return the current Authorization Token + * + * @param provider the provider + * @return the request builder + */ + public RequestBuilder endpointTokenProvider(EndpointTokenProvider provider) { + this.provider = provider; + return this; + } + + /** + * AdHoc JSON object to Post/Put + * + * @param json the JSON object in String form + * @return the request builder + */ + public RequestBuilder json(String json) { + request.json = json; + return this; + } + + /** + * Overrides the default content type for the request + * + * @param contentType the content type to use in the request + * @return the request builder + */ + public RequestBuilder contentType(String contentType) { + if (contentType != null) + request.contentType = contentType; + return this; + } + + /** + * Builds the HttpRequest + * + * @return HttpRequest + */ + public HttpRequest build() { + if (provider != null) { + request.endpoint = provider.getEndpoint(service); + if (provider.getTokenId() != null) + request.getHeaders().put(ClientConstants.HEADER_X_AUTH_TOKEN, provider.getTokenId()); + } + return request; + } + } } diff --git a/core/src/main/java/org/openstack4j/core/transport/HttpResponse.java b/core/src/main/java/org/openstack4j/core/transport/HttpResponse.java index 900ba8c1e..d0f43d656 100644 --- a/core/src/main/java/org/openstack4j/core/transport/HttpResponse.java +++ b/core/src/main/java/org/openstack4j/core/transport/HttpResponse.java @@ -6,73 +6,74 @@ /** * Wraps a Response from the Jersey Client - * + * * @author Jeremy Unruh */ public interface HttpResponse extends Closeable { - /** - * Gets the entity and Maps any errors which will result in a ResponseException - * - * @param the generic type - * @param returnType the return type - * @return the entity - */ - T getEntity(Class returnType); + /** + * Gets the entity and Maps any errors which will result in a ResponseException + * + * @param the generic type + * @param returnType the return type + * @return the entity + */ + T getEntity(Class returnType); - /** - * Gets the entity and Maps any errors which will result in a ResponseException - * - * @param the generic type - * @param returnType the return type - * @param options execution options - * @return the entity - */ - T getEntity(Class returnType, ExecutionOptions options); - - /** - * Reads the entity as is into the specified type without any exception mapping - * - * @param typeToReadAs the type to read the desired entity in as - * @return the entity - */ - T readEntity(Class typeToReadAs); + /** + * Gets the entity and Maps any errors which will result in a ResponseException + * + * @param the generic type + * @param returnType the return type + * @param options execution options + * @return the entity + */ + T getEntity(Class returnType, ExecutionOptions options); - /** - * Gets the status from the previous Request - * - * @return the status code - */ - int getStatus(); - - /** - * The current content-type within the response - * - * @return the response content-type - */ - String getContentType(); - - /** - * The status message which is associated with the current {@link #getStatus()} - * @return the status message or null - */ - String getStatusMessage(); + /** + * Reads the entity as is into the specified type without any exception mapping + * + * @param typeToReadAs the type to read the desired entity in as + * @return the entity + */ + T readEntity(Class typeToReadAs); - /** - * @return the input stream - */ - InputStream getInputStream(); + /** + * Gets the status from the previous Request + * + * @return the status code + */ + int getStatus(); - /** - * Returns a Header value from the specified name key - * - * @param name the name of the header to query for - * @return the header as a String or null if not found - */ - String header(String name); + /** + * The current content-type within the response + * + * @return the response content-type + */ + String getContentType(); - /** - * @return the a Map of Header Name to Header Value - */ - Map headers(); + /** + * The status message which is associated with the current {@link #getStatus()} + * + * @return the status message or null + */ + String getStatusMessage(); + + /** + * @return the input stream + */ + InputStream getInputStream(); + + /** + * Returns a Header value from the specified name key + * + * @param name the name of the header to query for + * @return the header as a String or null if not found + */ + String header(String name); + + /** + * @return the a Map of Header Name to Header Value + */ + Map headers(); } diff --git a/core/src/main/java/org/openstack4j/core/transport/ListType.java b/core/src/main/java/org/openstack4j/core/transport/ListType.java index f6e71e88e..f26262fcc 100644 --- a/core/src/main/java/org/openstack4j/core/transport/ListType.java +++ b/core/src/main/java/org/openstack4j/core/transport/ListType.java @@ -1,9 +1,9 @@ package org.openstack4j.core.transport; /** - * Decorator interface to designate List Type results and to insure that an EmptyList is returned in 404/NotFound + * Decorator interface to designate List Type results and to insure that an EmptyList is returned in 404/NotFound * responses - * + * * @author Jeremy Unruh */ public interface ListType { diff --git a/core/src/main/java/org/openstack4j/core/transport/ObjectMapperSingleton.java b/core/src/main/java/org/openstack4j/core/transport/ObjectMapperSingleton.java index 27e7f4b99..2d5c30270 100644 --- a/core/src/main/java/org/openstack4j/core/transport/ObjectMapperSingleton.java +++ b/core/src/main/java/org/openstack4j/core/transport/ObjectMapperSingleton.java @@ -8,13 +8,13 @@ /** * Default Jackson Mappings - * + * * @author Jeremy Unruh */ -public class ObjectMapperSingleton { +public class ObjectMapperSingleton { private static final ObjectMapperSingleton INSTANCE = new ObjectMapperSingleton(); - + ObjectMapper mapper; ObjectMapper rootMapper; @@ -35,7 +35,7 @@ private ObjectMapperSingleton() { rootMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); rootMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); } - + public static ObjectMapper getContext(Class type) { return type.getAnnotation(JsonRootName.class) == null ? INSTANCE.mapper : INSTANCE.rootMapper; diff --git a/core/src/main/java/org/openstack4j/core/transport/PropagateResponse.java b/core/src/main/java/org/openstack4j/core/transport/PropagateResponse.java index 88bd88b0a..06df94ca9 100644 --- a/core/src/main/java/org/openstack4j/core/transport/PropagateResponse.java +++ b/core/src/main/java/org/openstack4j/core/transport/PropagateResponse.java @@ -4,16 +4,17 @@ * Allows for propagation depending on the state of a response. If applied to an HttpExecution the execution will * call the {@link #propagate(HttpResponse)} method. The method will either throw a ClientResponseException variant * or do nothing letting the execution code handle like normal - * + * * @author Jeremy Unruh */ public interface PropagateResponse { /** * Called to allow for optional exception propagation depending on the HttpResponse state + * * @param response the http response * @throws ClientResponseException variant if execution deemed a failure */ void propagate(HttpResponse response); - + } diff --git a/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java b/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java index 5a505a329..47d1d86fe 100644 --- a/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java +++ b/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java @@ -3,7 +3,7 @@ /** * Proxy host configuration - * + * * @author Jeremy Unruh */ public final class ProxyHost { @@ -12,7 +12,7 @@ public final class ProxyHost { private int port; private String username; private String password; - + public ProxyHost(String host, int port) { this(host, port, null, null); } @@ -24,10 +24,10 @@ private ProxyHost(String host, int port, String username, String password) { this.username = username; this.password = password; } - + /** * Creates a new ProxyHost configuration - * + * * @param host the proxy host (ex. http://myproxy) * @param port the proxy port (ex. 8080) * @return ProxyHost @@ -35,12 +35,12 @@ private ProxyHost(String host, int port, String username, String password) { public static ProxyHost of(String host, int port) { return new ProxyHost(host, port); } - + /** * Creates a new ProxyHost configuration with credentials - * - * @param host the proxy host (ex. http://myproxy) - * @param port the proxy port (ex. 8080) + * + * @param host the proxy host (ex. http://myproxy) + * @param port the proxy port (ex. 8080) * @param username the username for proxy authentication * @param password the password for proxy authentication * @return ProxyHost @@ -52,10 +52,10 @@ public static ProxyHost of(String host, int port, String username, String passwo public String getHost() { return host; } - + public String getRawHost() { if (host != null && host.startsWith("http")) { - return host.substring(host.indexOf("://")+3); + return host.substring(host.indexOf("://") + 3); } return host; } @@ -71,7 +71,7 @@ public String getUsername() { public String getPassword() { return password; } - + public String getHostWithPort() { return String.format("%s:%d", host, port); } @@ -115,6 +115,6 @@ public boolean equals(Object obj) { return false; return true; } - - + + } diff --git a/core/src/main/java/org/openstack4j/core/transport/UntrustedSSL.java b/core/src/main/java/org/openstack4j/core/transport/UntrustedSSL.java index 04aa12b80..8ac91d699 100644 --- a/core/src/main/java/org/openstack4j/core/transport/UntrustedSSL.java +++ b/core/src/main/java/org/openstack4j/core/transport/UntrustedSSL.java @@ -21,15 +21,18 @@ public class UntrustedSSL { private HostnameVerifier verifier; private UntrustedSSL() { - try - { - TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { + try { + TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[]{}; + return new X509Certificate[]{}; } - public void checkClientTrusted(X509Certificate[] certs, String authType) {} - public void checkServerTrusted(X509Certificate[] certs, String authType) {} - } }; + + public void checkClientTrusted(X509Certificate[] certs, String authType) { + } + + public void checkServerTrusted(X509Certificate[] certs, String authType) { + } + }}; SSLContext ssc = SSLContext.getInstance("TLS"); ssc.init(null, trustAllCerts, new SecureRandom()); @@ -38,9 +41,9 @@ public void checkServerTrusted(X509Certificate[] certs, String authType) {} @Override public boolean verify(String s, SSLSession session) { return true; - } }; - } - catch (Throwable t) { + } + }; + } catch (Throwable t) { LOG.error(t.getMessage(), t); } } diff --git a/core/src/main/java/org/openstack4j/core/transport/functions/EndpointURIFromRequestFunction.java b/core/src/main/java/org/openstack4j/core/transport/functions/EndpointURIFromRequestFunction.java index f3bc1a857..a00f433b9 100644 --- a/core/src/main/java/org/openstack4j/core/transport/functions/EndpointURIFromRequestFunction.java +++ b/core/src/main/java/org/openstack4j/core/transport/functions/EndpointURIFromRequestFunction.java @@ -1,14 +1,13 @@ package org.openstack4j.core.transport.functions; -import static org.openstack4j.core.transport.ClientConstants.URI_SEP; - +import com.google.common.base.Function; import org.openstack4j.core.transport.HttpRequest; -import com.google.common.base.Function; +import static org.openstack4j.core.transport.ClientConstants.URI_SEP; /** * Builds a URI comprising of Endpoint and Path from a HttpRequest object - * + * * @author Jeremy Unruh */ public class EndpointURIFromRequestFunction implements Function, String> { @@ -20,10 +19,10 @@ public class EndpointURIFromRequestFunction implements Function, public String apply(HttpRequest request) { if (request.getEndpoint().endsWith(URI_SEP) || request.getPath().startsWith(URI_SEP)) return escape(request.getEndpoint() + request.getPath()); - + return escape(request.getEndpoint() + URI_SEP + request.getPath()); } - + private String escape(String uri) { return uri.replaceAll(" ", "%20"); } diff --git a/core/src/main/java/org/openstack4j/core/transport/functions/ParseActionResponseFromJsonMap.java b/core/src/main/java/org/openstack4j/core/transport/functions/ParseActionResponseFromJsonMap.java index 550533cc3..5f998b966 100644 --- a/core/src/main/java/org/openstack4j/core/transport/functions/ParseActionResponseFromJsonMap.java +++ b/core/src/main/java/org/openstack4j/core/transport/functions/ParseActionResponseFromJsonMap.java @@ -1,18 +1,17 @@ package org.openstack4j.core.transport.functions; -import java.util.Map; - +import com.google.common.base.Function; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.model.common.ActionResponse; -import com.google.common.base.Function; +import java.util.Map; /** - * Attempts to Parse a JSON Map created from an error response and map the message to an ActionResponse. - * + * Attempts to Parse a JSON Map created from an error response and map the message to an ActionResponse. + * * @author Jeremy Unruh */ -public class ParseActionResponseFromJsonMap implements Function, ActionResponse>{ +public class ParseActionResponseFromJsonMap implements Function, ActionResponse> { private static final String KEY_MESSAGE = "message"; private static final String NEUTRON_ERROR = "NeutronError"; @@ -20,16 +19,16 @@ public class ParseActionResponseFromJsonMap implements Function map) { if (map == null || map.isEmpty()) return null; - + for (String key : map.keySet()) { if (map.get(key) == null) { continue; @@ -54,12 +53,12 @@ public ActionResponse apply(Map map) { return ActionResponse.actionFailed(msg, response.getStatus()); } if (inner.containsKey(COMPUTE_FAULT)) { - /** For 'computeFault' Error Message Propagation.. */ + /** For 'computeFault' Error Message Propagation.. */ String msg = String.valueOf(map.get(COMPUTE_FAULT)); return ActionResponse.actionFailed(msg, response.getStatus()); - } + } if (inner.containsKey(TACKER_ERROR)) { - /** For 'TackerError' Error Message Propagation.. */ + /** For 'TackerError' Error Message Propagation.. */ String msg = String.valueOf(inner.get(TACKER_ERROR)); return ActionResponse.actionFailed(msg, response.getStatus()); } @@ -71,10 +70,10 @@ public ActionResponse apply(Map map) { // "error_message": "error message", // "error_code": XXX } if (map.containsKey("error_message")) { - String msg = String.valueOf(map.get("error_message")); - return ActionResponse.actionFailed(msg, response.getStatus()); + String msg = String.valueOf(map.get("error_message")); + return ActionResponse.actionFailed(msg, response.getStatus()); } - + // Neutron error handling when just a message is present if (map.containsKey(NEUTRON_ERROR)) { String msg = String.valueOf(map.get(NEUTRON_ERROR)); diff --git a/core/src/main/java/org/openstack4j/core/transport/functions/ResponseToActionResponse.java b/core/src/main/java/org/openstack4j/core/transport/functions/ResponseToActionResponse.java index 5b7aa0bdd..5f9a74824 100644 --- a/core/src/main/java/org/openstack4j/core/transport/functions/ResponseToActionResponse.java +++ b/core/src/main/java/org/openstack4j/core/transport/functions/ResponseToActionResponse.java @@ -1,12 +1,11 @@ package org.openstack4j.core.transport.functions; -import java.util.Map; - +import com.google.common.base.Function; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.openstack.internal.Parser; -import com.google.common.base.Function; +import java.util.Map; /** * Takes an HttpResponse as input and returns an ActionResponse as an output @@ -19,7 +18,7 @@ public class ResponseToActionResponse implements Function it = ServiceLoader.load(HttpExecutorService.class, getClass().getClassLoader()).iterator(); - if (!it.hasNext()) - { + if (!it.hasNext()) { LOG.error("No OpenStack4j connector found in classpath"); throw new ConnectorNotFoundException("No OpenStack4j connector found in classpath"); } diff --git a/core/src/main/java/org/openstack4j/core/transport/internal/HttpLoggingFilter.java b/core/src/main/java/org/openstack4j/core/transport/internal/HttpLoggingFilter.java index ceeb55d46..16cee0a11 100644 --- a/core/src/main/java/org/openstack4j/core/transport/internal/HttpLoggingFilter.java +++ b/core/src/main/java/org/openstack4j/core/transport/internal/HttpLoggingFilter.java @@ -4,21 +4,22 @@ /** * Handles turning Http Wire logging on/off for supported connectors. Some connectors need have specific registration and use this class * to determine if wire logging is enabled - * + * * @author Jeremy Unruh */ public final class HttpLoggingFilter { - private HttpLoggingFilter() { } - + private HttpLoggingFilter() { + } + public static void toggleLogging(boolean isEnabled) { System.getProperties().setProperty(HttpLoggingFilter.class.getName(), String.valueOf(isEnabled)); - System.setProperty("org.apache.commons.logging.Log","org.apache.commons.logging.impl.SimpleLog"); + System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true"); System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", isEnabled ? "DEBUG" : "WARN"); System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "ERROR"); } - + public static boolean isLoggingEnabled() { return Boolean.getBoolean(HttpLoggingFilter.class.getName()); } diff --git a/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java b/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java index 0b76d23b1..5318ea063 100644 --- a/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java +++ b/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java @@ -1,7 +1,5 @@ package org.openstack4j.core.transport.internal; -import java.io.IOException; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser.NumberType; import com.fasterxml.jackson.core.JsonProcessingException; @@ -9,78 +7,79 @@ import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; +import java.io.IOException; + /** * Openstack API V2 has a few Services which return a 'True' as a boolean value. Jackson typically will not realize that this is equivalent to 'true' and will throw an * error. This Deserializer is a workaround to both problems - * + * * @author Jeremy Unruh */ public class OSBadBooleanDeserializer extends JsonDeserializer { - /** - * {@inheritDoc} - */ - @Override - public Boolean deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { - JsonToken t = jp.getCurrentToken(); - if (t == JsonToken.VALUE_TRUE) { - return Boolean.TRUE; - } - if (t == JsonToken.VALUE_FALSE) { - return Boolean.FALSE; - } - // [JACKSON-78]: should accept ints too, (0 == false, otherwise true) - if (t == JsonToken.VALUE_NUMBER_INT) { - // 11-Jan-2012, tatus: May be outside of int... - if (jp.getNumberType() == NumberType.INT) { - return (jp.getIntValue() == 0) ? Boolean.FALSE : Boolean.TRUE; - } - return Boolean.valueOf(_parseBooleanFromNumber(jp, ctxt)); - } - if (t == JsonToken.VALUE_NULL) { - return getNullValue(); - } - // And finally, let's allow Strings to be converted too - if (t == JsonToken.VALUE_STRING) { - String text = jp.getText().trim(); - if ("true".equalsIgnoreCase(text)) { - return Boolean.TRUE; - } - if ("false".equalsIgnoreCase(text)) { - return Boolean.FALSE; - } - if (text.length() == 0) { - return getEmptyValue(); - } - throw ctxt.weirdStringException(text, Boolean.class, "only \"true\" or \"false\" recognized"); - } - // Otherwise, no can do: - throw ctxt.mappingException(Boolean.class, t); - } - - /** - * _parse boolean from number. - * - * @param jp the jp - * @param ctxt the ctxt - * @return true, if successful - * @throws IOException Signals that an I/O exception has occurred. - * @throws JsonProcessingException the json processing exception - */ - protected final boolean _parseBooleanFromNumber(JsonParser jp, DeserializationContext ctxt) - throws IOException, JsonProcessingException -{ - if (jp.getNumberType() == NumberType.LONG) { - return (jp.getLongValue() == 0L) ? Boolean.FALSE : Boolean.TRUE; - } - // no really good logic; let's actually resort to textual comparison - String str = jp.getText(); - if ("0.0".equals(str) || "0".equals(str)) { - return Boolean.FALSE; - } - return Boolean.TRUE; -} + /** + * {@inheritDoc} + */ + @Override + public Boolean deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonToken t = jp.getCurrentToken(); + if (t == JsonToken.VALUE_TRUE) { + return Boolean.TRUE; + } + if (t == JsonToken.VALUE_FALSE) { + return Boolean.FALSE; + } + // [JACKSON-78]: should accept ints too, (0 == false, otherwise true) + if (t == JsonToken.VALUE_NUMBER_INT) { + // 11-Jan-2012, tatus: May be outside of int... + if (jp.getNumberType() == NumberType.INT) { + return (jp.getIntValue() == 0) ? Boolean.FALSE : Boolean.TRUE; + } + return Boolean.valueOf(_parseBooleanFromNumber(jp, ctxt)); + } + if (t == JsonToken.VALUE_NULL) { + return getNullValue(); + } + // And finally, let's allow Strings to be converted too + if (t == JsonToken.VALUE_STRING) { + String text = jp.getText().trim(); + if ("true".equalsIgnoreCase(text)) { + return Boolean.TRUE; + } + if ("false".equalsIgnoreCase(text)) { + return Boolean.FALSE; + } + if (text.length() == 0) { + return getEmptyValue(); + } + throw ctxt.weirdStringException(text, Boolean.class, "only \"true\" or \"false\" recognized"); + } + // Otherwise, no can do: + throw ctxt.mappingException(Boolean.class, t); + } + + /** + * _parse boolean from number. + * + * @param jp the jp + * @param ctxt the ctxt + * @return true, if successful + * @throws IOException Signals that an I/O exception has occurred. + * @throws JsonProcessingException the json processing exception + */ + protected final boolean _parseBooleanFromNumber(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + if (jp.getNumberType() == NumberType.LONG) { + return (jp.getLongValue() == 0L) ? Boolean.FALSE : Boolean.TRUE; + } + // no really good logic; let's actually resort to textual comparison + String str = jp.getText(); + if ("0.0".equals(str) || "0".equals(str)) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } } diff --git a/core/src/main/java/org/openstack4j/core/transport/propagation/PropagateOnStatus.java b/core/src/main/java/org/openstack4j/core/transport/propagation/PropagateOnStatus.java index 70a26516d..00b21fe8f 100644 --- a/core/src/main/java/org/openstack4j/core/transport/propagation/PropagateOnStatus.java +++ b/core/src/main/java/org/openstack4j/core/transport/propagation/PropagateOnStatus.java @@ -1,29 +1,29 @@ package org.openstack4j.core.transport.propagation; -import static org.openstack4j.core.transport.HttpExceptionHandler.mapException; - import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.core.transport.PropagateResponse; import org.openstack4j.core.transport.functions.ResponseToActionResponse; import org.openstack4j.model.common.ActionResponse; +import static org.openstack4j.core.transport.HttpExceptionHandler.mapException; + /** * Propagates an exception based on the specified Status code - * + * * @author Jeremy Unruh */ public class PropagateOnStatus implements PropagateResponse { private final int statusCode; - + private PropagateOnStatus(int statusCode) { this.statusCode = statusCode; } - + public static PropagateOnStatus on(int statusCode) { return new PropagateOnStatus(statusCode); } - + @Override public void propagate(HttpResponse response) { if (response.getStatus() == statusCode) { diff --git a/core/src/main/java/org/openstack4j/model/ModelEntity.java b/core/src/main/java/org/openstack4j/model/ModelEntity.java index 8c700141e..4bedc7cb3 100644 --- a/core/src/main/java/org/openstack4j/model/ModelEntity.java +++ b/core/src/main/java/org/openstack4j/model/ModelEntity.java @@ -4,7 +4,7 @@ /** * Decorates a Model class which is used for Service Operations - * + * * @author Jeremy Unruh */ public interface ModelEntity extends Serializable { diff --git a/core/src/main/java/org/openstack4j/model/ResourceEntity.java b/core/src/main/java/org/openstack4j/model/ResourceEntity.java index dc208b815..c8d1dbc03 100644 --- a/core/src/main/java/org/openstack4j/model/ResourceEntity.java +++ b/core/src/main/java/org/openstack4j/model/ResourceEntity.java @@ -1,20 +1,20 @@ package org.openstack4j.model; /** - * Model class which is used for Service Operations that is backed by a unique identifier and a name - * + * Model class which is used for Service Operations that is backed by a unique identifier and a name + * * @author Jeremy Unruh */ public interface ResourceEntity extends ModelEntity { - /** - * @return the id of this entity - */ - String getId(); - - /** - * @return the name of this entity - */ - String getName(); - + /** + * @return the id of this entity + */ + String getId(); + + /** + * @return the name of this entity + */ + String getName(); + } diff --git a/core/src/main/java/org/openstack4j/model/artifact/Artifact.java b/core/src/main/java/org/openstack4j/model/artifact/Artifact.java index 4c5b8c1f9..82e4aec4d 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/Artifact.java +++ b/core/src/main/java/org/openstack4j/model/artifact/Artifact.java @@ -1,7 +1,5 @@ package org.openstack4j.model.artifact; -import org.openstack4j.common.Buildable; -import org.openstack4j.model.artifact.builder.ArtifactBuilder; import org.openstack4j.model.common.BasicResource; import java.util.List; diff --git a/core/src/main/java/org/openstack4j/model/artifact/ArtifactType.java b/core/src/main/java/org/openstack4j/model/artifact/ArtifactType.java index 0aa9bde04..c88a44fc2 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/ArtifactType.java +++ b/core/src/main/java/org/openstack4j/model/artifact/ArtifactType.java @@ -18,8 +18,7 @@ public String value() { } @JsonCreator - public static ArtifactType value(String v) - { + public static ArtifactType value(String v) { if (v == null) return ALL; try { return valueOf(v.toUpperCase()); diff --git a/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java b/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java index cfc4d8e59..1c73b5e43 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java +++ b/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java @@ -2,8 +2,6 @@ import org.openstack4j.model.ModelEntity; -import java.util.List; - /** * A Glare list of Artifacts * diff --git a/core/src/main/java/org/openstack4j/model/artifact/ToscaTemplatesArtifact.java b/core/src/main/java/org/openstack4j/model/artifact/ToscaTemplatesArtifact.java index 793b57244..e494e39d4 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/ToscaTemplatesArtifact.java +++ b/core/src/main/java/org/openstack4j/model/artifact/ToscaTemplatesArtifact.java @@ -2,7 +2,6 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.artifact.builder.ToscaTemplatesArtifactBuilder; -import org.openstack4j.model.common.BasicResource; /** * A Glare Tosca Templates Artifact diff --git a/core/src/main/java/org/openstack4j/model/artifact/builder/ToscaTemplatesArtifactBuilder.java b/core/src/main/java/org/openstack4j/model/artifact/builder/ToscaTemplatesArtifactBuilder.java index a2c0ebad0..ddd93b28c 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/builder/ToscaTemplatesArtifactBuilder.java +++ b/core/src/main/java/org/openstack4j/model/artifact/builder/ToscaTemplatesArtifactBuilder.java @@ -9,7 +9,7 @@ * * @author Pavan Vadavi */ -public interface ToscaTemplatesArtifactBuilder extends ArtifactBuilder, Builder { +public interface ToscaTemplatesArtifactBuilder extends ArtifactBuilder, Builder { ToscaTemplatesArtifactBuilder template(Template template); diff --git a/core/src/main/java/org/openstack4j/model/barbican/builder/ContainerCreateBuilder.java b/core/src/main/java/org/openstack4j/model/barbican/builder/ContainerCreateBuilder.java index d50857ef9..ec05684ab 100644 --- a/core/src/main/java/org/openstack4j/model/barbican/builder/ContainerCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/barbican/builder/ContainerCreateBuilder.java @@ -9,6 +9,7 @@ public interface ContainerCreateBuilder extends Buildable.Builder { /** * Optional. + * * @param name Human readable name for identifying your container. * @return */ @@ -16,6 +17,7 @@ public interface ContainerCreateBuilder extends Buildable.Builder constraints = Maps.newHashMap(); - + protected BaseFilter() { - + } - + protected void filter(String name, Object value) { constraints.put(name, value); } - + public Map getConstraints() { return constraints; } - + } diff --git a/core/src/main/java/org/openstack4j/model/common/BasicResource.java b/core/src/main/java/org/openstack4j/model/common/BasicResource.java index abc473ce9..3a92956a6 100644 --- a/core/src/main/java/org/openstack4j/model/common/BasicResource.java +++ b/core/src/main/java/org/openstack4j/model/common/BasicResource.java @@ -3,21 +3,21 @@ /** * A basic resource that captures an Id and Name of the resource - * + * * @author Jeremy Unruh */ public interface BasicResource extends IdEntity { - /** - * @return the name for this resource - */ - String getName(); - - /** - * Sets the name for this resource - * - * @param name the name to set - */ - void setName(String name); - + /** + * @return the name for this resource + */ + String getName(); + + /** + * Sets the name for this resource + * + * @param name the name to set + */ + void setName(String name); + } diff --git a/core/src/main/java/org/openstack4j/model/common/DLPayload.java b/core/src/main/java/org/openstack4j/model/common/DLPayload.java index 0afd9ed5a..0eadec1ad 100644 --- a/core/src/main/java/org/openstack4j/model/common/DLPayload.java +++ b/core/src/main/java/org/openstack4j/model/common/DLPayload.java @@ -1,35 +1,35 @@ package org.openstack4j.model.common; +import org.openstack4j.core.transport.HttpResponse; + import java.io.File; import java.io.IOException; import java.io.InputStream; -import org.openstack4j.core.transport.HttpResponse; - /** * A Payload which encapsulates downstream data - * + * * @author Jeremy Unruh */ public interface DLPayload { /** * The HttpResponse - * + * * @return the HttpResponse */ - HttpResponse getHttpResponse(); - + HttpResponse getHttpResponse(); + /** * The raw inputstream - * + * * @return the inputstream */ InputStream getInputStream(); - + /** * Writes the current stream to the specified {@code file} - * + * * @param file the file to write to * @throws IOException */ diff --git a/core/src/main/java/org/openstack4j/model/common/Extension.java b/core/src/main/java/org/openstack4j/model/common/Extension.java index c2edb6406..e661d048a 100644 --- a/core/src/main/java/org/openstack4j/model/common/Extension.java +++ b/core/src/main/java/org/openstack4j/model/common/Extension.java @@ -1,45 +1,45 @@ package org.openstack4j.model.common; +import org.openstack4j.model.ModelEntity; + import java.net.URI; import java.util.Date; import java.util.List; -import org.openstack4j.model.ModelEntity; - /** * Represents an Extension which adds additional functionality to the OpenStack API - * + * * @author Jeremy Unruh */ public interface Extension extends ModelEntity { - /** - * @return the name of the extension - */ - String getName(); - - /** - * @return the namespace of this extension - */ - URI getNamespace(); - - /** - * @return the alias which is used within RestFul and other operational calls - */ - String getAlias(); - - /** - * @return when the extension was last updated - */ - Date getUpdated(); - - /** - * @return the description of this extension - */ - String getDescription(); - - /** - * @return the additional information and documentation based links for this extension - */ - List getLinks(); + /** + * @return the name of the extension + */ + String getName(); + + /** + * @return the namespace of this extension + */ + URI getNamespace(); + + /** + * @return the alias which is used within RestFul and other operational calls + */ + String getAlias(); + + /** + * @return when the extension was last updated + */ + Date getUpdated(); + + /** + * @return the description of this extension + */ + String getDescription(); + + /** + * @return the additional information and documentation based links for this extension + */ + List getLinks(); } diff --git a/core/src/main/java/org/openstack4j/model/common/IdEntity.java b/core/src/main/java/org/openstack4j/model/common/IdEntity.java index ac6aeab59..e1439d9d3 100644 --- a/core/src/main/java/org/openstack4j/model/common/IdEntity.java +++ b/core/src/main/java/org/openstack4j/model/common/IdEntity.java @@ -4,7 +4,7 @@ /** * A simple entity which supports encapsulating an identifier - * + * * @author Jeremy Unruh */ public interface IdEntity extends ModelEntity { @@ -13,11 +13,11 @@ public interface IdEntity extends ModelEntity { * @return the identifier for this resource */ String getId(); - + /** - * Sets the identifier for this resource. Note: creating a new resource should not have the idenfier set since OpenStack will + * Sets the identifier for this resource. Note: creating a new resource should not have the idenfier set since OpenStack will * assign one on the create call - * + * * @param id the identifier */ void setId(String id); diff --git a/core/src/main/java/org/openstack4j/model/common/Identifier.java b/core/src/main/java/org/openstack4j/model/common/Identifier.java index 8858c4df7..f6e2a75ae 100644 --- a/core/src/main/java/org/openstack4j/model/common/Identifier.java +++ b/core/src/main/java/org/openstack4j/model/common/Identifier.java @@ -1,34 +1,35 @@ package org.openstack4j.model.common; -/** +/** * Represents an identifier which can either be an ID or Name - * + * * @author Jeremy Unruh */ public class Identifier { - public enum Type { ID, NAME } - + public enum Type {ID, NAME} + private final Type type; private final String id; - + private Identifier(Type type, String id) { this.type = type; this.id = id; } - + /** * Creates a new identifier which is an ID based value - * + * * @param id the ID value * @return identifier object */ public static Identifier byId(String id) { return new Identifier(Type.ID, id); } - + /** * Creates an identifier which is NAME based identification + * * @param name the name value * @return the identifier */ @@ -43,10 +44,10 @@ public Type getType() { public String getId() { return id; } - + public boolean isTypeID() { return type == Type.ID; } - - + + } diff --git a/core/src/main/java/org/openstack4j/model/common/Link.java b/core/src/main/java/org/openstack4j/model/common/Link.java index 78b581a39..446a37fea 100644 --- a/core/src/main/java/org/openstack4j/model/common/Link.java +++ b/core/src/main/java/org/openstack4j/model/common/Link.java @@ -6,24 +6,24 @@ /** * Model for a generic link - * + * * @author Jeremy Unruh */ public interface Link extends ModelEntity, Buildable { - /** - * @return the relative URL or null - */ - String getRel(); - - /** - * @return the href URL - */ - String getHref(); - - /** - * @return the type of link or null - */ - String getType(); - + /** + * @return the relative URL or null + */ + String getRel(); + + /** + * @return the href URL + */ + String getHref(); + + /** + * @return the type of link or null + */ + String getType(); + } diff --git a/core/src/main/java/org/openstack4j/model/common/Payload.java b/core/src/main/java/org/openstack4j/model/common/Payload.java index f64967531..821cb13be 100644 --- a/core/src/main/java/org/openstack4j/model/common/Payload.java +++ b/core/src/main/java/org/openstack4j/model/common/Payload.java @@ -11,23 +11,23 @@ */ public interface Payload extends Closeable { - /** - * Opens and returns the input stream. - * - * @return the input stream - */ - InputStream open(); - - /** - * Closes the stream and releases state. - */ - void closeQuietly(); - - /** - * Gets the raw underlying object for the Payload. - * - * @return the raw object - */ - T getRaw(); - + /** + * Opens and returns the input stream. + * + * @return the input stream + */ + InputStream open(); + + /** + * Closes the stream and releases state. + */ + void closeQuietly(); + + /** + * Gets the raw underlying object for the Payload. + * + * @return the raw object + */ + T getRaw(); + } diff --git a/core/src/main/java/org/openstack4j/model/common/Payloads.java b/core/src/main/java/org/openstack4j/model/common/Payloads.java index 77a14b0d8..023152ee0 100644 --- a/core/src/main/java/org/openstack4j/model/common/Payloads.java +++ b/core/src/main/java/org/openstack4j/model/common/Payloads.java @@ -1,13 +1,13 @@ package org.openstack4j.model.common; -import java.io.File; -import java.io.InputStream; -import java.net.URL; - import org.openstack4j.model.common.payloads.FilePayload; import org.openstack4j.model.common.payloads.InputStreamPayload; import org.openstack4j.model.common.payloads.URLPayload; +import java.io.File; +import java.io.InputStream; +import java.net.URL; + /** * Utility class for creating supported Payloads. * @@ -15,34 +15,34 @@ */ public class Payloads { - /** - * Creates a new File based Payload - * - * @param file the file to send - * @return the Payload - */ - public static Payload create(File file) { - return new FilePayload(file); - } - - /** - * Creates a new Input Stream based Payload - * - * @param stream the input stream - * @return the Payload - */ - public static Payload create(InputStream stream) { - return new InputStreamPayload(stream); - } - - /** - * Creates a new URL based Payload allowing direct upload from the URL - * - * @param url the URL - * @return the Payload - */ - public static Payload create(URL url) { - return new URLPayload(url); - } - + /** + * Creates a new File based Payload + * + * @param file the file to send + * @return the Payload + */ + public static Payload create(File file) { + return new FilePayload(file); + } + + /** + * Creates a new Input Stream based Payload + * + * @param stream the input stream + * @return the Payload + */ + public static Payload create(InputStream stream) { + return new InputStreamPayload(stream); + } + + /** + * Creates a new URL based Payload allowing direct upload from the URL + * + * @param url the URL + * @return the Payload + */ + public static Payload create(URL url) { + return new URLPayload(url); + } + } diff --git a/core/src/main/java/org/openstack4j/model/common/QuotaDetails.java b/core/src/main/java/org/openstack4j/model/common/QuotaDetails.java index 0d9293fc6..06881f790 100644 --- a/core/src/main/java/org/openstack4j/model/common/QuotaDetails.java +++ b/core/src/main/java/org/openstack4j/model/common/QuotaDetails.java @@ -4,29 +4,28 @@ /** * Details for a specific Quota with a Quota-Set - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ public interface QuotaDetails extends ModelEntity { /** * The number of items in use for this tenant - * + * * @return number of items in use */ int getInUse(); - + /** * The number of items permitted for this tenant. - * + * * @return number of items permitted */ int getLimit(); - + /** * The number of reserved items for this tenant - * + * * @return the number of reserved items */ int getReserved(); diff --git a/core/src/main/java/org/openstack4j/model/common/Resource.java b/core/src/main/java/org/openstack4j/model/common/Resource.java index 0b5c426d8..e1ba9a77a 100644 --- a/core/src/main/java/org/openstack4j/model/common/Resource.java +++ b/core/src/main/java/org/openstack4j/model/common/Resource.java @@ -2,21 +2,21 @@ /** * A Resource is a common model which contains an Id, TenantId and Name - * + * * @author Jeremy Unruh */ public interface Resource extends BasicResource { - /** - * @return the tenant identifier for this resource - */ - String getTenantId(); - - /** - * Sets the tenant identifier - * - * @param tenantId the tenant id to set - */ - void setTenantId(String tenantId); - + /** + * @return the tenant identifier for this resource + */ + String getTenantId(); + + /** + * Sets the tenant identifier + * + * @param tenantId the tenant id to set + */ + void setTenantId(String tenantId); + } diff --git a/core/src/main/java/org/openstack4j/model/common/builder/BasicResourceBuilder.java b/core/src/main/java/org/openstack4j/model/common/builder/BasicResourceBuilder.java index 13328115b..f550392f8 100644 --- a/core/src/main/java/org/openstack4j/model/common/builder/BasicResourceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/common/builder/BasicResourceBuilder.java @@ -8,35 +8,35 @@ * @param the model type * @param the builder type */ -public abstract class BasicResourceBuilder> { +public abstract class BasicResourceBuilder> { + + /** + * Sets the name on the resource + * + * @param name the name + * @return the builder + */ + public T name(String name) { + reference().setName(name); + return self(); + } + + /** + * Sets the Id. + * + * @param id the identifier + * @return the builder + */ + public T id(String id) { + reference().setId(id); + return self(); + } + + @SuppressWarnings("unchecked") + protected T self() { + return (T) this; + } + + protected abstract M reference(); - /** - * Sets the name on the resource - * - * @param name the name - * @return the builder - */ - public T name(String name) { - reference().setName(name); - return self(); - } - - /** - * Sets the Id. - * - * @param id the identifier - * @return the builder - */ - public T id(String id) { - reference().setId(id); - return self(); - } - - @SuppressWarnings("unchecked") - protected T self() { - return (T) this; - } - - protected abstract M reference(); - } diff --git a/core/src/main/java/org/openstack4j/model/common/builder/LinkBuilder.java b/core/src/main/java/org/openstack4j/model/common/builder/LinkBuilder.java index ff302eeb4..a738154f5 100644 --- a/core/src/main/java/org/openstack4j/model/common/builder/LinkBuilder.java +++ b/core/src/main/java/org/openstack4j/model/common/builder/LinkBuilder.java @@ -5,24 +5,24 @@ /** * A Builder which creates a Link - * + * * @author Jeremy Unruh */ -public interface LinkBuilder extends Buildable.Builder{ +public interface LinkBuilder extends Buildable.Builder { + + /** + * @see Link#getRel() + */ + LinkBuilder rel(String rel); + + /** + * @see Link#getHref() + */ + LinkBuilder href(String href); + + /** + * @see Link#getType() + */ + LinkBuilder type(String type); - /** - * @see Link#getRel() - */ - LinkBuilder rel(String rel); - - /** - * @see Link#getHref() - */ - LinkBuilder href(String href); - - /** - * @see Link#getType() - */ - LinkBuilder type(String type); - } diff --git a/core/src/main/java/org/openstack4j/model/common/builder/ResourceBuilder.java b/core/src/main/java/org/openstack4j/model/common/builder/ResourceBuilder.java index 15843eb71..984e1a86c 100644 --- a/core/src/main/java/org/openstack4j/model/common/builder/ResourceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/common/builder/ResourceBuilder.java @@ -9,28 +9,28 @@ * @param the model type * @param the builder type */ -public abstract class ResourceBuilder> extends BasicResourceBuilder { +public abstract class ResourceBuilder> extends BasicResourceBuilder { - /** - * Set the Tenant id. - * - * @param tenantId the tenant id - * @return the builder - */ - public T tenantId(String tenantId) { - reference().setTenantId(tenantId); - return self(); - } + /** + * Set the Tenant id. + * + * @param tenantId the tenant id + * @return the builder + */ + public T tenantId(String tenantId) { + reference().setTenantId(tenantId); + return self(); + } + + /** + * Sets the Tenant. + * + * @param tenant the tenant + * @return the builder + */ + public T tenant(Tenant tenant) { + reference().setTenantId(tenant.getId()); + return self(); + } - /** - * Sets the Tenant. - * - * @param tenant the tenant - * @return the builder - */ - public T tenant(Tenant tenant) { - reference().setTenantId(tenant.getId()); - return self(); - } - } diff --git a/core/src/main/java/org/openstack4j/model/common/functions/IdEntityToString.java b/core/src/main/java/org/openstack4j/model/common/functions/IdEntityToString.java index 91a2c6801..757bd0532 100644 --- a/core/src/main/java/org/openstack4j/model/common/functions/IdEntityToString.java +++ b/core/src/main/java/org/openstack4j/model/common/functions/IdEntityToString.java @@ -1,18 +1,17 @@ package org.openstack4j.model.common.functions; -import org.openstack4j.model.common.IdEntity; - import com.google.common.base.Function; +import org.openstack4j.model.common.IdEntity; /** * A function which transforms an IdEntity into a String identifier - * + * * @author Jeremy Unruh */ public class IdEntityToString implements Function { public static final IdEntityToString INSTANCE = new IdEntityToString(); - + @Override public String apply(IdEntity input) { return input.getId(); diff --git a/core/src/main/java/org/openstack4j/model/common/functions/RangesToHeaderNameValue.java b/core/src/main/java/org/openstack4j/model/common/functions/RangesToHeaderNameValue.java index d20d7ae55..f81318f6c 100644 --- a/core/src/main/java/org/openstack4j/model/common/functions/RangesToHeaderNameValue.java +++ b/core/src/main/java/org/openstack4j/model/common/functions/RangesToHeaderNameValue.java @@ -1,19 +1,18 @@ package org.openstack4j.model.common.functions; +import com.google.common.base.Function; import org.openstack4j.model.common.header.HeaderNameValue; import org.openstack4j.model.common.header.Range; -import com.google.common.base.Function; - /** * Transforms a Header Range array into a single HeaderNameValue object - * + * * @author Jeremy Unruh */ public class RangesToHeaderNameValue implements Function { public static final RangesToHeaderNameValue INSTANCE = new RangesToHeaderNameValue(); - + @Override public HeaderNameValue apply(Range[] input) { if (input == null || input.length == 0) @@ -21,15 +20,15 @@ public HeaderNameValue apply(Range[] input) { if (input.length == 1) return input[0].toHeader(); - + String name = input[0].toHeader().getName(); StringBuilder value = new StringBuilder(String.valueOf(input[0].toHeader().getValue())); - + for (int i = 1; i < input.length; i++) { value.append(","); value.append(input[i].value()); } - + return new HeaderNameValue(name, value.toString()); } diff --git a/core/src/main/java/org/openstack4j/model/common/header/HeaderNameValue.java b/core/src/main/java/org/openstack4j/model/common/header/HeaderNameValue.java index acceac13d..995bcfabc 100644 --- a/core/src/main/java/org/openstack4j/model/common/header/HeaderNameValue.java +++ b/core/src/main/java/org/openstack4j/model/common/header/HeaderNameValue.java @@ -2,16 +2,16 @@ /** * Simple container which holds a Header name and Header value - * + * * @author Jeremy Unruh */ public final class HeaderNameValue { private final String name; private final Object value; - + public HeaderNameValue(String name, Object value) { - this.name = name; + this.name = name; this.value = value; } @@ -22,7 +22,7 @@ public String getName() { public Object getValue() { return value; } - + @Override public String toString() { return String.format("%s: %s", name, value); diff --git a/core/src/main/java/org/openstack4j/model/common/header/HeaderOption.java b/core/src/main/java/org/openstack4j/model/common/header/HeaderOption.java index c3eabdb29..5bb85cf6c 100644 --- a/core/src/main/java/org/openstack4j/model/common/header/HeaderOption.java +++ b/core/src/main/java/org/openstack4j/model/common/header/HeaderOption.java @@ -2,14 +2,14 @@ /** * Transforms an Option into a Header based name and value - * + * * @author Jeremy Unruh */ public interface HeaderOption { /** * Transform the option into a Header - * + * * @return the header name value object */ HeaderNameValue toHeader(); diff --git a/core/src/main/java/org/openstack4j/model/common/header/IfCondition.java b/core/src/main/java/org/openstack4j/model/common/header/IfCondition.java index cd9b39295..e8bd59154 100644 --- a/core/src/main/java/org/openstack4j/model/common/header/IfCondition.java +++ b/core/src/main/java/org/openstack4j/model/common/header/IfCondition.java @@ -1,63 +1,63 @@ package org.openstack4j.model.common.header; -import static com.google.common.base.Preconditions.checkNotNull; +import org.openstack4j.openstack.internal.Parser; import java.util.Date; -import org.openstack4j.openstack.internal.Parser; +import static com.google.common.base.Preconditions.checkNotNull; /** * A delegate class which contains calls to create various conditional header options - * + * * @author Jeremy Unruh */ public class IfCondition implements HeaderOption { private String name; private Object value; - + protected IfCondition(String name) { this.name = name; } - + protected IfCondition(String name, Object value) { this(name); this.value = value; } - + /** * Determines if the remote data has been modified since the specified date - * + * * @param milliseconds the date in milliseconds * @return if modified since condition */ public static IfModifiedSince modifiedSince(long milliseconds) { return new IfModifiedSince(new Date(milliseconds)); } - + /** * Determines if the remote data has been un-modified since the specified date - * + * * @param milliseconds the date in milliseconds * @return if un-modified since condition */ public static IfUnModifiedSince unModifiedSince(long milliseconds) { return new IfUnModifiedSince(new Date(milliseconds)); } - + /** * Determines if the remote data has been un-modified since the specified date - * + * * @param date the date since un-modified * @return if un-modified since condition */ public static IfUnModifiedSince unModifiedSince(Date date) { return new IfUnModifiedSince(date); } - + /** * Determines if the remote data has been modified since the specified date - * + * * @param date the date condition * @return if modified since condition */ @@ -65,10 +65,10 @@ public static IfModifiedSince modifiedSince(Date date) { checkNotNull(date, "Date must not be null"); return new IfModifiedSince(date); } - + /** * Compares the ETag as a condition to determine if the remote data does not match the checksum - * + * * @param matchCondition the match condition (ETag) * @return the if none match condition * @see http://www.ietf.org/rfc/rfc2616.txt @@ -77,10 +77,10 @@ public static IfNoneMatch noneMatch(String matchCondition) { checkNotNull(matchCondition, "Match condition must not be null"); return new IfNoneMatch(matchCondition); } - + /** * Compares the ETag as a condition to determine if the remote data matches the checksum - * + * * @param matchValue the match value (ETag) * @return the if match condition * @see http://www.ietf.org/rfc/rfc2616.txt @@ -89,43 +89,43 @@ public static IfMatch match(String matchValue) { checkNotNull(matchValue, "Match value must not be null"); return new IfMatch(matchValue); } - + @Override public HeaderNameValue toHeader() { return new HeaderNameValue(name, value); } - + public static class IfModifiedSince extends IfCondition { private static final String IF_MODIFIED_SINCE = "If-Modified-Since"; - + IfModifiedSince(Date date) { super(IF_MODIFIED_SINCE, Parser.toRFC1123(date)); } } - + public static class IfUnModifiedSince extends IfCondition { private static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; - + IfUnModifiedSince(Date date) { super(IF_UNMODIFIED_SINCE, Parser.toRFC1123(date)); } } - + public static class IfNoneMatch extends IfCondition { private static final String IF_NONE_MATCH = "If-None-Match"; - + IfNoneMatch(String condition) { super(IF_NONE_MATCH, condition); } } - + public static class IfMatch extends IfCondition { private static final String IF_MATCH = "If-Match"; - + IfMatch(String matchValue) { super(IF_MATCH, matchValue); } diff --git a/core/src/main/java/org/openstack4j/model/common/header/Range.java b/core/src/main/java/org/openstack4j/model/common/header/Range.java index b03714c54..5346051a6 100644 --- a/core/src/main/java/org/openstack4j/model/common/header/Range.java +++ b/core/src/main/java/org/openstack4j/model/common/header/Range.java @@ -2,17 +2,17 @@ /** * A Range is used to get portions of data by using one or more range specifications. - * + * * @author Jeremy Unruh */ public class Range implements HeaderOption { static final String RANGE_HEADER_NAME = "Range"; static final String RANGE_HEADER_VALUE_PREFIX = "bytes="; - + protected long offset; protected long length; - + Range(long offset, long length) { this.offset = offset; this.length = length; @@ -20,38 +20,38 @@ public class Range implements HeaderOption { /** * Return only the last N bytes of data - * + * * @param lastBytes the last N bytes to return * @return the range object */ public static Range last(long lastBytes) { return new Range(-1, lastBytes); } - + /** * Return only bytes starting from 0 to {@code maxBytes} of data - * + * * @param maxBytes the max bytes to download * @return the range object */ public static Range first(long maxBytes) { return new Range(0, maxBytes); } - + /** * Return all bytes after the specified {@code offset} of data - * + * * @param offset the starting pointer * @return the range object */ public static Range startAt(long offset) { return new Range(offset, -1); } - + /** * Return bytes only from {@code offset} in bytes to the specified {@code lastByte} - * - * @param offset the starting pointer + * + * @param offset the starting pointer * @param lastByte the last byte * @return the range object */ @@ -63,10 +63,10 @@ public static Range from(long offset, long lastByte) { public HeaderNameValue toHeader() { return new HeaderNameValue(RANGE_HEADER_NAME, RANGE_HEADER_VALUE_PREFIX + value()); } - + public String value() { return (offset >= 0 ? Long.toString(offset) : "") + "-" + - (length >= 0 ? Long.toString(length) : ""); + (length >= 0 ? Long.toString(length) : ""); } } diff --git a/core/src/main/java/org/openstack4j/model/common/payloads/FilePayload.java b/core/src/main/java/org/openstack4j/model/common/payloads/FilePayload.java index b0f39120f..224a0274b 100644 --- a/core/src/main/java/org/openstack4j/model/common/payloads/FilePayload.java +++ b/core/src/main/java/org/openstack4j/model/common/payloads/FilePayload.java @@ -1,70 +1,63 @@ package org.openstack4j.model.common.payloads; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; - +import com.google.common.base.Throwables; import org.openstack4j.model.common.Payload; -import com.google.common.base.Throwables; +import java.io.*; /** * A File based Payload - * + * * @author Jeremy Unruh */ public class FilePayload implements Payload { - private File file; - private InputStream is; - - public FilePayload(File file) { - this.file = file; - } - - /** - * {@inheritDoc} - */ - @Override - public InputStream open() { - try { - is = new FileInputStream(file); - return is; - } - catch (FileNotFoundException e) { - throw Throwables.propagate(e); - } - } - - /** - * {@inheritDoc} - */ - @Override - public File getRaw() { - return file; - } - - /** - * {@inheritDoc} - */ - @Override - public void close() throws IOException { - if (is != null) - is.close(); - } - - /** - * {@inheritDoc} - */ - @Override - public void closeQuietly() { - try - { - close(); - } - catch (IOException e) { } - } + private File file; + private InputStream is; + + public FilePayload(File file) { + this.file = file; + } + + /** + * {@inheritDoc} + */ + @Override + public InputStream open() { + try { + is = new FileInputStream(file); + return is; + } catch (FileNotFoundException e) { + throw Throwables.propagate(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public File getRaw() { + return file; + } + + /** + * {@inheritDoc} + */ + @Override + public void close() throws IOException { + if (is != null) + is.close(); + } + + /** + * {@inheritDoc} + */ + @Override + public void closeQuietly() { + try { + close(); + } catch (IOException e) { + } + } } diff --git a/core/src/main/java/org/openstack4j/model/common/payloads/InputStreamPayload.java b/core/src/main/java/org/openstack4j/model/common/payloads/InputStreamPayload.java index f61c1811e..5ae6fa675 100644 --- a/core/src/main/java/org/openstack4j/model/common/payloads/InputStreamPayload.java +++ b/core/src/main/java/org/openstack4j/model/common/payloads/InputStreamPayload.java @@ -1,58 +1,57 @@ package org.openstack4j.model.common.payloads; +import org.openstack4j.model.common.Payload; + import java.io.IOException; import java.io.InputStream; -import org.openstack4j.model.common.Payload; - /** * Input Stream Payload - * + * * @author Jeremy Unruh */ -public class InputStreamPayload implements Payload{ - - private InputStream is; - - public InputStreamPayload(InputStream is) { - this.is = is; - } - - /** - * {@inheritDoc} - */ - @Override - public void close() throws IOException { - if (is != null) - is.close(); - } - - /** - * {@inheritDoc} - */ - @Override - public InputStream open() { - return is; - } - - /** - * {@inheritDoc} - */ - @Override - public void closeQuietly() { - try { - close(); - } - catch (IOException e) { - } - } - - /** - * {@inheritDoc} - */ - @Override - public InputStream getRaw() { - return is; - } +public class InputStreamPayload implements Payload { + + private InputStream is; + + public InputStreamPayload(InputStream is) { + this.is = is; + } + + /** + * {@inheritDoc} + */ + @Override + public void close() throws IOException { + if (is != null) + is.close(); + } + + /** + * {@inheritDoc} + */ + @Override + public InputStream open() { + return is; + } + + /** + * {@inheritDoc} + */ + @Override + public void closeQuietly() { + try { + close(); + } catch (IOException e) { + } + } + + /** + * {@inheritDoc} + */ + @Override + public InputStream getRaw() { + return is; + } } diff --git a/core/src/main/java/org/openstack4j/model/common/payloads/URLPayload.java b/core/src/main/java/org/openstack4j/model/common/payloads/URLPayload.java index b351b8a50..e722c8f97 100644 --- a/core/src/main/java/org/openstack4j/model/common/payloads/URLPayload.java +++ b/core/src/main/java/org/openstack4j/model/common/payloads/URLPayload.java @@ -1,69 +1,66 @@ package org.openstack4j.model.common.payloads; +import com.google.common.base.Throwables; +import org.openstack4j.model.common.Payload; + import java.io.IOException; import java.io.InputStream; import java.net.URL; -import org.openstack4j.model.common.Payload; - -import com.google.common.base.Throwables; - /** * URL based Payload - * + * * @author Jeremy Unruh */ public class URLPayload implements Payload { - URL url; - InputStream is; - - public URLPayload(URL url) { - this.url = url; - } - - /** - * {@inheritDoc} - */ - @Override - public void close() throws IOException { - if (is != null) - is.close(); - } + URL url; + InputStream is; + + public URLPayload(URL url) { + this.url = url; + } + + /** + * {@inheritDoc} + */ + @Override + public void close() throws IOException { + if (is != null) + is.close(); + } - /** - * {@inheritDoc} - */ - @Override - public InputStream open() { - try { - is = url.openStream(); - return is; - } - catch (IOException e) { - throw Throwables.propagate(e); - } - } + /** + * {@inheritDoc} + */ + @Override + public InputStream open() { + try { + is = url.openStream(); + return is; + } catch (IOException e) { + throw Throwables.propagate(e); + } + } - /** - * {@inheritDoc} - */ - @Override - public void closeQuietly() { - try - { - if (is != null) - is.close(); - } - catch (IOException e) { } - } + /** + * {@inheritDoc} + */ + @Override + public void closeQuietly() { + try { + if (is != null) + is.close(); + } catch (IOException e) { + } + } - /** - * {@inheritDoc} - */ - @Override - public URL getRaw() { - return url; - } + /** + * {@inheritDoc} + */ + @Override + public URL getRaw() { + return url; + } } diff --git a/core/src/main/java/org/openstack4j/model/common/resolvers/LatestServiceVersionResolver.java b/core/src/main/java/org/openstack4j/model/common/resolvers/LatestServiceVersionResolver.java index 52b613e17..eb6560132 100644 --- a/core/src/main/java/org/openstack4j/model/common/resolvers/LatestServiceVersionResolver.java +++ b/core/src/main/java/org/openstack4j/model/common/resolvers/LatestServiceVersionResolver.java @@ -1,10 +1,10 @@ package org.openstack4j.model.common.resolvers; -import java.util.SortedSet; - import org.openstack4j.api.types.ServiceType; -import org.openstack4j.model.identity.v3.Service; import org.openstack4j.model.identity.v2.Access; +import org.openstack4j.model.identity.v3.Service; + +import java.util.SortedSet; /** * Resolves the service version to the latest version found within the Service Catalog diff --git a/core/src/main/java/org/openstack4j/model/common/resolvers/ServiceVersionResolver.java b/core/src/main/java/org/openstack4j/model/common/resolvers/ServiceVersionResolver.java index 5b4a891e0..808c407b9 100644 --- a/core/src/main/java/org/openstack4j/model/common/resolvers/ServiceVersionResolver.java +++ b/core/src/main/java/org/openstack4j/model/common/resolvers/ServiceVersionResolver.java @@ -1,11 +1,11 @@ package org.openstack4j.model.common.resolvers; -import java.util.SortedSet; - import org.openstack4j.api.types.ServiceType; import org.openstack4j.model.identity.v2.Access; import org.openstack4j.model.identity.v3.Service; +import java.util.SortedSet; + /** * Responsible for resolving a Service to a specific version. * @@ -15,25 +15,25 @@ public interface ServiceVersionResolver { /** * Resolves to a single identity v3 service for the given {@code ServiceType} and set of associated {@code services}. - * + *

* For example if a deployment contains Compute/Nova version 2 and 2.1 then resolve would be invoked with the * params of {@link ServiceType#COMPUTE} and a set of 2 services (Compute 2 and Compute 2.1). The resolver is * responsible for picking the appropriate version * - * @param type the type of {@code services} + * @param type the type of {@code services} * @param services the sorted by version set of service(s) * @return a single service */ - Service resolveV3(ServiceType type, SortedSet services); - + Service resolveV3(ServiceType type, SortedSet services); + /** * Resolves to a single identity v2 service for the given {@code ServiceType} and set of associated {@code services}. - * + *

* For example if a deployment contains Compute/Nova version 2 and 2.1 then resolve would be invoked with the * params of {@link ServiceType#COMPUTE} and a set of 2 services (Compute 2 and Compute 2.1). The resolver is * responsible for picking the appropriate version - * - * @param type type the type of {@code services} + * + * @param type type the type of {@code services} * @param services the sorted by version set of service(s) * @return a single service */ diff --git a/core/src/main/java/org/openstack4j/model/common/resolvers/StableServiceVersionResolver.java b/core/src/main/java/org/openstack4j/model/common/resolvers/StableServiceVersionResolver.java index 3e0b638f5..3d88521ee 100644 --- a/core/src/main/java/org/openstack4j/model/common/resolvers/StableServiceVersionResolver.java +++ b/core/src/main/java/org/openstack4j/model/common/resolvers/StableServiceVersionResolver.java @@ -1,10 +1,10 @@ package org.openstack4j.model.common.resolvers; -import java.util.SortedSet; - import org.openstack4j.api.types.ServiceType; -import org.openstack4j.model.identity.v3.Service; import org.openstack4j.model.identity.v2.Access; +import org.openstack4j.model.identity.v3.Service; + +import java.util.SortedSet; /** * Resolves each service to the lowest version which we consider most stable and diff --git a/core/src/main/java/org/openstack4j/model/compute/AbsoluteLimit.java b/core/src/main/java/org/openstack4j/model/compute/AbsoluteLimit.java index 99a6e8210..a0c96da10 100644 --- a/core/src/main/java/org/openstack4j/model/compute/AbsoluteLimit.java +++ b/core/src/main/java/org/openstack4j/model/compute/AbsoluteLimit.java @@ -3,211 +3,211 @@ import org.openstack4j.model.ModelEntity; /** - * Absolute limits are specified as name/value pairs. The name of the absolute limit uniquely identifies the limit within a deployment. - * Please consult your provider for an exhaustive list of absolute value names. An absolute limit value is always specified as an integer. - * The name of the absolute limit determines the unit type of the integer value. - * + * Absolute limits are specified as name/value pairs. The name of the absolute limit uniquely identifies the limit within a deployment. + * Please consult your provider for an exhaustive list of absolute value names. An absolute limit value is always specified as an integer. + * The name of the absolute limit determines the unit type of the integer value. + *

* For example, the name maxServerMeta implies that the value is in terms of server metadata items. - * + *

* Any limit which returns -1 indicates no value/no data/not supported by vendor - * + * * @author Jeremy Unruh */ public interface AbsoluteLimit extends ModelEntity { - /** - * Gets the max server meta. - * - * @return the maxServerMeta (-1 indicates no value) - */ - int getMaxServerMeta(); - - /** - * Gets the max personality. - * - * @return the maxPersonality (-1 indicates no value) - */ - int getMaxPersonality(); - - /** - * Gets the max image meta. - * - * @return the maxImageMeta (-1 indicates no value) - */ - int getMaxImageMeta(); - - /** - * Gets the max personality size. - * - * @return the maxPersonalitySize (-1 indicates no value) - */ - int getMaxPersonalitySize(); - - /** - * Gets the max total cores. - * - * @return the maxTotalCores (-1 indicates no value) - */ - int getMaxTotalCores(); - - /** - * Gets the max total instances. - * - * @return the maxTotalInstances (-1 indicates no value) - */ - int getMaxTotalInstances(); - - /** - * Gets the max total ram size. - * - * @return the maxTotalRAMSize (-1 indicates no value) - */ - int getMaxTotalRAMSize(); - - /** - * Gets the total volumes used. - * - * @return the totalVolumesUsed (-1 indicates no value) - */ - int getTotalVolumesUsed(); - - /** - * Gets the max security group rules. - * - * @return the maxSecurityGroupRules (-1 indicates no value) - */ - int getMaxSecurityGroupRules(); - - /** - * Gets the max total keypairs. - * - * @return the maxTotalKeypairs (-1 indicates no value) - */ - int getMaxTotalKeypairs(); - - /** - * Gets the total cores used. - * - * @return the totalCoresUsed (-1 indicates no value) - */ - int getTotalCoresUsed(); - - /** - * Gets the max total volumes. - * - * @return the maxTotalVolumes (-1 indicates no value) - */ - int getMaxTotalVolumes(); - - /** - * Gets the total ram used. - * - * @return the totalRAMUsed (-1 indicates no value) - */ - int getTotalRAMUsed(); - - /** - * Gets the total instances used. - * - * @return the totalInstancesUsed (-1 indicates no value) - */ - int getTotalInstancesUsed(); - - /** - * Gets the max security groups. - * - * @return the maxSecurityGroups (-1 indicates no value) - */ - int getMaxSecurityGroups(); - - /** - * Gets the total volume gigabytes used. - * - * @return the totalVolumeGigabytesUsed (-1 indicates no value) - */ - int getTotalVolumeGigabytesUsed(); - - /** - * Gets the total security groups used. - * - * @return the totalSecurityGroupsUsed (-1 indicates no value) - */ - int getTotalSecurityGroupsUsed(); - - /** - * Gets the max total floating ips. - * - * @return the maxTotalFloatingIps (-1 indicates no value) - */ - int getMaxTotalFloatingIps(); - - /** - * Gets the total key pairs used. - * - * @return the totalKeyPairsUsed (-1 indicates no value) - */ - int getTotalKeyPairsUsed(); - - /** - * Gets the max total volume gigabytes. - * - * @return the maxTotalVolumeGigabytes (-1 indicates no value) - */ - int getMaxTotalVolumeGigabytes(); - - /** - * Gets the server meta used. - * - * @return the serverMetaUsed (-1 indicates no value) - */ - int getServerMetaUsed(); - - /** - * Gets the personality used. - * - * @return the personalityUsed (-1 indicates no value) - */ - int getPersonalityUsed(); - - /** - * Gets the image meta used. - * - * @return the imageMetaUsed (-1 indicates no value) - */ - int getImageMetaUsed(); - - /** - * Gets the personality size used. - * - * @return the personalitySizeUsed (-1 indicates no value) - */ - int getPersonalitySizeUsed(); - - /** - * Gets the security group rules used. - * - * @return the securityGroupRulesUsed (-1 indicates no value) - */ - int getSecurityGroupRulesUsed(); - - /** - * Gets the total floating ips used. - * - * @return the totalFloatingIpsUsed (-1 indicates no value) - */ - int getTotalFloatingIpsUsed(); - - /** - * Gets the max server group members - * - * @return the max server group members (-1 indicates no value) - */ - int getMaxServerGroupMembers(); - - /** - * Gets the max server groups - * - * @return the max server groups (-1 indicates no value) - */ - int getMaxServerGroups(); + /** + * Gets the max server meta. + * + * @return the maxServerMeta (-1 indicates no value) + */ + int getMaxServerMeta(); + + /** + * Gets the max personality. + * + * @return the maxPersonality (-1 indicates no value) + */ + int getMaxPersonality(); + + /** + * Gets the max image meta. + * + * @return the maxImageMeta (-1 indicates no value) + */ + int getMaxImageMeta(); + + /** + * Gets the max personality size. + * + * @return the maxPersonalitySize (-1 indicates no value) + */ + int getMaxPersonalitySize(); + + /** + * Gets the max total cores. + * + * @return the maxTotalCores (-1 indicates no value) + */ + int getMaxTotalCores(); + + /** + * Gets the max total instances. + * + * @return the maxTotalInstances (-1 indicates no value) + */ + int getMaxTotalInstances(); + + /** + * Gets the max total ram size. + * + * @return the maxTotalRAMSize (-1 indicates no value) + */ + int getMaxTotalRAMSize(); + + /** + * Gets the total volumes used. + * + * @return the totalVolumesUsed (-1 indicates no value) + */ + int getTotalVolumesUsed(); + + /** + * Gets the max security group rules. + * + * @return the maxSecurityGroupRules (-1 indicates no value) + */ + int getMaxSecurityGroupRules(); + + /** + * Gets the max total keypairs. + * + * @return the maxTotalKeypairs (-1 indicates no value) + */ + int getMaxTotalKeypairs(); + + /** + * Gets the total cores used. + * + * @return the totalCoresUsed (-1 indicates no value) + */ + int getTotalCoresUsed(); + + /** + * Gets the max total volumes. + * + * @return the maxTotalVolumes (-1 indicates no value) + */ + int getMaxTotalVolumes(); + + /** + * Gets the total ram used. + * + * @return the totalRAMUsed (-1 indicates no value) + */ + int getTotalRAMUsed(); + + /** + * Gets the total instances used. + * + * @return the totalInstancesUsed (-1 indicates no value) + */ + int getTotalInstancesUsed(); + + /** + * Gets the max security groups. + * + * @return the maxSecurityGroups (-1 indicates no value) + */ + int getMaxSecurityGroups(); + + /** + * Gets the total volume gigabytes used. + * + * @return the totalVolumeGigabytesUsed (-1 indicates no value) + */ + int getTotalVolumeGigabytesUsed(); + + /** + * Gets the total security groups used. + * + * @return the totalSecurityGroupsUsed (-1 indicates no value) + */ + int getTotalSecurityGroupsUsed(); + + /** + * Gets the max total floating ips. + * + * @return the maxTotalFloatingIps (-1 indicates no value) + */ + int getMaxTotalFloatingIps(); + + /** + * Gets the total key pairs used. + * + * @return the totalKeyPairsUsed (-1 indicates no value) + */ + int getTotalKeyPairsUsed(); + + /** + * Gets the max total volume gigabytes. + * + * @return the maxTotalVolumeGigabytes (-1 indicates no value) + */ + int getMaxTotalVolumeGigabytes(); + + /** + * Gets the server meta used. + * + * @return the serverMetaUsed (-1 indicates no value) + */ + int getServerMetaUsed(); + + /** + * Gets the personality used. + * + * @return the personalityUsed (-1 indicates no value) + */ + int getPersonalityUsed(); + + /** + * Gets the image meta used. + * + * @return the imageMetaUsed (-1 indicates no value) + */ + int getImageMetaUsed(); + + /** + * Gets the personality size used. + * + * @return the personalitySizeUsed (-1 indicates no value) + */ + int getPersonalitySizeUsed(); + + /** + * Gets the security group rules used. + * + * @return the securityGroupRulesUsed (-1 indicates no value) + */ + int getSecurityGroupRulesUsed(); + + /** + * Gets the total floating ips used. + * + * @return the totalFloatingIpsUsed (-1 indicates no value) + */ + int getTotalFloatingIpsUsed(); + + /** + * Gets the max server group members + * + * @return the max server group members (-1 indicates no value) + */ + int getMaxServerGroupMembers(); + + /** + * Gets the max server groups + * + * @return the max server groups (-1 indicates no value) + */ + int getMaxServerGroups(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/Action.java b/core/src/main/java/org/openstack4j/model/compute/Action.java index bf4fc96eb..27f105857 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Action.java +++ b/core/src/main/java/org/openstack4j/model/compute/Action.java @@ -2,36 +2,64 @@ /** * Basic Actions against a Live Server - * + * * @author Jeremy Unruh */ public enum Action { - /** Pause the server */ - PAUSE, - /** UnPause the paused server */ - UNPAUSE, - /** Stop the server */ - STOP, - /** Start the server */ - START, - /** Lock the server */ - LOCK, - /** Unlock a locked server */ - UNLOCK, - /** Suspend a server */ - SUSPEND, - /** Resume a suspended server */ - RESUME, - /** Rescue the server */ - RESCUE, - /** Unrescue the server */ - UNRESCUE, - /** Shelve the server */ - SHELVE, - /** Remove a shelved instance from the compute node */ - SHELVE_OFFLOAD, - /** Unshelve the server */ - UNSHELVE, - /** Force delete the server */ - FORCEDELETE + /** + * Pause the server + */ + PAUSE, + /** + * UnPause the paused server + */ + UNPAUSE, + /** + * Stop the server + */ + STOP, + /** + * Start the server + */ + START, + /** + * Lock the server + */ + LOCK, + /** + * Unlock a locked server + */ + UNLOCK, + /** + * Suspend a server + */ + SUSPEND, + /** + * Resume a suspended server + */ + RESUME, + /** + * Rescue the server + */ + RESCUE, + /** + * Unrescue the server + */ + UNRESCUE, + /** + * Shelve the server + */ + SHELVE, + /** + * Remove a shelved instance from the compute node + */ + SHELVE_OFFLOAD, + /** + * Unshelve the server + */ + UNSHELVE, + /** + * Force delete the server + */ + FORCEDELETE } diff --git a/core/src/main/java/org/openstack4j/model/compute/Address.java b/core/src/main/java/org/openstack4j/model/compute/Address.java index c220354a2..8a2bf63d3 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Address.java +++ b/core/src/main/java/org/openstack4j/model/compute/Address.java @@ -4,29 +4,29 @@ /** * Represents an IP Address - * + * * @author Jeremy Unruh */ public interface Address extends ModelEntity { - /** - * @return the macaddress for the address - */ - String getMacAddr(); + /** + * @return the macaddress for the address + */ + String getMacAddr(); - /** - * @return the IP version (4 | 6) - */ - int getVersion(); + /** + * @return the IP version (4 | 6) + */ + int getVersion(); + + /** + * @return the IP Address + */ + String getAddr(); + + /** + * @return the type of address + */ + String getType(); - /** - * @return the IP Address - */ - String getAddr(); - - /** - * @return the type of address - */ - String getType(); - } diff --git a/core/src/main/java/org/openstack4j/model/compute/Addresses.java b/core/src/main/java/org/openstack4j/model/compute/Addresses.java index e2b488ec6..ebfc91c85 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Addresses.java +++ b/core/src/main/java/org/openstack4j/model/compute/Addresses.java @@ -1,36 +1,36 @@ package org.openstack4j.model.compute; +import org.openstack4j.model.ModelEntity; + import java.util.List; import java.util.Map; -import org.openstack4j.model.ModelEntity; - /** * A container which holds networks with 1 or more addresses - * + * * @author Jeremy Unruh */ public interface Addresses extends ModelEntity { - /** - * Adds an address to the given network type - * - * @param key the type of address classification - * @param value of the address - */ - void add(String key, Address value); - - /** - * @return the a Map - */ - Map> getAddresses(); - - /** - * Gets the addresses associated with the given network type - * - * @param type the type of network - * @return the List of Addresses - */ - List getAddresses(String type); - + /** + * Adds an address to the given network type + * + * @param key the type of address classification + * @param value of the address + */ + void add(String key, Address value); + + /** + * @return the a Map + */ + Map> getAddresses(); + + /** + * Gets the addresses associated with the given network type + * + * @param type the type of network + * @return the List of Addresses + */ + List getAddresses(String type); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/BDMDestType.java b/core/src/main/java/org/openstack4j/model/compute/BDMDestType.java index 9061092aa..c91f786ea 100644 --- a/core/src/main/java/org/openstack4j/model/compute/BDMDestType.java +++ b/core/src/main/java/org/openstack4j/model/compute/BDMDestType.java @@ -5,15 +5,19 @@ /** * Block Device Mapping Destination Type - * + * * @author Jeremy Unruh * @see http://docs.openstack.org/developer/nova/block_device_mapping.html */ public enum BDMDestType { - /** Will either mean an ephemeral blank disk on hypervisor local storage, or a swap disk **/ - LOCAL, - /** Creates a blank Cinder volume and attaches it. This will also require the volume size to be set **/ + /** + * Will either mean an ephemeral blank disk on hypervisor local storage, or a swap disk + **/ + LOCAL, + /** + * Creates a blank Cinder volume and attaches it. This will also require the volume size to be set + **/ VOLUME; @JsonCreator diff --git a/core/src/main/java/org/openstack4j/model/compute/BDMSourceType.java b/core/src/main/java/org/openstack4j/model/compute/BDMSourceType.java index 49cb634cb..2d5a1b23d 100644 --- a/core/src/main/java/org/openstack4j/model/compute/BDMSourceType.java +++ b/core/src/main/java/org/openstack4j/model/compute/BDMSourceType.java @@ -5,7 +5,7 @@ /** * Block Device Mapping Source Type - * + * * @author Jeremy Unruh * @see http://docs.openstack.org/developer/nova/block_device_mapping.html */ @@ -13,9 +13,8 @@ public enum BDMSourceType { BLANK, IMAGE, SNAPSHOT, - VOLUME - ; - + VOLUME; + @JsonCreator public static BDMSourceType value(String v) { if (v == null) @@ -31,5 +30,5 @@ public static BDMSourceType value(String v) { public String value() { return name().toLowerCase(); } - + } diff --git a/core/src/main/java/org/openstack4j/model/compute/BlockDeviceMappingCreate.java b/core/src/main/java/org/openstack4j/model/compute/BlockDeviceMappingCreate.java index 4d0d00919..26123ffe0 100644 --- a/core/src/main/java/org/openstack4j/model/compute/BlockDeviceMappingCreate.java +++ b/core/src/main/java/org/openstack4j/model/compute/BlockDeviceMappingCreate.java @@ -4,7 +4,6 @@ import org.openstack4j.model.compute.builder.BlockDeviceMappingBuilder; /** - * * @author jaroslav.sovicka@oracle.com */ public interface BlockDeviceMappingCreate extends Buildable { diff --git a/core/src/main/java/org/openstack4j/model/compute/Fault.java b/core/src/main/java/org/openstack4j/model/compute/Fault.java index 94dc5eb69..8088fe00f 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Fault.java +++ b/core/src/main/java/org/openstack4j/model/compute/Fault.java @@ -1,34 +1,34 @@ package org.openstack4j.model.compute; -import java.util.Date; - import org.openstack4j.model.ModelEntity; +import java.util.Date; + /** * Represents a Fault with the Nova OpenStack service - * + * * @author Jeremy Unruh */ public interface Fault extends ModelEntity { - /** - * @return the fault code - */ - int getCode(); - - /** - * @return the message of the fault - */ - String getMessage(); - - /** - * @return details for the fault - */ - String getDetails(); - - /** - * @return the date the fault was created - */ - Date getCreated(); - + /** + * @return the fault code + */ + int getCode(); + + /** + * @return the message of the fault + */ + String getMessage(); + + /** + * @return details for the fault + */ + String getDetails(); + + /** + * @return the date the fault was created + */ + Date getCreated(); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/Flavor.java b/core/src/main/java/org/openstack4j/model/compute/Flavor.java index 5b07efed8..6f92af7ab 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Flavor.java +++ b/core/src/main/java/org/openstack4j/model/compute/Flavor.java @@ -1,97 +1,97 @@ /* - * + * */ package org.openstack4j.model.compute; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; import org.openstack4j.model.compute.builder.FlavorBuilder; +import java.util.List; + /** * An OpenStack Flavor which is a template used for configuration against running Instances - * + * * @author Jeremy Unruh */ public interface Flavor extends ModelEntity, Buildable { - /** - * @return the id for this flavor - */ - String getId(); - - /** - * @return the descriptive name of the flavor - */ - String getName(); - - /** - * @return the Memory in MB for the flavor - */ - int getRam(); - - /** - * @return the Number of VCPUs for the flavor - */ - int getVcpus(); - - /** - * @return the size of the local disk in GB - */ - int getDisk(); - - /** - * @return the Swap space in MB - */ - int getSwap(); - - /** - * @return the RX/TX factor - */ - float getRxtxFactor(); - - /** - * Gets the ephemeral. - * - * @return the ephemeral - */ - int getEphemeral(); - - /** - * Gets the rxtx quota. - * - * @return the rxtx quota - */ - int getRxtxQuota(); - - /** - * Gets the rxtx cap. - * - * @return the rxtx cap - */ - int getRxtxCap(); - - /** - * Checks if is public. - * - * @return true, if is public - */ - Boolean isPublic(); - - /** - * Checks if is disabled. - * - * @return true, if is disabled - */ - Boolean isDisabled(); - - /** - * Gets the links. - * - * @return the links - */ - List getLinks(); - + /** + * @return the id for this flavor + */ + String getId(); + + /** + * @return the descriptive name of the flavor + */ + String getName(); + + /** + * @return the Memory in MB for the flavor + */ + int getRam(); + + /** + * @return the Number of VCPUs for the flavor + */ + int getVcpus(); + + /** + * @return the size of the local disk in GB + */ + int getDisk(); + + /** + * @return the Swap space in MB + */ + int getSwap(); + + /** + * @return the RX/TX factor + */ + float getRxtxFactor(); + + /** + * Gets the ephemeral. + * + * @return the ephemeral + */ + int getEphemeral(); + + /** + * Gets the rxtx quota. + * + * @return the rxtx quota + */ + int getRxtxQuota(); + + /** + * Gets the rxtx cap. + * + * @return the rxtx cap + */ + int getRxtxCap(); + + /** + * Checks if is public. + * + * @return true, if is public + */ + Boolean isPublic(); + + /** + * Checks if is disabled. + * + * @return true, if is disabled + */ + Boolean isDisabled(); + + /** + * Gets the links. + * + * @return the links + */ + List getLinks(); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/FlavorAccess.java b/core/src/main/java/org/openstack4j/model/compute/FlavorAccess.java index e89561de7..d744d66c3 100644 --- a/core/src/main/java/org/openstack4j/model/compute/FlavorAccess.java +++ b/core/src/main/java/org/openstack4j/model/compute/FlavorAccess.java @@ -4,19 +4,19 @@ /** * An OpenStack Flavor Access for tenants - * + * * @author Moodpo */ -public interface FlavorAccess extends ModelEntity{ - - /** - * @return the id for this flavor - */ - String getFlavorId(); - - /** - * @return the id for this tenant - */ - String getTenantId(); - +public interface FlavorAccess extends ModelEntity { + + /** + * @return the id for this flavor + */ + String getFlavorId(); + + /** + * @return the id for this tenant + */ + String getTenantId(); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/FloatingIP.java b/core/src/main/java/org/openstack4j/model/compute/FloatingIP.java index dd0f9feb5..b4102f72d 100755 --- a/core/src/main/java/org/openstack4j/model/compute/FloatingIP.java +++ b/core/src/main/java/org/openstack4j/model/compute/FloatingIP.java @@ -6,44 +6,43 @@ /** * The Interface FloatingIP. - * * * @author nanderson */ public interface FloatingIP extends ModelEntity, Buildable { - /** - * Gets the id. - * - * @return the id - */ - String getId(); + /** + * Gets the id. + * + * @return the id + */ + String getId(); - /** - * Gets the instance id. - * - * @return the instance id - */ - String getInstanceId(); + /** + * Gets the instance id. + * + * @return the instance id + */ + String getInstanceId(); - /** - * Gets the floating ip address. - * - * @return the floating ip address - */ - String getFloatingIpAddress(); + /** + * Gets the floating ip address. + * + * @return the floating ip address + */ + String getFloatingIpAddress(); - /** - * Gets the fixed ip address. - * - * @return the fixed ip address - */ - String getFixedIpAddress(); - - /** - * Gets the pool. - * - * @return the pool name - */ - String getPool(); + /** + * Gets the fixed ip address. + * + * @return the fixed ip address + */ + String getFixedIpAddress(); + + /** + * Gets the pool. + * + * @return the pool name + */ + String getPool(); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/compute/HostAggregate.java b/core/src/main/java/org/openstack4j/model/compute/HostAggregate.java index 4ffda7b03..35ec9d685 100644 --- a/core/src/main/java/org/openstack4j/model/compute/HostAggregate.java +++ b/core/src/main/java/org/openstack4j/model/compute/HostAggregate.java @@ -1,66 +1,70 @@ package org.openstack4j.model.compute; +import org.openstack4j.model.ModelEntity; + import java.util.Date; import java.util.List; import java.util.Map; -import org.openstack4j.model.ModelEntity; /** * Represents the HostAggregates - * @author liujunpeng * + * @author liujunpeng */ public interface HostAggregate extends ModelEntity { - /** - * Availability zone of aggregate - * @return Availability zone - */ - String getAvailabilityZone(); - /** - * - * @return created time - */ - Date getCreate(); - /** - * - * @return true:deleted;false:no - */ - boolean isDeleted(); - /** - * - * @return deleted time - */ - Date getDeletedAt(); - - /** - * Host ID to add to an aggregate, which is a collection of multiple groups - * of hosts that share common resources like storage and network. - * - * @return hosts list - */ - List getHosts(); + /** + * Availability zone of aggregate + * + * @return Availability zone + */ + String getAvailabilityZone(); + + /** + * @return created time + */ + Date getCreate(); + + /** + * @return true:deleted;false:no + */ + boolean isDeleted(); + + /** + * @return deleted time + */ + Date getDeletedAt(); + + /** + * Host ID to add to an aggregate, which is a collection of multiple groups + * of hosts that share common resources like storage and network. + * + * @return hosts list + */ + List getHosts(); + + /** + * The ID associated with an aggregate + * + * @return id + */ + String getId(); + + /** + * Metadata value + * + * @return Map + */ + Map getMetadata(); + + /** + * @return name + */ + String getName(); + + /** + * @return last updated time + */ + Date getUpdatedAt(); - /** - * The ID associated with an aggregate - * - * @return id - */ - String getId(); - /** - * Metadata value - * @return Map - */ - Map getMetadata(); - /** - * - * @return name - */ - String getName(); - /** - * - * @return last updated time - */ - Date getUpdatedAt(); - } diff --git a/core/src/main/java/org/openstack4j/model/compute/HostResource.java b/core/src/main/java/org/openstack4j/model/compute/HostResource.java index a96ce0df2..ad50cca5f 100644 --- a/core/src/main/java/org/openstack4j/model/compute/HostResource.java +++ b/core/src/main/java/org/openstack4j/model/compute/HostResource.java @@ -4,7 +4,7 @@ /** * OS Host describes capabilities of each compute host where Nova servers are running on - * + * * @author Qin An */ public interface HostResource extends ModelEntity { @@ -32,21 +32,21 @@ public interface HostResource extends ModelEntity { * @return the project id (or special name like total, used_now, used_max) */ public String getProject(); - - - /** - * @return service - */ - String getService(); - - /** - * @return zone - */ - String getZone(); - - /** - * @return host name - */ - String getHostName(); + + + /** + * @return service + */ + String getService(); + + /** + * @return zone + */ + String getZone(); + + /** + * @return host name + */ + String getHostName(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java b/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java index 575172931..5b553f918 100644 --- a/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java +++ b/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java @@ -2,14 +2,14 @@ /** * Host Resource Body contains Nova host resource - * + * * @author Qin An */ public interface HostResourceBody { - /** - * @return the Host Resource contained in the unamed body - */ - public HostResource getHostResource(); + /** + * @return the Host Resource contained in the unamed body + */ + public HostResource getHostResource(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/IPProtocol.java b/core/src/main/java/org/openstack4j/model/compute/IPProtocol.java index 1a28f62e8..b3b6145cd 100644 --- a/core/src/main/java/org/openstack4j/model/compute/IPProtocol.java +++ b/core/src/main/java/org/openstack4j/model/compute/IPProtocol.java @@ -5,30 +5,27 @@ /** - * * Represents an IP Protocol Type - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ public enum IPProtocol { - TCP, UDP, ICMP, UNRECOGNIZED; - - @JsonCreator - public static IPProtocol value(String v) - { - if (v == null) return UNRECOGNIZED; - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - - @JsonValue - public String value() { - return name().toLowerCase(); - } - + TCP, UDP, ICMP, UNRECOGNIZED; + + @JsonCreator + public static IPProtocol value(String v) { + if (v == null) return UNRECOGNIZED; + try { + return valueOf(v.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + + @JsonValue + public String value() { + return name().toLowerCase(); + } + } diff --git a/core/src/main/java/org/openstack4j/model/compute/Image.java b/core/src/main/java/org/openstack4j/model/compute/Image.java index 86bdcf15a..e8def8073 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Image.java +++ b/core/src/main/java/org/openstack4j/model/compute/Image.java @@ -1,102 +1,100 @@ package org.openstack4j.model.compute; -import java.util.Date; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonCreator; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * An OpenStack image is a collection of files used to create a Server. Users provide pre-built OS images by default and or custom * images can be built - * + * * @author Jeremy Unruh */ public interface Image extends ModelEntity { - /** - * Status can be used while an image is being saved. It provides state of the progress indicator. Images with ACTIVE status - * are available for install. - */ - enum Status { - UNRECOGNIZED, UNKNOWN, ACTIVE, SAVING, ERROR, DELETED; - - @JsonCreator - public static Status forValue(String value) { - if (value != null) - { - for (Status s : Status.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return Status.UNKNOWN; - } - } - - /** - * @return the identifier of this image - */ - String getId(); - - /** - * @return the descriptive name of the image - */ - String getName(); - - /** - * @return the size in bytes - */ - long getSize(); - - /** - * @return the minimum disk in bytes - */ - int getMinDisk(); - - /** - * @return the minimum ram in bytes - */ - int getMinRam(); - - /** - * @return the progress of the image during upload or setup - */ - int getProgress(); - - /** - * @return the status of this image - */ - Status getStatus(); - - /** - * @return the date the image was created - */ - Date getCreated(); - - /** - * @return the date the image was last updated - */ - Date getUpdated(); - - /** - * @return external reference links for the image - */ - List getLinks(); - - /** - * @return extra metadata/specs associated with the image - */ - Map getMetaData(); - - /** - * Determines if this image is a snapshot - * - * @return true if this image is a snapshot - */ - boolean isSnapshot(); - + /** + * Status can be used while an image is being saved. It provides state of the progress indicator. Images with ACTIVE status + * are available for install. + */ + enum Status { + UNRECOGNIZED, UNKNOWN, ACTIVE, SAVING, ERROR, DELETED; + + @JsonCreator + public static Status forValue(String value) { + if (value != null) { + for (Status s : Status.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return Status.UNKNOWN; + } + } + + /** + * @return the identifier of this image + */ + String getId(); + + /** + * @return the descriptive name of the image + */ + String getName(); + + /** + * @return the size in bytes + */ + long getSize(); + + /** + * @return the minimum disk in bytes + */ + int getMinDisk(); + + /** + * @return the minimum ram in bytes + */ + int getMinRam(); + + /** + * @return the progress of the image during upload or setup + */ + int getProgress(); + + /** + * @return the status of this image + */ + Status getStatus(); + + /** + * @return the date the image was created + */ + Date getCreated(); + + /** + * @return the date the image was last updated + */ + Date getUpdated(); + + /** + * @return external reference links for the image + */ + List getLinks(); + + /** + * @return extra metadata/specs associated with the image + */ + Map getMetaData(); + + /** + * Determines if this image is a snapshot + * + * @return true if this image is a snapshot + */ + boolean isSnapshot(); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/InstanceAction.java b/core/src/main/java/org/openstack4j/model/compute/InstanceAction.java index 74af73e2d..837c6e1d3 100644 --- a/core/src/main/java/org/openstack4j/model/compute/InstanceAction.java +++ b/core/src/main/java/org/openstack4j/model/compute/InstanceAction.java @@ -4,7 +4,7 @@ /** * An action executed on an instance - * + * * @author Christian Banse */ public interface InstanceAction { diff --git a/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java b/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java index be69ee405..9e6db5ef8 100644 --- a/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java +++ b/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java @@ -1,62 +1,62 @@ package org.openstack4j.model.compute; -import java.util.List; - import org.openstack4j.model.ModelEntity; +import java.util.List; + /** * Interface attachment model entity - * + * * @author Jeremy Unruh */ public interface InterfaceAttachment extends ModelEntity { - + /** * List of Fixed IpAddresses - * + * * @return list of fix addresses */ List getFixedIps(); - + /** * The interface MacAddress - * + * * @return the MacAddress for this Interface */ String getMacAddr(); - + /** * The network identifier - * + * * @return the network identifier associated to this interface */ String getNetId(); - + /** * The port aka interface identifier - * + * * @return the port/interface identifier */ String getPortId(); - + /** * The current port state - * + * * @return the port state */ PortState getPortState(); public interface FixedIp extends ModelEntity { - + /** * @return the IpAddress */ String getIpAddress(); - + /** * @return the subnet unique identifier */ String getSubnetId(); } - + } diff --git a/core/src/main/java/org/openstack4j/model/compute/Keypair.java b/core/src/main/java/org/openstack4j/model/compute/Keypair.java index 462ac76a4..4f816765e 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Keypair.java +++ b/core/src/main/java/org/openstack4j/model/compute/Keypair.java @@ -1,77 +1,77 @@ package org.openstack4j.model.compute; -import java.util.Date; - import org.openstack4j.model.ModelEntity; +import java.util.Date; + /** * An OpenStack Keypair is an SSH Key - * + * * @author Jeremy Unruh,whaon */ public interface Keypair extends ModelEntity { - - /** - * The name associated with the keypair - * - * @return the name of the keypair - */ - String getName(); - - /** - * The public SSH key - * - * @return the public key - */ - String getPublicKey(); - - /** - * The private key associated with this keypair. Only populated on create when a public key is not specified and is auto-generated - * by the server - * - * @return the private key - */ - String getPrivateKey(); - - /** - * @return the server fingerprint - */ - String getFingerprint(); - - /** - * - * @return the user_id for a keypair. - */ - String getUserId(); - - /** - * - * @return is deleted - */ - Boolean getDeleted(); - - /** - * time created - * @return - */ - Date getCreatedAt(); - - /** - * time updated - * @return - */ - Date getUpdatedAt(); - - /** - * time deleted - * @return - */ - Date getDeletedAt(); - - /** - * - * @return id of the keypair - */ - Integer getId(); + + /** + * The name associated with the keypair + * + * @return the name of the keypair + */ + String getName(); + + /** + * The public SSH key + * + * @return the public key + */ + String getPublicKey(); + + /** + * The private key associated with this keypair. Only populated on create when a public key is not specified and is auto-generated + * by the server + * + * @return the private key + */ + String getPrivateKey(); + + /** + * @return the server fingerprint + */ + String getFingerprint(); + + /** + * @return the user_id for a keypair. + */ + String getUserId(); + + /** + * @return is deleted + */ + Boolean getDeleted(); + + /** + * time created + * + * @return + */ + Date getCreatedAt(); + + /** + * time updated + * + * @return + */ + Date getUpdatedAt(); + + /** + * time deleted + * + * @return + */ + Date getDeletedAt(); + + /** + * @return id of the keypair + */ + Integer getId(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/Limits.java b/core/src/main/java/org/openstack4j/model/compute/Limits.java index 5cea8068b..282527d76 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Limits.java +++ b/core/src/main/java/org/openstack4j/model/compute/Limits.java @@ -1,27 +1,27 @@ package org.openstack4j.model.compute; -import java.util.List; - import org.openstack4j.model.ModelEntity; +import java.util.List; + /** - * Accounts may be pre-configured with a set of thresholds (or limits) to manage capacity and prevent abuse of the system. - * The system recognizes two kinds of limits: rate limits and absolute limits. Rate limits are thresholds that are reset after a + * Accounts may be pre-configured with a set of thresholds (or limits) to manage capacity and prevent abuse of the system. + * The system recognizes two kinds of limits: rate limits and absolute limits. Rate limits are thresholds that are reset after a * certain amount of time passes. Absolute limits are fixed. - * + * * @author Jeremy Unruh * @see http://docs.openstack.org/api/openstack-compute/2/content/Limits-d1e846.html */ public interface Limits extends ModelEntity { - /** - * @return the rate limits (limits that are reset as X time passes) - */ - List getRate(); - - /** - * @return the absolute fixed layout limits - */ - AbsoluteLimit getAbsolute(); - + /** + * @return the rate limits (limits that are reset as X time passes) + */ + List getRate(); + + /** + * @return the absolute fixed layout limits + */ + AbsoluteLimit getAbsolute(); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/NetworkCreate.java b/core/src/main/java/org/openstack4j/model/compute/NetworkCreate.java index cd901f5ea..fff881702 100644 --- a/core/src/main/java/org/openstack4j/model/compute/NetworkCreate.java +++ b/core/src/main/java/org/openstack4j/model/compute/NetworkCreate.java @@ -4,25 +4,26 @@ /** * A network which allows an association to a network UUID and a specified Fix IP Address - * + * * @author Jeremy Unruh */ public interface NetworkCreate extends ModelEntity { - - /** - * @return the network UUID - */ - String getId(); - /** - * @return the fixed IP Address - */ - String getFixedIp(); - - /** - * port id of a pre-made port - * @return - */ - String getPort(); + /** + * @return the network UUID + */ + String getId(); + + /** + * @return the fixed IP Address + */ + String getFixedIp(); + + /** + * port id of a pre-made port + * + * @return + */ + String getPort(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/Personality.java b/core/src/main/java/org/openstack4j/model/compute/Personality.java index ea7fe4242..21e53eaf8 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Personality.java +++ b/core/src/main/java/org/openstack4j/model/compute/Personality.java @@ -4,38 +4,41 @@ /** * A Personality is a file (path to file) and the contents that should be replaced on a new VM Server - * + * * @author Jeremy Unruh */ public class Personality implements ModelEntity { - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = 1L; - - private String path; - private String contents; - - public Personality() { } - - public Personality(String path, String contents) { - this.path = path; - this.contents = contents; - } - - public void setPath(String path) { - this.path = path; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getPath() { - return path; - } - - public String getContents() { - return contents; - } + /** + * The Constant serialVersionUID. + */ + private static final long serialVersionUID = 1L; + + private String path; + private String contents; + + public Personality() { + } + + public Personality(String path, String contents) { + this.path = path; + this.contents = contents; + } + + public void setPath(String path) { + this.path = path; + } + + public void setContents(String contents) { + this.contents = contents; + } + + public String getPath() { + return path; + } + + public String getContents() { + return contents; + } } diff --git a/core/src/main/java/org/openstack4j/model/compute/PortState.java b/core/src/main/java/org/openstack4j/model/compute/PortState.java index f3391c748..c69dab590 100644 --- a/core/src/main/java/org/openstack4j/model/compute/PortState.java +++ b/core/src/main/java/org/openstack4j/model/compute/PortState.java @@ -4,7 +4,7 @@ /** * Represents a Port State - * + * * @author Jeremy Unruh */ public enum PortState { @@ -13,17 +13,16 @@ public enum PortState { BUILD, ERROR, UNRECOGNIZED; - - @JsonCreator - public static PortState forValue(String value) { - if (value != null) - { - for (PortState s : PortState.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return PortState.UNRECOGNIZED; - } - + + @JsonCreator + public static PortState forValue(String value) { + if (value != null) { + for (PortState s : PortState.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return PortState.UNRECOGNIZED; + } + } diff --git a/core/src/main/java/org/openstack4j/model/compute/QuotaSet.java b/core/src/main/java/org/openstack4j/model/compute/QuotaSet.java index eb6097ae1..77b83622e 100644 --- a/core/src/main/java/org/openstack4j/model/compute/QuotaSet.java +++ b/core/src/main/java/org/openstack4j/model/compute/QuotaSet.java @@ -4,79 +4,79 @@ /** * An OpenStack Quota-Set - * + * * @author Jeremy Unruh */ public interface QuotaSet extends ModelEntity { - /** - * @return the identifier - */ - String getId(); - - /** - * @return Metadata items permitted - */ - int getMetadataItems(); - - /** - * @return Injected file maximum length - */ - int getInjectedFileContentBytes(); - - /** - * @return Number of inject-able files - */ - int getInjectedFiles(); - - /** - * @return the number of gigabytes allowed - */ - int getGigabytes(); - - /** - * @return Quantity of instanceable RAM (MBytes) - */ - int getRam(); - - /** - * @return Number of floating IP - */ - int getFloatingIps(); - - /** - * @return Number of permitted instances - */ - int getInstances(); - - /** - * @return Number of permitted volumes - */ - int getVolumes(); - - /** - * @return Number of instanceable cores - */ - int getCores(); - - /** - * @return Number of security groups permitted - */ - int getSecurityGroups(); - - /** - * @return Number of rules per security group permitted - */ - int getSecurityGroupRules(); - - /** - * @return Injected file path name maximum length - */ - int getInjectedFilePathBytes(); - - /** - * @return Number of keypairs - */ - int getKeyPairs(); + /** + * @return the identifier + */ + String getId(); + + /** + * @return Metadata items permitted + */ + int getMetadataItems(); + + /** + * @return Injected file maximum length + */ + int getInjectedFileContentBytes(); + + /** + * @return Number of inject-able files + */ + int getInjectedFiles(); + + /** + * @return the number of gigabytes allowed + */ + int getGigabytes(); + + /** + * @return Quantity of instanceable RAM (MBytes) + */ + int getRam(); + + /** + * @return Number of floating IP + */ + int getFloatingIps(); + + /** + * @return Number of permitted instances + */ + int getInstances(); + + /** + * @return Number of permitted volumes + */ + int getVolumes(); + + /** + * @return Number of instanceable cores + */ + int getCores(); + + /** + * @return Number of security groups permitted + */ + int getSecurityGroups(); + + /** + * @return Number of rules per security group permitted + */ + int getSecurityGroupRules(); + + /** + * @return Injected file path name maximum length + */ + int getInjectedFilePathBytes(); + + /** + * @return Number of keypairs + */ + int getKeyPairs(); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/compute/QuotaSetUpdate.java b/core/src/main/java/org/openstack4j/model/compute/QuotaSetUpdate.java index 87774dc95..c259691d2 100644 --- a/core/src/main/java/org/openstack4j/model/compute/QuotaSetUpdate.java +++ b/core/src/main/java/org/openstack4j/model/compute/QuotaSetUpdate.java @@ -6,9 +6,9 @@ /** * Represents an updateable quota set - * + * * @author Jeremy Unruh */ -public interface QuotaSetUpdate extends ModelEntity, Buildable{ +public interface QuotaSetUpdate extends ModelEntity, Buildable { } diff --git a/core/src/main/java/org/openstack4j/model/compute/RateLimit.java b/core/src/main/java/org/openstack4j/model/compute/RateLimit.java index f72411134..65e4e9cf1 100644 --- a/core/src/main/java/org/openstack4j/model/compute/RateLimit.java +++ b/core/src/main/java/org/openstack4j/model/compute/RateLimit.java @@ -1,62 +1,62 @@ package org.openstack4j.model.compute; +import org.openstack4j.model.ModelEntity; + import java.util.Date; import java.util.List; -import org.openstack4j.model.ModelEntity; - /** - * Rate limits are specified in terms of both a human-readable wild-card URI and a machine-processable regular expression. - * The human-readable limit is intended for displaying in graphical user interfaces. The machine-processable form is + * Rate limits are specified in terms of both a human-readable wild-card URI and a machine-processable regular expression. + * The human-readable limit is intended for displaying in graphical user interfaces. The machine-processable form is * intended to be used directly by client applications. - * + * * @author Jeremy Unruh */ public interface RateLimit extends ModelEntity { - /** - * @return the regular expression used for this rate limit - */ - String getRegex(); - - /** - * @return the URI associated with the rate limit - */ - String getUri(); - - List getLimit(); - - public interface LimitEntry { - - /** - * @return the nextAvailable date/time - */ - Date getNextAvailable(); - - /** - * @return the unit of time for limiting - */ - String getUnit(); - - /** - * @return the verb (action type) - */ - String getVerb(); - - /** - * @return the remaining limits - */ - int getRemaining(); - - /** - * @return the available limit slots - */ - int getAvailable(); - - /** - * @return the value for the last limit - */ - int getValue(); - } - + /** + * @return the regular expression used for this rate limit + */ + String getRegex(); + + /** + * @return the URI associated with the rate limit + */ + String getUri(); + + List getLimit(); + + public interface LimitEntry { + + /** + * @return the nextAvailable date/time + */ + Date getNextAvailable(); + + /** + * @return the unit of time for limiting + */ + String getUnit(); + + /** + * @return the verb (action type) + */ + String getVerb(); + + /** + * @return the remaining limits + */ + int getRemaining(); + + /** + * @return the available limit slots + */ + int getAvailable(); + + /** + * @return the value for the last limit + */ + int getValue(); + } + } diff --git a/core/src/main/java/org/openstack4j/model/compute/RebootType.java b/core/src/main/java/org/openstack4j/model/compute/RebootType.java index 9db42a52c..bd1a91eeb 100644 --- a/core/src/main/java/org/openstack4j/model/compute/RebootType.java +++ b/core/src/main/java/org/openstack4j/model/compute/RebootType.java @@ -2,13 +2,17 @@ /** * The type of reboot to perform when doing a Reboot based action - * + * * @author Jeremy Unruh */ public enum RebootType { - /** Software-level reboot */ - SOFT, - /** Virtual power cycle hard reboot */ - HARD + /** + * Software-level reboot + */ + SOFT, + /** + * Virtual power cycle hard reboot + */ + HARD } diff --git a/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java b/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java index 57d08d95a..0d217e892 100644 --- a/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java +++ b/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java @@ -1,141 +1,138 @@ package org.openstack4j.model.compute; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; import org.openstack4j.model.compute.builder.SecurityGroupRuleBuilder; +import java.util.List; + /** * A Security Group which is defined the the (os-security-groups) extension - * + * * @author Jeremy Unruh */ -public interface SecGroupExtension extends ModelEntity{ - - /** - * Security Group Rule - */ - public interface Rule extends ModelEntity, Buildable - { - - /** - * @return the IPProtocol for this rule - */ - IPProtocol getIPProtocol(); - - /** - * @return the referenced security group which contains the name and tenant identifier - */ - Group getGroup(); - - /** - * @return the IP Range - */ - IpRange getRange(); - - /** - * @return the port at the start of the range - */ - int getToPort(); - - /** - * @return the port at the end of the range - */ - int getFromPort(); - - /** - * Gets the parent group id. - * - * @return the parent group id - */ - String getParentGroupId(); - - /** - * @return the name of the rule - */ - String getName(); - - /** - * @return the identifier for the rule - */ - String getId(); - - /** - * Rule Group - * - */ - public interface Group - { - - /** - * @return the name of the group - */ - String getName(); - - /** - * Gets the tenant id. - * - * @return the tenant id - */ - String getTenantId(); - } - - /** - * Rule IP Range - */ - public interface IpRange { - - /** - * Gets the CIDR address range - * - * @return the CIDR address range - */ - String getCidr(); - } - } - - /** - * Gets the identifier for the Security Group - * - * @return the identifier - */ - String getId(); - - /** - * Gets the name of the Security Group - * - * @return the name of the Group - */ - String getName(); - - /** - * Gets the description. - * - * @return the description of the Security Group - */ - String getDescription(); - - /** - * Gets the tenant id associated with the group - * - * @return the tenant identifier - */ - String getTenantId(); - - /** - * Gets the rules that make up this security group - * - * @return the list of rules - */ - List getRules(); - - /** - * Gets the reference / external links - * - * @return external/reference list of links - */ - List getLinks(); - +public interface SecGroupExtension extends ModelEntity { + + /** + * Security Group Rule + */ + public interface Rule extends ModelEntity, Buildable { + + /** + * @return the IPProtocol for this rule + */ + IPProtocol getIPProtocol(); + + /** + * @return the referenced security group which contains the name and tenant identifier + */ + Group getGroup(); + + /** + * @return the IP Range + */ + IpRange getRange(); + + /** + * @return the port at the start of the range + */ + int getToPort(); + + /** + * @return the port at the end of the range + */ + int getFromPort(); + + /** + * Gets the parent group id. + * + * @return the parent group id + */ + String getParentGroupId(); + + /** + * @return the name of the rule + */ + String getName(); + + /** + * @return the identifier for the rule + */ + String getId(); + + /** + * Rule Group + */ + public interface Group { + + /** + * @return the name of the group + */ + String getName(); + + /** + * Gets the tenant id. + * + * @return the tenant id + */ + String getTenantId(); + } + + /** + * Rule IP Range + */ + public interface IpRange { + + /** + * Gets the CIDR address range + * + * @return the CIDR address range + */ + String getCidr(); + } + } + + /** + * Gets the identifier for the Security Group + * + * @return the identifier + */ + String getId(); + + /** + * Gets the name of the Security Group + * + * @return the name of the Group + */ + String getName(); + + /** + * Gets the description. + * + * @return the description of the Security Group + */ + String getDescription(); + + /** + * Gets the tenant id associated with the group + * + * @return the tenant identifier + */ + String getTenantId(); + + /** + * Gets the rules that make up this security group + * + * @return the list of rules + */ + List getRules(); + + /** + * Gets the reference / external links + * + * @return external/reference list of links + */ + List getLinks(); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/SecurityGroup.java b/core/src/main/java/org/openstack4j/model/compute/SecurityGroup.java index d56334b3a..071907598 100644 --- a/core/src/main/java/org/openstack4j/model/compute/SecurityGroup.java +++ b/core/src/main/java/org/openstack4j/model/compute/SecurityGroup.java @@ -3,7 +3,7 @@ import org.openstack4j.model.ModelEntity; public interface SecurityGroup extends ModelEntity { - + /** * Gets the name. * diff --git a/core/src/main/java/org/openstack4j/model/compute/Server.java b/core/src/main/java/org/openstack4j/model/compute/Server.java index f79f93d4f..d22a411a0 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Server.java +++ b/core/src/main/java/org/openstack4j/model/compute/Server.java @@ -1,280 +1,318 @@ package org.openstack4j.model.compute; -import java.util.Date; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import java.util.List; +import java.util.Map; /** - * A server is a virtual machine instance on a compute based system. - * + * A server is a virtual machine instance on a compute based system. + * * @author Jeremy Unruh */ public interface Server extends ModelEntity { - /** - * Servers contain a status attribute that can be used as an indication of the current server - * state. Servers with an ACTIVE status are available for use. - */ - public enum Status { - /** The server is active */ - ACTIVE, - /** The server has not finished the original build process */ - BUILD, - /** The server is currently being rebuilt */ - REBUILD, - /** The server is suspended, either by request or necessity. This status appears for only the following hypervisors: - * XenServer/XCP, KVM, and ESXi. Administrative users may suspend an instance if it is infrequently used or to - * perform system maintenance. When you suspend an instance, its VM state is stored on disk, all memory is written to disk, - * and the virtual machine is stopped. Suspending an instance is similar to placing a device in hibernation; - * memory and vCPUs become available to create other instances. - */ - SUSPENDED, - /** In a paused state, the state of the server is stored in RAM. A paused server continues to run in frozen state. */ - PAUSED, - /** Server is performing the differential copy of data that changed during its initial copy. Server is down for this stage. */ - RESIZE, - /** System is awaiting confirmation that the server is operational after a move or resize. */ - VERIFY_RESIZE, - /** The resize or migration of a server failed for some reason. The destination server is being cleaned up and - * the original source server is restarting. */ - REVERT_RESIZE, - /** The password is being reset on the server. */ - PASSWORD, - /** The server is in a soft reboot state. A reboot command was passed to the operating system. */ - REBOOT, - /** The server is hard rebooting. This is equivalent to pulling the power plug on a physical server, - * plugging it back in, and rebooting it. - */ - HARD_REBOOT, - /** The server is permanently deleted. */ - DELETED, - /** The state of the server is unknown. Contact your cloud provider. */ - UNKNOWN, - /** The server is in error. */ - ERROR, - /** The server is powered off and the disk image still persists. */ - STOPPED, - /** The virtual machine (VM) was powered down by the user, but not through the OpenStack Compute API. */ - SHUTOFF, - /** The server is currently being migrated */ - MIGRATING, - /** The server is shelved*/ - SHELVED, - /** The server is shelved_offloaded, server removed from the hypervisor to minimize resource usage. */ - SHELVED_OFFLOADED, - /** The server is in rescue mode*/ - RESCUE, - /** OpenStack4j could not find a Status mapping for the current reported Status. File an issue indicating the missing state */ - UNRECOGNIZED; - - @JsonCreator - public static Status forValue(String value) { - if (value != null) - { - for (Status s : Status.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return Status.UNRECOGNIZED; - } - - @JsonValue - public String value() { - return name().toLowerCase(); - } - } - - enum DiskConfig { - MANUAL, AUTO; - - @JsonCreator - public static DiskConfig forValue(String value) { - if (value != null && value.equalsIgnoreCase("auto")) - return DiskConfig.AUTO; - return DiskConfig.MANUAL; - } - } - - /** - * @return the identifier for the server - */ - String getId(); - - /** - * @return the descriptive name for the server - */ - String getName(); - - /** - * @return the addresses assigned to the server - */ - Addresses getAddresses(); - - /** - * @return external reference links - */ - List getLinks(); - - /** - * @return the image identifier - */ - String getImageId(); - - /** - * @return the image used to boot the server with - */ - Image getImage(); - - /** - * @return the flavor identifier - */ - String getFlavorId(); - - /** - * @return the flavor to boot into - */ - Flavor getFlavor(); - - /** - * @return the accessible IPV4 address (if applicable) - */ - String getAccessIPv4(); - - /** - * @return the accessible IPV6 address (if applicable) - */ - String getAccessIPv6(); - - /** - * @return the configDrive - */ - String getConfigDrive(); - - /** - * @return the status - */ - Status getStatus(); - - /** - * @return the progress - */ - int getProgress(); - - /** - * @return the fault - */ - Fault getFault(); - - /** - * @return the tenant id - */ - String getTenantId(); - - /** - * @return the user id - */ - String getUserId(); - - /** - * @return the key name - */ - String getKeyName(); - - /** - * @return the host id - */ - String getHostId(); - - /** - * @return the updated - */ - Date getUpdated(); - - /** - * @return the created - */ - Date getCreated(); - - /** - * @return the metadata - */ - Map getMetadata(); - - //List getSecurityGroups(); - - /** - * @return the task state - */ - String getTaskState(); - - /** - * @return the power state - */ - String getPowerState(); - - /** - * @return the vm state - */ - String getVmState(); - - /** - * @return the host - */ - String getHost(); - - /** - * @return the instance name - */ - String getInstanceName(); - - /** - * @return the hypervisor hostname - */ - String getHypervisorHostname(); - - /** - * Disk config attribute from the Disk Config Extension (alias "OS-DCF").. - * - * @return the current disk configuration - */ - DiskConfig getDiskConfig(); - - /** - * @return the availability zone - */ - String getAvailabilityZone(); - - /** - * @return the last time the server was launched - */ - Date getLaunchedAt(); - - /** - * @return the last termination date - */ - Date getTerminatedAt(); - - /** - * @return the OS extended volumes attached - */ - List getOsExtendedVolumesAttached(); - - /** - * @return the UUID for this server - */ - String getUuid(); - - /** - * @return the administrative password to the VM - */ - String getAdminPass(); + /** + * Servers contain a status attribute that can be used as an indication of the current server + * state. Servers with an ACTIVE status are available for use. + */ + public enum Status { + /** + * The server is active + */ + ACTIVE, + /** + * The server has not finished the original build process + */ + BUILD, + /** + * The server is currently being rebuilt + */ + REBUILD, + /** + * The server is suspended, either by request or necessity. This status appears for only the following hypervisors: + * XenServer/XCP, KVM, and ESXi. Administrative users may suspend an instance if it is infrequently used or to + * perform system maintenance. When you suspend an instance, its VM state is stored on disk, all memory is written to disk, + * and the virtual machine is stopped. Suspending an instance is similar to placing a device in hibernation; + * memory and vCPUs become available to create other instances. + */ + SUSPENDED, + /** + * In a paused state, the state of the server is stored in RAM. A paused server continues to run in frozen state. + */ + PAUSED, + /** + * Server is performing the differential copy of data that changed during its initial copy. Server is down for this stage. + */ + RESIZE, + /** + * System is awaiting confirmation that the server is operational after a move or resize. + */ + VERIFY_RESIZE, + /** + * The resize or migration of a server failed for some reason. The destination server is being cleaned up and + * the original source server is restarting. + */ + REVERT_RESIZE, + /** + * The password is being reset on the server. + */ + PASSWORD, + /** + * The server is in a soft reboot state. A reboot command was passed to the operating system. + */ + REBOOT, + /** + * The server is hard rebooting. This is equivalent to pulling the power plug on a physical server, + * plugging it back in, and rebooting it. + */ + HARD_REBOOT, + /** + * The server is permanently deleted. + */ + DELETED, + /** + * The state of the server is unknown. Contact your cloud provider. + */ + UNKNOWN, + /** + * The server is in error. + */ + ERROR, + /** + * The server is powered off and the disk image still persists. + */ + STOPPED, + /** + * The virtual machine (VM) was powered down by the user, but not through the OpenStack Compute API. + */ + SHUTOFF, + /** + * The server is currently being migrated + */ + MIGRATING, + /** + * The server is shelved + */ + SHELVED, + /** + * The server is shelved_offloaded, server removed from the hypervisor to minimize resource usage. + */ + SHELVED_OFFLOADED, + /** + * The server is in rescue mode + */ + RESCUE, + /** + * OpenStack4j could not find a Status mapping for the current reported Status. File an issue indicating the missing state + */ + UNRECOGNIZED; + + @JsonCreator + public static Status forValue(String value) { + if (value != null) { + for (Status s : Status.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return Status.UNRECOGNIZED; + } + + @JsonValue + public String value() { + return name().toLowerCase(); + } + } + + enum DiskConfig { + MANUAL, AUTO; + + @JsonCreator + public static DiskConfig forValue(String value) { + if (value != null && value.equalsIgnoreCase("auto")) + return DiskConfig.AUTO; + return DiskConfig.MANUAL; + } + } + + /** + * @return the identifier for the server + */ + String getId(); + + /** + * @return the descriptive name for the server + */ + String getName(); + + /** + * @return the addresses assigned to the server + */ + Addresses getAddresses(); + + /** + * @return external reference links + */ + List getLinks(); + + /** + * @return the image identifier + */ + String getImageId(); + + /** + * @return the image used to boot the server with + */ + Image getImage(); + + /** + * @return the flavor identifier + */ + String getFlavorId(); + + /** + * @return the flavor to boot into + */ + Flavor getFlavor(); + + /** + * @return the accessible IPV4 address (if applicable) + */ + String getAccessIPv4(); + + /** + * @return the accessible IPV6 address (if applicable) + */ + String getAccessIPv6(); + + /** + * @return the configDrive + */ + String getConfigDrive(); + + /** + * @return the status + */ + Status getStatus(); + + /** + * @return the progress + */ + int getProgress(); + + /** + * @return the fault + */ + Fault getFault(); + + /** + * @return the tenant id + */ + String getTenantId(); + + /** + * @return the user id + */ + String getUserId(); + + /** + * @return the key name + */ + String getKeyName(); + + /** + * @return the host id + */ + String getHostId(); + + /** + * @return the updated + */ + Date getUpdated(); + + /** + * @return the created + */ + Date getCreated(); + + /** + * @return the metadata + */ + Map getMetadata(); + + //List getSecurityGroups(); + + /** + * @return the task state + */ + String getTaskState(); + + /** + * @return the power state + */ + String getPowerState(); + + /** + * @return the vm state + */ + String getVmState(); + + /** + * @return the host + */ + String getHost(); + + /** + * @return the instance name + */ + String getInstanceName(); + + /** + * @return the hypervisor hostname + */ + String getHypervisorHostname(); + + /** + * Disk config attribute from the Disk Config Extension (alias "OS-DCF").. + * + * @return the current disk configuration + */ + DiskConfig getDiskConfig(); + + /** + * @return the availability zone + */ + String getAvailabilityZone(); + + /** + * @return the last time the server was launched + */ + Date getLaunchedAt(); + + /** + * @return the last termination date + */ + Date getTerminatedAt(); + + /** + * @return the OS extended volumes attached + */ + List getOsExtendedVolumesAttached(); + + /** + * @return the UUID for this server + */ + String getUuid(); + + /** + * @return the administrative password to the VM + */ + String getAdminPass(); /** * @return security groups attached to the VM diff --git a/core/src/main/java/org/openstack4j/model/compute/ServerCreate.java b/core/src/main/java/org/openstack4j/model/compute/ServerCreate.java index 05b9ed364..50880ecad 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ServerCreate.java +++ b/core/src/main/java/org/openstack4j/model/compute/ServerCreate.java @@ -1,167 +1,168 @@ package org.openstack4j.model.compute; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.compute.Server.DiskConfig; import org.openstack4j.model.compute.builder.ServerCreateBuilder; +import java.util.List; +import java.util.Map; + /** - * The Model used to create a new VM/Server - * + * The Model used to create a new VM/Server + * * @author Jeremy Unruh */ public interface ServerCreate extends ModelEntity, Buildable { - /** - * The descriptive name for the Server - * - * @return the name of the server - */ - String getName(); - - /** - * @return the administrative password - */ - String getAdminPass(); - - /** - * A reference to the boot Image - * - * @return the image identifier - */ - String getImageRef(); - - /** - * The resources/flavor to be assigned - * - * @return the flavor identifier - */ - String getFlavorRef(); - - /** - * @return the accessible IPV4 address - */ - String getAccessIPv4(); - - /** - * @return the accessible IPV6 address - */ - String getAccessIPv6(); - - /** - * @return the min - */ - Integer getMin(); - - /** - * Gets the max. - * - * @return the max - */ - Integer getMax(); - - /** - * Controls how the disk is partitioned - * - * @return the disk configuration - */ - DiskConfig getDiskConfig(); - - /** - * name of keypair to inject into the instance - * - * @return the keypair name - */ - String getKeyName(); - - /** - * Gets the user data. - * - * @return the user data - */ - String getUserData(); - - /** - * The value for config drive - * - * @return true, if this is a config based drive - */ - boolean isConfigDrive(); - - /** - * Gets the meta data. - * - * @return the meta data - */ - Map getMetaData(); - - /** - * Personality is a list of Files which will be injected onto the server. - * @see Personality - * - * @return the personality - */ - List getPersonality(); - - /** - * Gets the security groups. - * - * @return the security groups - */ - List getSecurityGroups(); - - /** - * Gets the availability zone. - * - * @return the availability zone - */ - String getAvailabilityZone(); - - /** - * Gets the networks. - * - * @return the networks - */ - List getNetworks(); - - /** - * A Map of Key and Value used for scheduler hints on bootup - * - * @return scheduler hints or null - */ - Map getSchedulerHints(); - - /** - * Adds the personality. - * - * @param path the path - * @param contents the contents - */ - void addPersonality(String path, String contents); - - /** - * Adds the security group. - * - * @param name the name - */ - void addSecurityGroup(String name); - - /** - * Adds the network. - * - * @param id the id - * @param fixedIP the fixed ip - */ - void addNetwork(String id, String fixedIP); - - /** - * Adds network port - * @param id id of a premade neutron port - */ - void addNetworkPort(String id); - + /** + * The descriptive name for the Server + * + * @return the name of the server + */ + String getName(); + + /** + * @return the administrative password + */ + String getAdminPass(); + + /** + * A reference to the boot Image + * + * @return the image identifier + */ + String getImageRef(); + + /** + * The resources/flavor to be assigned + * + * @return the flavor identifier + */ + String getFlavorRef(); + + /** + * @return the accessible IPV4 address + */ + String getAccessIPv4(); + + /** + * @return the accessible IPV6 address + */ + String getAccessIPv6(); + + /** + * @return the min + */ + Integer getMin(); + + /** + * Gets the max. + * + * @return the max + */ + Integer getMax(); + + /** + * Controls how the disk is partitioned + * + * @return the disk configuration + */ + DiskConfig getDiskConfig(); + + /** + * name of keypair to inject into the instance + * + * @return the keypair name + */ + String getKeyName(); + + /** + * Gets the user data. + * + * @return the user data + */ + String getUserData(); + + /** + * The value for config drive + * + * @return true, if this is a config based drive + */ + boolean isConfigDrive(); + + /** + * Gets the meta data. + * + * @return the meta data + */ + Map getMetaData(); + + /** + * Personality is a list of Files which will be injected onto the server. + * + * @return the personality + * @see Personality + */ + List getPersonality(); + + /** + * Gets the security groups. + * + * @return the security groups + */ + List getSecurityGroups(); + + /** + * Gets the availability zone. + * + * @return the availability zone + */ + String getAvailabilityZone(); + + /** + * Gets the networks. + * + * @return the networks + */ + List getNetworks(); + + /** + * A Map of Key and Value used for scheduler hints on bootup + * + * @return scheduler hints or null + */ + Map getSchedulerHints(); + + /** + * Adds the personality. + * + * @param path the path + * @param contents the contents + */ + void addPersonality(String path, String contents); + + /** + * Adds the security group. + * + * @param name the name + */ + void addSecurityGroup(String name); + + /** + * Adds the network. + * + * @param id the id + * @param fixedIP the fixed ip + */ + void addNetwork(String id, String fixedIP); + + /** + * Adds network port + * + * @param id id of a premade neutron port + */ + void addNetworkPort(String id); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/ServerGroup.java b/core/src/main/java/org/openstack4j/model/compute/ServerGroup.java index 96eb20b98..c1113b3d2 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ServerGroup.java +++ b/core/src/main/java/org/openstack4j/model/compute/ServerGroup.java @@ -1,39 +1,39 @@ package org.openstack4j.model.compute; +import org.openstack4j.model.ModelEntity; + import java.util.List; import java.util.Map; -import org.openstack4j.model.ModelEntity; - /** * An OpenStack ServerGroup which is a group that the server in it must be Located on different hosts - * + * * @author Octopus Zhang */ public interface ServerGroup extends ModelEntity { - /** - * @return the id of this group - */ - String getId(); - - /** - * @return the name of this group - */ - String getName(); - - /** - * @return the servers in this group - */ - List getMembers(); - - /** - * @return the metadata of this group - */ - Map getMetadata(); - - /** - * @return the polices of this group - */ - List getPolicies(); + /** + * @return the id of this group + */ + String getId(); + + /** + * @return the name of this group + */ + String getName(); + + /** + * @return the servers in this group + */ + List getMembers(); + + /** + * @return the metadata of this group + */ + Map getMetadata(); + + /** + * @return the polices of this group + */ + List getPolicies(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/ServerPassword.java b/core/src/main/java/org/openstack4j/model/compute/ServerPassword.java index a1e8c861d..71847b419 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ServerPassword.java +++ b/core/src/main/java/org/openstack4j/model/compute/ServerPassword.java @@ -1,12 +1,13 @@ package org.openstack4j.model.compute; import org.openstack4j.model.ModelEntity; + /** - * Server password - * + * Server password + * * @author vinod borole */ -public interface ServerPassword extends ModelEntity { +public interface ServerPassword extends ModelEntity { /** * @return the password of the server */ diff --git a/core/src/main/java/org/openstack4j/model/compute/ServerUpdateOptions.java b/core/src/main/java/org/openstack4j/model/compute/ServerUpdateOptions.java index 5f2e95344..01a1b40f9 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ServerUpdateOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/ServerUpdateOptions.java @@ -2,7 +2,7 @@ /** * Options used to Update a Server instance - * + * * @author Jeremy Unruh */ public class ServerUpdateOptions { @@ -10,17 +10,17 @@ public class ServerUpdateOptions { private String name; private String accessIPv4; private String accessIPv6; - + public static ServerUpdateOptions create() { return new ServerUpdateOptions(); } /** - * The name of the server. - * - * If you edit the server name, the server host name does not change. + * The name of the server. + *

+ * If you edit the server name, the server host name does not change. * Also, server names are not guaranteed to be unique. - * + * * @param name the new name of the server * @return ServerUpdateOptions */ @@ -28,10 +28,10 @@ public ServerUpdateOptions name(String name) { this.name = name; return this; } - + /** * The IP Version 4 Address - * + * * @param accessIPv4 the IP Version 4 Address * @return ServerUpdateOptions */ @@ -39,10 +39,10 @@ public ServerUpdateOptions accessIPv4(String accessIPv4) { this.accessIPv4 = accessIPv4; return this; } - + /** * The IP Version 6 Address - * + * * @param accessIPv6 the IP Version 6 Address * @return ServerUpdateOptions */ diff --git a/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java b/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java index 015e2f402..5374e9557 100644 --- a/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java +++ b/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java @@ -1,122 +1,122 @@ package org.openstack4j.model.compute; +import org.openstack4j.model.ModelEntity; +import org.openstack4j.model.compute.Server.Status; + import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import java.util.List; -import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.compute.Server.Status; - /** * Provides simple usage reporting for tenants - * + * * @author Jeremy Unruh */ public interface SimpleTenantUsage extends ModelEntity { - /** - * @return the total memory usage in MB - */ - BigDecimal getTotalMemoryMbUsage(); - - /** - * @return the total Virtual CPU Usage - */ - BigDecimal getTotalVcpusUsage(); - - /** - * @return the total local GB of data used - */ - BigDecimal getTotalLocalGbUsage(); - - /** - * @return the start date/time - */ - Date getStart(); - - /** - * @return the stop date/time - */ - Date getStop(); - - /** - * @return the tenant the usage is reporting againt - */ - String getTenantId(); - - /** - * @return the total hours of usage - */ - String getTotalHours(); - - /** - * @return the list of usages per tenant server (Null when query was against all tenants) - */ - List getServerUsages(); - - - public interface ServerUsage extends Serializable { - - /** - * @return the instance id of the server - */ - String getInstanceId(); - - /** - * @return the uptime of the server - */ - int getUptime(); - - /** - * @return the date the server was started or null - */ - Date getStartedAt(); - - /** - * @return the date the server was last stopped or null - */ - Date getEndedAt(); - - /** - * @return the memory used for the server in MB - */ - int getMemoryMb(); - - /** - * @return the tenant assigned to the server - */ - String getTenantId(); - - /** - * @return the state - */ - Status getState(); - - /** - * @return the hours of usage - */ - double getHours(); - - /** - * @return the Virtual CPUs used - */ - int getVcpus(); - - /** - * @return the flavor assigned to the server - */ - String getFlavor(); - - /** - * @return the local disk size in GB - */ - int getLocalDiskSize(); - - /** - * @return the name of the server - */ - String getName(); - } + /** + * @return the total memory usage in MB + */ + BigDecimal getTotalMemoryMbUsage(); + + /** + * @return the total Virtual CPU Usage + */ + BigDecimal getTotalVcpusUsage(); + + /** + * @return the total local GB of data used + */ + BigDecimal getTotalLocalGbUsage(); + + /** + * @return the start date/time + */ + Date getStart(); + + /** + * @return the stop date/time + */ + Date getStop(); + + /** + * @return the tenant the usage is reporting againt + */ + String getTenantId(); + + /** + * @return the total hours of usage + */ + String getTotalHours(); + + /** + * @return the list of usages per tenant server (Null when query was against all tenants) + */ + List getServerUsages(); + + + public interface ServerUsage extends Serializable { + + /** + * @return the instance id of the server + */ + String getInstanceId(); + + /** + * @return the uptime of the server + */ + int getUptime(); + + /** + * @return the date the server was started or null + */ + Date getStartedAt(); + + /** + * @return the date the server was last stopped or null + */ + Date getEndedAt(); + + /** + * @return the memory used for the server in MB + */ + int getMemoryMb(); + + /** + * @return the tenant assigned to the server + */ + String getTenantId(); + + /** + * @return the state + */ + Status getState(); + + /** + * @return the hours of usage + */ + double getHours(); + + /** + * @return the Virtual CPUs used + */ + int getVcpus(); + + /** + * @return the flavor assigned to the server + */ + String getFlavor(); + + /** + * @return the local disk size in GB + */ + int getLocalDiskSize(); + + /** + * @return the name of the server + */ + String getName(); + } } diff --git a/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java b/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java index a86240609..7a3bdb909 100644 --- a/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java +++ b/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java @@ -1,9 +1,8 @@ package org.openstack4j.model.compute; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import org.openstack4j.model.ModelEntity; /** * Represents a VNC Console which provides VNC connection information for a remote server @@ -11,54 +10,50 @@ * @author Jeremy Unruh */ public interface VNCConsole extends ModelEntity { - - /** - * The OpenStack VNC Console Type - */ - public enum Type { - NOVNC("novnc"), - XVPVNC("xvpvnc"), - SPICE("spice-html5"), - UNRECOGNIZED("unregonized") - ; - - private final String value; - - private Type(String value) { - this.value = value; - } - - @JsonValue - public String value() { - return value; - } - - @JsonCreator - public static Type value(String vncType) { - if (vncType == null || vncType.isEmpty()) return UNRECOGNIZED; - try - { - for (Type t : Type.values()) - { - if (t.value.equalsIgnoreCase(vncType)) - return t; - } + + /** + * The OpenStack VNC Console Type + */ + public enum Type { + NOVNC("novnc"), + XVPVNC("xvpvnc"), + SPICE("spice-html5"), + UNRECOGNIZED("unregonized"); + + private final String value; + + private Type(String value) { + this.value = value; + } + + @JsonValue + public String value() { + return value; + } + + @JsonCreator + public static Type value(String vncType) { + if (vncType == null || vncType.isEmpty()) return UNRECOGNIZED; + try { + for (Type t : Type.values()) { + if (t.value.equalsIgnoreCase(vncType)) + return t; + } + return UNRECOGNIZED; + } catch (IllegalArgumentException e) { return UNRECOGNIZED; - } - catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - /** - * @return the VNC console Type - */ - Type getType(); - - /** - * @return the connection URL to the VNC Console - */ - String getURL(); - + } + } + } + + /** + * @return the VNC console Type + */ + Type getType(); + + /** + * @return the connection URL to the VNC Console + */ + String getURL(); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/VolumeAttachment.java b/core/src/main/java/org/openstack4j/model/compute/VolumeAttachment.java index ff32cf061..e3b35e6ad 100644 --- a/core/src/main/java/org/openstack4j/model/compute/VolumeAttachment.java +++ b/core/src/main/java/org/openstack4j/model/compute/VolumeAttachment.java @@ -4,32 +4,36 @@ /** * Provides volume attachment result - * + * * @author Octopus Zhang */ public interface VolumeAttachment extends ModelEntity { - - /** - * the device name in the server,like /dev/vdd - * @return device name - */ - String getDevice(); - + + /** + * the device name in the server,like /dev/vdd + * + * @return device name + */ + String getDevice(); + + /** + * Gets the id. + * + * @return the id + */ + String getId(); + + /** + * the server's id int this attachment + * + * @return the id + */ + String getServerId(); + /** - * Gets the id. - * @return the id - */ - String getId(); - - /** - * the server's id int this attachment - * @return the id - */ - String getServerId(); - - /** - * the volume's id int this attachment - * @return the id - */ - String getVolumeId(); + * the volume's id int this attachment + * + * @return the id + */ + String getVolumeId(); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java index 332aa6a52..951c4f7ca 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java @@ -4,19 +4,21 @@ /** * Options for Creating a Backup schedule - * + * * @author Jeremy Unruh */ public final class BackupOptions extends BaseActionOptions { - + private enum Option implements OptionEnum { NAME("name"), BACKUP_TYPE("backup_type"), - ROTATION("rotation") - ; + ROTATION("rotation"); private final String param; - private Option(String param) { this.param = param; } - + + private Option(String param) { + this.param = param; + } + public String getParam() { return param; } @@ -25,10 +27,10 @@ public String getParam() { private BackupOptions(String name) { add(Option.NAME, name); } - + /** * Create a new Backup schedule with the given {@code backupName} - * + * * @param backupName the name of the backup * @return BackupOptions */ @@ -36,10 +38,10 @@ public static BackupOptions create(String backupName) { checkNotNull(backupName); return new BackupOptions(backupName); } - + /** * Indicates the backup will run daily keeping {@code rotation} copies - * + * * @param rotation the number of backups to maintain * @return BackupOptions */ @@ -48,10 +50,10 @@ public BackupOptions daily(int rotation) { add(Option.ROTATION, rotation); return this; } - + /** * Indicates the backup will run weekly keeping {@code rotation} copies - * + * * @param rotation the number of backups to maintain * @return BackupOptions */ @@ -60,15 +62,15 @@ public BackupOptions weekly(int rotation) { add(Option.ROTATION, rotation); return this; } - + public String getName() { return get(Option.NAME); } - + public String getBackupType() { return get(Option.BACKUP_TYPE); } - + public Integer getRotation() { return get(Option.ROTATION); } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/BaseActionOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/BaseActionOptions.java index b878f5ec0..4121b6c52 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/BaseActionOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/BaseActionOptions.java @@ -1,31 +1,32 @@ package org.openstack4j.model.compute.actions; +import com.google.common.collect.Maps; + import java.util.Iterator; import java.util.Map; -import com.google.common.collect.Maps; - public class BaseActionOptions { private static final String OPT_FMT = "\"%s\": \"%s\""; - + public interface OptionEnum { String getParam(); } - + private Map options = Maps.newHashMap(); - protected BaseActionOptions() { } - + protected BaseActionOptions() { + } + protected void add(OptionEnum option, Object value) { options.put(option, value); } - + @SuppressWarnings("unchecked") protected T get(OptionEnum option) { return (T) options.get(option); } - + /** * @return A JSON String representing this object */ @@ -42,5 +43,5 @@ public String toJsonString() { sb.append("\n}"); return sb.toString(); } - + } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java index 649faa0a9..5acea6561 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java @@ -2,36 +2,38 @@ /** * Options to evacuates a server from a failed host to a new host - * */ public class EvacuateOptions extends BaseActionOptions { - + private enum Option implements OptionEnum { - HOST("host"), + HOST("host"), ADMIN_PASS("adminPass"), ON_SHARED_STORAGE("onSharedStorage"); private final String param; - private Option(String param) { this.param = param; } - + + private Option(String param) { + this.param = param; + } + public String getParam() { return param; } } private EvacuateOptions() { - super(); - add(Option.HOST, null); + super(); + add(Option.HOST, null); add(Option.ADMIN_PASS, null); - add(Option.ON_SHARED_STORAGE, false); + add(Option.ON_SHARED_STORAGE, false); } - + public static EvacuateOptions create() { return new EvacuateOptions(); } - + /** * Name of the the host (Optional) - * + * * @param name or ID of the host to which the server is evacuated * @return EvacuateOptions */ @@ -39,10 +41,10 @@ public EvacuateOptions host(String host) { add(Option.HOST, host); return this; } - + /** * An administrative password (Optional) - * + * * @param adminPass to access the evacuated or rebuilt instance * @return EvacuateOptions */ @@ -50,10 +52,10 @@ public EvacuateOptions adminPass(String adminPass) { add(Option.ADMIN_PASS, adminPass); return this; } - + /** * Server on shared storage - * + * * @param isShare if isShare, server on shared storage * @return EvacuateOptions */ @@ -61,15 +63,15 @@ public EvacuateOptions onSharedStorage(boolean isShare) { add(Option.ON_SHARED_STORAGE, isShare); return this; } - + public String getHost() { return get(Option.HOST); } - + public String getAdminPass() { return get(Option.ADMIN_PASS); } - + public boolean isOnSharedStorage() { return get(Option.ON_SHARED_STORAGE); } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java index 7631d19bb..1017db675 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java @@ -2,19 +2,21 @@ /** * Options to live-migrate a server to a new host without rebooting - * + * * @author Jeremy Unruh */ public class LiveMigrateOptions extends BaseActionOptions { - + private enum Option implements OptionEnum { HOST("host"), BLOCK_MIGRATION("block_migration"), - DISK_OVER_COMMIT("disk_over_commit") - ; + DISK_OVER_COMMIT("disk_over_commit"); private final String param; - private Option(String param) { this.param = param; } - + + private Option(String param) { + this.param = param; + } + public String getParam() { return param; } @@ -26,14 +28,14 @@ private LiveMigrateOptions() { add(Option.BLOCK_MIGRATION, false); add(Option.DISK_OVER_COMMIT, false); } - + public static LiveMigrateOptions create() { return new LiveMigrateOptions(); } - + /** * Name of the new host (Optional) - * + * * @param host the name of the new host * @return LiveMigrateOptions */ @@ -41,10 +43,10 @@ public LiveMigrateOptions host(String host) { add(Option.HOST, host); return this; } - + /** * Block Migration - * + * * @param blocked if true, migration is blocked * @return LiveMigrateOptions */ @@ -52,10 +54,10 @@ public LiveMigrateOptions blockMigration(boolean blocked) { add(Option.BLOCK_MIGRATION, blocked); return this; } - + /** * Disk over commit - * + * * @param enabled if enabled, disk over commit is allowed * @return LiveMigrateOptions */ @@ -63,15 +65,15 @@ public LiveMigrateOptions diskOverCommit(boolean enabled) { add(Option.DISK_OVER_COMMIT, enabled); return this; } - + public String getHost() { return get(Option.HOST); } - + public boolean getBlockMigration() { return get(Option.BLOCK_MIGRATION); } - + public boolean getDiskOverCommit() { return get(Option.DISK_OVER_COMMIT); } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java index db6ced147..a0e4f3457 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java @@ -11,30 +11,32 @@ public final class RebuildOptions extends BaseActionOptions { private enum Option implements OptionEnum { IMAGE("imageRef"), NAME("name"), - ADMIN_PASS("adminPass") - ; + ADMIN_PASS("adminPass"); private final String param; - private Option(String param) { this.param = param; } - + + private Option(String param) { + this.param = param; + } + public String getParam() { return param; } } - - private RebuildOptions() { + + private RebuildOptions() { super(); } - + /** * @return a new RebuildOptions object */ public static RebuildOptions create() { return new RebuildOptions(); } - + /** * Can optionally set a new image to rebuild the server against. This is the image identifier - * + * * @param imageId the image id to rebuild the server against * @return RebuildOptions */ @@ -42,10 +44,10 @@ public RebuildOptions image(String imageId) { add(Option.IMAGE, imageId); return this; } - + /** * Can optionally change the name of the instance to a new {@code name} - * + * * @param name the new name of the server instance * @return RebuildOptions */ @@ -53,10 +55,10 @@ public RebuildOptions name(String name) { add(Option.NAME, name); return this; } - + /** * Can optionally specify a new admin password to be used during the rebuild - * + * * @param adminPass the new admin password * @return RebuildOptions */ @@ -64,15 +66,15 @@ public RebuildOptions adminPass(String adminPass) { add(Option.ADMIN_PASS, adminPass); return this; } - + public String getName() { return get(Option.NAME); } - + public String getAdminPass() { return get(Option.ADMIN_PASS); } - + public String getImageRef() { return get(Option.IMAGE); } diff --git a/core/src/main/java/org/openstack4j/model/compute/builder/BlockDeviceMappingBuilder.java b/core/src/main/java/org/openstack4j/model/compute/builder/BlockDeviceMappingBuilder.java index 81a5161e2..3868160d6 100644 --- a/core/src/main/java/org/openstack4j/model/compute/builder/BlockDeviceMappingBuilder.java +++ b/core/src/main/java/org/openstack4j/model/compute/builder/BlockDeviceMappingBuilder.java @@ -18,78 +18,77 @@ public interface BlockDeviceMappingBuilder extends Buildable.Builder/dev/dev_name. This value is typically vda. - * - * @param deviceName the device name - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder deviceName(String deviceName); + /** + * A device name where the volume is attached in the system at /dev/dev_name. This value is typically vda. + * + * @param deviceName the device name + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder deviceName(String deviceName); - /** - * The device ID. - * - * @param id the device id - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder uuid(String id); + /** + * The device ID. + * + * @param id the device id + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder uuid(String id); - /** - * Defines where the volume comes from. - * - * @param type the destination type - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder destinationType(BDMDestType type); + /** + * Defines where the volume comes from. + * + * @param type the destination type + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder destinationType(BDMDestType type); - /** - * The source type of the volume. - * - * @param type the source type - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder sourceType(BDMSourceType type); + /** + * The source type of the volume. + * + * @param type the source type + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder sourceType(BDMSourceType type); - /** - * Delete the volume at termination. - * - * @param deleteOnTermination Set to True to delete the volume when the instance is deleted. Set to False to retain the volume when the instance is deleted. - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder deleteOnTermination(boolean deleteOnTermination); + /** + * Delete the volume at termination. + * + * @param deleteOnTermination Set to True to delete the volume when the instance is deleted. Set to False to retain the volume when the instance is deleted. + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder deleteOnTermination(boolean deleteOnTermination); + + /** + * Set to create a volume from a snapshot id. + * + * @param snapshotId + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder snapshotId(String snapshotId); - /** - * Set to create a volume from a snapshot id. - * - * @param snapshotId - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder snapshotId(String snapshotId); + /** + * Set to create a volume from a volume id. + * + * @param volumeId + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder volumeId(String volumeId); - /** - * Set to create a volume from a volume id. - * - * @param volumeId - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder volumeId(String volumeId); - - /** - * Used to set the volume size of the destination volume (typically needed when source type is image). - * - * @param size the size of the volume in Gigabytes. - * @return BlockDeviceMappingBuilder - */ - BlockDeviceMappingBuilder volumeSize(Integer size); + /** + * Used to set the volume size of the destination volume (typically needed when source type is image). + * + * @param size the size of the volume in Gigabytes. + * @return BlockDeviceMappingBuilder + */ + BlockDeviceMappingBuilder volumeSize(Integer size); /** * Used to set the disk_bus, low level detail that some hypervisors * (currently only libvirt) may support. * - * @param diskBus - * type, e.g ide, usb, virtio, scsi + * @param diskBus type, e.g ide, usb, virtio, scsi * @return BlockDeviceMappingBuilder */ BlockDeviceMappingBuilder diskBus(String diskBus); @@ -98,8 +97,7 @@ public interface BlockDeviceMappingBuilder extends Buildable.Builder { - /** - * @see Flavor#getName() - */ - FlavorBuilder name(String name); - - /** - * @see Flavor#getRam() - */ - FlavorBuilder ram(int ram); - - /** - * @see Flavor#getVcpus() - */ - FlavorBuilder vcpus(int vcpus); - - /** - * @see Flavor#getDisk() - */ - FlavorBuilder disk(int disk); - - /** - * @see Flavor#getSwap() - */ - FlavorBuilder swap(int swap); - - /** - * @see Flavor#getRxtxFactor(); - */ - FlavorBuilder rxtxFactor(float rxtxFactor); - - /** - * @see Flavor#isPublic() - */ - FlavorBuilder isPublic(boolean isPublic); - - /** - * @see Flavor#getEphemeral() - */ - FlavorBuilder ephemeral(int ephemeral); - - /** - *@see Flavor#getId() - */ - FlavorBuilder id(String id); + /** + * @see Flavor#getName() + */ + FlavorBuilder name(String name); + + /** + * @see Flavor#getRam() + */ + FlavorBuilder ram(int ram); + + /** + * @see Flavor#getVcpus() + */ + FlavorBuilder vcpus(int vcpus); + + /** + * @see Flavor#getDisk() + */ + FlavorBuilder disk(int disk); + + /** + * @see Flavor#getSwap() + */ + FlavorBuilder swap(int swap); + + /** + * @see Flavor#getRxtxFactor(); + */ + FlavorBuilder rxtxFactor(float rxtxFactor); + + /** + * @see Flavor#isPublic() + */ + FlavorBuilder isPublic(boolean isPublic); + + /** + * @see Flavor#getEphemeral() + */ + FlavorBuilder ephemeral(int ephemeral); + + /** + * @see Flavor#getId() + */ + FlavorBuilder id(String id); } diff --git a/core/src/main/java/org/openstack4j/model/compute/builder/FloatingIPBuilder.java b/core/src/main/java/org/openstack4j/model/compute/builder/FloatingIPBuilder.java index 403a717a9..8e7bcaf86 100755 --- a/core/src/main/java/org/openstack4j/model/compute/builder/FloatingIPBuilder.java +++ b/core/src/main/java/org/openstack4j/model/compute/builder/FloatingIPBuilder.java @@ -5,34 +5,34 @@ /** * Builder for a FloatingIP model class - * + * * @author Nathan Anderson */ public interface FloatingIPBuilder extends Builder { - /** - * @see FloatingIP#getId() - */ - FloatingIPBuilder id(String id); - - /** - * @see FloatingIP#getFixedIpAddress() - */ - FloatingIPBuilder fixedIpAddress(String fixedIp); - - /** - * @see FloatingIP#getFloatingIpAddress() - */ - FloatingIPBuilder floatingIpAddress(String floatingIpAddress); - - /** - * @see FloatingIP#getInstanceId() - */ - FloatingIPBuilder instanceId(String instanceId); - - /** - * @see FloatingIP#getPool() - */ - FloatingIPBuilder pool(String pool); - + /** + * @see FloatingIP#getId() + */ + FloatingIPBuilder id(String id); + + /** + * @see FloatingIP#getFixedIpAddress() + */ + FloatingIPBuilder fixedIpAddress(String fixedIp); + + /** + * @see FloatingIP#getFloatingIpAddress() + */ + FloatingIPBuilder floatingIpAddress(String floatingIpAddress); + + /** + * @see FloatingIP#getInstanceId() + */ + FloatingIPBuilder instanceId(String instanceId); + + /** + * @see FloatingIP#getPool() + */ + FloatingIPBuilder pool(String pool); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/builder/QuotaSetUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/compute/builder/QuotaSetUpdateBuilder.java index 24a3bac40..7ac44821b 100644 --- a/core/src/main/java/org/openstack4j/model/compute/builder/QuotaSetUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/compute/builder/QuotaSetUpdateBuilder.java @@ -5,11 +5,11 @@ /** * A builder which creates a QuotaSetUpdate object - * + * * @author Jeremy Unruh */ public interface QuotaSetUpdateBuilder extends Builder { - + /** * Metadata items permitted */ diff --git a/core/src/main/java/org/openstack4j/model/compute/builder/SecurityGroupRuleBuilder.java b/core/src/main/java/org/openstack4j/model/compute/builder/SecurityGroupRuleBuilder.java index 4712177ef..d04f35a2f 100644 --- a/core/src/main/java/org/openstack4j/model/compute/builder/SecurityGroupRuleBuilder.java +++ b/core/src/main/java/org/openstack4j/model/compute/builder/SecurityGroupRuleBuilder.java @@ -6,50 +6,50 @@ /** * Creates a Security Group Extension {@link Rule} entity - * + * * @author Jeremy Unruh */ public interface SecurityGroupRuleBuilder extends Builder { - /** - * IP protocol, one of TCP, UDP or ICMP - * - * @param protocol the protocol - * @return the security group rule builder - */ - SecurityGroupRuleBuilder protocol(IPProtocol protocol); - - /** - * Port range which consists of a starting and destination port - * - * @param fromPort the source port - * @param toPort the destination port - * @return the security group rule builder - */ - SecurityGroupRuleBuilder range(int fromPort, int toPort); - - /** - * Destination IP address(es) in CIDR notation - * - * @param cidr the CIDR notation - * @return the security group rule builder - */ - SecurityGroupRuleBuilder cidr(String cidr); - - /** - * Security group id - * - * @param groupId the group id - * @return the security group rule builder - */ - SecurityGroupRuleBuilder groupId(String groupId); - - /** - * Parent security group id - * - * @param parentGroupId the parent group id - * @return the security group rule builder - */ - SecurityGroupRuleBuilder parentGroupId(String parentGroupId); - + /** + * IP protocol, one of TCP, UDP or ICMP + * + * @param protocol the protocol + * @return the security group rule builder + */ + SecurityGroupRuleBuilder protocol(IPProtocol protocol); + + /** + * Port range which consists of a starting and destination port + * + * @param fromPort the source port + * @param toPort the destination port + * @return the security group rule builder + */ + SecurityGroupRuleBuilder range(int fromPort, int toPort); + + /** + * Destination IP address(es) in CIDR notation + * + * @param cidr the CIDR notation + * @return the security group rule builder + */ + SecurityGroupRuleBuilder cidr(String cidr); + + /** + * Security group id + * + * @param groupId the group id + * @return the security group rule builder + */ + SecurityGroupRuleBuilder groupId(String groupId); + + /** + * Parent security group id + * + * @param parentGroupId the parent group id + * @return the security group rule builder + */ + SecurityGroupRuleBuilder parentGroupId(String parentGroupId); + } diff --git a/core/src/main/java/org/openstack4j/model/compute/builder/ServerCreateBuilder.java b/core/src/main/java/org/openstack4j/model/compute/builder/ServerCreateBuilder.java index 5df8beb32..bd657dbde 100644 --- a/core/src/main/java/org/openstack4j/model/compute/builder/ServerCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/compute/builder/ServerCreateBuilder.java @@ -1,17 +1,14 @@ package org.openstack4j.model.compute.builder; +import org.openstack4j.common.Buildable; +import org.openstack4j.model.compute.*; + import java.util.List; import java.util.Map; -import org.openstack4j.common.Buildable; -import org.openstack4j.model.compute.BlockDeviceMappingCreate; -import org.openstack4j.model.compute.Flavor; -import org.openstack4j.model.compute.Image; -import org.openstack4j.model.compute.Server; -import org.openstack4j.model.compute.ServerCreate; - /** * Builds a Server used for a Create Action + * * @author Jeremy Unruh */ public interface ServerCreateBuilder extends Buildable.Builder { @@ -58,9 +55,10 @@ public interface ServerCreateBuilder extends Buildable.Builder metadata); - + /** * Adds a scheduler hint used for boot up - * - * @param key the scheduler hint key + * + * @param key the scheduler hint key * @param value the scheduler hint value * @return this builder */ ServerCreateBuilder addSchedulerHint(String key, String value); - + /** * Adds a scheduler hint (array based) used for boot up - * - * @param key the scheduler hint key + * + * @param key the scheduler hint key * @param value the scheduler hint value * @return this builder */ ServerCreateBuilder addSchedulerHint(String key, List value); - + /** * Adds/Replaces scheduler hints used for bootup - * + * * @param schedulerHints map of key and value scheduler hints * @return this builder */ @@ -118,6 +117,7 @@ public interface ServerCreateBuilder extends Buildable.Builder { - /** - * @return id for the recordset - */ - String getId(); - - /** - * @return id for the project that owns the resource - */ - String getProjectId(); - - /** - * @return DNS Name for the recordset - */ - String getName(); - - /** - * @return TTL (Time to Live) for the recordset. - */ - String getTTL(); - - /** - * @return status of the resource - */ - Status getStatus(); - - /** - * @return current action in progress on the resource - */ - Action getAction(); - - /** - * @return id for the zone that contains this recordset - */ - String getZoneId(); - - /** - * @return name of the zone that contains this recordset - */ - String getZoneName(); - - /** - * @return description for this recordset - */ - String getDescription(); - - /** - * @return RRTYPE of the recordset - */ - String getType(); - - /** - * @return version of the resource - */ - Integer getVersion(); - - /** - * @return date / time when resource was created - */ - String getCreatedAt(); - - /** - * @return date / time when resource was last updated - */ - String getUpdatedAt(); - - /** - * @return links to the resource, and other related resources. - */ - Map getLinks(); - - /** - * @return list of data for this recordset. Each item will be a separate record in Designate. - */ - List getRecords(); + /** + * @return id for the recordset + */ + String getId(); + + /** + * @return id for the project that owns the resource + */ + String getProjectId(); + + /** + * @return DNS Name for the recordset + */ + String getName(); + + /** + * @return TTL (Time to Live) for the recordset. + */ + String getTTL(); + + /** + * @return status of the resource + */ + Status getStatus(); + + /** + * @return current action in progress on the resource + */ + Action getAction(); + + /** + * @return id for the zone that contains this recordset + */ + String getZoneId(); + + /** + * @return name of the zone that contains this recordset + */ + String getZoneName(); + + /** + * @return description for this recordset + */ + String getDescription(); + + /** + * @return RRTYPE of the recordset + */ + String getType(); + + /** + * @return version of the resource + */ + Integer getVersion(); + + /** + * @return date / time when resource was created + */ + String getCreatedAt(); + + /** + * @return date / time when resource was last updated + */ + String getUpdatedAt(); + + /** + * @return links to the resource, and other related resources. + */ + Map getLinks(); + + /** + * @return list of data for this recordset. Each item will be a separate record in Designate. + */ + List getRecords(); } diff --git a/core/src/main/java/org/openstack4j/model/dns/v2/Status.java b/core/src/main/java/org/openstack4j/model/dns/v2/Status.java index 89dce7f98..0d0b79c7b 100644 --- a/core/src/main/java/org/openstack4j/model/dns/v2/Status.java +++ b/core/src/main/java/org/openstack4j/model/dns/v2/Status.java @@ -8,23 +8,22 @@ */ public enum Status { - ERROR, PENDING, ACTIVE; + ERROR, PENDING, ACTIVE; - @JsonValue - public String value() { - return name().toUpperCase(); - } + @JsonValue + public String value() { + return name().toUpperCase(); + } - //default to PRIMARY - @JsonCreator - public static Status value(String v) - { - if (v == null) return ERROR; - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return ERROR; - } - } + //default to PRIMARY + @JsonCreator + public static Status value(String v) { + if (v == null) return ERROR; + try { + return valueOf(v.toUpperCase()); + } catch (IllegalArgumentException e) { + return ERROR; + } + } } diff --git a/core/src/main/java/org/openstack4j/model/dns/v2/ZoneType.java b/core/src/main/java/org/openstack4j/model/dns/v2/ZoneType.java index 84f1183e9..cf79d0b08 100644 --- a/core/src/main/java/org/openstack4j/model/dns/v2/ZoneType.java +++ b/core/src/main/java/org/openstack4j/model/dns/v2/ZoneType.java @@ -8,23 +8,22 @@ */ public enum ZoneType { - PRIMARY, SECONDARY; + PRIMARY, SECONDARY; - @JsonValue - public String value() { - return name().toUpperCase(); - } + @JsonValue + public String value() { + return name().toUpperCase(); + } - //default to PRIMARY - @JsonCreator - public static ZoneType value(String v) - { - if (v == null) return PRIMARY; - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return PRIMARY; - } - } + //default to PRIMARY + @JsonCreator + public static ZoneType value(String v) { + if (v == null) return PRIMARY; + try { + return valueOf(v.toUpperCase()); + } catch (IllegalArgumentException e) { + return PRIMARY; + } + } } diff --git a/core/src/main/java/org/openstack4j/model/dns/v2/builder/NameserverBuilder.java b/core/src/main/java/org/openstack4j/model/dns/v2/builder/NameserverBuilder.java index b63cf0129..c34f670fa 100644 --- a/core/src/main/java/org/openstack4j/model/dns/v2/builder/NameserverBuilder.java +++ b/core/src/main/java/org/openstack4j/model/dns/v2/builder/NameserverBuilder.java @@ -8,14 +8,14 @@ */ public interface NameserverBuilder extends Builder { - /** - * @see Nameserver#getHostname() - */ - NameserverBuilder hostname(String hostname); + /** + * @see Nameserver#getHostname() + */ + NameserverBuilder hostname(String hostname); - /** - * @see Nameserver#getPriority() - */ - NameserverBuilder priority(Integer priority); + /** + * @see Nameserver#getPriority() + */ + NameserverBuilder priority(Integer priority); } diff --git a/core/src/main/java/org/openstack4j/model/dns/v2/builder/RecordsetBuilder.java b/core/src/main/java/org/openstack4j/model/dns/v2/builder/RecordsetBuilder.java index da75b9589..d0dff242e 100644 --- a/core/src/main/java/org/openstack4j/model/dns/v2/builder/RecordsetBuilder.java +++ b/core/src/main/java/org/openstack4j/model/dns/v2/builder/RecordsetBuilder.java @@ -1,8 +1,8 @@ package org.openstack4j.model.dns.v2.builder; import org.openstack4j.common.Buildable.Builder; -import org.openstack4j.model.dns.v2.Recordset; import org.openstack4j.model.dns.v2.Action; +import org.openstack4j.model.dns.v2.Recordset; import org.openstack4j.model.dns.v2.Status; import java.util.List; @@ -10,84 +10,82 @@ /** * A Builder which creates a designate v2 Recordset - * - * */ public interface RecordsetBuilder extends Builder { - /** - * @see Recordset#getId() - */ - RecordsetBuilder id(String id); - - /** - * @see Recordset#getProjectId() - */ - RecordsetBuilder projectId(String projectId); - - /** - * @see Recordset#getName() - */ - RecordsetBuilder name(String name); - - /** - * @see Recordset#getTTL() () - */ - RecordsetBuilder ttl(String ttl); - - /** - * @see Recordset#getStatus() - */ - RecordsetBuilder status(Status status); - - /** - * @see Recordset#getAction() - */ - RecordsetBuilder action(Action action); - - /** - * @see Recordset#getZoneId() - */ - RecordsetBuilder zoneId(String zoneId); - - /** - * @see Recordset#getZoneName() - */ - RecordsetBuilder zoneName(String zoneName); - - /** - * @see Recordset#getDescription() - */ - RecordsetBuilder description(String description); - - /** - * @see Recordset#getType() - */ - RecordsetBuilder type(String type); - - /** - * @see Recordset#getVersion() - */ - RecordsetBuilder version(Integer version); - - /** - * @see Recordset#getCreatedAt() - */ - RecordsetBuilder createdAt(String createdAt); - - /** - * @see Recordset#getUpdatedAt() - */ - RecordsetBuilder updatedAt(String updatedAt); - - /** - * @see Recordset#getLinks() - */ - RecordsetBuilder links(Map links); - - /** - * @see Recordset#getRecords() - */ - RecordsetBuilder records(List records); + /** + * @see Recordset#getId() + */ + RecordsetBuilder id(String id); + + /** + * @see Recordset#getProjectId() + */ + RecordsetBuilder projectId(String projectId); + + /** + * @see Recordset#getName() + */ + RecordsetBuilder name(String name); + + /** + * @see Recordset#getTTL() () + */ + RecordsetBuilder ttl(String ttl); + + /** + * @see Recordset#getStatus() + */ + RecordsetBuilder status(Status status); + + /** + * @see Recordset#getAction() + */ + RecordsetBuilder action(Action action); + + /** + * @see Recordset#getZoneId() + */ + RecordsetBuilder zoneId(String zoneId); + + /** + * @see Recordset#getZoneName() + */ + RecordsetBuilder zoneName(String zoneName); + + /** + * @see Recordset#getDescription() + */ + RecordsetBuilder description(String description); + + /** + * @see Recordset#getType() + */ + RecordsetBuilder type(String type); + + /** + * @see Recordset#getVersion() + */ + RecordsetBuilder version(Integer version); + + /** + * @see Recordset#getCreatedAt() + */ + RecordsetBuilder createdAt(String createdAt); + + /** + * @see Recordset#getUpdatedAt() + */ + RecordsetBuilder updatedAt(String updatedAt); + + /** + * @see Recordset#getLinks() + */ + RecordsetBuilder links(Map links); + + /** + * @see Recordset#getRecords() + */ + RecordsetBuilder records(List records); } diff --git a/core/src/main/java/org/openstack4j/model/dns/v2/builder/ZoneBuilder.java b/core/src/main/java/org/openstack4j/model/dns/v2/builder/ZoneBuilder.java index 353dda543..9a0b3a8c2 100644 --- a/core/src/main/java/org/openstack4j/model/dns/v2/builder/ZoneBuilder.java +++ b/core/src/main/java/org/openstack4j/model/dns/v2/builder/ZoneBuilder.java @@ -1,104 +1,102 @@ package org.openstack4j.model.dns.v2.builder; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.dns.v2.Action; import org.openstack4j.model.dns.v2.Status; import org.openstack4j.model.dns.v2.Zone; import org.openstack4j.model.dns.v2.ZoneType; +import java.util.List; +import java.util.Map; + /** * A Builder which creates a designate v2 Zone - * - * */ public interface ZoneBuilder extends Builder { - /** - * @see Zone#getId() - */ - ZoneBuilder id(String id); - - /** - * @see Zone#getPoolId() - */ - ZoneBuilder poolId(String poolId); - - /** - * @see Zone#getProjectId() - */ - ZoneBuilder projectId(String projectId); - - /** - * @see Zone#getName() - */ - ZoneBuilder name(String name); - - /** - * @see Zone#getEmail() () - */ - ZoneBuilder email(String email); - - /** - * @see Zone#getTTL() () - */ - ZoneBuilder ttl(Integer ttl); - - /** - * @see Zone#getSerial() - */ - ZoneBuilder serial(String serial); - - /** - * @see Zone#getStatus() - */ - ZoneBuilder status(Status status); - - /** - * @see Zone#getAction() - */ - ZoneBuilder action(Action action); - - /** - * @see Zone#getDescription() () - */ - ZoneBuilder description(String description); - - /** - * @see Zone#getMasters() - */ - ZoneBuilder masters(List masters); - - /** - * @see Zone#getType() - */ - ZoneBuilder type(ZoneType type); - - /** - * @see Zone#getTransferedAt() - */ - ZoneBuilder transferredAt(String transferredAt); - - /** - * @see Zone#getVersion() - */ - ZoneBuilder version(Integer version); - - /** - * @see Zone#getCreatedAt() - */ - ZoneBuilder createdAt(String createdAt); - - /** - * @see Zone#getUpdatedAt() - */ - ZoneBuilder updatedAt(String updatedAt); - - /** - * @see Zone#getLinks() - */ - ZoneBuilder links(Map links); + /** + * @see Zone#getId() + */ + ZoneBuilder id(String id); + + /** + * @see Zone#getPoolId() + */ + ZoneBuilder poolId(String poolId); + + /** + * @see Zone#getProjectId() + */ + ZoneBuilder projectId(String projectId); + + /** + * @see Zone#getName() + */ + ZoneBuilder name(String name); + + /** + * @see Zone#getEmail() () + */ + ZoneBuilder email(String email); + + /** + * @see Zone#getTTL() () + */ + ZoneBuilder ttl(Integer ttl); + + /** + * @see Zone#getSerial() + */ + ZoneBuilder serial(String serial); + + /** + * @see Zone#getStatus() + */ + ZoneBuilder status(Status status); + + /** + * @see Zone#getAction() + */ + ZoneBuilder action(Action action); + + /** + * @see Zone#getDescription() () + */ + ZoneBuilder description(String description); + + /** + * @see Zone#getMasters() + */ + ZoneBuilder masters(List masters); + + /** + * @see Zone#getType() + */ + ZoneBuilder type(ZoneType type); + + /** + * @see Zone#getTransferedAt() + */ + ZoneBuilder transferredAt(String transferredAt); + + /** + * @see Zone#getVersion() + */ + ZoneBuilder version(Integer version); + + /** + * @see Zone#getCreatedAt() + */ + ZoneBuilder createdAt(String createdAt); + + /** + * @see Zone#getUpdatedAt() + */ + ZoneBuilder updatedAt(String updatedAt); + + /** + * @see Zone#getLinks() + */ + ZoneBuilder links(Map links); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/Direction.java b/core/src/main/java/org/openstack4j/model/gbp/Direction.java index 1493ae98f..9b2129361 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/Direction.java +++ b/core/src/main/java/org/openstack4j/model/gbp/Direction.java @@ -3,21 +3,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Direction enum - * + * * @author vinod borole */ -public enum Direction { +public enum Direction { IN, OUT, BI, UNRECOGNIZED; - + @JsonCreator public static Direction forValue(String value) { - if (value != null) - { + if (value != null) { for (Direction s : Direction.values()) { if (s.name().equalsIgnoreCase(value)) return s; @@ -25,6 +25,7 @@ public static Direction forValue(String value) { } return Direction.UNRECOGNIZED; } + @JsonValue public String value() { return name().toLowerCase(); diff --git a/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicy.java b/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicy.java index cf30fde21..4f587eb28 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicy.java +++ b/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicy.java @@ -1,14 +1,15 @@ package org.openstack4j.model.gbp; +import org.openstack4j.model.common.Resource; + import java.util.List; -import org.openstack4j.model.common.Resource; /** * External Policy Model Entity - * + * * @author vinod borole */ -public interface ExternalPolicy extends Resource{ +public interface ExternalPolicy extends Resource { /** * Gets the consumed policy rule sets Ids * @@ -29,7 +30,7 @@ public interface ExternalPolicy extends Resource{ * @return the external segment ids */ List getExternalSegments(); - + /** * Gets the description * diff --git a/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicyCreate.java b/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicyCreate.java index c03edc716..41c2fca26 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicyCreate.java +++ b/core/src/main/java/org/openstack4j/model/gbp/ExternalPolicyCreate.java @@ -1,30 +1,31 @@ package org.openstack4j.model.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.ExternalPolicyBuilder; + +import java.util.List; +import java.util.Map; + /** * External Policy Model Entity - * + * * @author vinod borole */ -public interface ExternalPolicyCreate extends Resource , Buildable{ +public interface ExternalPolicyCreate extends Resource, Buildable { /** * Gets the consumed policy rule sets Ids * * @return the consumed policy rule sets ids */ - Map getConsumedPolicyRuleSets(); + Map getConsumedPolicyRuleSets(); /** * Gets the provided policy rule sets Ids * * @return the provided policy rule sets ids */ - Map getProvidedPolicyRuleSets(); + Map getProvidedPolicyRuleSets(); /** * Gets the external segments associated with this external policy Ids @@ -32,7 +33,7 @@ public interface ExternalPolicyCreate extends Resource , Buildable getExternalSegments(); - + /** * Gets the description * diff --git a/core/src/main/java/org/openstack4j/model/gbp/ExternalRoutes.java b/core/src/main/java/org/openstack4j/model/gbp/ExternalRoutes.java index b59ad2f81..bc19e5a7d 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/ExternalRoutes.java +++ b/core/src/main/java/org/openstack4j/model/gbp/ExternalRoutes.java @@ -3,12 +3,13 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.gbp.builder.ExternalRoutesBuilder; + /** * External Routes Model Entity - * + * * @author vinod borole */ -public interface ExternalRoutes extends ModelEntity , Buildable { +public interface ExternalRoutes extends ModelEntity, Buildable { /** * Gets the destination for the route * diff --git a/core/src/main/java/org/openstack4j/model/gbp/ExternalSegment.java b/core/src/main/java/org/openstack4j/model/gbp/ExternalSegment.java index 70f932ea6..0267f4317 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/ExternalSegment.java +++ b/core/src/main/java/org/openstack4j/model/gbp/ExternalSegment.java @@ -1,14 +1,15 @@ package org.openstack4j.model.gbp; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.ExternalSegmentBuilder; import org.openstack4j.openstack.gbp.domain.GbpExternalRoutes; + +import java.util.List; + /** * External Segment Model Entity - * + * * @author vinod borole */ public interface ExternalSegment extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java b/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java index 6b2e42e96..cf3bc5d04 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java +++ b/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java @@ -2,21 +2,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * IP Version enum - * + * * @author vinod borole */ public enum IPVersionType { V4(4), - V6(6) - ; + V6(6); private final int version; - + private IPVersionType(int version) { this.version = version; } - + /** * Gets the version in Integer form * diff --git a/core/src/main/java/org/openstack4j/model/gbp/L2Policy.java b/core/src/main/java/org/openstack4j/model/gbp/L2Policy.java index ba9db259f..3d2f1c732 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/L2Policy.java +++ b/core/src/main/java/org/openstack4j/model/gbp/L2Policy.java @@ -1,14 +1,14 @@ package org.openstack4j.model.gbp; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.L2PolicyBuilder; +import java.util.List; + /** * L2 Policy Model Entity - * + * * @author vinod borole */ public interface L2Policy extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/gbp/L3Policy.java b/core/src/main/java/org/openstack4j/model/gbp/L3Policy.java index 997b90834..003b63b5b 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/L3Policy.java +++ b/core/src/main/java/org/openstack4j/model/gbp/L3Policy.java @@ -1,15 +1,15 @@ package org.openstack4j.model.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.L3PolicyBuilder; +import java.util.List; +import java.util.Map; + /** * L3 Policy Model Entity - * + * * @author vinod borole */ public interface L3Policy extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/gbp/NatPool.java b/core/src/main/java/org/openstack4j/model/gbp/NatPool.java index eafdc7ded..a37a2dae6 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/NatPool.java +++ b/core/src/main/java/org/openstack4j/model/gbp/NatPool.java @@ -6,7 +6,7 @@ /** * Nat Pool Model Entity - * + * * @author vinod borole */ public interface NatPool extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamType.java b/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamType.java index da2008530..d66bab644 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamType.java +++ b/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamType.java @@ -12,18 +12,18 @@ public enum NetworkServiceParamType { IP_SINGLE, IP_POOL, - UNRECOGNIZED - ; + UNRECOGNIZED; @JsonValue - public String value() { return name().toLowerCase(); } + public String value() { + return name().toLowerCase(); + } @JsonCreator public static NetworkServiceParamType value(String paramType) { try { return valueOf(paramType.toUpperCase()); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } diff --git a/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamValue.java b/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamValue.java index 2bb1e950a..a7868b3ac 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamValue.java +++ b/core/src/main/java/org/openstack4j/model/gbp/NetworkServiceParamValue.java @@ -10,18 +10,18 @@ public enum NetworkServiceParamValue { SELF_SUBNET, NAT_POOL, - UNRECOGNIZED - ; + UNRECOGNIZED; @JsonValue - public String value() { return name().toLowerCase(); } + public String value() { + return name().toLowerCase(); + } @JsonCreator public static NetworkServiceParamValue value(String paramValue) { try { return valueOf(paramValue.toUpperCase()); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } diff --git a/core/src/main/java/org/openstack4j/model/gbp/NetworkServicePolicy.java b/core/src/main/java/org/openstack4j/model/gbp/NetworkServicePolicy.java index 4918e518e..4c05169f1 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/NetworkServicePolicy.java +++ b/core/src/main/java/org/openstack4j/model/gbp/NetworkServicePolicy.java @@ -14,24 +14,28 @@ public interface NetworkServicePolicy extends Resource, Buildable getGbpNetworkServiceParamsList(); + List getGbpNetworkServiceParamsList(); /** * Gets the policy target groups associated with the service policy + * * @return list of policy target groups */ List getPolicyTargetGroupList(); /** * Gets the description of the network service policy + * * @return description */ String getDescription(); diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java index 6307ed913..36bd175ff 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java @@ -1,31 +1,29 @@ package org.openstack4j.model.gbp; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.PolicyActionCreateBuilder; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Policy Action Model Entity - * + * * @author vinod borole */ public interface PolicyAction extends Buildable, Resource { - public enum PolicyActionProtocol{ + public enum PolicyActionProtocol { ALLOW, REDIRECT, COPY, LOG, QoS, UNRECOGNIZED; - + @JsonCreator public static PolicyActionProtocol forValue(String value) { - if (value != null) - { + if (value != null) { for (PolicyActionProtocol s : PolicyActionProtocol.values()) { if (s.name().equalsIgnoreCase(value)) return s; @@ -33,13 +31,13 @@ public static PolicyActionProtocol forValue(String value) { } return PolicyActionProtocol.UNRECOGNIZED; } - + @JsonValue public String value() { return name().toLowerCase(); } } - + /** * Gets the Action value * diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyActionUpdate.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyActionUpdate.java index 7917fd37c..47588c32b 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyActionUpdate.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyActionUpdate.java @@ -6,7 +6,7 @@ /** * Policy Action Model Entity - * + * * @author vinod borole */ public interface PolicyActionUpdate extends ModelEntity, Buildable { @@ -22,14 +22,14 @@ public interface PolicyActionUpdate extends ModelEntity, Buildable, Resource { - + /** * Is Policy classifier shared * diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyClassifierUpdate.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyClassifierUpdate.java index 941e592a7..efa243a42 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyClassifierUpdate.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyClassifierUpdate.java @@ -3,12 +3,13 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.gbp.builder.PolicyClassifierUpdateBuilder; + /** * Policy Classifier Update Model Entity - * + * * @author vinod borole */ -public interface PolicyClassifierUpdate extends ModelEntity, Buildable{ +public interface PolicyClassifierUpdate extends ModelEntity, Buildable { /** * Is Policy classifier shared diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyRule.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyRule.java index 97ea5aaa0..2c381c31c 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyRule.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyRule.java @@ -1,17 +1,17 @@ package org.openstack4j.model.gbp; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.PolicyRuleBuilder; +import java.util.List; + /** * Policy rule Model Entity - * + * * @author vinod borole */ -public interface PolicyRule extends Resource,Buildable { +public interface PolicyRule extends Resource, Buildable { /** * Is policy rule enabled diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyRuleSet.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyRuleSet.java index 513949ca6..8fb7040e7 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyRuleSet.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyRuleSet.java @@ -1,14 +1,14 @@ package org.openstack4j.model.gbp; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.PolicyRuleSetBuilder; +import java.util.List; + /** * Policy rule set Model Entity - * + * * @author vinod borole */ public interface PolicyRuleSet extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyTarget.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyTarget.java index e65847630..e295579e1 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyTarget.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyTarget.java @@ -6,7 +6,7 @@ /** * Policy Target Model Entity - * + * * @author vinod borole */ public interface PolicyTarget extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroup.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroup.java index 15ac18f60..032f1145b 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroup.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroup.java @@ -1,12 +1,12 @@ package org.openstack4j.model.gbp; -import java.util.List; - import org.openstack4j.model.common.Resource; +import java.util.List; + /** * Policy Target group Model Entity - * + * * @author vinod borole */ public interface PolicyTargetGroup extends Resource { diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroupCreate.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroupCreate.java index e2be8178c..26a4f40d9 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroupCreate.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyTargetGroupCreate.java @@ -1,15 +1,15 @@ package org.openstack4j.model.gbp; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.gbp.builder.PolicyTargetGroupBuilder; +import java.util.List; +import java.util.Map; + /** * Policy Target group Model Entity - * + * * @author vinod borole */ public interface PolicyTargetGroupCreate extends Buildable, Resource { @@ -61,14 +61,14 @@ public interface PolicyTargetGroupCreate extends Buildable getProvidedPolicyRuleSets(); + Map getProvidedPolicyRuleSets(); /** * Gets the consumed policy rule sets Ids * * @return the consumed policy rule sets ids */ - Map getConsumedPolicyRuleSets(); + Map getConsumedPolicyRuleSets(); /** * Gets the description diff --git a/core/src/main/java/org/openstack4j/model/gbp/Protocol.java b/core/src/main/java/org/openstack4j/model/gbp/Protocol.java index 216855e42..23984776d 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/Protocol.java +++ b/core/src/main/java/org/openstack4j/model/gbp/Protocol.java @@ -2,9 +2,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Protocol enum - * + * * @author vinod borole */ public enum Protocol { @@ -16,13 +17,12 @@ public enum Protocol { SMTP, DNS, FTP, - NONE, + NONE, UNRECOGNIZED; - + @JsonCreator public static Protocol forValue(String value) { - if (value != null) - { + if (value != null) { for (Protocol s : Protocol.values()) { if (s.name().equalsIgnoreCase(value)) return s; @@ -30,7 +30,7 @@ public static Protocol forValue(String value) { } return Protocol.UNRECOGNIZED; } - + @JsonValue public String value() { return name().toLowerCase(); diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalPolicyBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalPolicyBuilder.java index 507c1dd37..438a35c62 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalPolicyBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalPolicyBuilder.java @@ -1,21 +1,27 @@ package org.openstack4j.model.gbp.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.ExternalPolicyCreate; + +import java.util.List; + /** * A builder which produces a External Policy object - * + * * @author vinod borole */ public interface ExternalPolicyBuilder extends Builder { ExternalPolicyBuilder name(String string); + ExternalPolicyBuilder description(String description); + ExternalPolicyBuilder isShared(boolean shared); + ExternalPolicyBuilder consumedPolicyRuleSets(List policyRuleSet); + ExternalPolicyBuilder providedPolicyRuleSets(List policyRuleSet); + ExternalPolicyBuilder externalSegments(List externalSegmentIds); - + } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalRoutesBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalRoutesBuilder.java index 2dba67f9b..081bd0f6a 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalRoutesBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalRoutesBuilder.java @@ -2,12 +2,14 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.ExternalRoutes; + /** * A builder which produces a External Routes object - * + * * @author vinod borole */ -public interface ExternalRoutesBuilder extends Builder{ +public interface ExternalRoutesBuilder extends Builder { ExternalRoutesBuilder destination(String destination); + ExternalRoutesBuilder nextHop(String nextHop); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalSegmentBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalSegmentBuilder.java index dddfb9735..6b28f7a37 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalSegmentBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/ExternalSegmentBuilder.java @@ -1,24 +1,33 @@ package org.openstack4j.model.gbp.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.ExternalRoutes; import org.openstack4j.model.gbp.ExternalSegment; + +import java.util.List; + /** * A builder which produces a External Segments object - * + * * @author vinod borole */ public interface ExternalSegmentBuilder extends Builder { ExternalSegmentBuilder name(String name); + ExternalSegmentBuilder description(String description); + ExternalSegmentBuilder externalPolicies(List extPolicyIds); + ExternalSegmentBuilder ipVersion(int ipVersion); + ExternalSegmentBuilder cidr(String cidr); + ExternalSegmentBuilder isShared(boolean shared); + ExternalSegmentBuilder externalRoutes(List extRoutes); + ExternalSegmentBuilder subnetId(String subnetId); + ExternalSegmentBuilder isPortAddressTranslation(boolean isPortAddressTranslation); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/L2PolicyBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/L2PolicyBuilder.java index 40d833973..851534b22 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/L2PolicyBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/L2PolicyBuilder.java @@ -1,20 +1,26 @@ package org.openstack4j.model.gbp.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.L2Policy; + +import java.util.List; + /** * A builder which produces a L2Policies object - * + * * @author vinod borole */ public interface L2PolicyBuilder extends Builder { L2PolicyBuilder name(String name); + L2PolicyBuilder description(String description); + L2PolicyBuilder isShared(boolean shared); + L2PolicyBuilder networkId(String id); + L2PolicyBuilder l3PolicyId(String id); + L2PolicyBuilder policyTargetGroups(List ids); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/L3PolicyBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/L3PolicyBuilder.java index 13d847266..9943eda1c 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/L3PolicyBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/L3PolicyBuilder.java @@ -1,22 +1,29 @@ package org.openstack4j.model.gbp.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.L3Policy; + +import java.util.List; + /** * A builder which produces a L3Policies object - * + * * @author vinod borole */ public interface L3PolicyBuilder extends Builder { L3PolicyBuilder name(String name); + L3PolicyBuilder description(String description); + L3PolicyBuilder ipVersion(int ipVersion); + L3PolicyBuilder ippool(String ippool); + L3PolicyBuilder subnetPrefixLength(String subnetPrefixLength); + L3PolicyBuilder isShared(boolean shared); + L3PolicyBuilder externalSegments(List extSegmentIds); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/NatPoolBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/NatPoolBuilder.java index 277ff368b..439860af9 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/NatPoolBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/NatPoolBuilder.java @@ -3,17 +3,23 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.IPVersionType; import org.openstack4j.model.gbp.NatPool; + /** * A builder which produces a Nat Pool object - * + * * @author vinod borole */ -public interface NatPoolBuilder extends Builder{ +public interface NatPoolBuilder extends Builder { NatPoolBuilder name(String name); + NatPoolBuilder description(String description); + NatPoolBuilder ipVersion(IPVersionType ipVersion); + NatPoolBuilder cidr(String cidr); + NatPoolBuilder isShared(boolean shared); + NatPoolBuilder externalSegmentId(String id); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/NetworkServicePolicyBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/NetworkServicePolicyBuilder.java index 11d214889..6ef2650fd 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/NetworkServicePolicyBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/NetworkServicePolicyBuilder.java @@ -11,7 +11,10 @@ */ public interface NetworkServicePolicyBuilder extends Buildable.Builder { NetworkServicePolicyBuilder name(String name); + NetworkServicePolicyBuilder description(String description); + NetworkServicePolicyBuilder isShared(boolean shared); + NetworkServicePolicyBuilder gbpNetworkServiceParams(List gbpNetworkServiceParams); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionCreateBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionCreateBuilder.java index 7678a635a..4638263ca 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionCreateBuilder.java @@ -3,15 +3,19 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.PolicyAction; import org.openstack4j.model.gbp.PolicyAction.PolicyActionProtocol; + /** * A builder which produces a Policy Action Create object - * + * * @author vinod borole */ public interface PolicyActionCreateBuilder extends Builder { PolicyActionCreateBuilder name(String name); + PolicyActionCreateBuilder description(String description); + PolicyActionCreateBuilder actionType(PolicyActionProtocol actionType); + PolicyActionCreateBuilder shared(boolean shared); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionUpdateBuilder.java index 02eeca8ab..c31174537 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyActionUpdateBuilder.java @@ -2,13 +2,16 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.PolicyActionUpdate; + /** * A builder which produces a Policy Action Update object - * + * * @author vinod borole */ -public interface PolicyActionUpdateBuilder extends Builder{ +public interface PolicyActionUpdateBuilder extends Builder { PolicyActionUpdateBuilder name(String name); + PolicyActionUpdateBuilder description(String description); + PolicyActionUpdateBuilder shared(boolean shared); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierBuilder.java index a1f1d647f..fa00a43cd 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierBuilder.java @@ -4,17 +4,24 @@ import org.openstack4j.model.gbp.Direction; import org.openstack4j.model.gbp.PolicyClassifier; import org.openstack4j.model.gbp.Protocol; + /** * A builder which produces a Policy Classifier object - * + * * @author vinod borole */ public interface PolicyClassifierBuilder extends Builder { PolicyClassifierBuilder name(String name); + PolicyClassifierBuilder description(String description); + PolicyClassifierBuilder portRangeMin(int min); + PolicyClassifierBuilder portRangeMax(int max); + PolicyClassifierBuilder direction(Direction direction); + PolicyClassifierBuilder protocol(Protocol protocol); + PolicyClassifierBuilder shared(boolean shared); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierUpdateBuilder.java index 27d3dd5c7..dd849bed9 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyClassifierUpdateBuilder.java @@ -4,18 +4,25 @@ import org.openstack4j.model.gbp.Direction; import org.openstack4j.model.gbp.PolicyClassifierUpdate; import org.openstack4j.model.gbp.Protocol; + /** * A builder which produces a Policy Classifier Update object - * + * * @author vinod borole */ public interface PolicyClassifierUpdateBuilder extends Builder { PolicyClassifierUpdateBuilder name(String name); + PolicyClassifierUpdateBuilder description(String description); + PolicyClassifierUpdateBuilder shared(boolean shared); + PolicyClassifierUpdateBuilder portRangeMin(int min); + PolicyClassifierUpdateBuilder portRangeMax(int max); + PolicyClassifierUpdateBuilder direction(Direction direction); + PolicyClassifierUpdateBuilder protocol(Protocol protocol); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleBuilder.java index 2fa3f9693..2bb2c1e43 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleBuilder.java @@ -1,19 +1,24 @@ package org.openstack4j.model.gbp.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.PolicyRule; + +import java.util.List; + /** * A builder which produces a Policy Rule object - * + * * @author vinod borole */ public interface PolicyRuleBuilder extends Builder { PolicyRuleBuilder name(String name); + PolicyRuleBuilder description(String description); + PolicyRuleBuilder shared(boolean shared); + PolicyRuleBuilder classifier(String classifierId); + PolicyRuleBuilder actions(List actionIds); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleSetBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleSetBuilder.java index e6409d23c..07c60d231 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleSetBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyRuleSetBuilder.java @@ -1,18 +1,22 @@ package org.openstack4j.model.gbp.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.PolicyRuleSet; + +import java.util.List; + /** * A builder which produces a Policy Rule Set object - * + * * @author vinod borole */ public interface PolicyRuleSetBuilder extends Builder { PolicyRuleSetBuilder name(String name); + PolicyRuleSetBuilder description(String description); + PolicyRuleSetBuilder shared(boolean shared); + PolicyRuleSetBuilder rules(List ruleIds); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetBuilder.java index d0f843a0f..d44882f91 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetBuilder.java @@ -2,16 +2,21 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.PolicyTarget; + /** * A builder which produces a Policy Target object - * + * * @author vinod borole */ public interface PolicyTargetBuilder extends Builder { PolicyTargetBuilder name(String name); + PolicyTargetBuilder portId(String portId); + PolicyTargetBuilder policyTargetGroupId(String policyTargetGroupId); + PolicyTargetBuilder clusterId(String clusterId); + PolicyTargetBuilder description(String description); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetGroupBuilder.java b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetGroupBuilder.java index 1d349be70..2b82812d6 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetGroupBuilder.java +++ b/core/src/main/java/org/openstack4j/model/gbp/builder/PolicyTargetGroupBuilder.java @@ -1,24 +1,33 @@ package org.openstack4j.model.gbp.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.gbp.PolicyTargetGroupCreate; + +import java.util.List; + /** * A builder which produces a Policy Target Group object - * + * * @author vinod borole */ public interface PolicyTargetGroupBuilder extends Builder { PolicyTargetGroupBuilder name(String name); + PolicyTargetGroupBuilder description(String description); + PolicyTargetGroupBuilder isShared(boolean shared); + PolicyTargetGroupBuilder consumedPolicyRuleSets(List policyRuleSet); + PolicyTargetGroupBuilder providedPolicyRuleSets(List policyRuleSet); + PolicyTargetGroupBuilder policyTargets(List policyTargets); + PolicyTargetGroupBuilder networkServicePolicyId(String id); + PolicyTargetGroupBuilder l2Policy(String id); + PolicyTargetGroupBuilder serviceManagement(boolean serviceManagement); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/heat/AdoptStackData.java b/core/src/main/java/org/openstack4j/model/heat/AdoptStackData.java index 4fd9d9023..b927dd6ee 100644 --- a/core/src/main/java/org/openstack4j/model/heat/AdoptStackData.java +++ b/core/src/main/java/org/openstack4j/model/heat/AdoptStackData.java @@ -1,23 +1,23 @@ package org.openstack4j.model.heat; -import java.util.Map; import org.openstack4j.model.ModelEntity; +import java.util.Map; + /** * This interface describes adopt_stack_data element. It is used * for stack adoption and as a return value for stack abandoning. All getters * map to the possible return values of * Delete /v1/{tenant_id}/stacks/{stack_name}/{stack_id}/abandon * - * @see https://developer.openstack.org/api-ref/orchestration/v1 - * * @author Ales Kemr + * @see https://developer.openstack.org/api-ref/orchestration/v1 */ public interface AdoptStackData extends ModelEntity { /** * Returns stack action, e.g. CREATE - * + * * @return stack action */ String getAction(); diff --git a/core/src/main/java/org/openstack4j/model/heat/BaseStackCreateUpdate.java b/core/src/main/java/org/openstack4j/model/heat/BaseStackCreateUpdate.java index 201fe5f0e..ace4c2ff2 100644 --- a/core/src/main/java/org/openstack4j/model/heat/BaseStackCreateUpdate.java +++ b/core/src/main/java/org/openstack4j/model/heat/BaseStackCreateUpdate.java @@ -1,31 +1,32 @@ package org.openstack4j.model.heat; -import java.util.Map; - import org.openstack4j.model.ModelEntity; +import java.util.Map; + /** * Base interface for Stack Creation or Update based API Services - * + * * @author Jeremy Unruh */ public interface BaseStackCreateUpdate extends ModelEntity { // Future versions: Replace with Template-Object + /** * Returns the Heat template if it was stored in JSON format or YAML format - * + * * @return the JSON or YAML formatted template out of which the stack is to be - * created. Returns null if no JSON formatted template has been set. + * created. Returns null if no JSON formatted template has been set. */ String getTemplate(); /** * Returns the parameters which are used for creation of the stack - * + * * @return Map of parameters. This map is null if no - * parameter has been set. Returns empty if no parameter has been - * set. + * parameter has been set. Returns empty if no parameter has been + * set. */ Map getParameters(); } diff --git a/core/src/main/java/org/openstack4j/model/heat/Event.java b/core/src/main/java/org/openstack4j/model/heat/Event.java index 6d0a390a7..0ae7d0b6b 100644 --- a/core/src/main/java/org/openstack4j/model/heat/Event.java +++ b/core/src/main/java/org/openstack4j/model/heat/Event.java @@ -1,91 +1,89 @@ package org.openstack4j.model.heat; -import java.util.Date; -import java.util.List; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; +import java.util.Date; +import java.util.List; + /** * This interface describes the getter-methods (and thus components) of a event. * All getters map to the possible return values of * Get /v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name}/events/{event_id} - * - * @see http://developer.openstack.org/api-ref-orchestration-v1.html - * + * * @author Octopus Zhang - * + * @see http://developer.openstack.org/api-ref-orchestration-v1.html */ public interface Event extends ModelEntity { - /** - * Returns the id of the event - * - * @return the id of the event - */ - String getId(); - - /** - * Returns the resource_name of the event - * - * @return the resource_name of the event - */ - String getResourceName(); - - /** - * Returns the event_time of the event - * - * @return the event_time of the event - */ - Date getTime(); - - /** - * Returns the logical_resource_id of the event - * - * @return the logical_resource_id of the event - */ - String getLocalReourceId(); - - /** - * Returns the resource_status_reason of the event - * - * @return the resource_status_reason of the event - */ - String getReason(); - - /** - * Returns the resource_status of the event - * - * @return the resource_status of the event - */ - String getResourceStatus(); - - /** - * Returns the physical_resource_id of the event - * - * @return the physical_resource_id of the event - */ - String getPhysicalResourceId(); - - /** - * Returns the links of the event - * - * @return the links of the event - */ - List getLinks(); - - /** - * Returns the resource type of the event - * - * @return the resource type of the event - */ - String getResourceType(); + /** + * Returns the id of the event + * + * @return the id of the event + */ + String getId(); + + /** + * Returns the resource_name of the event + * + * @return the resource_name of the event + */ + String getResourceName(); + + /** + * Returns the event_time of the event + * + * @return the event_time of the event + */ + Date getTime(); + + /** + * Returns the logical_resource_id of the event + * + * @return the logical_resource_id of the event + */ + String getLocalReourceId(); + + /** + * Returns the resource_status_reason of the event + * + * @return the resource_status_reason of the event + */ + String getReason(); + + /** + * Returns the resource_status of the event + * + * @return the resource_status of the event + */ + String getResourceStatus(); + + /** + * Returns the physical_resource_id of the event + * + * @return the physical_resource_id of the event + */ + String getPhysicalResourceId(); + + /** + * Returns the links of the event + * + * @return the links of the event + */ + List getLinks(); + + /** + * Returns the resource type of the event + * + * @return the resource type of the event + */ + String getResourceType(); - /** - * Returns the resource properties of the event - * - * @return the resource properties of the event - */ - Object getResourceProperties(); + /** + * Returns the resource properties of the event + * + * @return the resource properties of the event + */ + Object getResourceProperties(); } diff --git a/core/src/main/java/org/openstack4j/model/heat/Resource.java b/core/src/main/java/org/openstack4j/model/heat/Resource.java index 660ee2b69..ad97b9c0a 100644 --- a/core/src/main/java/org/openstack4j/model/heat/Resource.java +++ b/core/src/main/java/org/openstack4j/model/heat/Resource.java @@ -1,84 +1,82 @@ package org.openstack4j.model.heat; -import java.util.Date; -import java.util.List; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; +import java.util.Date; +import java.util.List; + /** * This interface describes the getter-methods (and thus components) of a heat source. * All getters map to the possible return values of * Get /v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name} - * - * @see http://developer.openstack.org/api-ref-orchestration-v1.html - * + * * @author Octopus Zhang - * + * @see http://developer.openstack.org/api-ref-orchestration-v1.html */ public interface Resource extends ModelEntity { - - /** - * Returns the link of the resource - * - * @return the link of the resource - */ - List getLinks(); - - /** - * Returns the update time of the resource - * - * @return the update time of the resource - */ - Date getTime(); - - /** - * Returns the type of the resource - * - * @return the type of the resource - */ - String getType(); - - /** - * Returns the type of the resource - * - * @return the type of the resource - */ - String getReason(); - - /** - * Returns the name of the resource - * - * @return the name of the resource - */ - String getResourceName(); - - /** - * Returns the local resource id of the resource - * - * @return the local resource id of the resource - */ - String getLocalReourceId(); - - /** - * Returns the local resource id of the resource - * - * @return the local resource id of the resource - */ - String getResourceStatus(); - - /** - * Returns the local physical resource id of the resource - * - * @return the local physical resource id of the resource - */ - String getPhysicalResourceId(); - /** - * Returns the resource name which need this resource - * - * @return the resource name which need this resource - */ - List getRequiredBy(); + /** + * Returns the link of the resource + * + * @return the link of the resource + */ + List getLinks(); + + /** + * Returns the update time of the resource + * + * @return the update time of the resource + */ + Date getTime(); + + /** + * Returns the type of the resource + * + * @return the type of the resource + */ + String getType(); + + /** + * Returns the type of the resource + * + * @return the type of the resource + */ + String getReason(); + + /** + * Returns the name of the resource + * + * @return the name of the resource + */ + String getResourceName(); + + /** + * Returns the local resource id of the resource + * + * @return the local resource id of the resource + */ + String getLocalReourceId(); + + /** + * Returns the local resource id of the resource + * + * @return the local resource id of the resource + */ + String getResourceStatus(); + + /** + * Returns the local physical resource id of the resource + * + * @return the local physical resource id of the resource + */ + String getPhysicalResourceId(); + + /** + * Returns the resource name which need this resource + * + * @return the resource name which need this resource + */ + List getRequiredBy(); } diff --git a/core/src/main/java/org/openstack4j/model/heat/ResourceHealth.java b/core/src/main/java/org/openstack4j/model/heat/ResourceHealth.java index 4188fb97a..62c021948 100644 --- a/core/src/main/java/org/openstack4j/model/heat/ResourceHealth.java +++ b/core/src/main/java/org/openstack4j/model/heat/ResourceHealth.java @@ -23,10 +23,8 @@ /** * This interface describes the getter-methods (and thus components) of a mark resource unhealthy request. * - * @see http://developer.openstack.org/api-ref-orchestration-v1.html - * * @author Dan Maas - * + * @see http://developer.openstack.org/api-ref-orchestration-v1.html */ public interface ResourceHealth extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java b/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java index cf7eae9c0..d195a2c37 100644 --- a/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java +++ b/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java @@ -1,12 +1,12 @@ package org.openstack4j.model.heat; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.heat.builder.SoftwareConfigBuilder; +import java.util.List; +import java.util.Map; + /** * Software Configuration Model * @@ -18,94 +18,94 @@ public interface SoftwareConfig extends ModelEntity, Buildable getInputs(); /** * List of outputs this software configuration produces - * + * * @return list of outputs */ List getOutputs(); - + /** * Map containing options specific to the configuration management tool used by this resource. - * + * * @return map of options or null */ Map getOptions(); - + public interface Input { - + /** * @return the name of this input */ String getName(); - + /** * @return the description of this input */ String getDescription(); - + /** * @return default initialized value for this input */ String getDefaultValue(); - + /** * @return the input type */ String getType(); } - + public interface Output { - + /** * @return the name of this output */ String getName(); - + /** * @return the description of this output */ String getDescription(); - + /** * @return the data type of this output */ String getType(); - + /** * @return true if this is an error related output */ boolean isErrorOutput(); } - + } diff --git a/core/src/main/java/org/openstack4j/model/heat/Stack.java b/core/src/main/java/org/openstack4j/model/heat/Stack.java index 67e4bfab4..8286d063a 100644 --- a/core/src/main/java/org/openstack4j/model/heat/Stack.java +++ b/core/src/main/java/org/openstack4j/model/heat/Stack.java @@ -1,108 +1,111 @@ package org.openstack4j.model.heat; -import java.util.List; -import java.util.Map; - import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; +import java.util.Map; + /** * This interface describes the getter-methods (and thus components) of a stack. * All getters map to the possible return values of * GET /v1/{tenant_id}/stacks/{stack_name}/{stack_id} - * - * @see http://developer.openstack.org/api-ref-orchestration-v1.html - * + * * @author Matthias Reisser - * + * @see http://developer.openstack.org/api-ref-orchestration-v1.html */ public interface Stack extends ModelEntity { - /** - * Returns the id of the stack - * - * @return the id of the stack - */ - String getId(); - - /** - * Returns the name of the stack - * - * @return the name of the stack - */ - String getName(); - - /** - * Returns the status of the stack - * - * @return the status of the stack - */ - String getStatus(); - - /** - * Returns the reason for the stack status - * - * @return the stack status reason - */ - String getStackStatusReason(); - - /** - * Returns the description of the stack - * - * @return the description of the stack - */ - String getDescription(); - - /** - * Returns the template description - * - * @return the template description - */ - String getTemplateDescription(); - - /** - * Returns the stacks timeout in minutes - * - * @return the timeout in minutes - */ - Long getTimeoutMins(); - - /** - * Returns the list of outputs of the stack - * - * @return a List of Maps. Each Map consists of one element with: Key is the - * Name of the output, Value is Json formatted containing - * output_value, description and output_key - */ - List> getOutputs(); - - /** - * Returns the parameters of the stack - * @return the parameters of the stack. Key is the name, value is the value of the key - */ - Map getParameters(); - - /** - * Returns the timestamp of the creation. - * @return Timestamp formated like this: 2014-06-03T20:59:46Z - */ - String getCreationTime(); - - /** - * Returns a list of links to resources of the stack - * @return a list of {@link GenericLink} objects - */ - List getLinks(); - - /** - * Returns the timestamp of the last update. - * @return Timestamp formated like this: 2014-06-03T20:59:46Z - */ - String getUpdatedTime(); - - /** - * Returns the tags associated with the stack. - * @return The list of tags, separated by a comma. - */ - List getTags(); + /** + * Returns the id of the stack + * + * @return the id of the stack + */ + String getId(); + + /** + * Returns the name of the stack + * + * @return the name of the stack + */ + String getName(); + + /** + * Returns the status of the stack + * + * @return the status of the stack + */ + String getStatus(); + + /** + * Returns the reason for the stack status + * + * @return the stack status reason + */ + String getStackStatusReason(); + + /** + * Returns the description of the stack + * + * @return the description of the stack + */ + String getDescription(); + + /** + * Returns the template description + * + * @return the template description + */ + String getTemplateDescription(); + + /** + * Returns the stacks timeout in minutes + * + * @return the timeout in minutes + */ + Long getTimeoutMins(); + + /** + * Returns the list of outputs of the stack + * + * @return a List of Maps. Each Map consists of one element with: Key is the + * Name of the output, Value is Json formatted containing + * output_value, description and output_key + */ + List> getOutputs(); + + /** + * Returns the parameters of the stack + * + * @return the parameters of the stack. Key is the name, value is the value of the key + */ + Map getParameters(); + + /** + * Returns the timestamp of the creation. + * + * @return Timestamp formated like this: 2014-06-03T20:59:46Z + */ + String getCreationTime(); + + /** + * Returns a list of links to resources of the stack + * + * @return a list of {@link GenericLink} objects + */ + List getLinks(); + + /** + * Returns the timestamp of the last update. + * + * @return Timestamp formated like this: 2014-06-03T20:59:46Z + */ + String getUpdatedTime(); + + /** + * Returns the tags associated with the stack. + * + * @return The list of tags, separated by a comma. + */ + List getTags(); } diff --git a/core/src/main/java/org/openstack4j/model/heat/StackCreate.java b/core/src/main/java/org/openstack4j/model/heat/StackCreate.java index 4c6e76c9d..a2a0df8ff 100644 --- a/core/src/main/java/org/openstack4j/model/heat/StackCreate.java +++ b/core/src/main/java/org/openstack4j/model/heat/StackCreate.java @@ -6,17 +6,16 @@ /** * This interface describes the model of a {@link Stack}, before it is sent to * the server for creation - * + * * @author Matthias Reisser - * */ public interface StackCreate extends BaseStackCreateUpdate, Buildable { - boolean getDisableRollback(); - - /** + boolean getDisableRollback(); + + /** * Returns the name of the stack to create - * + * * @return the name of the stack to create */ String getName(); diff --git a/core/src/main/java/org/openstack4j/model/heat/StackUpdate.java b/core/src/main/java/org/openstack4j/model/heat/StackUpdate.java index deae223eb..7ad5fc34b 100644 --- a/core/src/main/java/org/openstack4j/model/heat/StackUpdate.java +++ b/core/src/main/java/org/openstack4j/model/heat/StackUpdate.java @@ -5,7 +5,7 @@ /** * Model Entity used for updating a Stack - * + * * @author Jeremy Unruh */ public interface StackUpdate extends BaseStackCreateUpdate, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/heat/Template.java b/core/src/main/java/org/openstack4j/model/heat/Template.java index c3562aa0e..4be40ea8a 100644 --- a/core/src/main/java/org/openstack4j/model/heat/Template.java +++ b/core/src/main/java/org/openstack4j/model/heat/Template.java @@ -5,26 +5,25 @@ import org.openstack4j.model.heat.builder.TemplateBuilder; /** - * This interface describes a template object. - * @author Matthias Reisser + * This interface describes a template object. * + * @author Matthias Reisser */ public interface Template extends ModelEntity, Buildable { - - /** - * Returns the JSON-representation of the template - * - * @return the JSON formatted template - */ - String getTemplateJson(); - - /** - * The URL of the template to instantiate. This value is ignored if the template is supplied inline. - * - * @return the template URL - */ - String getTemplateURL(); - - + + /** + * Returns the JSON-representation of the template + * + * @return the JSON formatted template + */ + String getTemplateJson(); + + /** + * The URL of the template to instantiate. This value is ignored if the template is supplied inline. + * + * @return the template URL + */ + String getTemplateURL(); + } diff --git a/core/src/main/java/org/openstack4j/model/heat/TemplateResponse.java b/core/src/main/java/org/openstack4j/model/heat/TemplateResponse.java index 7e9d6c801..9a08ed248 100644 --- a/core/src/main/java/org/openstack4j/model/heat/TemplateResponse.java +++ b/core/src/main/java/org/openstack4j/model/heat/TemplateResponse.java @@ -11,7 +11,8 @@ public final class TemplateResponse { private String message; - private TemplateResponse() { } + private TemplateResponse() { + } private TemplateResponse(String message) { this.message = message; diff --git a/core/src/main/java/org/openstack4j/model/heat/builder/SoftwareConfigBuilder.java b/core/src/main/java/org/openstack4j/model/heat/builder/SoftwareConfigBuilder.java index df27da0db..2f128f3d7 100644 --- a/core/src/main/java/org/openstack4j/model/heat/builder/SoftwareConfigBuilder.java +++ b/core/src/main/java/org/openstack4j/model/heat/builder/SoftwareConfigBuilder.java @@ -1,29 +1,29 @@ package org.openstack4j.model.heat.builder; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.heat.SoftwareConfig; +import java.util.Map; + /** * A builder which produces a SoftwareConfig object - * + * * @author Jeremy Unruh */ public interface SoftwareConfigBuilder extends Buildable.Builder { /** * The name of this configuration - * + * * @param name the config name * @return SoftwareConfigBuilder */ SoftwareConfigBuilder name(String name); /** - * Namespace that groups this software configuration by when it is delivered to a server. + * Namespace that groups this software configuration by when it is delivered to a server. * This setting might imply which configuration tool performs the configuration. - * + * * @param group the group namespace * @return SoftwareConfigBuilder */ @@ -31,7 +31,7 @@ public interface SoftwareConfigBuilder extends Buildable.Builder { - + /** * Sets the template in YAML/JSON format. If the template begins with a "{" then JSON is assumed + * * @param template the template * @return StackUpdateBuilder */ StackUpdateBuilder template(String template); - + /** * Sets the template URL + * * @param templateURL the template URL * @return StackUpdateBuilder */ StackUpdateBuilder templateURL(String templateURL); - + /** * Sets the parameters which are passed to the server. It might contain Information about flavor, image, etc. + * * @param parameters Map of parameters. Key is name, value is the value of the parameters * @return the modified StackUpdateBuilder */ - StackUpdateBuilder parameters(Map parameters); - + StackUpdateBuilder parameters(Map parameters); + /** * Sets the stack creation timeout in minutes + * * @param timeoutMins timeout in minutes * @return the modified StackUpdateBuilder */ @@ -50,6 +54,7 @@ public interface StackUpdateBuilder extends Buildable.Builder{ - - /** - * Sets the template in JSON format. This value takes precedence over the template URL if both are supplied. - * - * @param template template in JSON format - * @return modified TemplateBuilder - */ - TemplateBuilder templateJson(String template); - - - /** - * The URL of the template to instantiate. This value is ignored if the template is supplied inline - * - * @param templateURL the template URL - * @return TemplateBuilder - */ - TemplateBuilder templateURL(String templateURL); +public interface TemplateBuilder extends Buildable.Builder { + + /** + * Sets the template in JSON format. This value takes precedence over the template URL if both are supplied. + * + * @param template template in JSON format + * @return modified TemplateBuilder + */ + TemplateBuilder templateJson(String template); + + + /** + * The URL of the template to instantiate. This value is ignored if the template is supplied inline + * + * @param templateURL the template URL + * @return TemplateBuilder + */ + TemplateBuilder templateURL(String templateURL); } diff --git a/core/src/main/java/org/openstack4j/model/identity/AuthStore.java b/core/src/main/java/org/openstack4j/model/identity/AuthStore.java index 848064aa6..8e3e0b381 100644 --- a/core/src/main/java/org/openstack4j/model/identity/AuthStore.java +++ b/core/src/main/java/org/openstack4j/model/identity/AuthStore.java @@ -1,42 +1,40 @@ package org.openstack4j.model.identity; -import org.openstack4j.model.identity.AuthVersion; - /** - * An entity which holds enough information in store to re-authenticate at any given time during a session. This is a generic mapping which provides the common - * information needed for authentication. Version dependent attributes can be found via the {@link #unwrap()} call returning the real typed object - * + * An entity which holds enough information in store to re-authenticate at any given time during a session. This is a generic mapping which provides the common + * information needed for authentication. Version dependent attributes can be found via the {@link #unwrap()} call returning the real typed object + * * @author Jeremy Unruh */ public interface AuthStore { - /** - * @return the version of this authentication store type - */ - AuthVersion getVersion(); - - /** - * @return the username used to authenticate - */ - String getUsername(); - - /** - * @return the password used to authenticate - */ - String getPassword(); - - /** - * If this is a {@link AuthVersion#V2} then this is the tenantId. If {@link AuthVersion#V3} then this maps to the projectId - * - * @return the tenantId (V2) or projectId for V3 - */ - String getId(); - - /** + /** + * @return the version of this authentication store type + */ + AuthVersion getVersion(); + + /** + * @return the username used to authenticate + */ + String getUsername(); + + /** + * @return the password used to authenticate + */ + String getPassword(); + + /** + * If this is a {@link AuthVersion#V2} then this is the tenantId. If {@link AuthVersion#V3} then this maps to the projectId + * + * @return the tenantId (V2) or projectId for V3 + */ + String getId(); + + /** * If this is a {@link AuthVersion#V2} then this is the tenant name. If {@link AuthVersion#V3} then this maps to the project name - * + * * @return the tenant name (V2) or project name for V3 */ - String getName(); - + String getName(); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/AuthVersion.java b/core/src/main/java/org/openstack4j/model/identity/AuthVersion.java index c4db1da23..331ed4417 100644 --- a/core/src/main/java/org/openstack4j/model/identity/AuthVersion.java +++ b/core/src/main/java/org/openstack4j/model/identity/AuthVersion.java @@ -3,10 +3,10 @@ /** * Represents the Authentication Version used to authenticate againt an OpenStack deployment - * + * * @author Jeremy Unruh */ public enum AuthVersion { - V2, - V3 + V2, + V3 } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/Access.java b/core/src/main/java/org/openstack4j/model/identity/v2/Access.java index 0c2718db5..1c11140d9 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/Access.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/Access.java @@ -1,94 +1,91 @@ package org.openstack4j.model.identity.v2; -import java.util.List; - +import com.google.common.collect.SortedSetMultimap; import org.openstack4j.api.types.ServiceType; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; import org.openstack4j.model.identity.AuthVersion; -import com.google.common.collect.SortedSetMultimap; +import java.util.List; /** * Access is the entity returned when Authenticated by the Identity service - * + * * @author Jeremy Unruh */ public interface Access extends ModelEntity { - /** - * @return the authorized token - */ - Token getToken(); - - /** - * @return the service catalog - */ - List getServiceCatalog(); - - /** + /** + * @return the authorized token + */ + Token getToken(); + + /** + * @return the service catalog + */ + List getServiceCatalog(); + + /** * A Lazy loading Aggregated Service Catalog Mapping. The key is a stripped version service type or name with a collection * of Services sorted by version - * + * * @return sorted aggregate service catalog */ - SortedSetMultimap getAggregatedCatalog(); - - /** - * @return the original endpoint used to authenticate - */ - String getEndpoint(); - - /** - * @return details about the current user - */ - UserDetails getUser(); - - /** - * If Access is being wrapped such as in V3 then this will return the underlying wrapped instance. Otherwise it returns itself - * - * @return the unwrapped underlying data source - */ - T unwrap(); - - - /** - * @return the internal UUID used for cache lookups of this access - */ - String getCacheIdentifier(); - - /** - * @return the version of the authentication method - */ - AuthVersion getVersion(); - - public interface UserDetails - { - String getId(); - - String getName(); - - String getUsername(); - - boolean isEnabled(); - - List getRoles(); - - List getRolesLinks(); - } - - public interface Service - { - String getType(); - - String getName(); - - ServiceType getServiceType(); - - List getEndpoints(); - - List getEndpointsLinks(); - - Integer getVersion(); - } + SortedSetMultimap getAggregatedCatalog(); + + /** + * @return the original endpoint used to authenticate + */ + String getEndpoint(); + + /** + * @return details about the current user + */ + UserDetails getUser(); + + /** + * If Access is being wrapped such as in V3 then this will return the underlying wrapped instance. Otherwise it returns itself + * + * @return the unwrapped underlying data source + */ + T unwrap(); + + + /** + * @return the internal UUID used for cache lookups of this access + */ + String getCacheIdentifier(); + + /** + * @return the version of the authentication method + */ + AuthVersion getVersion(); + + public interface UserDetails { + String getId(); + + String getName(); + + String getUsername(); + + boolean isEnabled(); + + List getRoles(); + + List getRolesLinks(); + } + + public interface Service { + String getType(); + + String getName(); + + ServiceType getServiceType(); + + List getEndpoints(); + + List getEndpointsLinks(); + + Integer getVersion(); + } } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/Endpoint.java b/core/src/main/java/org/openstack4j/model/identity/v2/Endpoint.java index b111c099c..35fd7611d 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/Endpoint.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/Endpoint.java @@ -1,71 +1,70 @@ package org.openstack4j.model.identity.v2; -import java.net.URI; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v2.builder.EndpointBuilder; +import java.net.URI; + /** * Endpoint Model is used to describe a network address which is described by URL's and other service * information depending on the context it was retrieved in. - * + * * @author Jeremy Unruh - * * @see { - String getType(); + String getType(); + + /** + * @return the id for this endpoint (null if a new endpoint is being created) + */ + String getId(); + + /** + * @return the name of this endpoint, or null when the endpoint is part of the Access ServiceCatalog + */ + String getName(); + + /** + * @return the admin URL for this endpoint, or null when the endpoint is part of the Access ServiceCatalog + */ + URI getAdminURL(); + + /** + * @return the URL for this endpoint + */ + URI getPublicURL(); + + /** + * @return the internal URL for this endpoint + */ + URI getInternalURL(); + + /** + * @return the region of the endpoint or null + */ + String getRegion(); + + /** + * @return the tenant identifier for this endpoint or null + */ + String getTenantId(); - /** - * @return the id for this endpoint (null if a new endpoint is being created) - */ - String getId(); + /** + * @return the version id or null + */ + String getVersionId(); - /** - * @return the name of this endpoint, or null when the endpoint is part of the Access ServiceCatalog - */ - String getName(); + /** + * @return the version information when endpoint is listed as part of Access Service Catalog, otherwise null + */ + URI getVersionInfo(); - /** - * @return the admin URL for this endpoint, or null when the endpoint is part of the Access ServiceCatalog - */ - URI getAdminURL(); + /** + * @return the version list when endpoint is listed as part of Access Service Catalog, otherwise null + */ + URI getVersionList(); - /** - * @return the URL for this endpoint - */ - URI getPublicURL(); - - /** - * @return the internal URL for this endpoint - */ - URI getInternalURL(); - - /** - * @return the region of the endpoint or null - */ - String getRegion(); - - /** - * @return the tenant identifier for this endpoint or null - */ - String getTenantId(); - - /** - * @return the version id or null - */ - String getVersionId(); - - /** - * @return the version information when endpoint is listed as part of Access Service Catalog, otherwise null - */ - URI getVersionInfo(); - - /** - * @return the version list when endpoint is listed as part of Access Service Catalog, otherwise null - */ - URI getVersionList(); - } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/Role.java b/core/src/main/java/org/openstack4j/model/identity/v2/Role.java index d2abf5aa1..4ebbd9b13 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/Role.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/Role.java @@ -7,39 +7,39 @@ /** * A permission scheme a user is assigned when performing specific operations. A role includes a set of rights and previleges. Any user who is assigned * the role inherits these traits. - * + * * @author Jeremy Unruh */ public interface Role extends ModelEntity, Buildable { - /** - * @return the id of the role - */ - String getId(); - - /** - * @return the name of the role - */ - String getName(); - - /** - * @return the service id of the role or null, if not present - */ - String getServiceId(); - - /** - * @return the tenant id of the role or null, if not present - */ - String getTenantId(); - - /** - * @return the description of the role - */ - String getDescription(); - - /** - * @return true if the role is enabled - */ - boolean isEnabled(); - + /** + * @return the id of the role + */ + String getId(); + + /** + * @return the name of the role + */ + String getName(); + + /** + * @return the service id of the role or null, if not present + */ + String getServiceId(); + + /** + * @return the tenant id of the role or null, if not present + */ + String getTenantId(); + + /** + * @return the description of the role + */ + String getDescription(); + + /** + * @return true if the role is enabled + */ + boolean isEnabled(); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/Service.java b/core/src/main/java/org/openstack4j/model/identity/v2/Service.java index a606ec2e0..903dd54a4 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/Service.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/Service.java @@ -6,32 +6,32 @@ /** * OpenStack service, such as Compute (Nova), Object Storage (Swift), or Image Service (Glance). - * A service provides one or more endpoints through which users can access resources and perform - * + * A service provides one or more endpoints through which users can access resources and perform + * * @author Jeremy Unruh */ public interface Service extends ModelEntity, Buildable { - /** - * @return the id for the service - */ - String getId(); - - /** - * The type of service (compute, identity, image, etc) - * - * @return the type of the service - */ - String getType(); - - /** - * @return the name of the service (nova, neutron, glance ...) - */ - String getName(); - - /** - * @return the description of the service - */ - String getDescription(); - + /** + * @return the id for the service + */ + String getId(); + + /** + * The type of service (compute, identity, image, etc) + * + * @return the type of the service + */ + String getType(); + + /** + * @return the name of the service (nova, neutron, glance ...) + */ + String getName(); + + /** + * @return the description of the service + */ + String getDescription(); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/ServiceEndpoint.java b/core/src/main/java/org/openstack4j/model/identity/v2/ServiceEndpoint.java index b901b7efe..90a65ac8d 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/ServiceEndpoint.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/ServiceEndpoint.java @@ -1,46 +1,46 @@ package org.openstack4j.model.identity.v2; -import java.net.URI; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v2.builder.ServiceEndpointBuilder; +import java.net.URI; + /** * OpenStack ServiceEndpoint is an endpoint which is mapped to a {@link Service} - * + * * @author Jeremy Unruh */ public interface ServiceEndpoint extends ModelEntity, Buildable { - /** - * @return the endpoint identifier - */ - String getId(); - - /** - * @return the region for this endpoint - */ - String getRegion(); - - /** - * @return the service id this endpoint is asssociated with - */ - String getServiceId(); - - /** - * @return the public URL for this endpoint - */ - URI getPublicURL(); - - /** - * @return the admin URL for this endpoint - */ - URI getAdminURL(); - - /** - * @return the internal URL for this endpoint - */ - URI getInternalURL(); - + /** + * @return the endpoint identifier + */ + String getId(); + + /** + * @return the region for this endpoint + */ + String getRegion(); + + /** + * @return the service id this endpoint is asssociated with + */ + String getServiceId(); + + /** + * @return the public URL for this endpoint + */ + URI getPublicURL(); + + /** + * @return the admin URL for this endpoint + */ + URI getAdminURL(); + + /** + * @return the internal URL for this endpoint + */ + URI getInternalURL(); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/Tenant.java b/core/src/main/java/org/openstack4j/model/identity/v2/Tenant.java index 79e7564e1..0e2722f28 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/Tenant.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/Tenant.java @@ -6,41 +6,40 @@ /** * Tenant Model class use to group/isolate resources and/or identity objects - * + * * @author Jeremy Unruh - * * @see { - - /** - * By providing an ID it is assumed this object will be mapped to an existing Tenant. - * - * @return the id of the tenant - */ - String getId(); - - /** - * @return the name of the tenant - */ - String getName(); - - /** - * @return the description of the tenant - */ - String getDescription(); - - /** - * @return if the tenant is enabled - */ - boolean isEnabled(); - - void delete(); - - void update(); - - void addUser(String userId, String roleId); - - void removeUser(String userId, String roleId); - + + /** + * By providing an ID it is assumed this object will be mapped to an existing Tenant. + * + * @return the id of the tenant + */ + String getId(); + + /** + * @return the name of the tenant + */ + String getName(); + + /** + * @return the description of the tenant + */ + String getDescription(); + + /** + * @return if the tenant is enabled + */ + boolean isEnabled(); + + void delete(); + + void update(); + + void addUser(String userId, String roleId); + + void removeUser(String userId, String roleId); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/TenantUser.java b/core/src/main/java/org/openstack4j/model/identity/v2/TenantUser.java index a4fc94340..15230e6e5 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/TenantUser.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/TenantUser.java @@ -4,7 +4,7 @@ /** * A User from a Tenant perspective - * + * * @author Jeremy Unruh */ public interface TenantUser extends ModelEntity { @@ -18,15 +18,15 @@ public interface TenantUser extends ModelEntity { * @return the name of the user */ String getName(); - + /** * @return the email address of the user */ String getEmail(); - + /** * @return true, if the user is enabled (active) */ boolean isEnabled(); - + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/Token.java b/core/src/main/java/org/openstack4j/model/identity/v2/Token.java index 7579d127d..e85f27909 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/Token.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/Token.java @@ -1,34 +1,34 @@ package org.openstack4j.model.identity.v2; -import java.util.Date; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.AuthVersion; +import java.util.Date; + /** * A token which is used during authentication allowing follow up calls to only supply the assigned token within the header avoiding re-authentication - * + * * @author Jeremy Unruh * @see http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_admin-authenticate_v2.0_tokens_Token_Operations.html */ public interface Token extends ModelEntity { - /** - * The generated token ID created by the Identity Restful service - * - * @return the token identifier - */ - String getId(); - - /** - * The expiring date/time of this token - * - * @return the expire date/time - */ - Date getExpires(); - - /** - * @return the authentication version of this token - */ - AuthVersion getVersion(); + /** + * The generated token ID created by the Identity Restful service + * + * @return the token identifier + */ + String getId(); + + /** + * The expiring date/time of this token + * + * @return the expire date/time + */ + Date getExpires(); + + /** + * @return the authentication version of this token + */ + AuthVersion getVersion(); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/TokenV2.java b/core/src/main/java/org/openstack4j/model/identity/v2/TokenV2.java index d006ca0b9..348fc1249 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/TokenV2.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/TokenV2.java @@ -2,15 +2,15 @@ /** * A version 2 token which is used during authentication allowing follow up calls to only supply the assigned token within the header avoiding re-authentication - * + * * @author Jeremy Unruh * @see http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_admin-authenticate_v2.0_tokens_Token_Operations.html */ public interface TokenV2 extends Token { - /** - * @return the tenant associated with the original authentication request - */ - Tenant getTenant(); - + /** + * @return the tenant associated with the original authentication request + */ + Tenant getTenant(); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/User.java b/core/src/main/java/org/openstack4j/model/identity/v2/User.java index 945651901..91428bb51 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/User.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/User.java @@ -6,39 +6,39 @@ /** * An Identity User within OpenStack - * + * * @author Jeremy Unruh */ public interface User extends ModelEntity, Buildable { - /** - * @return the user identifier - */ - String getId(); - - /** - * @return the username/sign-on name - */ - String getUsername(); - - /** - * @return the tenant identifier (default tenant) - */ - String getTenantId(); - - /** - * @return the name of the user - */ - String getName(); - - /** - * @return the email address of the user - */ - String getEmail(); - - /** - * @return true, if the user is enabled (active) - */ - Boolean isEnabled(); + /** + * @return the user identifier + */ + String getId(); + + /** + * @return the username/sign-on name + */ + String getUsername(); + + /** + * @return the tenant identifier (default tenant) + */ + String getTenantId(); + + /** + * @return the name of the user + */ + String getName(); + + /** + * @return the email address of the user + */ + String getEmail(); + + /** + * @return true, if the user is enabled (active) + */ + Boolean isEnabled(); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/builder/EndpointBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v2/builder/EndpointBuilder.java index 619129659..496251af7 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/builder/EndpointBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/builder/EndpointBuilder.java @@ -1,65 +1,65 @@ package org.openstack4j.model.identity.v2.builder; -import java.net.URI; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v2.Endpoint; +import java.net.URI; + /** * A Builder which creates an Endpoint - * + * * @author jeremy */ -public interface EndpointBuilder extends Builder{ +public interface EndpointBuilder extends Builder { + + /** + * @see Endpoint#getRegion() + */ + EndpointBuilder region(String region); + + /** + * @see Endpoint#getPublicURL() + */ + EndpointBuilder publicURL(URI publicURL); + + /** + * @see Endpoint#getInternalURL() + */ + EndpointBuilder internalURL(URI internalURL); + + /** + * @see Endpoint#getTenantId() + */ + EndpointBuilder tenantId(String tenantId); + + /** + * @see Endpoint#getType() + */ + EndpointBuilder type(String type); + + /** + * @see Endpoint#getId() + */ + EndpointBuilder id(String id); + + /** + * @see Endpoint#getName() + */ + EndpointBuilder name(String name); + + /** + * @see Endpoint#getAdminURL() + */ + EndpointBuilder adminURL(URI adminURL); + + /** + * @see Endpoint#getVersionInfo() + */ + EndpointBuilder versionInfo(URI versionInfo); + + /** + * @see Endpoint#getVersionList() + */ + EndpointBuilder versionList(URI versionList); - /** - * @see Endpoint#getRegion() - */ - EndpointBuilder region(String region); - - /** - * @see Endpoint#getPublicURL() - */ - EndpointBuilder publicURL(URI publicURL); - - /** - * @see Endpoint#getInternalURL() - */ - EndpointBuilder internalURL(URI internalURL); - - /** - * @see Endpoint#getTenantId() - */ - EndpointBuilder tenantId(String tenantId); - - /** - * @see Endpoint#getType() - */ - EndpointBuilder type(String type); - - /** - * @see Endpoint#getId() - */ - EndpointBuilder id(String id); - - /** - * @see Endpoint#getName() - */ - EndpointBuilder name(String name); - - /** - * @see Endpoint#getAdminURL() - */ - EndpointBuilder adminURL(URI adminURL); - - /** - * @see Endpoint#getVersionInfo() - */ - EndpointBuilder versionInfo(URI versionInfo); - - /** - * @see Endpoint#getVersionList() - */ - EndpointBuilder versionList(URI versionList); - } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/builder/RoleBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v2/builder/RoleBuilder.java index 65988be73..e0b5a279e 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/builder/RoleBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/builder/RoleBuilder.java @@ -5,34 +5,34 @@ /** * A Builder which creates an Identity Role - * + * * @author Jeremy Unruh */ public interface RoleBuilder extends Builder { - /** - * @see Role#getId() - */ - RoleBuilder id(String id); - - /** - * @see Role#getTenantId() - */ - RoleBuilder tenantId(String tenantId); - - /** - * @see Role#getName() - */ - RoleBuilder name(String name); - - /** - * @see Role#getDescription() - */ - RoleBuilder description(String description); - - /** - * @see Role#isEnabled() - */ - RoleBuilder enabled(boolean enabled); - + /** + * @see Role#getId() + */ + RoleBuilder id(String id); + + /** + * @see Role#getTenantId() + */ + RoleBuilder tenantId(String tenantId); + + /** + * @see Role#getName() + */ + RoleBuilder name(String name); + + /** + * @see Role#getDescription() + */ + RoleBuilder description(String description); + + /** + * @see Role#isEnabled() + */ + RoleBuilder enabled(boolean enabled); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceBuilder.java index 7e1a4d6df..b22cc40f7 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceBuilder.java @@ -5,24 +5,24 @@ /** * A Builder which creates an Identity Service - * + * * @author Jeremy Unruh */ public interface ServiceBuilder extends Builder { - /** - * @see Service#getName() - */ - ServiceBuilder name(String name); - - /** - * @see Service#getType() - */ - ServiceBuilder type(String type); - - /** - * @see Service#getDescription() - */ - ServiceBuilder description(String description); - + /** + * @see Service#getName() + */ + ServiceBuilder name(String name); + + /** + * @see Service#getType() + */ + ServiceBuilder type(String type); + + /** + * @see Service#getDescription() + */ + ServiceBuilder description(String description); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceEndpointBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceEndpointBuilder.java index e81617546..5edf24c93 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceEndpointBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/builder/ServiceEndpointBuilder.java @@ -5,34 +5,34 @@ /** * A Builder which creates an Identity Service Endpoint - * + * * @author Jeremy Unruh */ -public interface ServiceEndpointBuilder extends Builder{ - - /** - * @see ServiceEndpoint#getRegion() - */ - ServiceEndpointBuilder region(String region); - - /** - * @see ServiceEndpoint#getServiceId() - */ - ServiceEndpointBuilder serviceId(String serviceId); - - /** - * @see ServiceEndpoint#getPublicURL() - */ - ServiceEndpointBuilder publicURL(String publicURL); - - /** - * @see ServiceEndpoint#getAdminURL() - */ - ServiceEndpointBuilder adminURL(String adminURL); - - /** - * @see ServiceEndpoint#getInternalURL() - */ - ServiceEndpointBuilder internalURL(String internalURL); - +public interface ServiceEndpointBuilder extends Builder { + + /** + * @see ServiceEndpoint#getRegion() + */ + ServiceEndpointBuilder region(String region); + + /** + * @see ServiceEndpoint#getServiceId() + */ + ServiceEndpointBuilder serviceId(String serviceId); + + /** + * @see ServiceEndpoint#getPublicURL() + */ + ServiceEndpointBuilder publicURL(String publicURL); + + /** + * @see ServiceEndpoint#getAdminURL() + */ + ServiceEndpointBuilder adminURL(String adminURL); + + /** + * @see ServiceEndpoint#getInternalURL() + */ + ServiceEndpointBuilder internalURL(String internalURL); + } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/builder/TenantBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v2/builder/TenantBuilder.java index 7920adeda..f9418faac 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/builder/TenantBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/builder/TenantBuilder.java @@ -5,29 +5,29 @@ /** * A Builder which creates a Identity Tenant - * + * * @author jeremy */ public interface TenantBuilder extends Builder { - - /** - * @see Tenant#getName() - */ - TenantBuilder name(String name); - - /** - * @see Tenant#getDescription() - */ - TenantBuilder description(String desc); - - /** - * @see Tenant#getId() - */ - TenantBuilder id(String id); - - /** - * @see Tenant#getEnabled() - */ - TenantBuilder enabled(boolean enabled); + + /** + * @see Tenant#getName() + */ + TenantBuilder name(String name); + + /** + * @see Tenant#getDescription() + */ + TenantBuilder description(String desc); + + /** + * @see Tenant#getId() + */ + TenantBuilder id(String id); + + /** + * @see Tenant#getEnabled() + */ + TenantBuilder enabled(boolean enabled); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/builder/UserBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v2/builder/UserBuilder.java index a603ae322..5f949eaca 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/builder/UserBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/builder/UserBuilder.java @@ -6,49 +6,52 @@ /** * A Builder which creates an Identity User - * + * * @author Jeremy Unruh */ public interface UserBuilder extends Builder { - - /** - * @see User#getName() - */ - UserBuilder name(String name); - - /** - * ID should only ever be set if the user already exists and this is used for update based actions - * @param id the user id - * @return this for method chaining - */ - UserBuilder id(String id); - - /** - * Sets the initial password for the user - * @param password the password to set - * @return this builder - */ - UserBuilder password(String password); - - /** - * @see User#getEmail() - */ - UserBuilder email(String email); - - /** - * @see User#isEnabled() - */ - UserBuilder enabled(boolean enabled); - - /** - * @see User#getTenantId() - */ - UserBuilder tenantId(String tenantId); - - /** - * Accepts an existing tenant and uses the tenant's id - * @see User#getTenantId() - */ - UserBuilder tenant(Tenant tenant); + + /** + * @see User#getName() + */ + UserBuilder name(String name); + + /** + * ID should only ever be set if the user already exists and this is used for update based actions + * + * @param id the user id + * @return this for method chaining + */ + UserBuilder id(String id); + + /** + * Sets the initial password for the user + * + * @param password the password to set + * @return this builder + */ + UserBuilder password(String password); + + /** + * @see User#getEmail() + */ + UserBuilder email(String email); + + /** + * @see User#isEnabled() + */ + UserBuilder enabled(boolean enabled); + + /** + * @see User#getTenantId() + */ + UserBuilder tenantId(String tenantId); + + /** + * Accepts an existing tenant and uses the tenant's id + * + * @see User#getTenantId() + */ + UserBuilder tenant(Tenant tenant); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java b/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java index 6002f280a..323226cda 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java @@ -1,10 +1,10 @@ package org.openstack4j.model.identity.v3; -import java.util.List; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.ResourceEntity; +import java.util.List; + public interface Authentication extends ModelEntity { Identity getIdentity(); diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Credential.java b/core/src/main/java/org/openstack4j/model/identity/v3/Credential.java index 0715ba7f5..f37f859e6 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Credential.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Credential.java @@ -1,11 +1,11 @@ package org.openstack4j.model.identity.v3; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.CredentialBuilder; +import java.util.Map; + /** * Domain model. * diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Domain.java b/core/src/main/java/org/openstack4j/model/identity/v3/Domain.java index 3650f6b88..6e9ab506a 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Domain.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Domain.java @@ -1,14 +1,14 @@ package org.openstack4j.model.identity.v3; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.DomainBuilder; +import java.util.Map; + /** * Domain model. - * + * * @see API reference */ public interface Domain extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Endpoint.java b/core/src/main/java/org/openstack4j/model/identity/v3/Endpoint.java index 4cc6b2798..121da8de7 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Endpoint.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Endpoint.java @@ -1,13 +1,13 @@ package org.openstack4j.model.identity.v3; -import java.net.URL; -import java.util.Map; - import org.openstack4j.api.types.Facing; import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.EndpointBuilder; +import java.net.URL; +import java.util.Map; + /** * Endpoint model for identity v3. * diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Group.java b/core/src/main/java/org/openstack4j/model/identity/v3/Group.java index ce0db2dca..932c77ae5 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Group.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Group.java @@ -1,11 +1,11 @@ package org.openstack4j.model.identity.v3; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.GroupBuilder; +import java.util.Map; + /** * Group model * @@ -15,7 +15,7 @@ public interface Group extends ModelEntity, Buildable { /** * Globally unique within the owning domain. - * + * * @return the id of the group */ String getId(); diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Policy.java b/core/src/main/java/org/openstack4j/model/identity/v3/Policy.java index 9095eec3b..72c56fc49 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Policy.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Policy.java @@ -1,11 +1,11 @@ package org.openstack4j.model.identity.v3; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.PolicyBuilder; +import java.util.Map; + /** * policy model class * diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Project.java b/core/src/main/java/org/openstack4j/model/identity/v3/Project.java index 0d76b0b6a..15fe0f286 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Project.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Project.java @@ -1,15 +1,15 @@ package org.openstack4j.model.identity.v3; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.ProjectBuilder; +import java.util.List; +import java.util.Map; + /** * Project Model class use to group/isolate resources and/or identity objects - * + * * @see API reference */ public interface Project extends ModelEntity, Buildable { @@ -27,7 +27,6 @@ public interface Project extends ModelEntity, Buildable { String getDomainId(); /** - * * @return the domain */ Domain getDomain(); @@ -38,49 +37,41 @@ public interface Project extends ModelEntity, Buildable { String getDescription(); /** - * * @return the Name of the project */ String getName(); /** - * * @return the links of the project */ Map getLinks(); /** - * * @return the parentId of the project */ String getParentId(); /** - * * @return the subtree of the project */ String getSubtree(); /** - * * @return the parents of the project */ String getParents(); /** - * * @return if the project is enabled */ boolean isEnabled(); /** - * * @return value for the given key */ String getExtra(String key); - + /** - * * @return list of tags */ List getTags(); diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Role.java b/core/src/main/java/org/openstack4j/model/identity/v3/Role.java index 57fa8fb24..2bdae14d7 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Role.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Role.java @@ -1,21 +1,21 @@ package org.openstack4j.model.identity.v3; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.RoleBuilder; +import java.util.Map; + /** * identity v3 role model class - * + * * @see API reference */ public interface Role extends ModelEntity, Buildable { /** * Globally unique across all domains. - * + * * @return the id of the role */ String getId(); @@ -29,7 +29,7 @@ public interface Role extends ModelEntity, Buildable { * @return the links of the role */ Map getLinks(); - + /** * @return the domain id of the role */ diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/RoleAssignment.java b/core/src/main/java/org/openstack4j/model/identity/v3/RoleAssignment.java index eedffa1f1..de6298297 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/RoleAssignment.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/RoleAssignment.java @@ -1,21 +1,19 @@ package org.openstack4j.model.identity.v3; -import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.identity.v3.builder.RoleBuilder; import java.util.Map; /** * identity v3 role assignment class - * + * * @see API reference */ public interface RoleAssignment extends ModelEntity { /** * Get role id for role assignment - * + * * @return the id of the role */ String getRoleId(); diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Service.java b/core/src/main/java/org/openstack4j/model/identity/v3/Service.java index ae11f2e41..c6e16cbab 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Service.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Service.java @@ -1,12 +1,12 @@ package org.openstack4j.model.identity.v3; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.ServiceBuilder; +import java.util.List; +import java.util.Map; + /** * Identity V3 Service model * diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Tenant.java b/core/src/main/java/org/openstack4j/model/identity/v3/Tenant.java index 04703e36b..c55169c66 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Tenant.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Tenant.java @@ -2,7 +2,6 @@ /** * Tenant is required for some calls in other OpenStack components like network. - * */ public interface Tenant extends Project { diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Token.java b/core/src/main/java/org/openstack4j/model/identity/v3/Token.java index c136b27d7..b7f3d778d 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Token.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Token.java @@ -1,13 +1,12 @@ package org.openstack4j.model.identity.v3; -import java.util.Date; -import java.util.List; - +import com.google.common.collect.SortedSetMultimap; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.AuthStore; import org.openstack4j.model.identity.AuthVersion; -import com.google.common.collect.SortedSetMultimap; +import java.util.Date; +import java.util.List; /** * V3 token model diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/User.java b/core/src/main/java/org/openstack4j/model/identity/v3/User.java index fe9ed752a..a6c04431c 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/User.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/User.java @@ -1,11 +1,11 @@ package org.openstack4j.model.identity.v3; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.identity.v3.builder.UserBuilder; +import java.util.Map; + /** * identity v3 user model class * diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/CredentialBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/CredentialBuilder.java index 3bdd6c9c3..3ff4a9628 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/CredentialBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/CredentialBuilder.java @@ -1,11 +1,11 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Credential; -public interface CredentialBuilder extends Builder{ +import java.util.Map; + +public interface CredentialBuilder extends Builder { /** * @see Credential#getId() diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/DomainBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/DomainBuilder.java index 8dd8de187..c4c80ea0d 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/DomainBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/DomainBuilder.java @@ -1,14 +1,12 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Domain; +import java.util.Map; + /** * A Builder which creates a identity v3 domain. - * - * */ public interface DomainBuilder extends Builder { diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/EndpointBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/EndpointBuilder.java index 7e1607b57..385a969bf 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/EndpointBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/EndpointBuilder.java @@ -1,16 +1,14 @@ package org.openstack4j.model.identity.v3.builder; -import java.net.URL; -import java.util.Map; - import org.openstack4j.api.types.Facing; import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Endpoint; +import java.net.URL; +import java.util.Map; + /** * A Builder which creates an identity v3 endpoint. - * - * */ public interface EndpointBuilder extends Builder { diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/GroupBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/GroupBuilder.java index 95aa43773..20da46833 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/GroupBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/GroupBuilder.java @@ -1,14 +1,12 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Group; +import java.util.Map; + /** * A Builder which creates a identity v3 group - * - * */ public interface GroupBuilder extends Builder { diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java index 07058492d..fce6639ab 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java @@ -1,7 +1,5 @@ package org.openstack4j.model.identity.v3.builder; -import org.openstack4j.model.identity.v3.builder.*; - /** * The Identity V3 builders */ diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/PolicyBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/PolicyBuilder.java index d8e0ca8df..a4f8f767f 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/PolicyBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/PolicyBuilder.java @@ -1,14 +1,12 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Policy; +import java.util.Map; + /** - * * the policy builder - * */ public interface PolicyBuilder extends Builder { diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/ProjectBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/ProjectBuilder.java index 620103b1c..5e25683b7 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/ProjectBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/ProjectBuilder.java @@ -1,86 +1,76 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Domain; import org.openstack4j.model.identity.v3.Project; +import java.util.List; +import java.util.Map; + /** * A Builder which creates a identity v3 project - * - * */ public interface ProjectBuilder extends Builder { - /** - * @see Project#getId() - */ - ProjectBuilder id(String id); + /** + * @see Project#getId() + */ + ProjectBuilder id(String id); - /** - * - * @see Project#getDomainId() - */ - ProjectBuilder domainId(String domainId); + /** + * @see Project#getDomainId() + */ + ProjectBuilder domainId(String domainId); - /** - * Accepts an existing domain and uses its id - * - * @see Project#getDomainId() - */ - ProjectBuilder domain(Domain domain); + /** + * Accepts an existing domain and uses its id + * + * @see Project#getDomainId() + */ + ProjectBuilder domain(Domain domain); - /** - * - * @see Project#getDescription - */ - ProjectBuilder description(String description); + /** + * @see Project#getDescription + */ + ProjectBuilder description(String description); - /** - * @see Project#isEnabled() - */ - ProjectBuilder enabled(boolean enabled); + /** + * @see Project#isEnabled() + */ + ProjectBuilder enabled(boolean enabled); - /** - * @see Project#getName() - */ - ProjectBuilder name(String name); + /** + * @see Project#getName() + */ + ProjectBuilder name(String name); - /** - * - * @see Project#getLinks() - */ - ProjectBuilder links(Map links); + /** + * @see Project#getLinks() + */ + ProjectBuilder links(Map links); - /** - * - * @see Project#getParentId() - */ - ProjectBuilder parentId(String parentId); + /** + * @see Project#getParentId() + */ + ProjectBuilder parentId(String parentId); - /** - * - * @see Project#getSubtree() - */ - ProjectBuilder subtree(String subtree); + /** + * @see Project#getSubtree() + */ + ProjectBuilder subtree(String subtree); - /** - * - * @see Project#getParents() - */ - ProjectBuilder parents(String parents); + /** + * @see Project#getParents() + */ + ProjectBuilder parents(String parents); - /** - * - * @see Project#getExtra(String) - */ - ProjectBuilder setExtra(String name, String value); + /** + * @see Project#getExtra(String) + */ + ProjectBuilder setExtra(String name, String value); - /** - * - * @see Project#getTags() - */ - ProjectBuilder setTags(List tags); + /** + * @see Project#getTags() + */ + ProjectBuilder setTags(List tags); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/RoleBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/RoleBuilder.java index 6ec792c10..a6c77c30f 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/RoleBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/RoleBuilder.java @@ -1,14 +1,12 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Role; +import java.util.Map; + /** * A Builder which creates an identity v3 role - * - * */ public interface RoleBuilder extends Builder { @@ -30,6 +28,6 @@ public interface RoleBuilder extends Builder { /** * @see Role#getLinks() */ - RoleBuilder domainId(String domainId); + RoleBuilder domainId(String domainId); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/ServiceBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/ServiceBuilder.java index c61c04e0c..6f0d72c25 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/ServiceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/ServiceBuilder.java @@ -1,14 +1,12 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Service; +import java.util.Map; + /** * A Builder which creates an identity v3 service - * - * */ public interface ServiceBuilder extends Builder { diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/UserBuilder.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/UserBuilder.java index eebd9ccf1..380d2e323 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/UserBuilder.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/UserBuilder.java @@ -1,16 +1,13 @@ package org.openstack4j.model.identity.v3.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Domain; import org.openstack4j.model.identity.v3.User; +import java.util.Map; + /** * A Builder which creates a identity v3 project - * - * - * */ public interface UserBuilder extends Builder { @@ -41,7 +38,7 @@ public interface UserBuilder extends Builder { /** * Accepts an existing domain and uses its id - * + * * @see User#getDomain() */ UserBuilder domain(Domain domain); diff --git a/core/src/main/java/org/openstack4j/model/image/CachedImage.java b/core/src/main/java/org/openstack4j/model/image/CachedImage.java index a7ed575b5..c441fff85 100644 --- a/core/src/main/java/org/openstack4j/model/image/CachedImage.java +++ b/core/src/main/java/org/openstack4j/model/image/CachedImage.java @@ -11,31 +11,26 @@ public interface CachedImage extends ModelEntity { /** - * * @return the image id of the cached image */ String getImageId(); /** - * * @return date when this image was last accessed in the cache */ Date getLastAccessed(); /** - * * @return date when the image was last modified in the cache */ Date getLastModified(); /** - * * @return nr of cache hits */ Integer getHits(); /** - * * @return the image size */ Long getSize(); diff --git a/core/src/main/java/org/openstack4j/model/image/ContainerFormat.java b/core/src/main/java/org/openstack4j/model/image/ContainerFormat.java index ab5262a2a..c7dd36732 100644 --- a/core/src/main/java/org/openstack4j/model/image/ContainerFormat.java +++ b/core/src/main/java/org/openstack4j/model/image/ContainerFormat.java @@ -7,63 +7,61 @@ /** * The container format refers to whether the virtual machine image is in a file format that also * contains metadata about the actual virtual machine. - * + *

* Note that the container format string is not currently used by Glance or other OpenStack * components, so it is safe to simply specify {@link #BARE} as the container format if you are * unsure. - * + * * @author Jeremy Unruh */ public enum ContainerFormat { - /** - * This indicates there is no container or metadata envelope for the image - */ - BARE, + /** + * This indicates there is no container or metadata envelope for the image + */ + BARE, - /** - * This is the OVF container format - */ - OVF, + /** + * This is the OVF container format + */ + OVF, - /** - * This indicates what is stored in Glance is an Amazon kernel image - */ - AKI, + /** + * This indicates what is stored in Glance is an Amazon kernel image + */ + AKI, - /** - * This indicates what is stored in Glance is an Amazon ramdisk image - */ - ARI, + /** + * This indicates what is stored in Glance is an Amazon ramdisk image + */ + ARI, - /** - * This indicates what is stored in Glance is an Amazon machine image - */ - AMI, + /** + * This indicates what is stored in Glance is an Amazon machine image + */ + AMI, - /** - * This is the Docker container format - * */ - DOCKER, + /** + * This is the Docker container format + */ + DOCKER, - /** - * Type unknown - */ - UNRECOGNIZED; - - @JsonValue - public String value() { - return name().toLowerCase(); - } - - @JsonCreator - public static ContainerFormat value(String cf) { - if (cf == null || cf.isEmpty()) return UNRECOGNIZED; - try - { - return valueOf(cf.toUpperCase()); - } - catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } + /** + * Type unknown + */ + UNRECOGNIZED; + + @JsonValue + public String value() { + return name().toLowerCase(); + } + + @JsonCreator + public static ContainerFormat value(String cf) { + if (cf == null || cf.isEmpty()) return UNRECOGNIZED; + try { + return valueOf(cf.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } } diff --git a/core/src/main/java/org/openstack4j/model/image/DiskFormat.java b/core/src/main/java/org/openstack4j/model/image/DiskFormat.java index ed813142f..3b880ea27 100644 --- a/core/src/main/java/org/openstack4j/model/image/DiskFormat.java +++ b/core/src/main/java/org/openstack4j/model/image/DiskFormat.java @@ -4,73 +4,71 @@ import com.fasterxml.jackson.annotation.JsonValue; -/** +/** * The disk format of a virtual machine image is the format of the underlying disk image - * + * * @author Jeremy Unruh */ public enum DiskFormat { - /** - * This is an unstructured disk image format - */ - RAW, - /** - * This is the VHD disk format, a common disk format used by virtual machine monitors from - * VMWare, Xen, Microsoft, VirtualBox, and others - */ - VHD, - /** - * Another common disk format supported by many common virtual machine monitors - */ - VMDK, - /** - * A disk format supported by VirtualBox virtual machine monitor and the QEMU emulator - */ - VDI, - /** - * An archive format for the data contents of an optical disc (e.g. CDROM). - */ - ISO, - /** - * A disk format supported by the QEMU emulator that can expand dynamically and supports Copy on - * Write - */ - QCOW2, + /** + * This is an unstructured disk image format + */ + RAW, + /** + * This is the VHD disk format, a common disk format used by virtual machine monitors from + * VMWare, Xen, Microsoft, VirtualBox, and others + */ + VHD, + /** + * Another common disk format supported by many common virtual machine monitors + */ + VMDK, + /** + * A disk format supported by VirtualBox virtual machine monitor and the QEMU emulator + */ + VDI, + /** + * An archive format for the data contents of an optical disc (e.g. CDROM). + */ + ISO, + /** + * A disk format supported by the QEMU emulator that can expand dynamically and supports Copy on + * Write + */ + QCOW2, - /** - * This indicates what is stored in Glance is an Amazon kernel image - */ - AKI, + /** + * This indicates what is stored in Glance is an Amazon kernel image + */ + AKI, - /** - * This indicates what is stored in Glance is an Amazon ramdisk image - */ - ARI, + /** + * This indicates what is stored in Glance is an Amazon ramdisk image + */ + ARI, - /** - * This indicates what is stored in Glance is an Amazon machine image - */ - AMI, + /** + * This indicates what is stored in Glance is an Amazon machine image + */ + AMI, - /** - * Type unknown - */ - UNRECOGNIZED; + /** + * Type unknown + */ + UNRECOGNIZED; - @JsonValue - public String value() { - return name().toLowerCase(); - } - - @JsonCreator - public static DiskFormat value(String df) { - if (df == null || df.isEmpty()) return UNRECOGNIZED; - try - { - return valueOf(df.toUpperCase()); - } - catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } + @JsonValue + public String value() { + return name().toLowerCase(); + } + + @JsonCreator + public static DiskFormat value(String df) { + if (df == null || df.isEmpty()) return UNRECOGNIZED; + try { + return valueOf(df.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } } diff --git a/core/src/main/java/org/openstack4j/model/image/Image.java b/core/src/main/java/org/openstack4j/model/image/Image.java index 130a47fa4..d8445cceb 100644 --- a/core/src/main/java/org/openstack4j/model/image/Image.java +++ b/core/src/main/java/org/openstack4j/model/image/Image.java @@ -1,20 +1,18 @@ package org.openstack4j.model.image; -import java.util.Date; -import java.util.Map; - -import javax.annotation.Nullable; - +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openstack4j.common.Buildable; import org.openstack4j.model.common.BasicResource; import org.openstack4j.model.image.builder.ImageBuilder; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nullable; +import java.util.Date; +import java.util.Map; /** * A Glance v1.1 Image - * + * * @author Jeremy Unruh * @see http://docs.openstack.org/api/openstack-image-service/1.1/content/index.html */ @@ -24,8 +22,7 @@ public enum Status { UNRECOGNIZED, ACTIVE, SAVING, QUEUED, KILLED, PENDING_DELETE, DELETED; @JsonCreator - public static Status value(String v) - { + public static Status value(String v) { if (v == null) return UNRECOGNIZED; try { return valueOf(v.toUpperCase()); @@ -80,14 +77,14 @@ public String value() { /** * Timestamp when an image's metadata was last updated, not its image data, as all image data is immutable once stored in Glance - * + * * @return the last updated date/time */ Date getUpdatedAt(); /** * The timestamp of when the image was created - * + * * @return the created date/time */ Date getCreatedAt(); @@ -105,6 +102,7 @@ public String value() { /** * Indicates whether the image is publicly available + * * @return true if the image is publicly available */ boolean isPublic(); @@ -121,25 +119,26 @@ public String value() { /** * A mapping of free-form key/value pairs that have been saved with the image metadata + * * @return Map of key to value */ Map getProperties(); /** * This will always be null on any list or get request. It is intented as an option for creating, updating or reserving images + * * @return the store type */ StoreType getStoreType(); /** * Determines if this image is a snapshot - * + * * @return true if this image is a snapshot */ boolean isSnapshot(); /** - * * @return the image url as String */ String getCopyFrom(); diff --git a/core/src/main/java/org/openstack4j/model/image/ImageMember.java b/core/src/main/java/org/openstack4j/model/image/ImageMember.java index 412f1a4c9..5b38e64ce 100644 --- a/core/src/main/java/org/openstack4j/model/image/ImageMember.java +++ b/core/src/main/java/org/openstack4j/model/image/ImageMember.java @@ -4,24 +4,24 @@ /** * Represents a system tenant who has access to another tenants Image - * + * * @author Jeremy Unruh */ public interface ImageMember extends ModelEntity { - /** - * The Member/Tenant - * - * @return the member identifier - */ - String getMemberId(); - - /** - * If true the current member can share the image with another tenant - * - * @return true, if the current member/tenant can share the image - */ - boolean isCanShare(); - + /** + * The Member/Tenant + * + * @return the member identifier + */ + String getMemberId(); + + /** + * If true the current member can share the image with another tenant + * + * @return true, if the current member/tenant can share the image + */ + boolean isCanShare(); + } diff --git a/core/src/main/java/org/openstack4j/model/image/StoreType.java b/core/src/main/java/org/openstack4j/model/image/StoreType.java index 08eefec93..73139263f 100644 --- a/core/src/main/java/org/openstack4j/model/image/StoreType.java +++ b/core/src/main/java/org/openstack4j/model/image/StoreType.java @@ -2,30 +2,30 @@ /** * Backing store types for glance images - * + * * @author Jeremy Unruh */ public enum StoreType { - - /** - * File system store - */ - FILE, - /** - * S3 store - */ - S3, - /** - * OpenStack swift store - */ - SWIFT; - - public String value() { - return name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } + + /** + * File system store + */ + FILE, + /** + * S3 store + */ + S3, + /** + * OpenStack swift store + */ + SWIFT; + + public String value() { + return name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } } diff --git a/core/src/main/java/org/openstack4j/model/image/builder/ImageBuilder.java b/core/src/main/java/org/openstack4j/model/image/builder/ImageBuilder.java index 8ad3aea49..605d1337a 100644 --- a/core/src/main/java/org/openstack4j/model/image/builder/ImageBuilder.java +++ b/core/src/main/java/org/openstack4j/model/image/builder/ImageBuilder.java @@ -1,93 +1,92 @@ package org.openstack4j.model.image.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.image.ContainerFormat; import org.openstack4j.model.image.DiskFormat; import org.openstack4j.model.image.Image; import org.openstack4j.model.image.StoreType; +import java.util.Map; + /** * Builder which creates an Image - * + * * @author Jeremy Unruh */ -public interface ImageBuilder extends Builder{ - - /** - * @see Image#getId() - */ - ImageBuilder id(String id); - - /** - * @see Image#getName() - */ - ImageBuilder name(String name); - - /** - * @see Image#getDiskFormat() - */ - ImageBuilder diskFormat(DiskFormat diskFormat); - - /** - * @see Image#getContainerFormat() - */ - ImageBuilder containerFormat(ContainerFormat containerFormat); - - /** - * @see Image#getSize() - */ - ImageBuilder size(Long size); - - /** - * @see Image#getChecksum() - */ - ImageBuilder checksum(String checksum); - - /** - * @see Image#getMinDisk() - */ - ImageBuilder minDisk(Long minDisk); - - /** - * @see Image#getMinRam() - */ - ImageBuilder minRam(Long minRam); - - /** - * @see Image#getOwner() - */ - ImageBuilder owner(String owner); - - /** - * @see Image#isPublic() - */ - ImageBuilder isPublic(Boolean isPublic); - - /** - * @see Image#getProperties() - */ - ImageBuilder properties(Map properties); - - /** - * @see Image#getProperties() - */ - ImageBuilder property(String key, String value); - - /** - * Store type to be used during create or reserving of new images - * - * @param storeType the store type - * @return the image builder - */ - ImageBuilder storeType(StoreType storeType); +public interface ImageBuilder extends Builder { + + /** + * @see Image#getId() + */ + ImageBuilder id(String id); + + /** + * @see Image#getName() + */ + ImageBuilder name(String name); + + /** + * @see Image#getDiskFormat() + */ + ImageBuilder diskFormat(DiskFormat diskFormat); + + /** + * @see Image#getContainerFormat() + */ + ImageBuilder containerFormat(ContainerFormat containerFormat); + + /** + * @see Image#getSize() + */ + ImageBuilder size(Long size); + + /** + * @see Image#getChecksum() + */ + ImageBuilder checksum(String checksum); + /** + * @see Image#getMinDisk() + */ + ImageBuilder minDisk(Long minDisk); + + /** + * @see Image#getMinRam() + */ + ImageBuilder minRam(Long minRam); + + /** + * @see Image#getOwner() + */ + ImageBuilder owner(String owner); + + /** + * @see Image#isPublic() + */ + ImageBuilder isPublic(Boolean isPublic); /** + * @see Image#getProperties() + */ + ImageBuilder properties(Map properties); + + /** + * @see Image#getProperties() + */ + ImageBuilder property(String key, String value); + + /** + * Store type to be used during create or reserving of new images * + * @param storeType the store type + * @return the image builder + */ + ImageBuilder storeType(StoreType storeType); + + + /** * @see Image#getCopyFrom() */ ImageBuilder copyFrom(String copyFrom); - + } diff --git a/core/src/main/java/org/openstack4j/model/image/v2/CachedImage.java b/core/src/main/java/org/openstack4j/model/image/v2/CachedImage.java index 7c4bcfb70..c8dec98a6 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/CachedImage.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/CachedImage.java @@ -1,6 +1,7 @@ package org.openstack4j.model.image.v2; import org.openstack4j.model.ModelEntity; + import java.util.Date; /** @@ -10,31 +11,26 @@ public interface CachedImage extends ModelEntity { /** - * * @return the image id of the cached image */ String getImageId(); /** - * * @return date when this image was last accessed in the cache */ Date getLastAccessed(); /** - * * @return date when the image was last modified in the cache */ Date getLastModified(); /** - * * @return nr of cache hits */ Integer getHits(); /** - * * @return the image size */ Long getSize(); diff --git a/core/src/main/java/org/openstack4j/model/image/v2/ContainerFormat.java b/core/src/main/java/org/openstack4j/model/image/v2/ContainerFormat.java index 0925fd5c4..44c85c930 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/ContainerFormat.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/ContainerFormat.java @@ -6,7 +6,7 @@ /** * The container format refers to whether the virtual machine image is in a file format that also * contains metadata about the actual virtual machine. - * + *

* Note that the container format string is not currently used by Glance or other OpenStack * components, so it is safe to simply specify {@link #BARE} as the container format if you are * unsure. @@ -62,11 +62,9 @@ public String value() { @JsonCreator public static ContainerFormat value(String cf) { if (cf == null || cf.isEmpty()) return UNRECOGNIZED; - try - { + try { return valueOf(cf.toUpperCase()); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } diff --git a/core/src/main/java/org/openstack4j/model/image/v2/DiskFormat.java b/core/src/main/java/org/openstack4j/model/image/v2/DiskFormat.java index cca39305b..adbb34e67 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/DiskFormat.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/DiskFormat.java @@ -70,11 +70,9 @@ public String value() { @JsonCreator public static DiskFormat value(String df) { if (df == null || df.isEmpty()) return UNRECOGNIZED; - try - { + try { return valueOf(df.toUpperCase()); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } diff --git a/core/src/main/java/org/openstack4j/model/image/v2/Image.java b/core/src/main/java/org/openstack4j/model/image/v2/Image.java index 16fb0dca9..48ff4bd1c 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/Image.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/Image.java @@ -1,18 +1,18 @@ package org.openstack4j.model.image.v2; -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openstack4j.common.Buildable; import org.openstack4j.model.common.BasicResource; import org.openstack4j.model.image.v2.builder.ImageBuilder; import org.openstack4j.openstack.image.v2.domain.GlanceImage.Location; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import java.util.List; /** * A Glance v2.0-2.3 Image + * * @author emjburns * @see http://developer.openstack.org/api-ref-image-v2.html#showImage-v2 */ @@ -65,8 +65,7 @@ public enum ImageStatus { PENDING_DELETE; @JsonCreator - public static ImageStatus value(String v) - { + public static ImageStatus value(String v) { if (v == null) return UNRECOGNIZED; try { return valueOf(v.toUpperCase()); @@ -88,8 +87,7 @@ public enum ImageVisibility { @JsonCreator public static ImageVisibility forValue(String value) { - if (value != null) - { + if (value != null) { for (ImageVisibility s : ImageVisibility.values()) { if (s.name().equalsIgnoreCase(value)) { return s; @@ -185,7 +183,7 @@ public String value() { /** * @return A list of URLs to access the image file in external store. - * + *

* This list appears if the show_multiple_locations option is * set to true in the Image service's configuration file. */ @@ -215,6 +213,7 @@ public String value() { /** * Pattern: ^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$ + * * @return ID of image stored in Glance that should be used as the ramdisk when booting an AMI-style image. */ String getRamdiskId(); @@ -232,6 +231,7 @@ public String value() { /** * Pattern: ^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$ + * * @return ID of image stored in Glance that should be used as the kernel when booting an AMI-style image */ String getKernelId(); diff --git a/core/src/main/java/org/openstack4j/model/image/v2/ImageUpdate.java b/core/src/main/java/org/openstack4j/model/image/v2/ImageUpdate.java index 02ca683e3..de9be09c0 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/ImageUpdate.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/ImageUpdate.java @@ -11,6 +11,7 @@ * A class for defining json patch operations. * Image is the only API to take json patch and not a changed object. * This allows you to define the patch object yourself. + * * @author emjburns */ public interface ImageUpdate extends ModelEntity, Buildable { @@ -19,6 +20,7 @@ public interface ImageUpdate extends ModelEntity, Buildable * A list of Patch operations for updating an image * Patch operation description found here: * http://specs.openstack.org/openstack/glance-specs/specs/api/v2/http-patch-image-api-v2.html + * * @return List of PatchOperations */ List getOps(); diff --git a/core/src/main/java/org/openstack4j/model/image/v2/Member.java b/core/src/main/java/org/openstack4j/model/image/v2/Member.java index e4821d8e1..2eb0ec5a1 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/Member.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/Member.java @@ -10,6 +10,7 @@ /** * A Glance V2 Member + * * @author emjburns */ @JsonDeserialize(as = GlanceMember.class) @@ -36,8 +37,7 @@ public enum MemberStatus { @JsonCreator public static MemberStatus forValue(String value) { - if (value != null) - { + if (value != null) { for (MemberStatus s : MemberStatus.values()) { if (s.name().equalsIgnoreCase(value)) { return s; @@ -56,36 +56,42 @@ public String value() { /** * An identifier for the image * Pattern: ^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$ + * * @return imageId */ String getImageId(); /** * An identifier for the image member (tenantId or projectId) + * * @return memberId */ String getMemberId(); /** * The date and time of image member creation + * * @return createdAt */ Date getCreatedAt(); /** * The date and time of last modification of image member + * * @return updatedAt */ Date getUpdatedAt(); /** * The status of the image member + * * @return status */ MemberStatus getStatus(); /** * The json schema for the member object + * * @return */ String getSchema(); diff --git a/core/src/main/java/org/openstack4j/model/image/v2/Task.java b/core/src/main/java/org/openstack4j/model/image/v2/Task.java index df1382957..a2f38d31f 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/Task.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/Task.java @@ -1,26 +1,26 @@ package org.openstack4j.model.image.v2; -import java.util.Date; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.image.v2.builder.TaskBuilder; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import java.util.Map; /** * An object representing a Glance V2 task. * Tasks offer end users a front end to long * running asynchronous operations. + * * @author emjburns */ public interface Task extends ModelEntity, Buildable { public enum TaskStatus { /** - *The task identifier has been reserved for a task in the Glance. + * The task identifier has been reserved for a task in the Glance. * No processing has begun on it yet. */ PENDING, @@ -45,8 +45,7 @@ public enum TaskStatus { UNKNOWN; @JsonCreator - public static TaskStatus value(String v) - { + public static TaskStatus value(String v) { if (v == null) return UNKNOWN; try { return valueOf(v.toUpperCase()); @@ -63,6 +62,7 @@ public String value() { /** * Date and time task was created. + * * @return */ Date getCreatedAt(); @@ -70,24 +70,28 @@ public String value() { /** * The date and time the task is subject to removal. * The result of the task will still exist. + * * @return */ Date getExpiresAt(); /** * The date and time the task was updated. + * * @return */ Date getUpdatedAt(); /** * Identifier for the task, a UUID. + * * @return */ String getId(); /** * A JSON object specifying the input parameters of the task. + * * @return */ Map getInput(); @@ -96,12 +100,14 @@ public String value() { * Human readable text, possibly and empty string, usually * displayed in an error situation to provide more information * about what has occurred. + * * @return */ String getMessage(); /** * Identifier for owner of the task, usually tenant ID. + * * @return */ String getOwner(); @@ -109,30 +115,35 @@ public String value() { /** * A JSON object specifying information about the ultimate * outcome of the task. + * * @return */ Map getResult(); /** * The URI for the schema describing an image task. + * * @return */ String getSchema(); /** * The status of the task. + * * @return taskStatus */ TaskStatus getStatus(); /** * The type of task represented by this content. + * * @return */ String getType(); /** * A URI for this task. + * * @return */ String getSelf(); diff --git a/core/src/main/java/org/openstack4j/model/image/v2/builder/ImageBuilder.java b/core/src/main/java/org/openstack4j/model/image/v2/builder/ImageBuilder.java index 2c67d907d..5b4e330f6 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/builder/ImageBuilder.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/builder/ImageBuilder.java @@ -1,14 +1,15 @@ package org.openstack4j.model.image.v2.builder; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.image.v2.ContainerFormat; import org.openstack4j.model.image.v2.DiskFormat; import org.openstack4j.model.image.v2.Image; +import java.util.List; + /** * Builder which creates a v2 Image + * * @author emjburns */ public interface ImageBuilder extends Buildable.Builder { diff --git a/core/src/main/java/org/openstack4j/model/image/v2/builder/TaskBuilder.java b/core/src/main/java/org/openstack4j/model/image/v2/builder/TaskBuilder.java index bdab4bbe5..a594d2c4e 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/builder/TaskBuilder.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/builder/TaskBuilder.java @@ -7,6 +7,7 @@ /** * Builder for Glance V2 tasks + * * @author emjburns */ public interface TaskBuilder extends Buildable.Builder { @@ -18,5 +19,5 @@ public interface TaskBuilder extends Buildable.Builder { /** * @see Task#getInput() */ - TaskBuilder input(Map input); + TaskBuilder input(Map input); } diff --git a/core/src/main/java/org/openstack4j/model/magnum/Bay.java b/core/src/main/java/org/openstack4j/model/magnum/Bay.java index 8ee7cb51f..91eb28a7b 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Bay.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Bay.java @@ -1,129 +1,129 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface Bay extends ModelEntity, Buildable { - /** - * Gets status - * - * @return status - */ - String getStatus(); - - /** - * Gets uuid - * - * @return uuid - */ - String getUuid(); - - /** - * Gets links - * - * @return links - */ - List getLinks(); - - /** - * Gets stackId - * - * @return stackId - */ - String getStackId(); - - /** - * Gets createdAt - * - * @return createdAt - */ - String getCreatedAt(); - - /** - * Gets apiAddress - * - * @return apiAddress - */ - String getApiAddress(); - - /** - * Gets discoveryUrl - * - * @return discoveryUrl - */ - String getDiscoveryUrl(); - - /** - * Gets updatedAt - * - * @return updatedAt - */ - String getUpdatedAt(); - - /** - * Gets masterCount - * - * @return masterCount - */ - Integer getMasterCount(); - - /** - * Gets coeVersion - * - * @return coeVersion - */ - String getCoeVersion(); - - /** - * Gets baymodelId - * - * @return baymodelId - */ - String getBaymodelId(); - - /** - * Gets masterAddresses - * - * @return masterAddresses - */ - List getMasterAddresses(); - - /** - * Gets nodeCount - * - * @return nodeCount - */ - Integer getNodeCount(); - - /** - * Gets nodeAddresses - * - * @return nodeAddresses - */ - List getNodeAddresses(); - - /** - * Gets statusReason - * - * @return statusReason - */ - String getStatusReason(); - - /** - * Gets bayCreateTimeout - * - * @return bayCreateTimeout - */ - String getBayCreateTimeout(); - - /** - * Gets name - * - * @return name - */ - String getName(); + /** + * Gets status + * + * @return status + */ + String getStatus(); + + /** + * Gets uuid + * + * @return uuid + */ + String getUuid(); + + /** + * Gets links + * + * @return links + */ + List getLinks(); + + /** + * Gets stackId + * + * @return stackId + */ + String getStackId(); + + /** + * Gets createdAt + * + * @return createdAt + */ + String getCreatedAt(); + + /** + * Gets apiAddress + * + * @return apiAddress + */ + String getApiAddress(); + + /** + * Gets discoveryUrl + * + * @return discoveryUrl + */ + String getDiscoveryUrl(); + + /** + * Gets updatedAt + * + * @return updatedAt + */ + String getUpdatedAt(); + + /** + * Gets masterCount + * + * @return masterCount + */ + Integer getMasterCount(); + + /** + * Gets coeVersion + * + * @return coeVersion + */ + String getCoeVersion(); + + /** + * Gets baymodelId + * + * @return baymodelId + */ + String getBaymodelId(); + + /** + * Gets masterAddresses + * + * @return masterAddresses + */ + List getMasterAddresses(); + + /** + * Gets nodeCount + * + * @return nodeCount + */ + Integer getNodeCount(); + + /** + * Gets nodeAddresses + * + * @return nodeAddresses + */ + List getNodeAddresses(); + + /** + * Gets statusReason + * + * @return statusReason + */ + String getStatusReason(); + + /** + * Gets bayCreateTimeout + * + * @return bayCreateTimeout + */ + String getBayCreateTimeout(); + + /** + * Gets name + * + * @return name + */ + String getName(); } diff --git a/core/src/main/java/org/openstack4j/model/magnum/BayBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/BayBuilder.java index 264b835ed..b2542455b 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/BayBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/BayBuilder.java @@ -1,94 +1,94 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface BayBuilder extends Builder { - /** - * @see Bay#getStatus - */ - BayBuilder status(String status); - - /** - * @see Bay#getUuid - */ - BayBuilder uuid(String uuid); - - /** - * @see Bay#getLinks - */ - BayBuilder links(List links); - - /** - * @see Bay#getStackId - */ - BayBuilder stackId(String stackId); - - /** - * @see Bay#getCreatedAt - */ - BayBuilder createdAt(String createdAt); - - /** - * @see Bay#getApiAddress - */ - BayBuilder apiAddress(String apiAddress); - - /** - * @see Bay#getDiscoveryUrl - */ - BayBuilder discoveryUrl(String discoveryUrl); - - /** - * @see Bay#getUpdatedAt - */ - BayBuilder updatedAt(String updatedAt); - - /** - * @see Bay#getMasterCount - */ - BayBuilder masterCount(Integer masterCount); - - /** - * @see Bay#getCoeVersion - */ - BayBuilder coeVersion(String coeVersion); - - /** - * @see Bay#getBaymodelId - */ - BayBuilder baymodelId(String baymodelId); - - /** - * @see Bay#getMasterAddresses - */ - BayBuilder masterAddresses(List masterAddresses); - - /** - * @see Bay#getNodeCount - */ - BayBuilder nodeCount(Integer nodeCount); - - /** - * @see Bay#getNodeAddresses - */ - BayBuilder nodeAddresses(List nodeAddresses); - - /** - * @see Bay#getStatusReason - */ - BayBuilder statusReason(String statusReason); - - /** - * @see Bay#getBayCreateTimeout - */ - BayBuilder bayCreateTimeout(String bayCreateTimeout); - - /** - * @see Bay#getName - */ - BayBuilder name(String name); + /** + * @see Bay#getStatus + */ + BayBuilder status(String status); + + /** + * @see Bay#getUuid + */ + BayBuilder uuid(String uuid); + + /** + * @see Bay#getLinks + */ + BayBuilder links(List links); + + /** + * @see Bay#getStackId + */ + BayBuilder stackId(String stackId); + + /** + * @see Bay#getCreatedAt + */ + BayBuilder createdAt(String createdAt); + + /** + * @see Bay#getApiAddress + */ + BayBuilder apiAddress(String apiAddress); + + /** + * @see Bay#getDiscoveryUrl + */ + BayBuilder discoveryUrl(String discoveryUrl); + + /** + * @see Bay#getUpdatedAt + */ + BayBuilder updatedAt(String updatedAt); + + /** + * @see Bay#getMasterCount + */ + BayBuilder masterCount(Integer masterCount); + + /** + * @see Bay#getCoeVersion + */ + BayBuilder coeVersion(String coeVersion); + + /** + * @see Bay#getBaymodelId + */ + BayBuilder baymodelId(String baymodelId); + + /** + * @see Bay#getMasterAddresses + */ + BayBuilder masterAddresses(List masterAddresses); + + /** + * @see Bay#getNodeCount + */ + BayBuilder nodeCount(Integer nodeCount); + + /** + * @see Bay#getNodeAddresses + */ + BayBuilder nodeAddresses(List nodeAddresses); + + /** + * @see Bay#getStatusReason + */ + BayBuilder statusReason(String statusReason); + + /** + * @see Bay#getBayCreateTimeout + */ + BayBuilder bayCreateTimeout(String bayCreateTimeout); + + /** + * @see Bay#getName + */ + BayBuilder name(String name); } diff --git a/core/src/main/java/org/openstack4j/model/magnum/Baymodel.java b/core/src/main/java/org/openstack4j/model/magnum/Baymodel.java index 19e05de74..f1ab996bf 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Baymodel.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Baymodel.java @@ -1,190 +1,219 @@ package org.openstack4j.model.magnum; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface Baymodel extends ModelEntity, Buildable { /** * Insecure registry + * * @return InsecureRegistry */ - String getInsecureRegistry(); - + String getInsecureRegistry(); + /** * All links + * * @return links */ List getLinks(); - + /** * Http proxy + * * @return httpProxy */ String getHttpProxy(); - + /** * Updated time + * * @return updatedAt */ - String getUpdatedAt(); - + String getUpdatedAt(); + /** * Is Floating IP enabled + * * @return floatingIpEnabled */ Boolean isFloatingIpEnabled(); - + /** * Fixed subnet + * * @return fixedSubnet */ String getFixedSubnet(); - + /** * Master flavor id + * * @return masterFlavorId */ - String getMasterFlavorId(); - + String getMasterFlavorId(); + /** * UUID + * * @return uuid */ - String getUuid(); - + String getUuid(); + /** * No proxy + * * @return noProxy */ - String getNoProxy(); - + String getNoProxy(); + /** * Http proxy + * * @return http proxy */ - String getHttpsProxy(); - + String getHttpsProxy(); + /** * Is TLS disabled + * * @return tlsDisabled boolean value */ - Boolean isTlsDisabled(); - + Boolean isTlsDisabled(); + /** * Keypair id + * * @return keypairId */ - String getKeypairId(); - + String getKeypairId(); + /** * Is it public + * * @return public boolean vallue */ - Boolean isPublicBaymodel(); - + Boolean isPublicBaymodel(); + /** * Docker volume size + * * @return dockerVolumeSize */ String getDockerVolumeSize(); - + /** * Server type + * * @return serverType */ String getServerType(); - + /** * External network id + * * @return externalNetworkId */ String getExternalNetworkId(); - + /** * Cluster distro + * * @return clusterDistro */ String getClusterDistro(); - + /** * Imdage id + * * @return imageId */ - String getImageId(); - + String getImageId(); + /** * Volume driver + * * @return volume driver */ - String getVolumeDriver(); - + String getVolumeDriver(); + /** * Is registry enabled + * * @return registryEnabled boolean value */ - Boolean isRegistryEnabled(); - + Boolean isRegistryEnabled(); + /** * Docker storage driver + * * @return dockerStorageDriver */ String getDockerStorageDriver(); - + /** * Api server port + * * @return apiserverPort */ String getApiserverPort(); - + /** * Name + * * @return name */ - String getName(); - + String getName(); + /** * Date of creation + * * @return createdAt */ - String getCreatedAt(); - + String getCreatedAt(); + /** * Network driver + * * @return networkDriver */ - String getNetworkDriver(); - + String getNetworkDriver(); + /** * Fixed network + * * @return fixedNetwork */ - String getFixedNetwork(); - + String getFixedNetwork(); + /** * Coe + * * @return coe */ String getCoe(); - + /** * Flavor id + * * @return flavorId */ - String getFlavorId(); - + String getFlavorId(); + /** * Is master lb enabled + * * @return masterLbEnabled boolean value */ - Boolean isMasterLbEnabled(); - + Boolean isMasterLbEnabled(); + /** * DNS name server + * * @return dnsNameServer */ - String getDnsNameserver(); + String getDnsNameserver(); } diff --git a/core/src/main/java/org/openstack4j/model/magnum/BaymodelBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/BaymodelBuilder.java index 74e837300..df6431ec3 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/BaymodelBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/BaymodelBuilder.java @@ -1,11 +1,10 @@ package org.openstack4j.model.magnum; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface BaymodelBuilder extends Builder { /** * @see Baymodel#getInsecureRegistry() diff --git a/core/src/main/java/org/openstack4j/model/magnum/Carequest.java b/core/src/main/java/org/openstack4j/model/magnum/Carequest.java index b3bcc9fe8..e1a42f7ae 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Carequest.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Carequest.java @@ -6,14 +6,14 @@ public interface Carequest extends ModelEntity, Buildable { /** * Gets bayUuid - * + * * @return bayUuid */ String getBayUuid(); /** * Gets csr - * + * * @return csr */ String getCsr(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/Certificate.java b/core/src/main/java/org/openstack4j/model/magnum/Certificate.java index 64bdf59cf..7db2330d8 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Certificate.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Certificate.java @@ -1,29 +1,29 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface Certificate extends ModelEntity, Buildable { /** * Gets pem - * + * * @return pem */ String getPem(); /** * Gets bayUuid - * + * * @return bayUuid */ String getBayUuid(); /** * Gets links - * + * * @return links */ List getLinks(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/CertificateBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/CertificateBuilder.java index e32652bad..5a51cdef8 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/CertificateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/CertificateBuilder.java @@ -1,10 +1,10 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface CertificateBuilder extends Builder { /** * @see Certificate#getPem diff --git a/core/src/main/java/org/openstack4j/model/magnum/Cluster.java b/core/src/main/java/org/openstack4j/model/magnum/Cluster.java index 822adee42..e247b10b8 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Cluster.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Cluster.java @@ -1,85 +1,85 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface Cluster extends ModelEntity, Buildable { /** * Gets status - * + * * @return status */ String getStatus(); /** * Gets clusterTemplateId - * + * * @return clusterTemplateId */ String getClusterTemplateId(); /** * Gets uuid - * + * * @return uuid */ String getUuid(); /** * Gets links - * + * * @return links */ List getLinks(); /** * Gets stackId - * + * * @return stackId */ String getStackId(); /** * Gets masterCount - * + * * @return masterCount */ Integer getMasterCount(); /** * Gets createTimeout - * + * * @return createTimeout */ Integer getCreateTimeout(); /** * Gets nodeCount - * + * * @return nodeCount */ Integer getNodeCount(); /** * Gets discoveryUrl - * + * * @return discoveryUrl */ String getDiscoveryUrl(); /** * Gets keypair - * + * * @return keypair */ String getKeypair(); /** * Gets name - * + * * @return name */ String getName(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/ClusterBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/ClusterBuilder.java index a6838433d..535855c0b 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/ClusterBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/ClusterBuilder.java @@ -1,10 +1,10 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface ClusterBuilder extends Builder { /** * @see Cluster#getStatus diff --git a/core/src/main/java/org/openstack4j/model/magnum/Clustertemplate.java b/core/src/main/java/org/openstack4j/model/magnum/Clustertemplate.java index e793d4b97..c0fb373b5 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Clustertemplate.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Clustertemplate.java @@ -1,225 +1,225 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface Clustertemplate extends ModelEntity, Buildable { /** * Gets insecureRegistry - * + * * @return insecureRegistry */ String getInsecureRegistry(); /** * Gets links - * + * * @return links */ List getLinks(); /** * Gets httpProxy - * + * * @return httpProxy */ String getHttpProxy(); /** * Gets updatedAt - * + * * @return updatedAt */ String getUpdatedAt(); /** * Gets floatingIpEnabled - * + * * @return floatingIpEnabled */ Boolean getFloatingIpEnabled(); /** * Gets fixedSubnet - * + * * @return fixedSubnet */ String getFixedSubnet(); /** * Gets masterFlavorId - * + * * @return masterFlavorId */ String getMasterFlavorId(); /** * Gets uuid - * + * * @return uuid */ String getUuid(); /** * Gets noProxy - * + * * @return noProxy */ String getNoProxy(); /** * Gets httpsProxy - * + * * @return httpsProxy */ String getHttpsProxy(); /** * Gets tlsDisabled - * + * * @return tlsDisabled */ Boolean getTlsDisabled(); /** * Gets keypairId - * + * * @return keypairId */ String getKeypairId(); /** * Gets publicTemplate - * + * * @return publicTemplate */ Boolean getPublicTemplate(); /** * Gets labels - * + * * @return labels */ Label getLabels(); /** * Gets dockerVolumeSize - * + * * @return dockerVolumeSize */ Integer getDockerVolumeSize(); /** * Gets serverType - * + * * @return serverType */ String getServerType(); /** * Gets externalNetworkId - * + * * @return externalNetworkId */ String getExternalNetworkId(); /** * Gets clusterDistro - * + * * @return clusterDistro */ String getClusterDistro(); /** * Gets imageId - * + * * @return imageId */ String getImageId(); /** * Gets volumeDriver - * + * * @return volumeDriver */ String getVolumeDriver(); /** * Gets registryEnabled - * + * * @return registryEnabled */ Boolean getRegistryEnabled(); /** * Gets dockerStorageDriver - * + * * @return dockerStorageDriver */ String getDockerStorageDriver(); /** * Gets apiserverPort - * + * * @return apiserverPort */ String getApiserverPort(); /** * Gets name - * + * * @return name */ String getName(); /** * Gets createdAt - * + * * @return createdAt */ String getCreatedAt(); /** * Gets networkDriver - * + * * @return networkDriver */ String getNetworkDriver(); /** * Gets fixedNetwork - * + * * @return fixedNetwork */ String getFixedNetwork(); /** * Gets coe - * + * * @return coe */ String getCoe(); /** * Gets flavorId - * + * * @return flavorId */ String getFlavorId(); /** * Gets masterLbEnabled - * + * * @return masterLbEnabled */ Boolean getMasterLbEnabled(); /** * Gets dnsNameserver - * + * * @return dnsNameserver */ String getDnsNameserver(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/ClustertemplateBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/ClustertemplateBuilder.java index d9241d28d..5d3e37dbb 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/ClustertemplateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/ClustertemplateBuilder.java @@ -1,10 +1,10 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.openstack.common.GenericLink; +import java.util.List; + public interface ClustertemplateBuilder extends Builder { /** * @see Clustertemplate#getInsecureRegistry diff --git a/core/src/main/java/org/openstack4j/model/magnum/Container.java b/core/src/main/java/org/openstack4j/model/magnum/Container.java index 8e3291907..8e566f8c1 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Container.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Container.java @@ -1,72 +1,72 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.magnum.MagnumEnvironment; +import java.util.List; + public interface Container extends ModelEntity, Buildable { /** * Gets status - * + * * @return status */ String getStatus(); /** * Gets uuid - * + * * @return uuid */ String getUuid(); /** * Gets links - * + * * @return links */ List getLinks(); /** * Gets image - * + * * @return image */ String getImage(); /** * Gets environment - * + * * @return environment */ MagnumEnvironment getEnvironment(); /** * Gets command - * + * * @return command */ String getCommand(); /** * Gets memory - * + * * @return memory */ String getMemory(); /** * Gets bayUuid - * + * * @return bayUuid */ String getBayUuid(); /** * Gets name - * + * * @return name */ String getName(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/ContainerBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/ContainerBuilder.java index 9c50b92e7..9b75c37a6 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/ContainerBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/ContainerBuilder.java @@ -1,11 +1,11 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.magnum.MagnumEnvironment; +import java.util.List; + public interface ContainerBuilder extends Builder { /** diff --git a/core/src/main/java/org/openstack4j/model/magnum/Environment.java b/core/src/main/java/org/openstack4j/model/magnum/Environment.java index 7c2f1b923..57d41473d 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Environment.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Environment.java @@ -6,6 +6,7 @@ public interface Environment extends ModelEntity, Buildable { /** * Gets path + * * @return path */ String getPath(); @@ -13,6 +14,7 @@ public interface Environment extends ModelEntity, Buildable /** * Gets ldLibraryPath + * * @return ldLibraryPath */ String getLdLibraryPath(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/Label.java b/core/src/main/java/org/openstack4j/model/magnum/Label.java index a4a4c6507..50da87d88 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Label.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Label.java @@ -6,7 +6,7 @@ public interface Label extends ModelEntity, Buildable { /** * Gets key - * + * * @return key */ String getKey(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/Mservice.java b/core/src/main/java/org/openstack4j/model/magnum/Mservice.java index 587fe375e..c024e0551 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Mservice.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Mservice.java @@ -3,61 +3,61 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; -public interface Mservice extends ModelEntity, Buildable{ - - /** - * Identifier of Magnum Service - * - * @return the of Magnum Service - */ - String getId(); - - /** - * Binary of the service - * - * @return the binary of the service - */ - String getBinary(); - - /** - * Creation date - * - * @return the date of creation - */ - String getCreatedAt(); - - /** - * Current state if it is up or not - * - * @return the state of the service - */ - String getState(); - - /** - * Report count - * - * @return the report count of the service - */ - int getReportCount(); - - /** - * The date of last updation - * - * @return the last updated time - */ - String getUpdatedAt(); - - /** - * The host name - * - * @return the host name - */ - String getHost(); - - /** - * The disabled reason - * - * @return the disabled reason - */ - String getDisabledReason(); +public interface Mservice extends ModelEntity, Buildable { + + /** + * Identifier of Magnum Service + * + * @return the of Magnum Service + */ + String getId(); + + /** + * Binary of the service + * + * @return the binary of the service + */ + String getBinary(); + + /** + * Creation date + * + * @return the date of creation + */ + String getCreatedAt(); + + /** + * Current state if it is up or not + * + * @return the state of the service + */ + String getState(); + + /** + * Report count + * + * @return the report count of the service + */ + int getReportCount(); + + /** + * The date of last updation + * + * @return the last updated time + */ + String getUpdatedAt(); + + /** + * The host name + * + * @return the host name + */ + String getHost(); + + /** + * The disabled reason + * + * @return the disabled reason + */ + String getDisabledReason(); } diff --git a/core/src/main/java/org/openstack4j/model/magnum/MserviceBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/MserviceBuilder.java index dfea3b45e..dc594c489 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/MserviceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/MserviceBuilder.java @@ -4,49 +4,48 @@ /** * Builder which crates Magnum Service - * - * @author Sohan Sangwan * + * @author Sohan Sangwan */ - + public interface MserviceBuilder extends Builder { - /** + /** * @see Mservice#getId() */ - MserviceBuilder id(String id); - - /** + MserviceBuilder id(String id); + + /** * @see Mservice#getBinary() */ - MserviceBuilder binary(String binary); - - /** + MserviceBuilder binary(String binary); + + /** * @see Mservice#getCreatedAt() */ - MserviceBuilder createdAt(String createdAt); - - /** + MserviceBuilder createdAt(String createdAt); + + /** * @see Mservice#getState() */ - MserviceBuilder state(String state); - - /** + MserviceBuilder state(String state); + + /** * @see Mservice#getReportCount() */ - MserviceBuilder reportCount(int reportCount); - - /** + MserviceBuilder reportCount(int reportCount); + + /** * @see Mservice#getUpdatedAt() */ - MserviceBuilder updatedAt(String updatedAt); - - /** + MserviceBuilder updatedAt(String updatedAt); + + /** * @see Mservice#getHost() */ - MserviceBuilder host(String host); - - /** + MserviceBuilder host(String host); + + /** * @see Mservice#getDisabledReason() */ - MserviceBuilder disabledReason(String disabledReason); + MserviceBuilder disabledReason(String disabledReason); } diff --git a/core/src/main/java/org/openstack4j/model/magnum/Pod.java b/core/src/main/java/org/openstack4j/model/magnum/Pod.java index 0baa6805f..5aa8359f7 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/Pod.java +++ b/core/src/main/java/org/openstack4j/model/magnum/Pod.java @@ -1,63 +1,63 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; +import java.util.List; + public interface Pod extends ModelEntity, Buildable { /** * Gets id - * + * * @return id */ String getId(); /** * Gets uuid - * + * * @return uuid */ String getUuid(); /** * Gets name - * + * * @return name */ String getName(); /** * Gets desc - * + * * @return desc */ String getDesc(); /** * Gets bayUuid - * + * * @return bayUuid */ String getBayUuid(); /** * Gets images - * + * * @return images */ List getImages(); /** * Gets labels - * + * * @return labels */ Label getLabels(); /** * Gets status - * + * * @return status */ String getStatus(); diff --git a/core/src/main/java/org/openstack4j/model/magnum/PodBuilder.java b/core/src/main/java/org/openstack4j/model/magnum/PodBuilder.java index ed760f703..eb3e1b4ba 100644 --- a/core/src/main/java/org/openstack4j/model/magnum/PodBuilder.java +++ b/core/src/main/java/org/openstack4j/model/magnum/PodBuilder.java @@ -1,9 +1,9 @@ package org.openstack4j.model.magnum; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; +import java.util.List; + public interface PodBuilder extends Builder { /** * @see Pod#getId diff --git a/core/src/main/java/org/openstack4j/model/manila/SecurityServiceUpdateOptions.java b/core/src/main/java/org/openstack4j/model/manila/SecurityServiceUpdateOptions.java index 968680d1e..d3016043f 100644 --- a/core/src/main/java/org/openstack4j/model/manila/SecurityServiceUpdateOptions.java +++ b/core/src/main/java/org/openstack4j/model/manila/SecurityServiceUpdateOptions.java @@ -14,7 +14,7 @@ public class SecurityServiceUpdateOptions { private String password; private String domain; private String server; - + public static SecurityServiceUpdateOptions create() { return new SecurityServiceUpdateOptions(); } @@ -32,6 +32,7 @@ public SecurityServiceUpdateOptions type(SecurityService.Type type) { /** * Update the security service name. + * * @param name the security service name * @return SecurityServiceUpdateOptions */ @@ -42,6 +43,7 @@ public SecurityServiceUpdateOptions name(String name) { /** * Update the security service description. + * * @param description the security service description * @return SecurityServiceUpdateOptions */ @@ -52,6 +54,7 @@ public SecurityServiceUpdateOptions description(String description) { /** * Update the security service DNS IP. + * * @param dnsIp the security service DNS IP * @return SecurityServiceUpdateOptions */ @@ -62,6 +65,7 @@ public SecurityServiceUpdateOptions dnsIp(String dnsIp) { /** * Update the security service user. + * * @param user the security service user * @return SecurityServiceUpdateOptions */ @@ -72,6 +76,7 @@ public SecurityServiceUpdateOptions user(String user) { /** * Update the security service password. + * * @param password the security service password * @return SecurityServiceUpdateOptions */ @@ -82,6 +87,7 @@ public SecurityServiceUpdateOptions password(String password) { /** * Update the security service domain. + * * @param domain the security service domain * @return SecurityServiceUpdateOptions */ @@ -92,6 +98,7 @@ public SecurityServiceUpdateOptions domain(String domain) { /** * Update the security service server. + * * @param server the security service server * @return SecurityServiceUpdateOptions */ diff --git a/core/src/main/java/org/openstack4j/model/manila/ShareServer.java b/core/src/main/java/org/openstack4j/model/manila/ShareServer.java index 1ca9b0e1b..8fd61a465 100644 --- a/core/src/main/java/org/openstack4j/model/manila/ShareServer.java +++ b/core/src/main/java/org/openstack4j/model/manila/ShareServer.java @@ -28,6 +28,7 @@ public String value() { return name().toLowerCase(); } } + /** * @return the share server ID */ diff --git a/core/src/main/java/org/openstack4j/model/manila/ShareTypeAccess.java b/core/src/main/java/org/openstack4j/model/manila/ShareTypeAccess.java index b5a1770dd..9e9add11c 100644 --- a/core/src/main/java/org/openstack4j/model/manila/ShareTypeAccess.java +++ b/core/src/main/java/org/openstack4j/model/manila/ShareTypeAccess.java @@ -20,12 +20,12 @@ public class ShareTypeAccess implements ModelEntity { private String projectId; public String getShareTypeId() { - return shareTypeId; - } + return shareTypeId; + } public String getProjectId() { - return projectId; - } + return projectId; + } public static class ShareTypeAccessList extends ListResult { private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/org/openstack4j/model/manila/builder/SecurityServiceCreateBuilder.java b/core/src/main/java/org/openstack4j/model/manila/builder/SecurityServiceCreateBuilder.java index 662fafbb0..7104055d5 100644 --- a/core/src/main/java/org/openstack4j/model/manila/builder/SecurityServiceCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/manila/builder/SecurityServiceCreateBuilder.java @@ -13,6 +13,7 @@ public interface SecurityServiceCreateBuilder extends Buildable.Builder { /** * Set the security service type + * * @param type the security service type * @return SecurityServiceCreateBuilder */ @@ -20,6 +21,7 @@ public interface SecurityServiceCreateBuilder /** * Set the security service name + * * @param name the security service name * @return SecurityServiceCreateBuilder */ @@ -27,6 +29,7 @@ public interface SecurityServiceCreateBuilder /** * Set the security service description + * * @param description the security service description * @return SecurityServiceCreateBuilder */ @@ -34,6 +37,7 @@ public interface SecurityServiceCreateBuilder /** * Set the security service DNS IP + * * @param dnsIp the security service DNS IP * @return SecurityServiceCreateBuilder */ @@ -41,6 +45,7 @@ public interface SecurityServiceCreateBuilder /** * Set the security service user + * * @param user the security service user * @return SecurityServiceCreateBuilder */ @@ -48,6 +53,7 @@ public interface SecurityServiceCreateBuilder /** * Set the security service password + * * @param password the security service password * @return SecurityServiceCreateBuilder */ @@ -55,6 +61,7 @@ public interface SecurityServiceCreateBuilder /** * Set the security service domain + * * @param domain the security service domain * @return SecurityServiceCreateBuilder */ @@ -62,6 +69,7 @@ public interface SecurityServiceCreateBuilder /** * Set the security service server + * * @param server the security service server * @return SecurityServiceCreateBuilder */ diff --git a/core/src/main/java/org/openstack4j/model/manila/builder/ShareCreateBuilder.java b/core/src/main/java/org/openstack4j/model/manila/builder/ShareCreateBuilder.java index 1fc91c29c..dd0d8efbe 100644 --- a/core/src/main/java/org/openstack4j/model/manila/builder/ShareCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/manila/builder/ShareCreateBuilder.java @@ -31,7 +31,7 @@ public interface ShareCreateBuilder extends Buildable.Builder * The Shared File Systems API supports the use of both name and display_name attributes, * which are inherited attributes from the Block Storage API. * @@ -54,7 +54,7 @@ public interface ShareSnapshotCreateBuilder extends Buildable.Builder * The Shared File Systems API supports the use of both description and * display_description parameters, which are inherited attributes from the Block Storage API. * diff --git a/core/src/main/java/org/openstack4j/model/manila/builder/ShareTypeCreateBuilder.java b/core/src/main/java/org/openstack4j/model/manila/builder/ShareTypeCreateBuilder.java index b465867a6..0c02b154a 100644 --- a/core/src/main/java/org/openstack4j/model/manila/builder/ShareTypeCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/manila/builder/ShareTypeCreateBuilder.java @@ -13,7 +13,7 @@ public interface ShareTypeCreateBuilder extends Buildable.Builder { diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/domain/ActionResult.java b/core/src/main/java/org/openstack4j/model/murano/v1/domain/ActionResult.java index f0a80efd2..6b4d0ca0d 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/domain/ActionResult.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/domain/ActionResult.java @@ -14,14 +14,14 @@ public interface ActionResult extends ModelEntity { /** * @return the Result object. * It might be one of: - * - String - * - boolean - * - int - * - float - * - List - * - Map - * - * depending on Action itself. + * - String + * - boolean + * - int + * - float + * - List + * - Map + *

+ * depending on Action itself. */ Object getResult(); } diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/domain/AppCatalogSession.java b/core/src/main/java/org/openstack4j/model/murano/v1/domain/AppCatalogSession.java index 88624163b..1206e24d7 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/domain/AppCatalogSession.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/domain/AppCatalogSession.java @@ -17,10 +17,10 @@ public interface AppCatalogSession extends ModelEntity { String getEnvId(); /** - * * @return the user id */ String getUserId(); + /** * @return the created date */ diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/domain/Application.java b/core/src/main/java/org/openstack4j/model/murano/v1/domain/Application.java index 3caae2f6e..30e2b7720 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/domain/Application.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/domain/Application.java @@ -9,13 +9,11 @@ */ public interface Application extends ModelEntity { /** - * * @return data in map format (Map). */ Map getData(); /** - * * @return service internal info */ ServiceInfo getService(); diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/domain/Deployment.java b/core/src/main/java/org/openstack4j/model/murano/v1/domain/Deployment.java index 1a6849de1..20a056e5a 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/domain/Deployment.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/domain/Deployment.java @@ -7,55 +7,46 @@ */ public interface Deployment extends ModelEntity { /** - * * @return state of the deployment. */ String getState(); /** - * * @return date and time of the start of the deployment. */ String getStarted(); /** - * * @return date and time of the finish of the deployment. */ String getFinished(); /** - * * @return the environment id. */ String getEnvironmentId(); /** - * * @return the id of the deployment. */ String getId(); /** - * * @return the description Object. */ EnvironmentDescription getDescription(); /** - * * @return created date. */ String getCreated(); /** - * * @return updated date. */ String getUpdated(); /** - * * @return the result. */ DeploymentResult getResult(); diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/domain/DeploymentResult.java b/core/src/main/java/org/openstack4j/model/murano/v1/domain/DeploymentResult.java index e435ba9b6..8440e8b05 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/domain/DeploymentResult.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/domain/DeploymentResult.java @@ -7,26 +7,22 @@ */ public interface DeploymentResult extends ModelEntity { /** - * * @return true if exception is raised during deployment. */ boolean isException(); /** - * * @return the result of the deployment. */ InnerResult getResult(); interface InnerResult extends ModelEntity { /** - * * @return Detailed message (in case of exception - full traceback). */ String getDetails(); /** - * * @return result message. */ String getMessage(); diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/domain/EnvironmentDescription.java b/core/src/main/java/org/openstack4j/model/murano/v1/domain/EnvironmentDescription.java index dc48040ae..e7380d853 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/domain/EnvironmentDescription.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/domain/EnvironmentDescription.java @@ -10,25 +10,21 @@ */ public interface EnvironmentDescription extends ModelEntity { /** - * * @return services list in given environment. */ List getServices(); /** - * * @return the environment name. */ String getName(); /** - * * @return defaultNetworks info. */ Map getDefaultNetworks(); /** - * * @return Map object containing env id and type. */ Map getEnvIdentities(); diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/domain/Report.java b/core/src/main/java/org/openstack4j/model/murano/v1/domain/Report.java index 5936dff42..0258feea7 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/domain/Report.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/domain/Report.java @@ -7,55 +7,46 @@ */ public interface Report extends ModelEntity { /** - * * @return entity. */ String getEntity(); /** - * * @return entity id. */ String getEntityId(); /** - * * @return report level. */ String getLevel(); /** - * * @return Created date. */ String getCreated(); /** - * * @return Updated date. */ String getUpdated(); /** - * * @return report text. */ String getText(); /** - * * @return task id which deployment belongs to. */ String getTaskId(); /** - * * @return id of the report. */ String getId(); /** - * * @return report details. */ String getDetails(); diff --git a/core/src/main/java/org/openstack4j/model/network/Agent.java b/core/src/main/java/org/openstack4j/model/network/Agent.java index e416a2a97..6246b67c8 100644 --- a/core/src/main/java/org/openstack4j/model/network/Agent.java +++ b/core/src/main/java/org/openstack4j/model/network/Agent.java @@ -1,12 +1,11 @@ package org.openstack4j.model.network; -import java.util.Date; - +import com.fasterxml.jackson.annotation.JsonCreator; import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.network.builder.AgentBuilder; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Date; /** * This class represents a neutron agent diff --git a/core/src/main/java/org/openstack4j/model/network/AllowedAddressPair.java b/core/src/main/java/org/openstack4j/model/network/AllowedAddressPair.java index 4e52b7b63..b84f7f170 100644 --- a/core/src/main/java/org/openstack4j/model/network/AllowedAddressPair.java +++ b/core/src/main/java/org/openstack4j/model/network/AllowedAddressPair.java @@ -5,19 +5,19 @@ /** * Allowed Address Pair for Neutron Port - * + * * @author Nathan Anderson */ public interface AllowedAddressPair extends ModelEntity { - /** - * @return the ip address - */ - String getIpAddress(); + /** + * @return the ip address + */ + String getIpAddress(); + + /** + * @return the mac address + */ + String getMacAddress(); - /** - * @return the mac address - */ - String getMacAddress(); - } diff --git a/core/src/main/java/org/openstack4j/model/network/AttachInterfaceType.java b/core/src/main/java/org/openstack4j/model/network/AttachInterfaceType.java index df62e1da5..548a12c5c 100644 --- a/core/src/main/java/org/openstack4j/model/network/AttachInterfaceType.java +++ b/core/src/main/java/org/openstack4j/model/network/AttachInterfaceType.java @@ -2,9 +2,9 @@ /** * Used during Add Router Interface calls to set the type of the inbound attachment identifier - * + * * @author Jeremy Unruh */ public enum AttachInterfaceType { - PORT, SUBNET + PORT, SUBNET } diff --git a/core/src/main/java/org/openstack4j/model/network/AvailabilityZone.java b/core/src/main/java/org/openstack4j/model/network/AvailabilityZone.java index f0c3f6b4a..5a417d330 100644 --- a/core/src/main/java/org/openstack4j/model/network/AvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/model/network/AvailabilityZone.java @@ -1,31 +1,28 @@ package org.openstack4j.model.network; -import java.util.List; - import org.openstack4j.model.ModelEntity; /** - * An availability zone groups network nodes that run services like DHCP, L3, FW, and others. - * + * An availability zone groups network nodes that run services like DHCP, L3, FW, and others. + * * @author Taemin */ public interface AvailabilityZone extends ModelEntity { - /** - * @return State - */ - String getState(); + /** + * @return State + */ + String getState(); + + /** + * @return Resource + */ + String getResource(); - /** - * @return Resource - */ - String getResource(); - - /** - * @return The Zone Name of Neutron - */ - String getName(); + /** + * @return The Zone Name of Neutron + */ + String getName(); - } diff --git a/core/src/main/java/org/openstack4j/model/network/ExternalGateway.java b/core/src/main/java/org/openstack4j/model/network/ExternalGateway.java index cbdbe3710..951eca1cf 100644 --- a/core/src/main/java/org/openstack4j/model/network/ExternalGateway.java +++ b/core/src/main/java/org/openstack4j/model/network/ExternalGateway.java @@ -4,27 +4,27 @@ /** * Configurable external gateway modes extension model. By default, when a gateway is attached to a router using the Neutron L3 extension, - * Network Address Translation (NAT) is enabled for traffic generated by subnets attached to the router. With this extension, the user will + * Network Address Translation (NAT) is enabled for traffic generated by subnets attached to the router. With this extension, the user will * have the option of choosing whether SNAT should be enabled or not on a router basis. - * + * * @author Jeremy Unruh * @see http://docs.openstack.org/api/openstack-network/2.0/content/extgwmodes-ext.html */ public interface ExternalGateway extends ModelEntity { - /** - * @return the network identifier - */ - String getNetworkId(); - - /** - * SNAT can be enabled or disabled at any time on a Neutron router regardless of the current status of floating IPs. - * Floating IPs will continue working even when SNAT is disabled. - * - * NOTE: The default setting is True to ensure backward compatibility for plugins supporting this extension. - * - * @return true if SNAT is enabled - */ - boolean isEnableSnat(); - + /** + * @return the network identifier + */ + String getNetworkId(); + + /** + * SNAT can be enabled or disabled at any time on a Neutron router regardless of the current status of floating IPs. + * Floating IPs will continue working even when SNAT is disabled. + *

+ * NOTE: The default setting is True to ensure backward compatibility for plugins supporting this extension. + * + * @return true if SNAT is enabled + */ + boolean isEnableSnat(); + } diff --git a/core/src/main/java/org/openstack4j/model/network/ExtraDhcpOptCreate.java b/core/src/main/java/org/openstack4j/model/network/ExtraDhcpOptCreate.java index bb181681e..6af5bf851 100644 --- a/core/src/main/java/org/openstack4j/model/network/ExtraDhcpOptCreate.java +++ b/core/src/main/java/org/openstack4j/model/network/ExtraDhcpOptCreate.java @@ -4,11 +4,10 @@ import org.openstack4j.model.network.builder.ExtraDhcpOptBuilder; /** - * * @author Ales Kemr */ public interface ExtraDhcpOptCreate extends Buildable { - + String getOptValue(); String getOptName(); diff --git a/core/src/main/java/org/openstack4j/model/network/FloatingIP.java b/core/src/main/java/org/openstack4j/model/network/FloatingIP.java index 5586c8d0b..a3bc333b9 100755 --- a/core/src/main/java/org/openstack4j/model/network/FloatingIP.java +++ b/core/src/main/java/org/openstack4j/model/network/FloatingIP.java @@ -4,109 +4,109 @@ /** * The Interface FloatingIP. - * + * *

Copyright (c) 2014 by Dorado Software, Inc. All Rights Reserved. * * @author nanderson */ public interface FloatingIP extends ModelEntity { - /** - * Gets the id. - * - * @return the id - */ - public abstract String getId(); - - /** - * Gets the router id. - * - * @return the router id - */ - public abstract String getRouterId(); - - /** - * Gets the tenant id. - * - * @return the tenant id - */ - public abstract String getTenantId(); - - /** - * Gets the floating network id. - * - * @return the floating network id - */ - public abstract String getFloatingNetworkId(); - - /** - * Gets the floating ip address. - * - * @return the floating ip address - */ - public abstract String getFloatingIpAddress(); - - /** - * Gets the fixed ip address. - * - * @return the fixed ip address - */ - public abstract String getFixedIpAddress(); - - /** - * Gets the port id. - * - * @return the port id - */ - public abstract String getPortId(); - - /** - * Sets the id. - * - * @param id the new id - */ - public abstract void setId(String id); - - /** - * Sets the router id. - * - * @param routerId the new router id - */ - public abstract void setRouterId(String routerId); - - /** - * Sets the tenant id. - * - * @param tenantId the new tenant id - */ - public abstract void setTenantId(String tenantId); - - /** - * Sets the floating network id. - * - * @param floatingNetworkId the new floating network id - */ - public abstract void setFloatingNetworkId(String floatingNetworkId); - - /** - * Sets the floating ip address. - * - * @param floatingIpAddress the new floating ip address - */ - public abstract void setFloatingIpAddress(String floatingIpAddress); - - /** - * Sets the fixed ip address. - * - * @param fixedIpAddress the new fixed ip address - */ - public abstract void setFixedIpAddress(String fixedIpAddress); - - /** - * Sets the port id. - * - * @param portId the new port id - */ - public abstract void setPortId(String portId); + /** + * Gets the id. + * + * @return the id + */ + public abstract String getId(); + + /** + * Gets the router id. + * + * @return the router id + */ + public abstract String getRouterId(); + + /** + * Gets the tenant id. + * + * @return the tenant id + */ + public abstract String getTenantId(); + + /** + * Gets the floating network id. + * + * @return the floating network id + */ + public abstract String getFloatingNetworkId(); + + /** + * Gets the floating ip address. + * + * @return the floating ip address + */ + public abstract String getFloatingIpAddress(); + + /** + * Gets the fixed ip address. + * + * @return the fixed ip address + */ + public abstract String getFixedIpAddress(); + + /** + * Gets the port id. + * + * @return the port id + */ + public abstract String getPortId(); + + /** + * Sets the id. + * + * @param id the new id + */ + public abstract void setId(String id); + + /** + * Sets the router id. + * + * @param routerId the new router id + */ + public abstract void setRouterId(String routerId); + + /** + * Sets the tenant id. + * + * @param tenantId the new tenant id + */ + public abstract void setTenantId(String tenantId); + + /** + * Sets the floating network id. + * + * @param floatingNetworkId the new floating network id + */ + public abstract void setFloatingNetworkId(String floatingNetworkId); + + /** + * Sets the floating ip address. + * + * @param floatingIpAddress the new floating ip address + */ + public abstract void setFloatingIpAddress(String floatingIpAddress); + + /** + * Sets the fixed ip address. + * + * @param fixedIpAddress the new fixed ip address + */ + public abstract void setFixedIpAddress(String fixedIpAddress); + + /** + * Sets the port id. + * + * @param portId the new port id + */ + public abstract void setPortId(String portId); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/network/HostRoute.java b/core/src/main/java/org/openstack4j/model/network/HostRoute.java index 365e0acd7..3ad479cd9 100644 --- a/core/src/main/java/org/openstack4j/model/network/HostRoute.java +++ b/core/src/main/java/org/openstack4j/model/network/HostRoute.java @@ -4,22 +4,22 @@ /** * A Network Host based Routing Entry - * + * * @author Jeremy Unruh */ public interface HostRoute extends ModelEntity { - /** - * Gets the destination for the route - * - * @return the destination host for this host route - */ - String getDestination(); + /** + * Gets the destination for the route + * + * @return the destination host for this host route + */ + String getDestination(); - /** - * Gets the NextHop for this route - * - * @return the NextHop for this host route - */ - String getNexthop(); + /** + * Gets the NextHop for this route + * + * @return the NextHop for this host route + */ + String getNexthop(); } diff --git a/core/src/main/java/org/openstack4j/model/network/IP.java b/core/src/main/java/org/openstack4j/model/network/IP.java index f68fefadd..6fa7ba889 100644 --- a/core/src/main/java/org/openstack4j/model/network/IP.java +++ b/core/src/main/java/org/openstack4j/model/network/IP.java @@ -5,19 +5,19 @@ /** * A Fixed IP Address - * + * * @author Jeremy Unruh */ public interface IP extends ModelEntity { - /** - * @return the fixed ip address - */ - String getIpAddress(); + /** + * @return the fixed ip address + */ + String getIpAddress(); + + /** + * @return the id of the subnet of this ip + */ + String getSubnetId(); - /** - * @return the id of the subnet of this ip - */ - String getSubnetId(); - } diff --git a/core/src/main/java/org/openstack4j/model/network/IPVersionType.java b/core/src/main/java/org/openstack4j/model/network/IPVersionType.java index 0555f251e..484025780 100644 --- a/core/src/main/java/org/openstack4j/model/network/IPVersionType.java +++ b/core/src/main/java/org/openstack4j/model/network/IPVersionType.java @@ -6,37 +6,36 @@ /** * IP Address Version Type (V4/V6) - * + * * @author Jeremy Unruh */ public enum IPVersionType { - V4(4), - V6(6) - ; - private final int version; - - private IPVersionType(int version) { - this.version = version; - } - - /** - * Gets the version in Integer form - * - * @return the version as int - */ - @JsonValue - public int getVersion() { - return version; - } + V4(4), + V6(6); + private final int version; + + private IPVersionType(int version) { + this.version = version; + } + + /** + * Gets the version in Integer form + * + * @return the version as int + */ + @JsonValue + public int getVersion() { + return version; + } + + @JsonCreator + public static IPVersionType valueOf(int value) { + for (IPVersionType v : IPVersionType.values()) { + if (v.version == value) { + return v; + } + } + return V4; + } - @JsonCreator - public static IPVersionType valueOf(int value) { - for (IPVersionType v : IPVersionType.values()) { - if (v.version == value) { - return v; - } - } - return V4; - } - } diff --git a/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java b/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java index bacacd669..af84ced94 100644 --- a/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java +++ b/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java @@ -5,34 +5,34 @@ /** * The IPv6 address modes specifies mechanisms for assigning IP addresses - * + * * @author Taemin */ public enum Ipv6AddressMode { - SLAAC("slaac"), - DHCPV6_STATEFUL("dhcpv6-stateful"), - DHCPV6_STATELESS("dhcpv6-stateless"), - NULL("null"); - - private final String ipv6AddressMode; - - private Ipv6AddressMode(String ipv6AddressMode) { - this.ipv6AddressMode = ipv6AddressMode; - } - - @JsonValue - public String getIpv6AddressMode() { - return ipv6AddressMode; - } - - @JsonCreator - public static Ipv6AddressMode forValue(String value) { - if (value != null){ - for (Ipv6AddressMode s : Ipv6AddressMode.values()) { - if (s.ipv6AddressMode.equalsIgnoreCase(value)) - return s; - } - } - return null; - } + SLAAC("slaac"), + DHCPV6_STATEFUL("dhcpv6-stateful"), + DHCPV6_STATELESS("dhcpv6-stateless"), + NULL("null"); + + private final String ipv6AddressMode; + + private Ipv6AddressMode(String ipv6AddressMode) { + this.ipv6AddressMode = ipv6AddressMode; + } + + @JsonValue + public String getIpv6AddressMode() { + return ipv6AddressMode; + } + + @JsonCreator + public static Ipv6AddressMode forValue(String value) { + if (value != null) { + for (Ipv6AddressMode s : Ipv6AddressMode.values()) { + if (s.ipv6AddressMode.equalsIgnoreCase(value)) + return s; + } + } + return null; + } } diff --git a/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java b/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java index 8136ec00c..ebdef7fe8 100644 --- a/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java +++ b/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java @@ -5,33 +5,33 @@ /** * The IPv6 router advertisement specifies whether the networking service should transmit ICMPv6 packets, for a subnet - * + * * @author Taemin */ public enum Ipv6RaMode { - SLAAC("slaac"), - DHCPV6_STATEFUL("dhcpv6-stateful"), - DHCPV6_STATELESS("dhcpv6-stateless"); - - private final String ipv6RaMode; - - private Ipv6RaMode(String ipv6RaMode) { - this.ipv6RaMode = ipv6RaMode; - } - - @JsonValue - public String getIpv6RaMode() { - return ipv6RaMode; - } + SLAAC("slaac"), + DHCPV6_STATEFUL("dhcpv6-stateful"), + DHCPV6_STATELESS("dhcpv6-stateless"); - @JsonCreator - public static Ipv6RaMode forValue(String value) { - if (value != null) { - for (Ipv6RaMode v : Ipv6RaMode.values()) { - if (v.ipv6RaMode.equalsIgnoreCase(value)) - return v; - } - } - return null; - } + private final String ipv6RaMode; + + private Ipv6RaMode(String ipv6RaMode) { + this.ipv6RaMode = ipv6RaMode; + } + + @JsonValue + public String getIpv6RaMode() { + return ipv6RaMode; + } + + @JsonCreator + public static Ipv6RaMode forValue(String value) { + if (value != null) { + for (Ipv6RaMode v : Ipv6RaMode.values()) { + if (v.ipv6RaMode.equalsIgnoreCase(value)) + return v; + } + } + return null; + } } diff --git a/core/src/main/java/org/openstack4j/model/network/NetFloatingIP.java b/core/src/main/java/org/openstack4j/model/network/NetFloatingIP.java index a31a3a0d3..2183f8947 100644 --- a/core/src/main/java/org/openstack4j/model/network/NetFloatingIP.java +++ b/core/src/main/java/org/openstack4j/model/network/NetFloatingIP.java @@ -6,67 +6,66 @@ /** * The Interface NetFloatingIP. - * * * @author nanderson */ public interface NetFloatingIP extends ModelEntity, Buildable { - /** - * Gets the id. - * - * @return the id - */ - String getId(); + /** + * Gets the id. + * + * @return the id + */ + String getId(); - /** - * Gets the router id. - * - * @return the router id - */ - String getRouterId(); + /** + * Gets the router id. + * + * @return the router id + */ + String getRouterId(); - /** - * Gets the tenant id. - * - * @return the tenant id - */ - String getTenantId(); + /** + * Gets the tenant id. + * + * @return the tenant id + */ + String getTenantId(); - /** - * Gets the floating network id. - * - * @return the floating network id - */ - String getFloatingNetworkId(); + /** + * Gets the floating network id. + * + * @return the floating network id + */ + String getFloatingNetworkId(); - /** - * Gets the floating ip address. - * - * @return the floating ip address - */ - String getFloatingIpAddress(); + /** + * Gets the floating ip address. + * + * @return the floating ip address + */ + String getFloatingIpAddress(); - /** - * Gets the fixed ip address. - * - * @return the fixed ip address - */ - String getFixedIpAddress(); + /** + * Gets the fixed ip address. + * + * @return the fixed ip address + */ + String getFixedIpAddress(); + + /** + * Gets the port id. + * + * @return the port id + */ + String getPortId(); + + /** + * Gets the floating ip status + * + * @return the floating ip status + */ + String getStatus(); - /** - * Gets the port id. - * - * @return the port id - */ - String getPortId(); - - /** - * Gets the floating ip status - * - * @return the floating ip status - */ - String getStatus(); - } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/network/NetQuota.java b/core/src/main/java/org/openstack4j/model/network/NetQuota.java index b290619e0..af0e5feb1 100644 --- a/core/src/main/java/org/openstack4j/model/network/NetQuota.java +++ b/core/src/main/java/org/openstack4j/model/network/NetQuota.java @@ -6,42 +6,42 @@ /** * Network quotas that are bound to a Tenant - * + * * @author Jeremy Unruh */ public interface NetQuota extends ModelEntity, Buildable { /** * Number of subnets allowed per tenant - * + * * @return number of subnets */ int getSubnet(); - + /** * Number of routers allowed per tenant - * + * * @return number of routers */ int getRouter(); - + /** * Number of ports allowed per tenant - * + * * @return number of ports */ int getPort(); - + /** * Number of networks allowed per tenant - * + * * @return number of networks */ int getNetwork(); - + /** * Number of floating IpAddresses allowed per tenant - * + * * @return number of float IpAddresses */ int getFloatingIP(); diff --git a/core/src/main/java/org/openstack4j/model/network/Network.java b/core/src/main/java/org/openstack4j/model/network/Network.java index c04151357..92693c393 100644 --- a/core/src/main/java/org/openstack4j/model/network/Network.java +++ b/core/src/main/java/org/openstack4j/model/network/Network.java @@ -1,77 +1,77 @@ package org.openstack4j.model.network; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.builder.NetworkBuilder; +import java.util.List; + /** * An OpenStack (Neutron) network - * + * * @author Jeremy Unruh */ public interface Network extends Resource, Buildable { - /** - * @return the status of the network - */ - State getStatus(); - - /** - * @return list of subnet identifiers associated with the network - */ - List getSubnets(); - - /** - * @return the physical network provider or null - */ - String getProviderPhyNet(); - - /** - * @return true if the administrative state is up - */ - boolean isAdminStateUp(); - - /** - * @return the network type - */ - NetworkType getNetworkType(); - - /** - * @return true if the router is external - */ - boolean isRouterExternal(); - - /** - * @return true if the network is shared - */ - boolean isShared(); - - /** - * @return the provider segmentation identifier - */ - String getProviderSegID(); - - /** - * @return the list of Subnets - */ - List getNeutronSubnets(); - - /** - * @return The maximum transmission unit (MTU) value to address fragmentation. Minimum value is 68 for IPv4, and 1280 for IPv6. - */ - Integer getMTU(); - - /** - * @return the list of the availability zone candidate for the network. - */ - List getAvailabilityZoneHints(); - - /** - * @return the list of the availability zone for the network. - */ - List getAvailabilityZones(); - - + /** + * @return the status of the network + */ + State getStatus(); + + /** + * @return list of subnet identifiers associated with the network + */ + List getSubnets(); + + /** + * @return the physical network provider or null + */ + String getProviderPhyNet(); + + /** + * @return true if the administrative state is up + */ + boolean isAdminStateUp(); + + /** + * @return the network type + */ + NetworkType getNetworkType(); + + /** + * @return true if the router is external + */ + boolean isRouterExternal(); + + /** + * @return true if the network is shared + */ + boolean isShared(); + + /** + * @return the provider segmentation identifier + */ + String getProviderSegID(); + + /** + * @return the list of Subnets + */ + List getNeutronSubnets(); + + /** + * @return The maximum transmission unit (MTU) value to address fragmentation. Minimum value is 68 for IPv4, and 1280 for IPv6. + */ + Integer getMTU(); + + /** + * @return the list of the availability zone candidate for the network. + */ + List getAvailabilityZoneHints(); + + /** + * @return the list of the availability zone for the network. + */ + List getAvailabilityZones(); + + } diff --git a/core/src/main/java/org/openstack4j/model/network/NetworkType.java b/core/src/main/java/org/openstack4j/model/network/NetworkType.java index 39e6798f0..46af4ae40 100644 --- a/core/src/main/java/org/openstack4j/model/network/NetworkType.java +++ b/core/src/main/java/org/openstack4j/model/network/NetworkType.java @@ -6,32 +6,30 @@ /** * The type of Network - * + * * @author Jeremy Unruh */ public enum NetworkType { - LOCAL, - FLAT, - VLAN, - VXLAN, - GRE - ; - - @JsonCreator - public static NetworkType forValue(String value) { - if (value != null) - { - for (NetworkType s : NetworkType.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return null; - } - - @JsonValue - public String toJson() { - return name().toLowerCase(); - } - + LOCAL, + FLAT, + VLAN, + VXLAN, + GRE; + + @JsonCreator + public static NetworkType forValue(String value) { + if (value != null) { + for (NetworkType s : NetworkType.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return null; + } + + @JsonValue + public String toJson() { + return name().toLowerCase(); + } + } diff --git a/core/src/main/java/org/openstack4j/model/network/NetworkUpdate.java b/core/src/main/java/org/openstack4j/model/network/NetworkUpdate.java index d39f119f9..0094c8880 100644 --- a/core/src/main/java/org/openstack4j/model/network/NetworkUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/NetworkUpdate.java @@ -6,30 +6,30 @@ /** * An entity used to update a network - * + * * @author Jeremy Unruh */ public interface NetworkUpdate extends ModelEntity, Buildable { /** * The name of the network - * + * * @return the network name */ String getName(); - + /** * The administrative state of the network, which is up (true) or down (false). - * + * * @return the admin state up state */ boolean isAdminStateUp(); - + /** * Admin-only. Indicates whether this network is shared across all tenants. - * + * * @return true if this network is shared */ boolean isShared(); - + } diff --git a/core/src/main/java/org/openstack4j/model/network/Pool.java b/core/src/main/java/org/openstack4j/model/network/Pool.java index 912e3490d..362a532ba 100644 --- a/core/src/main/java/org/openstack4j/model/network/Pool.java +++ b/core/src/main/java/org/openstack4j/model/network/Pool.java @@ -4,19 +4,19 @@ /** * An IP Address Pool which has a starting network and a ending network which becomes a pool of addresses - * + * * @author Jeremy Unruh */ public interface Pool extends ModelEntity { - /** - * @return the starting IP - */ - String getStart(); - - /** - * @return the ending IP - */ - String getEnd(); - + /** + * @return the starting IP + */ + String getStart(); + + /** + * @return the ending IP + */ + String getEnd(); + } diff --git a/core/src/main/java/org/openstack4j/model/network/Port.java b/core/src/main/java/org/openstack4j/model/network/Port.java index d68aa65e3..696c28e61 100644 --- a/core/src/main/java/org/openstack4j/model/network/Port.java +++ b/core/src/main/java/org/openstack4j/model/network/Port.java @@ -1,74 +1,74 @@ package org.openstack4j.model.network; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.builder.PortBuilder; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * A Network (Neutron) Port - * + * * @author Jeremy Unruh */ public interface Port extends Resource, Buildable { - /** - * @return the current state of the port - */ - State getState(); - - /** - * @return the administrative state of port. If false, port does not forward packets. - */ - boolean isAdminStateUp(); - - /** - * @return the id of the network where this port is associated with - */ - String getNetworkId(); - - /** - * @return the id of the device (e.g. server) using this port. - */ - String getDeviceId(); - - /** - * @return the entity (e.g.: DHCP Agent) using this port. - */ - String getDeviceOwner(); - - /** - * @return the set of fixed IPs this port has been assigned - */ - Set getFixedIps(); - - Set getAllowedAddressPairs(); - - /** - * @return the MacAddress of this port - */ - String getMacAddress(); - - /** - * @return the security group identifiers assigned to this port - */ - List getSecurityGroups(); - - /** - * @return The port security status. A valid value is enabled (true) or disabled (false). - */ - Boolean isPortSecurityEnabled(); - - String getHostId(); - - String getVifType(); - - Map getVifDetails(); - - String getvNicType(); - - Map getProfile(); + /** + * @return the current state of the port + */ + State getState(); + + /** + * @return the administrative state of port. If false, port does not forward packets. + */ + boolean isAdminStateUp(); + + /** + * @return the id of the network where this port is associated with + */ + String getNetworkId(); + + /** + * @return the id of the device (e.g. server) using this port. + */ + String getDeviceId(); + + /** + * @return the entity (e.g.: DHCP Agent) using this port. + */ + String getDeviceOwner(); + + /** + * @return the set of fixed IPs this port has been assigned + */ + Set getFixedIps(); + + Set getAllowedAddressPairs(); + + /** + * @return the MacAddress of this port + */ + String getMacAddress(); + + /** + * @return the security group identifiers assigned to this port + */ + List getSecurityGroups(); + + /** + * @return The port security status. A valid value is enabled (true) or disabled (false). + */ + Boolean isPortSecurityEnabled(); + + String getHostId(); + + String getVifType(); + + Map getVifDetails(); + + String getvNicType(); + + Map getProfile(); } diff --git a/core/src/main/java/org/openstack4j/model/network/Router.java b/core/src/main/java/org/openstack4j/model/network/Router.java index e2537d7c1..377f15de3 100644 --- a/core/src/main/java/org/openstack4j/model/network/Router.java +++ b/core/src/main/java/org/openstack4j/model/network/Router.java @@ -1,49 +1,50 @@ package org.openstack4j.model.network; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.builder.RouterBuilder; +import java.util.List; + /** * A router is used to interconnect subnets and forward traffic among them. Another feature of the router is to NAT internal traffic to external networks. - * + * * @author Jeremy Unruh */ public interface Router extends Resource, Buildable { - /** - * Host Routing entries for the router - * - * @return the routes for the router - */ - List getRoutes(); - - /** - * Administrative state of the router - * - * @return true, if the administrative state is up - */ - boolean isAdminStateUp(); - - /** - * Indicates whether a router is currently operational or not - * - * @return the state/status of the router - */ - State getStatus(); - - /** - * Information on external gateway for the router - * - * @return the external gateway info - */ - ExternalGateway getExternalGatewayInfo(); - - /** - * true indicates a distributed router. It is available when dvr extension is enabled. - * @return - */ - Boolean getDistributed(); + /** + * Host Routing entries for the router + * + * @return the routes for the router + */ + List getRoutes(); + + /** + * Administrative state of the router + * + * @return true, if the administrative state is up + */ + boolean isAdminStateUp(); + + /** + * Indicates whether a router is currently operational or not + * + * @return the state/status of the router + */ + State getStatus(); + + /** + * Information on external gateway for the router + * + * @return the external gateway info + */ + ExternalGateway getExternalGatewayInfo(); + + /** + * true indicates a distributed router. It is available when dvr extension is enabled. + * + * @return + */ + Boolean getDistributed(); } diff --git a/core/src/main/java/org/openstack4j/model/network/RouterInterface.java b/core/src/main/java/org/openstack4j/model/network/RouterInterface.java index 74ecbd5b5..61fc46c4f 100644 --- a/core/src/main/java/org/openstack4j/model/network/RouterInterface.java +++ b/core/src/main/java/org/openstack4j/model/network/RouterInterface.java @@ -4,28 +4,28 @@ /** * An interface data model which is returned during interface association with a router - * + * * @author Jeremy Unruh */ public interface RouterInterface extends ModelEntity { - /** - * @return the router identifier - */ - String getId(); - - /** - * @return the subnet identifier or null if no subnet is associated - */ - String getSubnetId(); - - /** - * @return the port identifier or null if no port is associated - */ - String getPortId(); - - /** - * @return the tenant identifier or null - */ - String getTenantId(); + /** + * @return the router identifier + */ + String getId(); + + /** + * @return the subnet identifier or null if no subnet is associated + */ + String getSubnetId(); + + /** + * @return the port identifier or null if no port is associated + */ + String getPortId(); + + /** + * @return the tenant identifier or null + */ + String getTenantId(); } diff --git a/core/src/main/java/org/openstack4j/model/network/SecurityGroup.java b/core/src/main/java/org/openstack4j/model/network/SecurityGroup.java index d009931f9..a83187148 100644 --- a/core/src/main/java/org/openstack4j/model/network/SecurityGroup.java +++ b/core/src/main/java/org/openstack4j/model/network/SecurityGroup.java @@ -1,30 +1,30 @@ package org.openstack4j.model.network; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.builder.NetSecurityGroupBuilder; +import java.util.List; + /** * The Interface SecurityGroup. * * @author Nathan Anderson */ -public interface SecurityGroup extends Resource, Buildable{ - - /** - * Gets the description. - * - * @return the description - */ - String getDescription(); - - /** - * Gets the rules. - * - * @return the rules - */ - List getRules(); - +public interface SecurityGroup extends Resource, Buildable { + + /** + * Gets the description. + * + * @return the description + */ + String getDescription(); + + /** + * Gets the rules. + * + * @return the rules + */ + List getRules(); + } diff --git a/core/src/main/java/org/openstack4j/model/network/SecurityGroupRule.java b/core/src/main/java/org/openstack4j/model/network/SecurityGroupRule.java index fd36eb9bf..c8974e3eb 100644 --- a/core/src/main/java/org/openstack4j/model/network/SecurityGroupRule.java +++ b/core/src/main/java/org/openstack4j/model/network/SecurityGroupRule.java @@ -6,81 +6,80 @@ /** * The Interface SecurityGroupRule. - * * * @author Nathan Anderson */ -public interface SecurityGroupRule extends ModelEntity, Buildable{ - - /** - * Gets the direction. - * - * @return the direction - */ - String getDirection(); - - /** - * Gets the ether type. - * - * @return the ether type - */ - String getEtherType(); - - /** - * Gets the id. - * - * @return the id - */ - String getId(); - - /** - * Gets the port range max. - * - * @return the port range max - */ - Integer getPortRangeMax(); - - /** - * Gets the port range min. - * - * @return the port range min - */ - Integer getPortRangeMin(); - - /** - * Gets the protocol. - * - * @return the protocol - */ - String getProtocol(); - - /** - * Gets the remote group id. - * - * @return the remote group id - */ - String getRemoteGroupId(); - - /** - * Gets the remote ip prefix. - * - * @return the remote ip prefix - */ - String getRemoteIpPrefix(); - - /** - * Gets the security group id. - * - * @return the security group id - */ - String getSecurityGroupId(); - - /** - * Gets the tenant id. - * - * @return the tenant id - */ - String getTenantId(); - - +public interface SecurityGroupRule extends ModelEntity, Buildable { + + /** + * Gets the direction. + * + * @return the direction + */ + String getDirection(); + + /** + * Gets the ether type. + * + * @return the ether type + */ + String getEtherType(); + + /** + * Gets the id. + * + * @return the id + */ + String getId(); + + /** + * Gets the port range max. + * + * @return the port range max + */ + Integer getPortRangeMax(); + + /** + * Gets the port range min. + * + * @return the port range min + */ + Integer getPortRangeMin(); + + /** + * Gets the protocol. + * + * @return the protocol + */ + String getProtocol(); + + /** + * Gets the remote group id. + * + * @return the remote group id + */ + String getRemoteGroupId(); + + /** + * Gets the remote ip prefix. + * + * @return the remote ip prefix + */ + String getRemoteIpPrefix(); + + /** + * Gets the security group id. + * + * @return the security group id + */ + String getSecurityGroupId(); + + /** + * Gets the tenant id. + * + * @return the tenant id + */ + String getTenantId(); + + } diff --git a/core/src/main/java/org/openstack4j/model/network/SecurityGroupUpdate.java b/core/src/main/java/org/openstack4j/model/network/SecurityGroupUpdate.java index 5714f55b0..59ac6a272 100644 --- a/core/src/main/java/org/openstack4j/model/network/SecurityGroupUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/SecurityGroupUpdate.java @@ -6,7 +6,7 @@ /** * The Interface SecurityGroupUpdate. - * + *

* Created by Ayberk CAL on 17.03.2017. */ public interface SecurityGroupUpdate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/network/State.java b/core/src/main/java/org/openstack4j/model/network/State.java index e549db559..e87eb14fd 100644 --- a/core/src/main/java/org/openstack4j/model/network/State.java +++ b/core/src/main/java/org/openstack4j/model/network/State.java @@ -4,28 +4,27 @@ /** * The state of a Network (Neutron) entity - * + * * @author Jeremy Unruh */ public enum State { - ACTIVE, - DOWN, - BUILD, - ERROR, - PENDING_CREATE, - PENDING_UPDATE, - PENDING_DELETE, - UNRECOGNIZED; - - @JsonCreator - public static State forValue(String value) { - if (value != null) - { - for (State s : State.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return State.UNRECOGNIZED; - } + ACTIVE, + DOWN, + BUILD, + ERROR, + PENDING_CREATE, + PENDING_UPDATE, + PENDING_DELETE, + UNRECOGNIZED; + + @JsonCreator + public static State forValue(String value) { + if (value != null) { + for (State s : State.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return State.UNRECOGNIZED; + } } diff --git a/core/src/main/java/org/openstack4j/model/network/Subnet.java b/core/src/main/java/org/openstack4j/model/network/Subnet.java index 534c6535f..4850878f5 100644 --- a/core/src/main/java/org/openstack4j/model/network/Subnet.java +++ b/core/src/main/java/org/openstack4j/model/network/Subnet.java @@ -1,67 +1,67 @@ package org.openstack4j.model.network; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.builder.SubnetBuilder; +import java.util.List; + /** * A Subnet is a network with Pools and network based settings - * + * * @author Jeremy Unruh */ public interface Subnet extends Resource, Buildable { - /** - * @return true if DHCP is enabled for this subnet, false if not. - */ - boolean isDHCPEnabled(); + /** + * @return true if DHCP is enabled for this subnet, false if not. + */ + boolean isDHCPEnabled(); + + /** + * @return the id of the network this subnet is associated with + */ + String getNetworkId(); + + /** + * @return the DNS server names/IP + */ + List getDnsNames(); - /** - * @return the id of the network this subnet is associated with - */ - String getNetworkId(); + /** + * @return the sub-ranges of cidr available for dynamic allocation to ports + */ + List getAllocationPools(); - /** - * @return the DNS server names/IP - */ - List getDnsNames(); - /** - * @return the sub-ranges of cidr available for dynamic allocation to ports - */ - List getAllocationPools(); + /** + * @return the set of routes that should be used by devices with IPs from this subnet + */ + List getHostRoutes(); + /** + * @return the ip version used by this subnet + */ + IPVersionType getIpVersion(); - /** - * @return the set of routes that should be used by devices with IPs from this subnet - */ - List getHostRoutes(); - /** - * @return the ip version used by this subnet - */ - IPVersionType getIpVersion(); + /** + * @return the default gateway used by devices in this subnet + */ + String getGateway(); + /** + * @return the cidr representing the IP range for this subnet, based on IP version + */ + String getCidr(); - /** - * @return the default gateway used by devices in this subnet - */ - String getGateway(); + /** + * @return The IPv6 address modes specifies mechanisms for assigning IP addresses + */ + Ipv6AddressMode getIpv6AddressMode(); - /** - * @return the cidr representing the IP range for this subnet, based on IP version - */ - String getCidr(); - - /** - * @return The IPv6 address modes specifies mechanisms for assigning IP addresses - */ - Ipv6AddressMode getIpv6AddressMode(); - - /** - * @return the IPv6 router advertisement specifies whether the networking service should transmit ICMPv6 packets, for a subnet - */ - Ipv6RaMode getIpv6RaMode(); + /** + * @return the IPv6 router advertisement specifies whether the networking service should transmit ICMPv6 packets, for a subnet + */ + Ipv6RaMode getIpv6RaMode(); } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/AgentBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/AgentBuilder.java index f165876df..a6c8252e9 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/AgentBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/AgentBuilder.java @@ -12,12 +12,12 @@ *

* * @author emagnbr 2016- initial version - * */ public interface AgentBuilder extends Builder { /** * Sets the admin_state_up + * * @param state the state of admin_state_up * @return the agent builder */ diff --git a/core/src/main/java/org/openstack4j/model/network/builder/ExtraDhcpOptBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/ExtraDhcpOptBuilder.java index dc6dba670..46f0700d6 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/ExtraDhcpOptBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/ExtraDhcpOptBuilder.java @@ -4,13 +4,12 @@ import org.openstack4j.model.network.ExtraDhcpOptCreate; /** - * * @author Ales Kemr */ public interface ExtraDhcpOptBuilder extends Builder { - ExtraDhcpOptBuilder optValue(String optValue); + ExtraDhcpOptBuilder optValue(String optValue); - ExtraDhcpOptBuilder optName(String optName); + ExtraDhcpOptBuilder optName(String optName); } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetFloatingIPBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetFloatingIPBuilder.java index e66311b4e..15a98ac84 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetFloatingIPBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetFloatingIPBuilder.java @@ -9,21 +9,21 @@ * @author Nathan Anderson */ public interface NetFloatingIPBuilder extends Builder { - - /** - * sets Id of floating network - * - * @param networkId the network id - * @return the floating ip builder - */ - NetFloatingIPBuilder floatingNetworkId(String networkId); - - /** - * Port id. - * - * @param portId the port id - * @return the floating ip builder - */ - NetFloatingIPBuilder portId(String portId); - + + /** + * sets Id of floating network + * + * @param networkId the network id + * @return the floating ip builder + */ + NetFloatingIPBuilder floatingNetworkId(String networkId); + + /** + * Port id. + * + * @param portId the port id + * @return the floating ip builder + */ + NetFloatingIPBuilder portId(String portId); + } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetQuotaBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetQuotaBuilder.java index eda2d3691..a5a38a215 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetQuotaBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetQuotaBuilder.java @@ -5,46 +5,46 @@ /** * A Builder which creates a NetQuota entity - * + * * @author Jeremy Unruh */ -public interface NetQuotaBuilder extends Builder{ +public interface NetQuotaBuilder extends Builder { /** * See {@link NetQuota#getSubnet()} for details - * + * * @param subnet the max subnets allowed * @return NetQuotaBuilder */ NetQuotaBuilder subnet(int subnet); - + /** * See {@link NetQuota#getRouter()} for details - * + * * @param router the max routers allowed * @return NetQuotaBuilder */ NetQuotaBuilder router(int router); - + /** * See {@link NetQuota#getPort()} for details - * + * * @param port the max ports allowed * @return NetQuotaBuilder */ NetQuotaBuilder port(int port); - + /** * See {@link NetQuota#getNetwork()} for details - * + * * @param network the max networks allowed * @return NetQuotaBuilder */ NetQuotaBuilder network(int network); - + /** * See {@link NetQuota#getFloatingIP()} for details - * + * * @param floatingIP the max floating IPAddresses allowed * @return NetQuotaBuilder */ diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupBuilder.java index 7567d0f1c..0fb35c09d 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupBuilder.java @@ -5,29 +5,29 @@ /** * Builder for a SecurityGroup model class - * + * * @author Nathan Anderson */ public interface NetSecurityGroupBuilder extends Builder { - /** - * @see SecurityGroup#getId() - */ - NetSecurityGroupBuilder id(String id); - - /** - * @see SecurityGroup#getName() - */ - NetSecurityGroupBuilder name(String name); - - /** - * @see SecurityGroup#getDescription() - */ - NetSecurityGroupBuilder description(String description); - - /** - * @see SecurityGroup#getTenantId() - */ - NetSecurityGroupBuilder tenantId(String tenantId); - + /** + * @see SecurityGroup#getId() + */ + NetSecurityGroupBuilder id(String id); + + /** + * @see SecurityGroup#getName() + */ + NetSecurityGroupBuilder name(String name); + + /** + * @see SecurityGroup#getDescription() + */ + NetSecurityGroupBuilder description(String description); + + /** + * @see SecurityGroup#getTenantId() + */ + NetSecurityGroupBuilder tenantId(String tenantId); + } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupRuleBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupRuleBuilder.java index 0099147ab..ccf531461 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupRuleBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetSecurityGroupRuleBuilder.java @@ -5,59 +5,59 @@ /** * Builder for a SecurityGroup model class - * + * * @author Nathan Anderson */ public interface NetSecurityGroupRuleBuilder extends Builder { - /** - * @see SecurityGroupRule#getId() - */ - NetSecurityGroupRuleBuilder id(String id); - - /** - * @see SecurityGroupRule#getTenantId() - */ - NetSecurityGroupRuleBuilder tenantId(String tenantId); - - /** - * @see SecurityGroupRule#getSecurityGroupId() - */ - NetSecurityGroupRuleBuilder securityGroupId(String groupId); - - /** - * @see SecurityGroupRule#getDirection() - */ - NetSecurityGroupRuleBuilder direction(String direction); - - /** - * @see SecurityGroupRule#getEthertype() - */ - NetSecurityGroupRuleBuilder ethertype(String ethertype); - - /** - * @see SecurityGroupRule#getPortRangeMax() - */ - NetSecurityGroupRuleBuilder portRangeMax(int max); - - /** - * @see SecurityGroupRule#getPortRangeMin() - */ - NetSecurityGroupRuleBuilder portRangeMin(int min); - - /** - * @see SecurityGroupRule#getProtocol() - */ - NetSecurityGroupRuleBuilder protocol(String protocol); - - /** - * @see SecurityGroupRule#getRemoteGroupId() - */ - NetSecurityGroupRuleBuilder remoteGroupId(String remoteGroupId); - - /** - * @see SecurityGroupRule#getRemoteIpPrefix() - */ - NetSecurityGroupRuleBuilder remoteIpPrefix(String prefix); - + /** + * @see SecurityGroupRule#getId() + */ + NetSecurityGroupRuleBuilder id(String id); + + /** + * @see SecurityGroupRule#getTenantId() + */ + NetSecurityGroupRuleBuilder tenantId(String tenantId); + + /** + * @see SecurityGroupRule#getSecurityGroupId() + */ + NetSecurityGroupRuleBuilder securityGroupId(String groupId); + + /** + * @see SecurityGroupRule#getDirection() + */ + NetSecurityGroupRuleBuilder direction(String direction); + + /** + * @see SecurityGroupRule#getEthertype() + */ + NetSecurityGroupRuleBuilder ethertype(String ethertype); + + /** + * @see SecurityGroupRule#getPortRangeMax() + */ + NetSecurityGroupRuleBuilder portRangeMax(int max); + + /** + * @see SecurityGroupRule#getPortRangeMin() + */ + NetSecurityGroupRuleBuilder portRangeMin(int min); + + /** + * @see SecurityGroupRule#getProtocol() + */ + NetSecurityGroupRuleBuilder protocol(String protocol); + + /** + * @see SecurityGroupRule#getRemoteGroupId() + */ + NetSecurityGroupRuleBuilder remoteGroupId(String remoteGroupId); + + /** + * @see SecurityGroupRule#getRemoteIpPrefix() + */ + NetSecurityGroupRuleBuilder remoteIpPrefix(String prefix); + } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilder.java index 25d67e9c1..b918df0ca 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilder.java @@ -6,53 +6,53 @@ /** * A Builder which creates a Network - * + * * @author Jeremy Unruh */ public interface NetworkBuilder extends Builder { - /** - * @see Network#getName() - */ - NetworkBuilder name(String name); - - /** - * @see Network#isAdminStateUp() - */ - NetworkBuilder adminStateUp(boolean adminStateUp); - - /** - * @see Network#getNetworkType() - */ - NetworkBuilder networkType(NetworkType networkType); - - /** - * @see Network#getProviderPhyNet() - */ - NetworkBuilder physicalNetwork(String providerPhysicalNetwork); - - /** - * @see Network#getProviderSegID() - */ - NetworkBuilder segmentId(String providerSegmentationId); - - /** - * @see Network#getTenantId() - */ - NetworkBuilder tenantId(String tenantId); - - /** - * @see Network#isShared() - */ - NetworkBuilder isShared(boolean shared); - - /** - * @see Network#isRouterExternal() - */ - NetworkBuilder isRouterExternal(boolean routerExternal); - - /** - * @see Network#getAvailabilityZoneHints() - */ - NetworkBuilder addAvailabilityZoneHints(String availabilityZone); + /** + * @see Network#getName() + */ + NetworkBuilder name(String name); + + /** + * @see Network#isAdminStateUp() + */ + NetworkBuilder adminStateUp(boolean adminStateUp); + + /** + * @see Network#getNetworkType() + */ + NetworkBuilder networkType(NetworkType networkType); + + /** + * @see Network#getProviderPhyNet() + */ + NetworkBuilder physicalNetwork(String providerPhysicalNetwork); + + /** + * @see Network#getProviderSegID() + */ + NetworkBuilder segmentId(String providerSegmentationId); + + /** + * @see Network#getTenantId() + */ + NetworkBuilder tenantId(String tenantId); + + /** + * @see Network#isShared() + */ + NetworkBuilder isShared(boolean shared); + + /** + * @see Network#isRouterExternal() + */ + NetworkBuilder isRouterExternal(boolean routerExternal); + + /** + * @see Network#getAvailabilityZoneHints() + */ + NetworkBuilder addAvailabilityZoneHints(String availabilityZone); } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java b/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java index 4ef73dc5b..8f07f1ed3 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java @@ -228,6 +228,7 @@ public interface NetworkBuilders { /** * The builder to createa v2 lbaas listener + * * @return ListenerV2Builder */ public ListenerV2Builder listenerV2(); diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetworkUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetworkUpdateBuilder.java index ee5c1a249..713fd4099 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetworkUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetworkUpdateBuilder.java @@ -5,14 +5,14 @@ /** * Builds a NetworkUpdate entity - * + * * @author Jeremy Unruh */ public interface NetworkUpdateBuilder extends Builder { /** * Sets the network name - * + * * @param name the name of the network * @return the builder */ @@ -20,15 +20,15 @@ public interface NetworkUpdateBuilder extends Builder { - /** - * @see Port#getName() - */ - PortBuilder name(String name); - - /** - * @see Port#getTenantId() - */ - PortBuilder tenantId(String tenantId); - - /** - * @see Port#getTenantId() - */ - PortBuilder tenant(Tenant tenant); - - /** - * @see Port#getNetworkId() - */ - PortBuilder networkId(String networkId); - - /** - * @see Port#getDeviceId() - */ - PortBuilder deviceId(String deviceId); - - /** - * @see Port#getDeviceOwner() - */ - PortBuilder deviceOwner(String deviceOwner); - - /** - * @see Port#getMacAddress() - */ - PortBuilder macAddress(String macAddress); - - /** - * Adds a fixed IP to the current list of fixed IP Addresses - * @param address the IP Address - * @param subnetId the subnet identifier - * @return PortBuilder - * @see Port#getFixedIps() - */ - PortBuilder fixedIp(String address, String subnetId); - - /** - * Removes a fixed IP from the current list of fixed IP Addresses - * @param address the IP Address - * @param subnetId the subnet identifier - * @return PortBuilder - * - */ - PortBuilder removeFixedIp(String address, String subnetId); - - - /** - * Adds an allowed address pair to the current list of allowed addresses - * @param ipAddress the Subnet Address (i.e. 192.168.1.0/24) - * @param macAddress the MAC Address - * @return PortBuilder - * @see Port#getAllowedAddressPairs() - */ - PortBuilder allowedAddressPair(String ipAddress, String macAddress); - - - - /** - * Removes an allowed address pair from the current list of allowed addresses - * @param ipAddress the Subnet Address (i.e. 192.168.1.0/24) - * @param macAddress the MAC address - * @return PortBuilder - * @see Port#getAllowedAddressPairs() - */ - PortBuilder removeAddressPair(String ipAddress, String macAddress); - - - /** - * @see Port#isAdminStateUp() - */ - PortBuilder adminState(boolean adminStateUp); - - /** - * @see Port#getState() - */ - PortBuilder state(State state); - + /** + * @see Port#getName() + */ + PortBuilder name(String name); + + /** + * @see Port#getTenantId() + */ + PortBuilder tenantId(String tenantId); + + /** + * @see Port#getTenantId() + */ + PortBuilder tenant(Tenant tenant); + + /** + * @see Port#getNetworkId() + */ + PortBuilder networkId(String networkId); + + /** + * @see Port#getDeviceId() + */ + PortBuilder deviceId(String deviceId); + + /** + * @see Port#getDeviceOwner() + */ + PortBuilder deviceOwner(String deviceOwner); + + /** + * @see Port#getMacAddress() + */ + PortBuilder macAddress(String macAddress); + + /** + * Adds a fixed IP to the current list of fixed IP Addresses + * + * @param address the IP Address + * @param subnetId the subnet identifier + * @return PortBuilder + * @see Port#getFixedIps() + */ + PortBuilder fixedIp(String address, String subnetId); + + /** + * Removes a fixed IP from the current list of fixed IP Addresses + * + * @param address the IP Address + * @param subnetId the subnet identifier + * @return PortBuilder + */ + PortBuilder removeFixedIp(String address, String subnetId); + + + /** + * Adds an allowed address pair to the current list of allowed addresses + * + * @param ipAddress the Subnet Address (i.e. 192.168.1.0/24) + * @param macAddress the MAC Address + * @return PortBuilder + * @see Port#getAllowedAddressPairs() + */ + PortBuilder allowedAddressPair(String ipAddress, String macAddress); + + + /** + * Removes an allowed address pair from the current list of allowed addresses + * + * @param ipAddress the Subnet Address (i.e. 192.168.1.0/24) + * @param macAddress the MAC address + * @return PortBuilder + * @see Port#getAllowedAddressPairs() + */ + PortBuilder removeAddressPair(String ipAddress, String macAddress); + + + /** + * @see Port#isAdminStateUp() + */ + PortBuilder adminState(boolean adminStateUp); + + /** + * @see Port#getState() + */ + PortBuilder state(State state); + PortBuilder extraDhcpOpt(ExtraDhcpOptCreate extraDhcpOptCreate); - - PortBuilder securityGroup(String groupName); - - PortBuilder portSecurityEnabled(Boolean portSecurityEnabled); - + + PortBuilder securityGroup(String groupName); + + PortBuilder portSecurityEnabled(Boolean portSecurityEnabled); + PortBuilder hostId(String hostId); - PortBuilder vifType(String vifType); + PortBuilder vifType(String vifType); + + PortBuilder vifDetails(Map vifDetails); - PortBuilder vifDetails(Map vifDetails); + PortBuilder vNicType(String vNicType); - PortBuilder vNicType(String vNicType); + PortBuilder profile(Map profile); - PortBuilder profile(Map profile); - } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/RouterBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/RouterBuilder.java index e1b57bb23..2de8399cb 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/RouterBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/RouterBuilder.java @@ -7,70 +7,69 @@ /** * A Builder that creates a Router - * + * * @author Jeremy Unruh */ public interface RouterBuilder extends Builder { - /** - * @see Router#getId() - */ - RouterBuilder id(String id); - - /** - * @see Router#getName() - */ - RouterBuilder name(String name); - - /** - * @see Router#getTenantId() - */ - RouterBuilder tenantId(String tenantId); - - /** - * @see Router#getTenantId() - */ - RouterBuilder tenant(Tenant tenant); - - /** - * @see Router#isAdminStateUp()() - */ - RouterBuilder adminStateUp(boolean isAdminStateUp); - - /** - * @see Router#getExternalGatewayInfo() - */ - RouterBuilder externalGateway(String networkId); - - /** - * @see Router#getExternalGatewayInfo() - */ - RouterBuilder externalGateway(String networkId, Boolean enableSNAT); - - /** - * @see Router#getExternalGatewayInfo() - */ - RouterBuilder externalGateway(ExternalGateway externalGateway); - - /** - * Removes the external gateway from the router during an update operation - */ - RouterBuilder clearExternalGateway(); + /** + * @see Router#getId() + */ + RouterBuilder id(String id); - /** - * @see Router#getRoutes() - */ - RouterBuilder route(String destination, String nexthop); + /** + * @see Router#getName() + */ + RouterBuilder name(String name); - /** - * Removes the static routes from the router during an update operation - */ - RouterBuilder noRoutes(); - - /** - * - * @param distributed:true indicates a distributed router. It is available when dvr extension is enabled. - * @return - */ - RouterBuilder distributed(Boolean distributed); + /** + * @see Router#getTenantId() + */ + RouterBuilder tenantId(String tenantId); + + /** + * @see Router#getTenantId() + */ + RouterBuilder tenant(Tenant tenant); + + /** + * @see Router#isAdminStateUp()() + */ + RouterBuilder adminStateUp(boolean isAdminStateUp); + + /** + * @see Router#getExternalGatewayInfo() + */ + RouterBuilder externalGateway(String networkId); + + /** + * @see Router#getExternalGatewayInfo() + */ + RouterBuilder externalGateway(String networkId, Boolean enableSNAT); + + /** + * @see Router#getExternalGatewayInfo() + */ + RouterBuilder externalGateway(ExternalGateway externalGateway); + + /** + * Removes the external gateway from the router during an update operation + */ + RouterBuilder clearExternalGateway(); + + /** + * @see Router#getRoutes() + */ + RouterBuilder route(String destination, String nexthop); + + /** + * Removes the static routes from the router during an update operation + */ + RouterBuilder noRoutes(); + + /** + * @param distributed:true indicates a distributed router. It is available when dvr extension is enabled. + * @return + */ + RouterBuilder distributed(Boolean distributed); } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/SubnetBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/SubnetBuilder.java index 6e01b09b7..f74e5a9c5 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/SubnetBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/SubnetBuilder.java @@ -2,15 +2,11 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.identity.v3.Tenant; -import org.openstack4j.model.network.IPVersionType; -import org.openstack4j.model.network.Ipv6AddressMode; -import org.openstack4j.model.network.Ipv6RaMode; -import org.openstack4j.model.network.Network; -import org.openstack4j.model.network.Subnet; +import org.openstack4j.model.network.*; /** * A Builder which creates a Subnet - * + * * @author Jeremy Unruh */ public interface SubnetBuilder extends Builder { @@ -44,7 +40,7 @@ public interface SubnetBuilder extends Builder { * Adds a allocation pool * * @param start the starting IP - * @param end the ending IP + * @param end the ending IP * @return the builder */ SubnetBuilder addPool(String start, String end); @@ -77,24 +73,24 @@ public interface SubnetBuilder extends Builder { /** * @see Subnet#getDnsNames() */ - SubnetBuilder addDNSNameServer(String host); - - /** - * Adds a host route to this subnet - * - * @param destination the destination subnet (ex: 10.0.0.0/16) - * @param nexthop the next gateway ip adddress (ex: 192.168.0.1) - * @returnSubnetBuilder - */ - SubnetBuilder addHostRoute(String destination, String nexthop); - + SubnetBuilder addDNSNameServer(String host); + + /** + * Adds a host route to this subnet + * + * @param destination the destination subnet (ex: 10.0.0.0/16) + * @param nexthop the next gateway ip adddress (ex: 192.168.0.1) + * @returnSubnetBuilder + */ + SubnetBuilder addHostRoute(String destination, String nexthop); + /** * @see Subnet#getIpv6AddressMode() */ - SubnetBuilder ipv6AddressMode (Ipv6AddressMode ipv6AddressMode); - + SubnetBuilder ipv6AddressMode(Ipv6AddressMode ipv6AddressMode); + /** * @see Subnet#getIpv6RaMode() */ - SubnetBuilder ipv6RaMode(Ipv6RaMode ipv6RaMode); + SubnetBuilder ipv6RaMode(Ipv6RaMode ipv6RaMode); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/Ethertype.java b/core/src/main/java/org/openstack4j/model/network/ext/Ethertype.java index e753196b7..99ae7d910 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/Ethertype.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/Ethertype.java @@ -13,8 +13,7 @@ public enum Ethertype { @JsonCreator public static Ethertype forValue(String value) { - if (value != null) - { + if (value != null) { for (Ethertype s : Ethertype.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java b/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java index f88b33320..13a49df1d 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java @@ -1,77 +1,68 @@ package org.openstack4j.model.network.ext; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.network.ext.builder.FirewallBuilder; import org.openstack4j.openstack.networking.domain.ext.NeutronFirewall; +import java.util.List; + /** *

Networking (Neutron) FwaaS Firewall Extension API.

- * + * *

Represents a logical firewall resource that a tenant can instantiate and manage. A firewall is associated with one firewall policy.

- * + * * @author Vishvesh Deshmukh */ public interface Firewall extends ModelEntity, Buildable { - /** - * - * @return id : Unique identifier for the firewall. - */ - public String getId(); - - /** - * - * @return name : Human readable name for the firewall (255 characters limit). Does not have to be unique. - */ - public String getName(); + /** + * @return id : Unique identifier for the firewall. + */ + public String getId(); + + /** + * @return name : Human readable name for the firewall (255 characters limit). Does not have to be unique. + */ + public String getName(); + + /** + * @return tenantId : Owner of the Firewall. Only an administrative user can + * specify a tenant ID other than its own. + */ + public String getTenantId(); + + /** + * @return description : Human readable description for the firewall (1024 characters limit). + */ + public String getDescription(); - /** - * - * @return tenantId : Owner of the Firewall. Only an administrative user can - * specify a tenant ID other than its own. - */ - public String getTenantId(); + /** + * @return adminstateup : The administrative state of the firewall, + * which is up (true) or down (false). + */ + public Boolean isAdminStateUp(); - /** - * - * @return description : Human readable description for the firewall (1024 characters limit). - */ - public String getDescription(); - - /** - * - * @return adminstateup : The administrative state of the firewall, - * which is up (true) or down (false). - */ - public Boolean isAdminStateUp(); + /** + * @return shared : When set to True makes this firewall rule visible to tenants other + * than its owner, and can be used in firewall policies not owned by its tenant. + */ + public Boolean isShared(); - /** - * - * @return shared : When set to True makes this firewall rule visible to tenants other - * than its owner, and can be used in firewall policies not owned by its tenant. - */ - public Boolean isShared(); + /** + * @return status The status of the health monitor. Indicates whether the + * health monitor is operational. + * @see NeutronFirewall.FirewallStatus + */ + public NeutronFirewall.FirewallStatus getStatus(); - /** - * @see NeutronFirewall.FirewallStatus - * - * @return status The status of the health monitor. Indicates whether the - * health monitor is operational. - */ - public NeutronFirewall.FirewallStatus getStatus(); - - /** - * - * @return policyid : The firewall policy uuid that this firewall is associated with. - * This firewall will implement the rules contained in the firewall policy represented by this uuid. - */ - public String getPolicy(); + /** + * @return policyid : The firewall policy uuid that this firewall is associated with. + * This firewall will implement the rules contained in the firewall policy represented by this uuid. + */ + public String getPolicy(); - /** - * - * @return routerIds : A list of UUIDs for routers that are associated with the firewall. - */ - public List getRouterIds(); + /** + * @return routerIds : A list of UUIDs for routers that are associated with the firewall. + */ + public List getRouterIds(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java index 83987ad30..70af34cc9 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java @@ -1,75 +1,75 @@ package org.openstack4j.model.network.ext; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.network.ext.builder.FirewallPolicyBuilder; +import java.util.List; + /** *

Networking (Neutron) FwaaS Firewall Policy Extension API

- * - *

Represents an ordered collection of firewall rules. A firewall policy can be shared across tenants. - * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the - * relevant entity that is authorized (and can be different from the tenants which create or use the firewall policy). + * + *

Represents an ordered collection of firewall rules. A firewall policy can be shared across tenants. + * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the + * relevant entity that is authorized (and can be different from the tenants which create or use the firewall policy). *

- * + * * @author Vishvesh Deshmukh */ public interface FirewallPolicy extends ModelEntity, Buildable { - - /** - * @return id : Unique identifier for the firewall policy. - */ - public String getId(); - - /** - * @return name : Human readable name for the FirewallPolicy (255 characters limit). Does not have to be unique. - */ - public String getName(); - /** - * @return tenantId : Owner of the Firewall Policy. Only an administrative user can - * specify a tenant ID other than its own. - */ - public String getTenantId(); + /** + * @return id : Unique identifier for the firewall policy. + */ + public String getId(); + + /** + * @return name : Human readable name for the FirewallPolicy (255 characters limit). Does not have to be unique. + */ + public String getName(); + + /** + * @return tenantId : Owner of the Firewall Policy. Only an administrative user can + * specify a tenant ID other than its own. + */ + public String getTenantId(); + + /** + * @return description : Human readable description for the FirewallPolicy (1024 characters limit). + */ + public String getDescription(); + + /** + * @return shared : When set to True makes this FirewallPolicy visible to tenants other + * than its owner, and can be used in FirewallPolicy not owned by its tenant. + */ + public Boolean isShared(); + + /** + * @return audited : When set to True by the policy owner indicates that the firewall policy has been audited. + * This attribute is meant to aid in the firewall policy audit workflows. + * Each time the firewall policy or the associated firewall rules are changed, + * this attribute will be set to False and will have to be explicitly set + * to True through an update operation. + */ + public Boolean isAudited(); - /** - * @return description : Human readable description for the FirewallPolicy (1024 characters limit). - */ - public String getDescription(); + /** + * @return firewallRules(UUID)List : This is an ordered list of firewall rule uuids. + * The firewall applies the rules in the order in which they appear in this list. + */ + public List getFirewallRuleIds(); - /** - * @return shared : When set to True makes this FirewallPolicy visible to tenants other - * than its owner, and can be used in FirewallPolicy not owned by its tenant. - */ - public Boolean isShared(); - - /** - * @return audited : When set to True by the policy owner indicates that the firewall policy has been audited. - * This attribute is meant to aid in the firewall policy audit workflows. - * Each time the firewall policy or the associated firewall rules are changed, - * this attribute will be set to False and will have to be explicitly set - * to True through an update operation. - */ - public Boolean isAudited(); - - /** - * @return firewallRules(UUID)List : This is an ordered list of firewall rule uuids. - * The firewall applies the rules in the order in which they appear in this list. - */ - public List getFirewallRuleIds(); - - /** - * @return firewallList(UUID)List : This is a list of Firewalls associated with Firewall Policy. - * This is returned when a firewall rule is added or removed from a firewall policy. - */ - public List getFirewallList(); + /** + * @return firewallList(UUID)List : This is a list of Firewalls associated with Firewall Policy. + * This is returned when a firewall rule is added or removed from a firewall policy. + */ + public List getFirewallList(); - /** - * @see FirewallRule - * @return neutronFirewallRulesList : This is an ordered list of firewall rules (by uuid). - * The firewall applies the rules in the order in which they appear in this list. - */ - public List getNeutronFirewallRules(); + /** + * @return neutronFirewallRulesList : This is an ordered list of firewall rules (by uuid). + * The firewall applies the rules in the order in which they appear in this list. + * @see FirewallRule + */ + public List getNeutronFirewallRules(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java index b90da982a..b9925dcb9 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java @@ -1,51 +1,51 @@ package org.openstack4j.model.network.ext; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.network.ext.builder.FirewallPolicyUpdateBuilder; +import java.util.List; + /** *

A Builder to Update Firewall Policy of FwaaS

- * - *

Represents an ordered collection of firewall rules. A firewall policy can be shared across tenants. - * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the - * relevant entity that is authorized (and can be different from the tenants which create or use the firewall policy). + * + *

Represents an ordered collection of firewall rules. A firewall policy can be shared across tenants. + * Thus it can also be made part of an audit workflow wherein the firewall_policy can be audited by the + * relevant entity that is authorized (and can be different from the tenants which create or use the firewall policy). *

- * + * * @author Vishvesh Deshmukh */ public interface FirewallPolicyUpdate extends ModelEntity, Buildable { - - /** - * @return name : Human readable name for the FirewallPolicyUpdate (255 characters limit). Does not have to be unique. - */ - public String getName(); - - /** - * @return description : Human readable description for the FirewallPolicyUpdate (1024 characters limit). - */ - public String getDescription(); - - /** - * @return shared : When set to True makes this FirewallPolicyUpdate visible to tenants other - * than its owner, and can be used in FirewallPolicyUpdate not owned by its tenant. - */ - public Boolean isShared(); - - /** - * @return audited : When set to True by the policy owner indicates that the firewall policy has been audited. - * This attribute is meant to aid in the firewall policy audit workflows. - * Each time the firewall policy or the associated firewall rules are changed, - * this attribute will be set to False and will have to be explicitly set - * to True through an update operation. - */ - public Boolean isAudited(); - - /** - * @return firewallRules(UUID)List : This is an ordered list of firewall rule uuids. - * The firewall applies the rules in the order in which they appear in this list. - */ - public List getFirewallRuleIds(); + + /** + * @return name : Human readable name for the FirewallPolicyUpdate (255 characters limit). Does not have to be unique. + */ + public String getName(); + + /** + * @return description : Human readable description for the FirewallPolicyUpdate (1024 characters limit). + */ + public String getDescription(); + + /** + * @return shared : When set to True makes this FirewallPolicyUpdate visible to tenants other + * than its owner, and can be used in FirewallPolicyUpdate not owned by its tenant. + */ + public Boolean isShared(); + + /** + * @return audited : When set to True by the policy owner indicates that the firewall policy has been audited. + * This attribute is meant to aid in the firewall policy audit workflows. + * Each time the firewall policy or the associated firewall rules are changed, + * this attribute will be set to False and will have to be explicitly set + * to True through an update operation. + */ + public Boolean isAudited(); + + /** + * @return firewallRules(UUID)List : This is an ordered list of firewall rule uuids. + * The firewall applies the rules in the order in which they appear in this list. + */ + public List getFirewallRuleIds(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java index a2b257419..373cb41b5 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java @@ -8,99 +8,98 @@ /** *

Networking (Neutron) FwaaS Firewall Rule Extension API

- * - *

Represents a collection of attributes like ports, ip addresses which define match - * criteria and action (allow, or deny) that needs to be taken on the matched data traffic.

- * + * + *

Represents a collection of attributes like ports, ip addresses which define match + * criteria and action (allow, or deny) that needs to be taken on the matched data traffic.

+ * * @author Vishvesh Deshmukh */ public interface FirewallRule extends ModelEntity, Buildable { - /** - * @return id : Unique identifier for the firewall rule object. - */ - public String getId(); - - /** - * @return name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. - */ - public String getName(); - - /** - * @return tenantId : Owner of the Firewall Rule. Only an administrative user can - * specify a tenant ID other than its own. - */ - public String getTenantId(); - - /** - * @return description : Human readable description for the firewall rule (1024 characters limit). - */ - public String getDescription(); - - /** - * @return policyid : This is a read-only attribute which gets populated with the uuid of the firewall policy when this - * firewall rule is associated with a firewall policy. A firewall rule can be associated with one firewall policy at a time. - * The association can however be updated to a different firewall policy. This attribute can be null if the rule is not - * associated with any firewall policy. - */ - public String getPolicy(); - - /** - * @return shared : When set to True makes this firewall rule visible to tenants other than its owner, - * and can be used in firewall policies not owned by its tenant. - */ - public Boolean isShared(); - - /** - * @see NeutronFirewallRule.IPProtocol - * @return protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). - */ - public NeutronFirewallRule.IPProtocol getProtocol(); - - /** - * @see IPVersionType - * - * @return ipVersion : IP Protocol Version : Possible values are 4/6. - */ - public IPVersionType getIpVersion(); - - /** - * @return sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - */ - public String getSourceIpAddress(); - - /** - * @return destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - */ - public String getDestinationIpAddress(); - - /** - * @return sourcePort : Valid port number (integer or string), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - */ - public String getSourcePort(); - - /** - * @return destinationPort : Valid port number (integer or string), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - */ - public String getDestinationPort(); - - /** - * @return position : This is a read-only attribute that gets assigned to this rule when the rule is associated with a firewall policy. - * It indicates the position of this rule in that firewall policy. This position number starts at 1. - * The position can be null if the firewall rule is not associated with any policy. - */ - public Integer getPosition(); - - /** - * @see NeutronFirewallRule.FirewallRuleAction - * @return action : Action to be performed on the traffic matching the rule (allow, deny). - */ - public NeutronFirewallRule.FirewallRuleAction getAction(); - - /** - * @return enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off - * rules without having to disassociate the rule from the firewall policy. - */ - public Boolean isEnabled(); + /** + * @return id : Unique identifier for the firewall rule object. + */ + public String getId(); + + /** + * @return name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. + */ + public String getName(); + + /** + * @return tenantId : Owner of the Firewall Rule. Only an administrative user can + * specify a tenant ID other than its own. + */ + public String getTenantId(); + + /** + * @return description : Human readable description for the firewall rule (1024 characters limit). + */ + public String getDescription(); + + /** + * @return policyid : This is a read-only attribute which gets populated with the uuid of the firewall policy when this + * firewall rule is associated with a firewall policy. A firewall rule can be associated with one firewall policy at a time. + * The association can however be updated to a different firewall policy. This attribute can be null if the rule is not + * associated with any firewall policy. + */ + public String getPolicy(); + + /** + * @return shared : When set to True makes this firewall rule visible to tenants other than its owner, + * and can be used in firewall policies not owned by its tenant. + */ + public Boolean isShared(); + + /** + * @return protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). + * @see NeutronFirewallRule.IPProtocol + */ + public NeutronFirewallRule.IPProtocol getProtocol(); + + /** + * @return ipVersion : IP Protocol Version : Possible values are 4/6. + * @see IPVersionType + */ + public IPVersionType getIpVersion(); + + /** + * @return sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + */ + public String getSourceIpAddress(); + + /** + * @return destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + */ + public String getDestinationIpAddress(); + + /** + * @return sourcePort : Valid port number (integer or string), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + */ + public String getSourcePort(); + + /** + * @return destinationPort : Valid port number (integer or string), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + */ + public String getDestinationPort(); + + /** + * @return position : This is a read-only attribute that gets assigned to this rule when the rule is associated with a firewall policy. + * It indicates the position of this rule in that firewall policy. This position number starts at 1. + * The position can be null if the firewall rule is not associated with any policy. + */ + public Integer getPosition(); + + /** + * @return action : Action to be performed on the traffic matching the rule (allow, deny). + * @see NeutronFirewallRule.FirewallRuleAction + */ + public NeutronFirewallRule.FirewallRuleAction getAction(); + + /** + * @return enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off + * rules without having to disassociate the rule from the firewall policy. + */ + public Boolean isEnabled(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java index 5f5ce23d4..83ac323f6 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java @@ -8,80 +8,79 @@ /** *

A Builder to Update Firewall Rule of FwaaS

- * - *

Represents a collection of attributes like ports, ip addresses which define match - * criteria and action (allow, or deny) that needs to be taken on the matched data traffic.

- * + * + *

Represents a collection of attributes like ports, ip addresses which define match + * criteria and action (allow, or deny) that needs to be taken on the matched data traffic.

+ * * @author Vishvesh Deshmukh */ public interface FirewallRuleUpdate extends ModelEntity, Buildable { - - /** - * @return name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. - */ - public String getName(); - /** - * @return tenantId : Owner of the Firewall Rule. Only an administrative user can - * specify a tenant ID other than its own. - */ - public String getTenantId(); + /** + * @return name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. + */ + public String getName(); - /** - * @return description : Human readable description for the firewall rule (1024 characters limit). - */ - public String getDescription(); - - /** - * @return shared : When set to True makes this firewall rule visible to tenants other than its owner, - * and can be used in firewall policies not owned by its tenant. - */ - public Boolean isShared(); - - /** - * @see NeutronFirewallRule.IPProtocol - * @return protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). - */ - public NeutronFirewallRule.IPProtocol getProtocol(); - - /** - * @see IPVersionType - * - * @return ipVersion : IP Protocol Version : Possible values are 4/6. - */ - public IPVersionType getIpVersion(); - - /** - * @return sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - */ - public String getSourceIpAddress(); - - /** - * @return destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - */ - public String getDestinationIpAddress(); - - /** - * @return sourcePort : Valid port number (integer or string), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - */ - public String getSourcePort(); - - /** - * @return destinationPort : Valid port number (integer or string), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - */ - public String getDestinationPort(); - - /** - * @see NeutronFirewallRule.FirewallRuleAction - * @return action : Action to be performed on the traffic matching the rule (allow, deny). - */ - public NeutronFirewallRule.FirewallRuleAction getAction(); + /** + * @return tenantId : Owner of the Firewall Rule. Only an administrative user can + * specify a tenant ID other than its own. + */ + public String getTenantId(); - /** - * @return enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off - * rules without having to disassociate the rule from the firewall policy. - */ - public Boolean isEnabled(); + /** + * @return description : Human readable description for the firewall rule (1024 characters limit). + */ + public String getDescription(); + + /** + * @return shared : When set to True makes this firewall rule visible to tenants other than its owner, + * and can be used in firewall policies not owned by its tenant. + */ + public Boolean isShared(); + + /** + * @return protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). + * @see NeutronFirewallRule.IPProtocol + */ + public NeutronFirewallRule.IPProtocol getProtocol(); + + /** + * @return ipVersion : IP Protocol Version : Possible values are 4/6. + * @see IPVersionType + */ + public IPVersionType getIpVersion(); + + /** + * @return sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + */ + public String getSourceIpAddress(); + + /** + * @return destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + */ + public String getDestinationIpAddress(); + + /** + * @return sourcePort : Valid port number (integer or string), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + */ + public String getSourcePort(); + + /** + * @return destinationPort : Valid port number (integer or string), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + */ + public String getDestinationPort(); + + /** + * @return action : Action to be performed on the traffic matching the rule (allow, deny). + * @see NeutronFirewallRule.FirewallRuleAction + */ + public NeutronFirewallRule.FirewallRuleAction getAction(); + + /** + * @return enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off + * rules without having to disassociate the rule from the firewall policy. + */ + public Boolean isEnabled(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallUpdate.java index 5f9a8362b..334868f11 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallUpdate.java @@ -6,42 +6,42 @@ /** * A Builder to Update Firewall of FwaaS - * + * * @author Vishvesh Deshmukh */ public interface FirewallUpdate extends ModelEntity, Buildable { - /** - * @return tenantId : Owner of the Firewall. Only an administrative user can - * specify a tenant ID other than its own. - */ - public String getTenantId(); - - /** - * @return tenantId : Human readable name for the firewall (255 characters limit). Does not have to be unique. - */ - public String getName(); - - /** - * @return description : Human readable description for the firewall (1024 characters limit). - */ - public String getDescription(); - - /** - * @return adminstateup : The administrative state of the firewall, - * which is up (true) or down (false). - */ - public Boolean isAdminStateUp(); - - /** - * @return shared : When set to True makes this firewall rule visible to tenants other - * than its owner, and can be used in firewall policies not owned by its tenant. - */ - public Boolean isShared(); - - /** - * @return policyid : The firewall policy uuid that this firewall is associated with. - * This firewall will implement the rules contained in the firewall policy represented by this uuid. - */ - public String getPolicy(); + /** + * @return tenantId : Owner of the Firewall. Only an administrative user can + * specify a tenant ID other than its own. + */ + public String getTenantId(); + + /** + * @return tenantId : Human readable name for the firewall (255 characters limit). Does not have to be unique. + */ + public String getName(); + + /** + * @return description : Human readable description for the firewall (1024 characters limit). + */ + public String getDescription(); + + /** + * @return adminstateup : The administrative state of the firewall, + * which is up (true) or down (false). + */ + public Boolean isAdminStateUp(); + + /** + * @return shared : When set to True makes this firewall rule visible to tenants other + * than its owner, and can be used in firewall policies not owned by its tenant. + */ + public Boolean isShared(); + + /** + * @return policyid : The firewall policy uuid that this firewall is associated with. + * This firewall will implement the rules contained in the firewall policy represented by this uuid. + */ + public String getPolicy(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FlowClassifier.java b/core/src/main/java/org/openstack4j/model/network/ext/FlowClassifier.java index ee2f3d498..c77a14210 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FlowClassifier.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FlowClassifier.java @@ -1,16 +1,15 @@ package org.openstack4j.model.network.ext; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.ext.builder.FlowClassifierBuilder; +import java.util.Map; + /** * A Flow Classifier Entity. * * @author Dmitry Gerenrot. - * */ public interface FlowClassifier extends Resource, Buildable { @@ -23,6 +22,7 @@ public interface FlowClassifier extends Resource, Buildable { + Buildable { - /** - * - * @return id the healthMonitor identifier - */ - public String getId(); + /** + * @return id the healthMonitor identifier + */ + public String getId(); - /** - * - * @return tenantId Owner of the VIP. Only an administrative user can - * specify a tenant ID other than its own. - */ - public String getTenantId(); + /** + * @return tenantId Owner of the VIP. Only an administrative user can + * specify a tenant ID other than its own. + */ + public String getTenantId(); - /** - * - * @return type The type of probe sent by the load balancer to verify the - * member state, which is PING, TCP, HTTP, or HTTPS. - */ - public HealthMonitorType getType(); + /** + * @return type The type of probe sent by the load balancer to verify the + * member state, which is PING, TCP, HTTP, or HTTPS. + */ + public HealthMonitorType getType(); - /** - * - * @return delay The time, in seconds, between sending probes to members. - */ - public Integer getDelay(); + /** + * @return delay The time, in seconds, between sending probes to members. + */ + public Integer getDelay(); - /** - * @return timeout The maximum number of seconds for a monitor to wait for a - * connection to be established before it times out. This value must - * be less than the delay value. - */ - public Integer getTimeout(); + /** + * @return timeout The maximum number of seconds for a monitor to wait for a + * connection to be established before it times out. This value must + * be less than the delay value. + */ + public Integer getTimeout(); - /** - * - * @return maxRetries Number of allowed connection failures before changing - * the status of the member to INACTIVE. A valid value is from 1 to - * 10. - */ - public Integer getMaxRetries(); + /** + * @return maxRetries Number of allowed connection failures before changing + * the status of the member to INACTIVE. A valid value is from 1 to + * 10. + */ + public Integer getMaxRetries(); - /** - * Optional. - * - * @return httpMethod The HTTP method that the monitor uses for requests. - */ - public String getHttpMethod(); + /** + * Optional. + * + * @return httpMethod The HTTP method that the monitor uses for requests. + */ + public String getHttpMethod(); - /** - * Optional. - * - * @return urlPath The HTTP path of the request sent by the monitor to test - * the health of a member. Must be a string beginning with a forward - * slash (/). - */ - public String getUrlPath(); + /** + * Optional. + * + * @return urlPath The HTTP path of the request sent by the monitor to test + * the health of a member. Must be a string beginning with a forward + * slash (/). + */ + public String getUrlPath(); - /** - * Optional. - * - * @return expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. - */ - public String getExpectedCodes(); + /** + * Optional. + * + * @return expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. + */ + public String getExpectedCodes(); - /** - * Optional. - * - * @return adminstateup The administrative state of the health monitor, - * which is up (true) or down (false). - */ - public boolean isAdminStateUp(); + /** + * Optional. + * + * @return adminstateup The administrative state of the health monitor, + * which is up (true) or down (false). + */ + public boolean isAdminStateUp(); - /** - * @return status The status of the health monitor. Indicates whether the - * health monitor is operational. - */ - public String getStatus(); + /** + * @return status The status of the health monitor. Indicates whether the + * health monitor is operational. + */ + public String getStatus(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorAssociate.java b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorAssociate.java index 1136358b3..9dec23fef 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorAssociate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorAssociate.java @@ -6,15 +6,14 @@ /** * An entity used to associate a healthMonitor with a lb pool - * - * @author liujunpeng * + * @author liujunpeng */ public interface HealthMonitorAssociate extends ModelEntity, - Buildable { + Buildable { - /** - * @return id the healthMonitor identifier - */ - public String getId(); + /** + * @return id the healthMonitor identifier + */ + public String getId(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorType.java b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorType.java index 46b5bb7f7..3a075d1c4 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorType.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorType.java @@ -1,19 +1,18 @@ package org.openstack4j.model.network.ext; import com.fasterxml.jackson.annotation.JsonCreator; + /** * A Health Monitor Type - * - * @author liujunpeng * + * @author liujunpeng */ public enum HealthMonitorType { - PING, TCP, HTTP, HTTPS; - + PING, TCP, HTTP, HTTPS; + @JsonCreator public static HealthMonitorType forValue(String value) { - if (value != null) - { + if (value != null) { for (HealthMonitorType s : HealthMonitorType.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorUpdate.java index 1247fa6ac..2df6f25a6 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorUpdate.java @@ -6,63 +6,61 @@ /** * An entity used to update a healthMonitor - * - * @author liujunpeng * + * @author liujunpeng */ public interface HealthMonitorUpdate extends ModelEntity, - Buildable { + Buildable { + + /** + * Optional. + * + * @return delay The time, in seconds, between sending probes to members + */ + public Integer getDelay(); + + /** + * Optional. + * + * @return urlPath The HTTP path of the request sent by the monitor to test + * the health of a member. Must be a string beginning with a forward + * slash (/). + */ + public String getUrlPath(); + + /** + * @return timeout The maximum number of seconds for a monitor to wait for a + * connection to be established before it times out. This value must + * be less than the delay value. + */ + public Integer getTimeout(); + + /** + * @return maxRetries Number of allowed connection failures before changing + * the status of the member to INACTIVE. A valid value is from 1 to + * 10. + */ + public Integer getMaxRetries(); + + /** + * Optional. + * + * @return httpMethod The HTTP method that the monitor uses for requests. + */ + public String getHttpMethod(); - /** - * Optional. - * - * @return delay The time, in seconds, between sending probes to members - */ - public Integer getDelay(); + /** + * Optional. + * + * @return expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. + */ + public String getExpectedCodes(); - /** - * Optional. - * - * @return urlPath The HTTP path of the request sent by the monitor to test - * the health of a member. Must be a string beginning with a forward - * slash (/). - */ - public String getUrlPath(); - - /** - * @return timeout The maximum number of seconds for a monitor to wait for a - * connection to be established before it times out. This value must - * be less than the delay value. - */ - public Integer getTimeout(); - - /** - * - * @return maxRetries Number of allowed connection failures before changing - * the status of the member to INACTIVE. A valid value is from 1 to - * 10. - */ - public Integer getMaxRetries(); - - /** - * Optional. - * - * @return httpMethod The HTTP method that the monitor uses for requests. - */ - public String getHttpMethod(); - - /** - * Optional. - * - * @return expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. - */ - public String getExpectedCodes(); - - /** - * Optional. - * - * @return adminstateup The administrative state of the health monitor, - * which is up (true) or down (false). - */ - public boolean isAdminStateUp(); + /** + * Optional. + * + * @return adminstateup The administrative state of the health monitor, + * which is up (true) or down (false). + */ + public boolean isAdminStateUp(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2.java b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2.java index f38b195fd..9fb0a4413 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2.java @@ -9,9 +9,10 @@ /** * A healthMonitor of a Lbaas V2 pool + * * @author emjburns */ -public interface HealthMonitorV2 extends ModelEntity, Buildable{ +public interface HealthMonitorV2 extends ModelEntity, Buildable { /** * @return id the healthMonitor identifier */ @@ -19,14 +20,13 @@ public interface HealthMonitorV2 extends ModelEntity, Buildable getPools(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2Update.java b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2Update.java index c118f7054..2ac2ae346 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2Update.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/HealthMonitorV2Update.java @@ -21,23 +21,22 @@ public interface HealthMonitorV2Update extends ModelEntity, Buildable { - /** - * - * @return id. The unique ID for the pool. - */ - public String getId(); - /** - * - * @return tenantId. - * Owner of the pool. Only an administrative user can specify a tenant ID other than its own. - */ - public String getTenantId(); - /** - * - * @return vip Id. - */ - public String getVipId(); - /** - * - * @return Pool name. Does not have to be unique. - */ - public String getName(); - /** - * - * @return Description for the pool. - */ - public String getDescription(); - /** - * - * @return subnetId The ID of the subnet on which to allocate the VIP address. - */ - public String getSubnetId(); - /** - * - * @return The protocol of the pool, which is TCP, HTTP, or HTTPS. - */ - public Protocol getProtocol(); - /** - * - * @return loadbalance provider,such as haproxy - */ - public String getProvider(); - /** - * - * @return The load-balancer algorithm, which is round-robin, least-connections, and so on. This value, which must be supported, is dependent on the load-balancer provider. Round-robin must be supported. - */ - public LbMethod getLbMethod(); - /** - * - * @return List of members that belong to the pool. - */ - public List getMembers(); - - /** - * - * @return List of health monitors that associated to the pool. - */ - public List getHealthMonitors(); - /** - * - * @return The administrative state of the lb pool, which is up (true) or - * down (false). - */ - public boolean isAdminStateUp(); - /** - * - * @return status The status of the lb pool. Indicates whether the lb pool is - * operational. - */ - public String getStatus(); + /** + * @return id. The unique ID for the pool. + */ + public String getId(); + + /** + * @return tenantId. + * Owner of the pool. Only an administrative user can specify a tenant ID other than its own. + */ + public String getTenantId(); + + /** + * @return vip Id. + */ + public String getVipId(); + + /** + * @return Pool name. Does not have to be unique. + */ + public String getName(); + + /** + * @return Description for the pool. + */ + public String getDescription(); + + /** + * @return subnetId The ID of the subnet on which to allocate the VIP address. + */ + public String getSubnetId(); + + /** + * @return The protocol of the pool, which is TCP, HTTP, or HTTPS. + */ + public Protocol getProtocol(); + + /** + * @return loadbalance provider,such as haproxy + */ + public String getProvider(); + + /** + * @return The load-balancer algorithm, which is round-robin, least-connections, and so on. This value, which must be supported, is dependent on the load-balancer provider. Round-robin must be supported. + */ + public LbMethod getLbMethod(); + + /** + * @return List of members that belong to the pool. + */ + public List getMembers(); + + /** + * @return List of health monitors that associated to the pool. + */ + public List getHealthMonitors(); + + /** + * @return The administrative state of the lb pool, which is up (true) or + * down (false). + */ + public boolean isAdminStateUp(); + + /** + * @return status The status of the lb pool. Indicates whether the lb pool is + * operational. + */ + public String getStatus(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java index 41f73768c..8bdf8793f 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java @@ -2,28 +2,24 @@ import org.openstack4j.model.ModelEntity; -public interface LbPoolStats extends ModelEntity{ - /** - * - * @return The inbound bytes of the loadbalancer. - */ - public Long getBytesIn(); +public interface LbPoolStats extends ModelEntity { + /** + * @return The inbound bytes of the loadbalancer. + */ + public Long getBytesIn(); - /** - * - * @return The inbound bytes of the loadbalancer. - */ - public Long getBytesOut(); + /** + * @return The inbound bytes of the loadbalancer. + */ + public Long getBytesOut(); - /** - * - * @return The number of total connections of the loadbalancer. - */ - public Integer getTotalConnections(); + /** + * @return The number of total connections of the loadbalancer. + */ + public Integer getTotalConnections(); - /** - * - * @return The number of active connections of the loadbalancer. - */ - public Integer getActiveConnections(); + /** + * @return The number of active connections of the loadbalancer. + */ + public Integer getActiveConnections(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java index 07299a5c1..4fbd782e7 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java @@ -5,31 +5,30 @@ import org.openstack4j.model.network.ext.builder.LbPoolUpdateBuilder; /** - * A entity used to update a lb pool - * @author liujunpeng + * A entity used to update a lb pool * + * @author liujunpeng */ public interface LbPoolUpdate extends ModelEntity, Buildable { - /** - * - * @return The administrative state of the lb pool, which is up (true) or - * down (false). - */ - public boolean isAdminStateUp(); - /** - * - * @return Pool name. Does not have to be unique. - */ - public String getName(); - /** - * - * @return The load-balancer algorithm, which is round-robin, least-connections, and so on. This value, which must be supported, is dependent on the load-balancer provider. Round-robin must be supported. - */ - public LbMethod getLbMethod(); - /** - * - * @return Description for the pool. - */ - public String getDescription(); + /** + * @return The administrative state of the lb pool, which is up (true) or + * down (false). + */ + public boolean isAdminStateUp(); + + /** + * @return Pool name. Does not have to be unique. + */ + public String getName(); + + /** + * @return The load-balancer algorithm, which is round-robin, least-connections, and so on. This value, which must be supported, is dependent on the load-balancer provider. Round-robin must be supported. + */ + public LbMethod getLbMethod(); + + /** + * @return Description for the pool. + */ + public String getDescription(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2.java b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2.java index 43f164b02..9458eb5c0 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2.java @@ -9,6 +9,7 @@ /** * A v2 loadbanlance pool + * * @author emjburns */ public interface LbPoolV2 extends ModelEntity, Buildable { @@ -44,19 +45,19 @@ public interface LbPoolV2 extends ModelEntity, Buildable { LbMethod getLbMethod(); /** - * * @return SessionPersistence */ SessionPersistence getSessionPersistence(); /** * @return The administrative state of the lb pool, which is up (true) or - * down (false). + * down (false). */ boolean isAdminStateUp(); /** * Listeners associated with the pool + * * @return listeners associated with the pool */ List getListeners(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2Update.java b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2Update.java index f7c854757..17788ff60 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2Update.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolV2Update.java @@ -6,37 +6,35 @@ /** * An entity for updating a lbaas v2 lb pool + * * @author emjburns */ public interface LbPoolV2Update extends ModelEntity, Buildable { /** - * * @return Pool name. Does not have to be unique. */ public String getName(); /** - * * @return Description for the pool. */ public String getDescription(); /** - * * @return The administrative state of the lb pool, which is up (true) or - * down (false). + * down (false). */ public boolean isAdminStateUp(); /** - * * @return The load-balancer algorithm, which is round-robin, least-connections, and so on. This value, which must be supported, is dependent on the load-balancer provider. Round-robin must be supported. */ public LbMethod getLbMethod(); /** * Optional + * * @see Vip#getSessionPersistence() */ public SessionPersistence getSessionPersistence(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LbProvisioningStatus.java b/core/src/main/java/org/openstack4j/model/network/ext/LbProvisioningStatus.java index 3cd21ee25..8b8ab275c 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LbProvisioningStatus.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LbProvisioningStatus.java @@ -17,8 +17,7 @@ public enum LbProvisioningStatus { @JsonCreator public static LbProvisioningStatus forValue(String value) { - if (value != null) - { + if (value != null) { for (LbProvisioningStatus s : LbProvisioningStatus.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/network/ext/ListenerProtocol.java b/core/src/main/java/org/openstack4j/model/network/ext/ListenerProtocol.java index dbb40e8c3..188aa7b8f 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/ListenerProtocol.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/ListenerProtocol.java @@ -4,6 +4,7 @@ /** * Protocol options for lbaas v2 listener + * * @author emjburns */ public enum ListenerProtocol { @@ -14,8 +15,7 @@ public enum ListenerProtocol { @JsonCreator public static ListenerProtocol forValue(String value) { - if (value != null) - { + if (value != null) { for (ListenerProtocol s : ListenerProtocol.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2.java b/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2.java index 8dd9cd3a3..a66a1a284 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2.java @@ -11,6 +11,7 @@ /** * A listener for v2 loadbalancer + * * @author emjburns */ @JsonDeserialize(as = NeutronListenerV2.class) @@ -70,7 +71,7 @@ public interface ListenerV2 extends ModelEntity, Buildable { /** * @return The administrative state of the listener, which is up (true) or - * down (false). + * down (false). */ boolean isAdminStateUp(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2Update.java b/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2Update.java index f583c74f9..fa071344a 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2Update.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/ListenerV2Update.java @@ -6,35 +6,41 @@ /** * An entity used to update an lbaas v2 listener + * * @author emjburns */ public interface ListenerV2Update extends ModelEntity, Buildable { /** * Optional + * * @see ListenerV2#isAdminStateUp() */ public boolean isAdminStateUp(); /** * Optional + * * @see ListenerV2#getDescription() */ public String getDescription(); /** * Optional + * * @see ListenerV2#getName() */ public String getName(); /** * Optional + * * @see ListenerV2#getConnectionLimit() */ public Integer getConnectionLimit(); /** * Optional + * * @see ListenerV2#getDefaultTlsContainerRef() */ public String getDefaultTlsContainerRef(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LoadBalancerV2.java b/core/src/main/java/org/openstack4j/model/network/ext/LoadBalancerV2.java index b0723f0dc..055cffd00 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LoadBalancerV2.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LoadBalancerV2.java @@ -9,9 +9,10 @@ /** * An entity used to update an lbaas v2 loadbalancer + * * @author emjburns */ -public interface LoadBalancerV2 extends ModelEntity, Buildable { +public interface LoadBalancerV2 extends ModelEntity, Buildable { /** * @return id. The unique ID for the loadbalancer. */ @@ -50,7 +51,7 @@ public interface LoadBalancerV2 extends ModelEntity, Buildable { /** * Optional + * * @see LoadBalancerV2#getDescription() */ public String getDescription(); /** * Optional + * * @see LoadBalancerV2#getName() */ public String getName(); /** * Optional + * * @see LoadBalancerV2#isAdminStateUp() */ public boolean isAdminStateUp(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/Member.java b/core/src/main/java/org/openstack4j/model/network/ext/Member.java index dd7b8b44d..56ed44e62 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/Member.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/Member.java @@ -3,58 +3,54 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.network.ext.builder.MemberBuilder; + /** * A member of a Lbaas pool + * * @author liujunpeng */ public interface Member extends ModelEntity, Buildable { - /** - * - * @return status The status of the member. Indicates whether the member is - * operational. - */ - public String getStatus(); - - /** - * @return address the IP address of a member - */ - public String getAddress(); - - /** - * - * @return The administrative state of the member, which is up (true) or - * down (false). - */ - public boolean isAdminStateUp(); - - /** - * - * @return the id of a tenant. Owner of the member. - */ - public String getTenantId(); - - /** - * - * @return the member identifier - */ - public String getId(); - - /** - * - * @return The port on which the application is hosted.such as 80 - */ - public Integer getProtocolPort(); - - /** - * - * @return Weight of member.1~256 - */ - public Integer getWeight(); - - /** - * @return The Loadbalance pool identifier - */ - public String getPoolId(); - + /** + * @return status The status of the member. Indicates whether the member is + * operational. + */ + public String getStatus(); + + /** + * @return address the IP address of a member + */ + public String getAddress(); + + /** + * @return The administrative state of the member, which is up (true) or + * down (false). + */ + public boolean isAdminStateUp(); + + /** + * @return the id of a tenant. Owner of the member. + */ + public String getTenantId(); + + /** + * @return the member identifier + */ + public String getId(); + + /** + * @return The port on which the application is hosted.such as 80 + */ + public Integer getProtocolPort(); + + /** + * @return Weight of member.1~256 + */ + public Integer getWeight(); + + /** + * @return The Loadbalance pool identifier + */ + public String getPoolId(); + } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java index fe5989376..94f9ad809 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java @@ -3,24 +3,27 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.network.ext.builder.MemberUpdateBuilder; + /** * An entity used to update a member of a pool + * * @author liujunpeng */ public interface MemberUpdate extends ModelEntity, Buildable { - - /** - * @see Member#isAdminStateUp() - */ - public boolean isAdminStateUp(); - - /** - * @see Member#getWeight() - */ - public Integer getWeight(); - /** - * @see Member#getPoolId() - */ - public String getPoolId(); + + /** + * @see Member#isAdminStateUp() + */ + public boolean isAdminStateUp(); + + /** + * @see Member#getWeight() + */ + public Integer getWeight(); + + /** + * @see Member#getPoolId() + */ + public String getPoolId(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/MemberV2.java b/core/src/main/java/org/openstack4j/model/network/ext/MemberV2.java index a925ec8e3..244ccba32 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/MemberV2.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/MemberV2.java @@ -6,9 +6,10 @@ /** * A member of a Lbaas V2 pool + * * @author emjburns */ -public interface MemberV2 extends ModelEntity, Buildable { +public interface MemberV2 extends ModelEntity, Buildable { /** * @return the member identifier */ @@ -41,7 +42,7 @@ public interface MemberV2 extends ModelEntity, Buildable { /** * @return The administrative state of the member, which is up (true) or - * down (false). + * down (false). */ boolean isAdminStateUp(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/MemberV2Update.java b/core/src/main/java/org/openstack4j/model/network/ext/MemberV2Update.java index 865008f00..638d3ef43 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/MemberV2Update.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/MemberV2Update.java @@ -6,6 +6,7 @@ /** * An entity used to update a member of an lbaas v2 pool + * * @author emjburns */ public interface MemberV2Update extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/network/ext/PortChain.java b/core/src/main/java/org/openstack4j/model/network/ext/PortChain.java index 890b0f2e1..104412ef4 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/PortChain.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/PortChain.java @@ -1,17 +1,16 @@ package org.openstack4j.model.network.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.ext.builder.PortChainBuilder; +import java.util.List; +import java.util.Map; + /** * A Port Chain Entity. * * @author Dmitry Gerenrot. - * */ public interface PortChain extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/network/ext/PortPair.java b/core/src/main/java/org/openstack4j/model/network/ext/PortPair.java index 20534a793..215f6e726 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/PortPair.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/PortPair.java @@ -1,16 +1,15 @@ package org.openstack4j.model.network.ext; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.ext.builder.PortPairBuilder; +import java.util.Map; + /** * A Port Pair Entity. * * @author Dmitry Gerenrot. - * */ public interface PortPair extends Resource, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/network/ext/PortPairGroup.java b/core/src/main/java/org/openstack4j/model/network/ext/PortPairGroup.java index 865d9283c..02cfdb4fa 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/PortPairGroup.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/PortPairGroup.java @@ -1,17 +1,16 @@ package org.openstack4j.model.network.ext; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; import org.openstack4j.model.network.ext.builder.PortPairGroupBuilder; +import java.util.List; +import java.util.Map; + /** * A Port Pair Group Entity. * * @author Dmitry Gerenrot. - * */ public interface PortPairGroup extends Resource, Buildable { @@ -27,7 +26,7 @@ public interface PortPairGroup extends Resource, Buildable /** * @return Dictionary of parameters for this group. - * Possible keys: lb_fields or service_type. Check openstack documentation. + * Possible keys: lb_fields or service_type. Check openstack documentation. */ Map getPortPairGroupParameters(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/Protocol.java b/core/src/main/java/org/openstack4j/model/network/ext/Protocol.java index d6d57e0ed..73d7fda69 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/Protocol.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/Protocol.java @@ -12,8 +12,7 @@ public enum Protocol { @JsonCreator public static Protocol forValue(String value) { - if (value != null) - { + if (value != null) { for (Protocol s : Protocol.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistence.java b/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistence.java index 99a3ec246..a7c814bac 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistence.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistence.java @@ -10,21 +10,23 @@ * used, the session_persistence parameter does not appear in the API response. * To clear session persistence for the VIP, set the session_persistence * parameter to null in a VIP update request. - * - * @author liujunpeng * + * @author liujunpeng */ -public interface SessionPersistence extends ModelEntity,Buildable{ +public interface SessionPersistence extends ModelEntity, Buildable { + + /** + * optional + * + * @return cookie name + */ + public String getCookieName(); - /** - * optional - * @return cookie name - */ - public String getCookieName(); - /** - * required - * @return type. APP_COOKIE,HTTP_COOKIE,SOURCE_IP - */ - public SessionPersistenceType getType(); + /** + * required + * + * @return type. APP_COOKIE,HTTP_COOKIE,SOURCE_IP + */ + public SessionPersistenceType getType(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistenceType.java b/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistenceType.java index 644dcf53e..664e7e734 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistenceType.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/SessionPersistenceType.java @@ -1,21 +1,20 @@ package org.openstack4j.model.network.ext; import com.fasterxml.jackson.annotation.JsonCreator; + /** * SessionPersistence type - * - * @author liujunpeng * + * @author liujunpeng */ public enum SessionPersistenceType { - APP_COOKIE, + APP_COOKIE, HTTP_COOKIE, SOURCE_IP; - @JsonCreator + @JsonCreator public static SessionPersistenceType forValue(String value) { - if (value != null) - { + if (value != null) { for (SessionPersistenceType s : SessionPersistenceType.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/network/ext/Vip.java b/core/src/main/java/org/openstack4j/model/network/ext/Vip.java index d90fb834b..36073866c 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/Vip.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/Vip.java @@ -6,97 +6,84 @@ /** * a vip of a pool - * + * * @author liujunpeng */ public interface Vip extends ModelEntity, Buildable { - /** - * - * @return The IP address of the VIP. - */ - public String getAddress(); - - /** - * @return The administrative state of the VIP. A valid value is true (UP) - * or false (DOWN). - */ - public boolean isAdminStateUp(); - - /** - * - * @return connectionLimit.The maximum number of connections allowed for the - * VIP. Default is -1, meaning no limit. - */ - public Integer getConnectionLimit(); - - /** - * @return Human-readable description for the VIP - */ - public String getDescription(); - - /** - * - * - * @return The unique ID for the VIP. - */ - public String getId(); - - /** - * - * - * @return Human-readable name for the VIP. Does not have to be unique. - */ - public String getName(); - - /** - * - * @return The ID of the pool with which the VIP is associated. - */ - public String getPoolId(); - - /** - * - * @return The protocol of the VIP address. A valid value is TCP, HTTP, or - * HTTPS. - */ - public Protocol getProtocol(); - - /** - * - * @return The port on which to listen to client traffic that is associated - * with the VIP address. A valid value is from 1 to 65535. - */ - public Integer getProtocolPort(); - - /** - * - * @return SessionPersistence.Session persistence parameters for the VIP. - * Omit the session_persistence parameter to prevent session - * persistence. When no session persistence is used, the - * session_persistence parameter does not appear in the API - * response. To clear session persistence for the VIP, set the - * session_persistence parameter to null in a VIP update request. - */ - public SessionPersistence getSessionPersistence(); - - /** - * - * @return status.The status of the VIP. Indicates whether the VIP is - * operational. - */ - public String getStatus(); - - /** - * - * @return The ID of the subnet on which to allocate the VIP address. - */ - public String getSubnetId(); - - /** - * - * @return The Tenant Id.Owner of the VIP. - */ - public String getTenantId(); - - + /** + * @return The IP address of the VIP. + */ + public String getAddress(); + + /** + * @return The administrative state of the VIP. A valid value is true (UP) + * or false (DOWN). + */ + public boolean isAdminStateUp(); + + /** + * @return connectionLimit.The maximum number of connections allowed for the + * VIP. Default is -1, meaning no limit. + */ + public Integer getConnectionLimit(); + + /** + * @return Human-readable description for the VIP + */ + public String getDescription(); + + /** + * @return The unique ID for the VIP. + */ + public String getId(); + + /** + * @return Human-readable name for the VIP. Does not have to be unique. + */ + public String getName(); + + /** + * @return The ID of the pool with which the VIP is associated. + */ + public String getPoolId(); + + /** + * @return The protocol of the VIP address. A valid value is TCP, HTTP, or + * HTTPS. + */ + public Protocol getProtocol(); + + /** + * @return The port on which to listen to client traffic that is associated + * with the VIP address. A valid value is from 1 to 65535. + */ + public Integer getProtocolPort(); + + /** + * @return SessionPersistence.Session persistence parameters for the VIP. + * Omit the session_persistence parameter to prevent session + * persistence. When no session persistence is used, the + * session_persistence parameter does not appear in the API + * response. To clear session persistence for the VIP, set the + * session_persistence parameter to null in a VIP update request. + */ + public SessionPersistence getSessionPersistence(); + + /** + * @return status.The status of the VIP. Indicates whether the VIP is + * operational. + */ + public String getStatus(); + + /** + * @return The ID of the subnet on which to allocate the VIP address. + */ + public String getSubnetId(); + + /** + * @return The Tenant Id.Owner of the VIP. + */ + public String getTenantId(); + + } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java index 5e0923e22..9d665c49f 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java @@ -6,50 +6,50 @@ /** * An entity used to update a vip - * + * * @author liujunpeng */ public interface VipUpdate extends ModelEntity, Buildable { - /** - * Optional - * - * @see Vip#isAdminStateUp() - */ - public boolean isAdminStateUp(); - - /** - * Optional - * - * @see Vip#getConnectionLimit() - */ - public Integer getConnectionLimit(); - - /** - * Optional - * - * @see Vip#getDescription() - */ - public String getDescription(); - - /** - * Optional - * - * @see Vip#getName() - */ - public String getName(); - - /** - * Optional - * - * @see Vip#getPoolId() - */ - public String getPoolId(); - - /** - * Optional - * - * @see Vip#getSessionPersistence() - */ - public SessionPersistence getSessionPersistence(); + /** + * Optional + * + * @see Vip#isAdminStateUp() + */ + public boolean isAdminStateUp(); + + /** + * Optional + * + * @see Vip#getConnectionLimit() + */ + public Integer getConnectionLimit(); + + /** + * Optional + * + * @see Vip#getDescription() + */ + public String getDescription(); + + /** + * Optional + * + * @see Vip#getName() + */ + public String getName(); + + /** + * Optional + * + * @see Vip#getPoolId() + */ + public String getPoolId(); + + /** + * Optional + * + * @see Vip#getSessionPersistence() + */ + public SessionPersistence getSessionPersistence(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java index 0e577ec95..bb13d099f 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java @@ -1,60 +1,61 @@ package org.openstack4j.model.network.ext.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.Firewall; +import java.util.List; + /** * A Builder to Create Firewall of FwaaS - * + * * @author Vishvesh Deshmukh */ public interface FirewallBuilder extends Builder { - /** - * @param tenantId : Owner of the Firewall. Only an administrative user can - * specify a tenant ID other than its own. - * @return FirewallBuilder - */ - public FirewallBuilder tenantId(String tenantId); - - /** - * @param name : Human readable name for the firewall (255 characters limit). Does not have to be unique. - * @return FirewallBuilder - */ - public FirewallBuilder name(String name); - - /** - * @param description : Human readable description for the firewall (1024 characters limit). - * @return FirewallBuilder - */ - public FirewallBuilder description(String description); - - /** - * @param adminstateup : The administrative state of the firewall, - * which is up (true) or down (false). - * @return FirewallBuilder - */ - public FirewallBuilder adminStateUp(Boolean adminStateUp); - - /** - * shared : When set to True makes this firewall rule visible to tenants other - * than its owner, and can be used in firewall policies not owned by its tenant. - * @return FirewallBuilder - */ - public FirewallBuilder shared(Boolean shared); - - /** - * @param policyid : The firewall policy uuid that this firewall is associated with. - * This firewall will implement the rules contained in the firewall policy represented by this uuid. - * @return FirewallBuilder - */ - public FirewallBuilder policy(String policyId); - - /** - * @param routerIds : A list of UUIDs for routers that are associated with the firewall. - * @return FirewallBuilder - */ - public FirewallBuilder routerIds(List routerIds); + /** + * @param tenantId : Owner of the Firewall. Only an administrative user can + * specify a tenant ID other than its own. + * @return FirewallBuilder + */ + public FirewallBuilder tenantId(String tenantId); + + /** + * @param name : Human readable name for the firewall (255 characters limit). Does not have to be unique. + * @return FirewallBuilder + */ + public FirewallBuilder name(String name); + + /** + * @param description : Human readable description for the firewall (1024 characters limit). + * @return FirewallBuilder + */ + public FirewallBuilder description(String description); + + /** + * @param adminstateup : The administrative state of the firewall, + * which is up (true) or down (false). + * @return FirewallBuilder + */ + public FirewallBuilder adminStateUp(Boolean adminStateUp); + + /** + * shared : When set to True makes this firewall rule visible to tenants other + * than its owner, and can be used in firewall policies not owned by its tenant. + * + * @return FirewallBuilder + */ + public FirewallBuilder shared(Boolean shared); + + /** + * @param policyid : The firewall policy uuid that this firewall is associated with. + * This firewall will implement the rules contained in the firewall policy represented by this uuid. + * @return FirewallBuilder + */ + public FirewallBuilder policy(String policyId); + + /** + * @param routerIds : A list of UUIDs for routers that are associated with the firewall. + * @return FirewallBuilder + */ + public FirewallBuilder routerIds(List routerIds); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java index 8e08f7afb..8144c7a28 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java @@ -1,57 +1,57 @@ package org.openstack4j.model.network.ext.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.FirewallPolicy; +import java.util.List; + /** * A Builder to Create FirewallPolicy of FwaaS. - * + * * @author Vishvesh Deshmukh */ public interface FirewallPolicyBuilder extends Builder { - /** - * @param name : Human readable name for the FirewallPolicy (255 characters limit). Does not have to be unique. - * @return FirewallPolicyBuilder - */ - public FirewallPolicyBuilder name(String name); - - /** - * @param tenantId : Owner of the FirewallPolicy. Only an administrative user can - * specify a tenant ID other than its own. - * @return FirewallPolicyBuilder - */ - public FirewallPolicyBuilder tenantId(String tenantId); - - /** - * @param description : Human readable description for the FirewallPolicy (1024 characters limit). - * @return FirewallPolicyBuilder - */ - public FirewallPolicyBuilder description(String description); - - /** - * @param shared : When set to True makes this FirewallPolicy visible to tenants other - * than its owner, and can be used in FirewallPolicy not owned by its tenant. - * @return FirewallPolicyBuilder - */ - public FirewallPolicyBuilder shared(Boolean shared); - - /** - * @param audited : When set to True by the policy owner indicates that the firewall policy has been audited. - * This attribute is meant to aid in the firewall policy audit workflows. - * Each time the firewall policy or the associated firewall rules are changed, - * this attribute will be set to False and will have to be explicitly set - * to True through an update operation. - * @return FirewallPolicyBuilder - */ - public FirewallPolicyBuilder audited(Boolean audited); - - /** - * @param firewallRules(UUID)List : This is an ordered list of firewall rule uuids. - * The firewall applies the rules in the order in which they appear in this list. - * @return FirewallPolicyBuilder - */ - public FirewallPolicyBuilder firewallRules(List ruleIdList); + /** + * @param name : Human readable name for the FirewallPolicy (255 characters limit). Does not have to be unique. + * @return FirewallPolicyBuilder + */ + public FirewallPolicyBuilder name(String name); + + /** + * @param tenantId : Owner of the FirewallPolicy. Only an administrative user can + * specify a tenant ID other than its own. + * @return FirewallPolicyBuilder + */ + public FirewallPolicyBuilder tenantId(String tenantId); + + /** + * @param description : Human readable description for the FirewallPolicy (1024 characters limit). + * @return FirewallPolicyBuilder + */ + public FirewallPolicyBuilder description(String description); + + /** + * @param shared : When set to True makes this FirewallPolicy visible to tenants other + * than its owner, and can be used in FirewallPolicy not owned by its tenant. + * @return FirewallPolicyBuilder + */ + public FirewallPolicyBuilder shared(Boolean shared); + + /** + * @param audited : When set to True by the policy owner indicates that the firewall policy has been audited. + * This attribute is meant to aid in the firewall policy audit workflows. + * Each time the firewall policy or the associated firewall rules are changed, + * this attribute will be set to False and will have to be explicitly set + * to True through an update operation. + * @return FirewallPolicyBuilder + */ + public FirewallPolicyBuilder audited(Boolean audited); + + /** + * @param firewallRules(UUID)List : This is an ordered list of firewall rule uuids. + * The firewall applies the rules in the order in which they appear in this list. + * @return FirewallPolicyBuilder + */ + public FirewallPolicyBuilder firewallRules(List ruleIdList); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java index 4dbf23f09..a5b942083 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java @@ -1,50 +1,50 @@ package org.openstack4j.model.network.ext.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.FirewallPolicyUpdate; +import java.util.List; + /** * A Builder to Update Firewall Policy of FwaaS. - * + * * @author Vishvesh Deshmukh */ public interface FirewallPolicyUpdateBuilder extends Builder { - /** - * @param name : Human readable name for the FirewallPolicy (255 characters limit). Does not have to be unique. - * @return FirewallPolicyUpdateBuilder - */ - public FirewallPolicyUpdateBuilder name(String name); - - /** - * @param description : Human readable description for the FirewallPolicy (1024 characters limit). - * @return FirewallPolicyUpdateBuilder - */ - public FirewallPolicyUpdateBuilder description(String description); - - /** - * @param shared : When set to True makes this FirewallPolicy visible to tenants other - * than its owner, and can be used in FirewallPolicy not owned by its tenant. - * @return FirewallPolicyUpdateBuilder - */ - public FirewallPolicyUpdateBuilder shared(Boolean shared); - - /** - * @param audited : When set to True by the policy owner indicates that the firewall policy has been audited. - * This attribute is meant to aid in the firewall policy audit workflows. - * Each time the firewall policy or the associated firewall rules are changed, - * this attribute will be set to False and will have to be explicitly set - * to True through an update operation. - * @return FirewallPolicyUpdateBuilder - */ - public FirewallPolicyUpdateBuilder audited(Boolean audited); - - /** - * @param firewallRules(UUID)List : This is an ordered list of firewall rule uuids. - * The firewall applies the rules in the order in which they appear in this list. - * @return FirewallPolicyUpdateBuilder - */ - public FirewallPolicyUpdateBuilder firewallRules(List ruleIdList); + /** + * @param name : Human readable name for the FirewallPolicy (255 characters limit). Does not have to be unique. + * @return FirewallPolicyUpdateBuilder + */ + public FirewallPolicyUpdateBuilder name(String name); + + /** + * @param description : Human readable description for the FirewallPolicy (1024 characters limit). + * @return FirewallPolicyUpdateBuilder + */ + public FirewallPolicyUpdateBuilder description(String description); + + /** + * @param shared : When set to True makes this FirewallPolicy visible to tenants other + * than its owner, and can be used in FirewallPolicy not owned by its tenant. + * @return FirewallPolicyUpdateBuilder + */ + public FirewallPolicyUpdateBuilder shared(Boolean shared); + + /** + * @param audited : When set to True by the policy owner indicates that the firewall policy has been audited. + * This attribute is meant to aid in the firewall policy audit workflows. + * Each time the firewall policy or the associated firewall rules are changed, + * this attribute will be set to False and will have to be explicitly set + * to True through an update operation. + * @return FirewallPolicyUpdateBuilder + */ + public FirewallPolicyUpdateBuilder audited(Boolean audited); + + /** + * @param firewallRules(UUID)List : This is an ordered list of firewall rule uuids. + * The firewall applies the rules in the order in which they appear in this list. + * @return FirewallPolicyUpdateBuilder + */ + public FirewallPolicyUpdateBuilder firewallRules(List ruleIdList); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java index eab81a59f..1256c3d6f 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java @@ -7,88 +7,88 @@ /** * A Builder to Create Firewall Rule of FwaaS. - * + * * @author Vishvesh Deshmukh */ public interface FirewallRuleBuilder extends Builder { - - /** - * @param name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder name(String name); - /** - * @param tenantId : Owner of the Firewall Rule. Only an administrative user can - * specify a tenant ID other than its own. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder tenantId(String tenantId); + /** + * @param name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder name(String name); - /** - * @param description : Human readable description for the firewall rule (1024 characters limit). - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder description(String description); - - /** - * @param shared : When set to True makes this firewall rule visible to tenants other than its owner, - * and can be used in firewall policies not owned by its tenant. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder shared(Boolean shared); - - /** - * @see NeutronFirewallRule.IPProtocol - * @param protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder protocol(NeutronFirewallRule.IPProtocol protocol); - - /** - * @see IPVersionType - * @param ipVersion : IP Protocol Version : Possible values are 4/6. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder ipVersion(IPVersionType ipVersion); - - /** - * @param sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder sourceIpAddress(String sourceIpAddress); - - /** - * @param destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder destinationIpAddress(String destinationIpAddress); - - /** - * @param sourcePort : Valid port number (integer or FirewallRuleBuilder), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder sourcePort(String sourcePort); - - /** - * @param destinationPort : Valid port number (integer or FirewallRuleBuilder), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder destinationPort(String destinationPort); - - /** - * @param action : Action to be performed on the traffic matching the rule (allow, deny). - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder action(NeutronFirewallRule.FirewallRuleAction action); + /** + * @param tenantId : Owner of the Firewall Rule. Only an administrative user can + * specify a tenant ID other than its own. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder tenantId(String tenantId); - /** - * @param enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off - * rules without having to disassociate the rule from the firewall policy. - * @return FirewallRuleBuilder - */ - public FirewallRuleBuilder enabled(Boolean enabled); + /** + * @param description : Human readable description for the firewall rule (1024 characters limit). + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder description(String description); + + /** + * @param shared : When set to True makes this firewall rule visible to tenants other than its owner, + * and can be used in firewall policies not owned by its tenant. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder shared(Boolean shared); + + /** + * @param protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). + * @return FirewallRuleBuilder + * @see NeutronFirewallRule.IPProtocol + */ + public FirewallRuleBuilder protocol(NeutronFirewallRule.IPProtocol protocol); + + /** + * @param ipVersion : IP Protocol Version : Possible values are 4/6. + * @return FirewallRuleBuilder + * @see IPVersionType + */ + public FirewallRuleBuilder ipVersion(IPVersionType ipVersion); + + /** + * @param sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder sourceIpAddress(String sourceIpAddress); + + /** + * @param destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder destinationIpAddress(String destinationIpAddress); + + /** + * @param sourcePort : Valid port number (integer or FirewallRuleBuilder), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder sourcePort(String sourcePort); + + /** + * @param destinationPort : Valid port number (integer or FirewallRuleBuilder), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder destinationPort(String destinationPort); + + /** + * @param action : Action to be performed on the traffic matching the rule (allow, deny). + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder action(NeutronFirewallRule.FirewallRuleAction action); + + /** + * @param enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off + * rules without having to disassociate the rule from the firewall policy. + * @return FirewallRuleBuilder + */ + public FirewallRuleBuilder enabled(Boolean enabled); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleUpdateBuilder.java index 0e866c010..5d851b414 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleUpdateBuilder.java @@ -7,87 +7,87 @@ /** * A Builder to Update Firewall Rule of FwaaS - * + * * @author Vishvesh Deshmukh */ public interface FirewallRuleUpdateBuilder extends Builder { - /** - * @param name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder name(String name); + /** + * @param name : Human readable name for the firewall rule (255 characters limit). Does not have to be unique. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder name(String name); - /** - * @param tenantId : Owner of the Firewall. Only an administrative user can - * specify a tenant ID other than its own. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder tenantId(String tenantId); + /** + * @param tenantId : Owner of the Firewall. Only an administrative user can + * specify a tenant ID other than its own. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder tenantId(String tenantId); - /** - * @param description : Human readable description for the firewall rule (1024 characters limit). - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder description(String description); - - /** - * @param shared : When set to True makes this firewall rule visible to tenants other than its owner, - * and can be used in firewall policies not owned by its tenant. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder shared(Boolean shared); - - /** - * @see NeutronFirewallRule.IPProtocol - * @param protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder protocol(NeutronFirewallRule.IPProtocol protocol); - - /** - * @see IPVersionType - * @param ipVersion : IP Protocol Version : Possible values are 4/6. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder ipVersion(IPVersionType ipVersion); - - /** - * @param sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder sourceIpAddress(String sourceIpAddress); - - /** - * @param destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder destinationIpAddress(String destinationIpAddress); - - /** - * @param sourcePort : Valid port number (integer or FirewallRuleUpdateBuilder), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder sourcePort(String sourcePort); - - /** - * @param destinationPort : Valid port number (integer or FirewallRuleUpdateBuilder), or port range in the format of a ':' separated range). - * In the case of port range, both ends of the range are included. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder destinationPort(String destinationPort); - - /** - * @param action : Action to be performed on the traffic matching the rule (allow, deny). - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder action(NeutronFirewallRule.FirewallRuleAction action); + /** + * @param description : Human readable description for the firewall rule (1024 characters limit). + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder description(String description); - /** - * @param enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off - * rules without having to disassociate the rule from the firewall policy. - * @return FirewallRuleUpdateBuilder - */ - public FirewallRuleUpdateBuilder enabled(Boolean enabled); + /** + * @param shared : When set to True makes this firewall rule visible to tenants other than its owner, + * and can be used in firewall policies not owned by its tenant. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder shared(Boolean shared); + + /** + * @param protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). + * @return FirewallRuleUpdateBuilder + * @see NeutronFirewallRule.IPProtocol + */ + public FirewallRuleUpdateBuilder protocol(NeutronFirewallRule.IPProtocol protocol); + + /** + * @param ipVersion : IP Protocol Version : Possible values are 4/6. + * @return FirewallRuleUpdateBuilder + * @see IPVersionType + */ + public FirewallRuleUpdateBuilder ipVersion(IPVersionType ipVersion); + + /** + * @param sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder sourceIpAddress(String sourceIpAddress); + + /** + * @param destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder destinationIpAddress(String destinationIpAddress); + + /** + * @param sourcePort : Valid port number (integer or FirewallRuleUpdateBuilder), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder sourcePort(String sourcePort); + + /** + * @param destinationPort : Valid port number (integer or FirewallRuleUpdateBuilder), or port range in the format of a ':' separated range). + * In the case of port range, both ends of the range are included. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder destinationPort(String destinationPort); + + /** + * @param action : Action to be performed on the traffic matching the rule (allow, deny). + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder action(NeutronFirewallRule.FirewallRuleAction action); + + /** + * @param enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off + * rules without having to disassociate the rule from the firewall policy. + * @return FirewallRuleUpdateBuilder + */ + public FirewallRuleUpdateBuilder enabled(Boolean enabled); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallUpdateBuilder.java index 0ff1522b5..39ae22493 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallUpdateBuilder.java @@ -5,48 +5,49 @@ /** * A Builder to Update Firewall of FwaaS - * + * * @author Vishvesh Deshmukh */ public interface FirewallUpdateBuilder extends Builder { - /** - * @param tenantId : Owner of the Firewall. Only an administrative user can - * specify a tenant ID other than its own. - * @return FirewallUpdateBuilder - */ - public FirewallUpdateBuilder tenantId(String tenantId); - - /** - * @param name : Human readable name for the firewall (255 characters limit). Does not have to be unique. - * @return FirewallUpdateBuilder - */ - public FirewallUpdateBuilder name(String name); - - /** - * @param description : Human readable description for the firewall (1024 characters limit). - * @return FirewallUpdateBuilder - */ - public FirewallUpdateBuilder description(String description); - - /** - * @param adminstateup : The administrative state of the firewall, - * which is up (true) or down (false). - * @return FirewallUpdateBuilder - */ - public FirewallUpdateBuilder adminStateUp(Boolean adminStateUp); - - /** - * shared : When set to True makes this firewall rule visible to tenants other - * than its owner, and can be used in firewall policies not owned by its tenant. - * @return FirewallUpdateBuilder - */ - public FirewallUpdateBuilder shared(Boolean shared); - - /** - * @param policyid : The firewall policy uuid that this firewall is associated with. - * This firewall will implement the rules contained in the firewall policy represented by this uuid. - * @return FirewallUpdateBuilder - */ - public FirewallUpdateBuilder policy(String policyId); + /** + * @param tenantId : Owner of the Firewall. Only an administrative user can + * specify a tenant ID other than its own. + * @return FirewallUpdateBuilder + */ + public FirewallUpdateBuilder tenantId(String tenantId); + + /** + * @param name : Human readable name for the firewall (255 characters limit). Does not have to be unique. + * @return FirewallUpdateBuilder + */ + public FirewallUpdateBuilder name(String name); + + /** + * @param description : Human readable description for the firewall (1024 characters limit). + * @return FirewallUpdateBuilder + */ + public FirewallUpdateBuilder description(String description); + + /** + * @param adminstateup : The administrative state of the firewall, + * which is up (true) or down (false). + * @return FirewallUpdateBuilder + */ + public FirewallUpdateBuilder adminStateUp(Boolean adminStateUp); + + /** + * shared : When set to True makes this firewall rule visible to tenants other + * than its owner, and can be used in firewall policies not owned by its tenant. + * + * @return FirewallUpdateBuilder + */ + public FirewallUpdateBuilder shared(Boolean shared); + + /** + * @param policyid : The firewall policy uuid that this firewall is associated with. + * This firewall will implement the rules contained in the firewall policy represented by this uuid. + * @return FirewallUpdateBuilder + */ + public FirewallUpdateBuilder policy(String policyId); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FlowClassifierBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FlowClassifierBuilder.java index 67692bfef..8d79fba97 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FlowClassifierBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FlowClassifierBuilder.java @@ -1,15 +1,15 @@ package org.openstack4j.model.network.ext.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.Ethertype; import org.openstack4j.model.network.ext.FlowClassifier; +import java.util.Map; + /** - * A builder to create a flow classifier - * @author Dmitry Gerenrot + * A builder to create a flow classifier * + * @author Dmitry Gerenrot */ public interface FlowClassifierBuilder extends Builder { @@ -38,7 +38,6 @@ public interface FlowClassifierBuilder extends Builder{ +public interface HealthMonitorAssociateBuilder extends Builder { - /** - * @param id the healthMonitor identifier - * @return HealthMonitorAssociateBuilder - */ - public HealthMonitorAssociateBuilder id(String id); + /** + * @param id the healthMonitor identifier + * @return HealthMonitorAssociateBuilder + */ + public HealthMonitorAssociateBuilder id(String id); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorBuilder.java index dd9c18d0d..084cc3488 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorBuilder.java @@ -6,84 +6,65 @@ /** * A builder to create a healthMonitor - * - * @author liujunpeng * + * @author liujunpeng */ public interface HealthMonitorBuilder extends Builder { - /** - * - * @param tenantId - * Owner of the VIP. Only an administrative user can specify a - * tenant ID other than its own. - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder tenantId(String tenantId); + /** + * @param tenantId Owner of the VIP. Only an administrative user can specify a + * tenant ID other than its own. + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder tenantId(String tenantId); - /** - * - * @param type - * The type of probe, which is PING, TCP, HTTP, or HTTPS, that is - * sent by the load balancer to verify the member state. - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder type(HealthMonitorType type); + /** + * @param type The type of probe, which is PING, TCP, HTTP, or HTTPS, that is + * sent by the load balancer to verify the member state. + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder type(HealthMonitorType type); - /** - * - * @param delay - * The time, in seconds, between sending probes to members. - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder delay(Integer delay); + /** + * @param delay The time, in seconds, between sending probes to members. + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder delay(Integer delay); - /** - * - * @param timeout - * Time in seconds to timeout each probe. - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder timeout(Integer timeout); + /** + * @param timeout Time in seconds to timeout each probe. + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder timeout(Integer timeout); - /** - * - * @param maxRetries - * Maximum consecutive health probe tries. - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder maxRetries(Integer maxRetries); + /** + * @param maxRetries Maximum consecutive health probe tries. + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder maxRetries(Integer maxRetries); - /** - * - * @param urlPath - * Path portion of URI that will be probed if type is HTTP(S). - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder urlPath(String urlPath); + /** + * @param urlPath Path portion of URI that will be probed if type is HTTP(S). + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder urlPath(String urlPath); - /** - * - * @param expectedCodes - * Expected HTTP codes for a passing HTTP(S) monitor. - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder expectedCodes(String expectedCodes); + /** + * @param expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder expectedCodes(String expectedCodes); - /** - * - * @param httpMethod - * GET/PUT/POST - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder httpMethod(String httpMethod); + /** + * @param httpMethod GET/PUT/POST + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder httpMethod(String httpMethod); - /** - * - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). - * @return HealthMonitorBuilder - */ - public HealthMonitorBuilder adminStateUp(boolean adminStateUp); + /** + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). + * @return HealthMonitorBuilder + */ + public HealthMonitorBuilder adminStateUp(boolean adminStateUp); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorUpdateBuilder.java index 0e33210b7..a568b7725 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorUpdateBuilder.java @@ -2,65 +2,54 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.HealthMonitorUpdate; + /** - * A builder to update a vip - * @author liujunpeng + * A builder to update a vip * + * @author liujunpeng */ -public interface HealthMonitorUpdateBuilder extends Builder{ - /** - * @param dealy - * The time, in seconds, between sending probes to members. - * @return HealthMonitorUpdateBuilder - */ - public HealthMonitorUpdateBuilder delay(Integer delay); - /** - * - * @param urlPath - * Path portion of URI that will be probed if type is HTTP(S). - * @return HealthMonitorUpdateBuilder - */ - public HealthMonitorUpdateBuilder urlPath(String urlPath); +public interface HealthMonitorUpdateBuilder extends Builder { + /** + * @param dealy The time, in seconds, between sending probes to members. + * @return HealthMonitorUpdateBuilder + */ + public HealthMonitorUpdateBuilder delay(Integer delay); + + /** + * @param urlPath Path portion of URI that will be probed if type is HTTP(S). + * @return HealthMonitorUpdateBuilder + */ + public HealthMonitorUpdateBuilder urlPath(String urlPath); + + /** + * @param expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. + * @return HealthMonitorUpdateBuilder + */ + public HealthMonitorUpdateBuilder expectedCodes(String expectedCodes); + + /** + * @param httpMethod GET/PUT/POST + * @return HealthMonitorUpdateBuilder + */ + public HealthMonitorUpdateBuilder httpMethod(String httpMethod); + + /** + * @param maxRetries Maximum consecutive health probe tries. + * @return HealthMonitorUpdateBuilder + */ + public HealthMonitorUpdateBuilder maxRetries(Integer maxRetries); + + /** + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). + * @return HealthMonitorUpdateBuilder + */ + public HealthMonitorUpdateBuilder adminStateUp(boolean adminStateUp); + + /** + * @param timeout Time in seconds to timeout each probe. + * @return HealthMonitorUpdateBuilder + */ + public HealthMonitorUpdateBuilder timeout(Integer timeout); - /** - * - * @param expectedCodes - * Expected HTTP codes for a passing HTTP(S) monitor. - * @return HealthMonitorUpdateBuilder - */ - public HealthMonitorUpdateBuilder expectedCodes(String expectedCodes); - - /** - * - * @param httpMethod - * GET/PUT/POST - * @return HealthMonitorUpdateBuilder - */ - public HealthMonitorUpdateBuilder httpMethod(String httpMethod); - - /** - * - * @param maxRetries - * Maximum consecutive health probe tries. - * @return HealthMonitorUpdateBuilder - */ - public HealthMonitorUpdateBuilder maxRetries(Integer maxRetries); - - /** - * - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). - * @return HealthMonitorUpdateBuilder - */ - public HealthMonitorUpdateBuilder adminStateUp(boolean adminStateUp); - - /** - * - * @param timeout - * Time in seconds to timeout each probe. - * @return HealthMonitorUpdateBuilder - */ - public HealthMonitorUpdateBuilder timeout(Integer timeout); - } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorV2Builder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorV2Builder.java index 5ecdcb5ef..a117a7a62 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/HealthMonitorV2Builder.java @@ -6,51 +6,39 @@ public interface HealthMonitorV2Builder extends Buildable.Builder { /** - * - * @param tenantId - * Owner of the VIP. Only an administrative user can specify a - * tenant ID other than its own. + * @param tenantId Owner of the VIP. Only an administrative user can specify a + * tenant ID other than its own. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder tenantId(String tenantId); /** - * - * @param type - * The type of probe, which is TCP, HTTP, or HTTPS, that is - * sent by the health monitor to verify the member state. + * @param type The type of probe, which is TCP, HTTP, or HTTPS, that is + * sent by the health monitor to verify the member state. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder type(HealthMonitorType type); /** - * - * @param delay - * The time, in seconds, between sending probes to members. + * @param delay The time, in seconds, between sending probes to members. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder delay(Integer delay); /** - * - * @param timeout - * Time in seconds to timeout each probe. + * @param timeout Time in seconds to timeout each probe. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder timeout(Integer timeout); /** - * - * @param maxRetries - * Maximum consecutive health probe tries. + * @param maxRetries Maximum consecutive health probe tries. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder maxRetries(Integer maxRetries); /** - * - * @param poolId - * Pool that this health monitor is assigned to + * @param poolId Pool that this health monitor is assigned to * @return HealthMonitorV2Builder */ HealthMonitorV2Builder poolId(String poolId); @@ -58,8 +46,7 @@ public interface HealthMonitorV2Builder extends Buildable.Builder { +public interface HealthMonitorV2UpdateBuilder extends Builder { /** - * @param delay - * The time, in seconds, between sending probes to members. + * @param delay The time, in seconds, between sending probes to members. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder delay(Integer delay); /** - * - * @param urlPath - * Path portion of URI that will be probed if type is HTTP(S). + * @param urlPath Path portion of URI that will be probed if type is HTTP(S). * @return HealthMonitorUpdateBuilder */ HealthMonitorV2UpdateBuilder urlPath(String urlPath); /** - * - * @param expectedCodes - * Expected HTTP codes for a passing HTTP(S) monitor. + * @param expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes); /** - * - * @param httpMethod - * GET/PUT/POST + * @param httpMethod GET/PUT/POST * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder httpMethod(String httpMethod); /** - * - * @param maxRetries - * Maximum consecutive health probe tries. + * @param maxRetries Maximum consecutive health probe tries. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries); /** - * - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp); /** - * - * @param timeout - * Time in seconds to timeout each probe. + * @param timeout Time in seconds to timeout each probe. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder timeout(Integer timeout); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolBuilder.java index 9ec111e67..14cc268a9 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolBuilder.java @@ -4,79 +4,65 @@ import org.openstack4j.model.network.ext.LbMethod; import org.openstack4j.model.network.ext.LbPool; import org.openstack4j.model.network.ext.Protocol; + /** * A Builder to create a lbpool - * - * @author liujunpeng * + * @author liujunpeng */ public interface LbPoolBuilder extends Builder { - /** - * - * @param tenantId - * Owner of the pool. Only an administrative user can specify a - * tenant ID other than its own. - * @return LbPoolBuilder - */ - public LbPoolBuilder tenantId(String tenantId); + /** + * @param tenantId Owner of the pool. Only an administrative user can specify a + * tenant ID other than its own. + * @return LbPoolBuilder + */ + public LbPoolBuilder tenantId(String tenantId); + + /** + * @param protocol The protocol of the VIP address. A valid value is TCP, HTTP, + * or HTTPS. + * @return LbPoolBuilder + */ + public LbPoolBuilder protocol(Protocol protocol); - /** - * @param protocol - * The protocol of the VIP address. A valid value is TCP, HTTP, - * or HTTPS. - * @return LbPoolBuilder - */ - public LbPoolBuilder protocol(Protocol protocol); - /** - * - * @param name - * Pool name. Does not have to be unique. - * @return LbPoolBuilder - */ - public LbPoolBuilder name(String name); + /** + * @param name Pool name. Does not have to be unique. + * @return LbPoolBuilder + */ + public LbPoolBuilder name(String name); - /** - * - * @param description - * Description for the pool. - * @return LbPoolBuilder - */ - public LbPoolBuilder description(String description); + /** + * @param description Description for the pool. + * @return LbPoolBuilder + */ + public LbPoolBuilder description(String description); - /** - * - * @param subnentId - * The ID of the subnet on which to allocate the VIP address. - * @return LbPoolBuilder - */ - public LbPoolBuilder subnetId(String subnentId); + /** + * @param subnentId The ID of the subnet on which to allocate the VIP address. + * @return LbPoolBuilder + */ + public LbPoolBuilder subnetId(String subnentId); - /** - * - * @param provider - * Loadbalance provider which openstack supports,such as haproxy - * @return LbPoolBuilder - */ - public LbPoolBuilder provider(String provider); + /** + * @param provider Loadbalance provider which openstack supports,such as haproxy + * @return LbPoolBuilder + */ + public LbPoolBuilder provider(String provider); - /** - * - * @param lbMethod - * The load-balancer algorithm, which is round-robin, - * least-connections, and so on. This value, which must be - * supported, is dependent on the load-balancer provider. Round - * robin must be supported. - * @return LbPoolBuilder - */ - public LbPoolBuilder lbMethod(LbMethod lbMethod); + /** + * @param lbMethod The load-balancer algorithm, which is round-robin, + * least-connections, and so on. This value, which must be + * supported, is dependent on the load-balancer provider. Round + * robin must be supported. + * @return LbPoolBuilder + */ + public LbPoolBuilder lbMethod(LbMethod lbMethod); - /** - * - * @param adminStateUp - * The administrative state of the lb pool, which is up (true) or - * down (false). - * @return LbPoolBuilder - */ - public LbPoolBuilder adminStateUp(boolean adminStateUp); + /** + * @param adminStateUp The administrative state of the lb pool, which is up (true) or + * down (false). + * @return LbPoolBuilder + */ + public LbPoolBuilder adminStateUp(boolean adminStateUp); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java index 650d0d3af..f9175ddb6 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java @@ -6,44 +6,37 @@ /** * A Builder to update a lbpool - * @author liujunpeng * + * @author liujunpeng */ public interface LbPoolUpdateBuilder extends Builder { - /** - * - * @param lbMethod - * The load-balancer algorithm, which is round-robin, - * least-connections, and so on. This value, which must be - * supported, is dependent on the load-balancer provider. Round - * robin must be supported. - * @return LbPoolUpdateBuilder - */ - public LbPoolUpdateBuilder lbMethod(LbMethod lbMethod); - - /** - * - * @param name - * Pool name. Does not have to be unique. - * @return LbPoolUpdateBuilder - */ - public LbPoolUpdateBuilder name(String name); - - /** - * - * @param description - * Description for the pool. - * @return LbPoolUpdateBuilder - */ - public LbPoolUpdateBuilder description(String description); - /** - * - * @param adminStateUp - * The administrative state of the lb pool, which is up (true) or - * down (false). - * @return LbPoolUpdateBuilder - */ - public LbPoolUpdateBuilder adminStateUp(boolean adminStateUp); - + /** + * @param lbMethod The load-balancer algorithm, which is round-robin, + * least-connections, and so on. This value, which must be + * supported, is dependent on the load-balancer provider. Round + * robin must be supported. + * @return LbPoolUpdateBuilder + */ + public LbPoolUpdateBuilder lbMethod(LbMethod lbMethod); + + /** + * @param name Pool name. Does not have to be unique. + * @return LbPoolUpdateBuilder + */ + public LbPoolUpdateBuilder name(String name); + + /** + * @param description Description for the pool. + * @return LbPoolUpdateBuilder + */ + public LbPoolUpdateBuilder description(String description); + + /** + * @param adminStateUp The administrative state of the lb pool, which is up (true) or + * down (false). + * @return LbPoolUpdateBuilder + */ + public LbPoolUpdateBuilder adminStateUp(boolean adminStateUp); + } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolV2Builder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolV2Builder.java index 0e249103c..5388ede39 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolV2Builder.java @@ -10,13 +10,11 @@ * A Builder to create a lbpoolV2 * * @author emjburns - * */ public interface LbPoolV2Builder extends Buildable.Builder { /** - * @param tenantId - * Owner of the pool. Only an administrative user can specify a - * tenant ID other than its own. + * @param tenantId Owner of the pool. Only an administrative user can specify a + * tenant ID other than its own. * @return LbPoolV2Builder */ LbPoolV2Builder tenantId(String tenantId); @@ -24,8 +22,7 @@ public interface LbPoolV2Builder extends Buildable.Builder { /** - * - * @param lbMethod - * The load-balancer algorithm, which is round-robin, - * least-connections, and so on. This value, which must be - * supported, is dependent on the load-balancer provider. Round - * robin must be supported. + * @param lbMethod The load-balancer algorithm, which is round-robin, + * least-connections, and so on. This value, which must be + * supported, is dependent on the load-balancer provider. Round + * robin must be supported. * @return LbPoolV2UpdateBuilder */ - public LbPoolV2UpdateBuilder lbMethod(LbMethod lbMethod); + public LbPoolV2UpdateBuilder lbMethod(LbMethod lbMethod); /** - * - * @param name - * Pool name. Does not have to be unique. + * @param name Pool name. Does not have to be unique. * @return LbPoolV2UpdateBuilder */ - public LbPoolV2UpdateBuilder name(String name); + public LbPoolV2UpdateBuilder name(String name); /** - * - * @param description - * Description for the pool. + * @param description Description for the pool. * @return LbPoolV2UpdateBuilder */ public LbPoolV2UpdateBuilder description(String description); + /** - * - * @param adminStateUp - * The administrative state of the lb pool, which is up (true) or - * down (false). + * @param adminStateUp The administrative state of the lb pool, which is up (true) or + * down (false). * @return LbPoolV2UpdateBuilder */ - public LbPoolV2UpdateBuilder adminStateUp(boolean adminStateUp); + public LbPoolV2UpdateBuilder adminStateUp(boolean adminStateUp); /** * Optional * - * @param sessionPersistence - * Session persistence parameters for the lbpool. Omit the - * session_persistence parameter to prevent session persistence. - * When no session persistence is used, the session_persistence - * parameter does not appear in the API response. To clear - * session persistence for the lbpool, set the session_persistence - * parameter to null in a lbpool update request. + * @param sessionPersistence Session persistence parameters for the lbpool. Omit the + * session_persistence parameter to prevent session persistence. + * When no session persistence is used, the session_persistence + * parameter does not appear in the API response. To clear + * session persistence for the lbpool, set the session_persistence + * parameter to null in a lbpool update request. * @return LbPoolV2UpdateBuilder */ - LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence); + LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2Builder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2Builder.java index 74bfa98b7..737791206 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2Builder.java @@ -1,30 +1,29 @@ package org.openstack4j.model.network.ext.builder; import org.openstack4j.common.Buildable; -import org.openstack4j.model.network.ext.ListenerV2; import org.openstack4j.model.network.ext.ListenerProtocol; +import org.openstack4j.model.network.ext.ListenerV2; import java.util.List; public interface ListenerV2Builder extends Buildable.Builder { /** - * @param tenantId - * Owner of the listener. Only an administrative user can specify a - * tenant ID other than its own. + * @param tenantId Owner of the listener. Only an administrative user can specify a + * tenant ID other than its own. * @return ListenerV2Builder */ ListenerV2Builder tenantId(String tenantId); /** - * @param protocol - * The protocol of the VIP address. A valid value is TCP, HTTP, - * or HTTPS. + * @param protocol The protocol of the VIP address. A valid value is TCP, HTTP, + * or HTTPS. * @return ListenerV2Builder */ ListenerV2Builder protocol(ListenerProtocol protocol); /** * The port in which the frontend will be listening. Must be an integer in the range of 1-65535 + * * @param protocolPort * @return ListenerV2Builder */ @@ -33,6 +32,7 @@ public interface ListenerV2Builder extends Buildable.Builder * The default value for this attribute will be -1, indicating an infinite limit. + * * @param connectionLimit * @return ListenerV2Builder */ @@ -76,8 +75,9 @@ public interface ListenerV2Builder extends Buildable.Builder * Barbican container with tls policy + * * @param tlsContainerRef * @return ListenerV2Builder */ @@ -85,8 +85,9 @@ public interface ListenerV2Builder extends Buildable.Builder * Barbican container(s) with sni certificates + * * @param sniContainerRefs * @return ListenerV2Builder */ diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2UpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2UpdateBuilder.java index 43b7b2b21..ef0148bcc 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2UpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/ListenerV2UpdateBuilder.java @@ -5,6 +5,7 @@ /** * A Builder to update a lbaas v2 listener + * * @author emjburns */ public interface ListenerV2UpdateBuilder extends Buildable.Builder { @@ -12,8 +13,7 @@ public interface ListenerV2UpdateBuilder extends Buildable.Builder * The tls container reference + * * @param defaultTlsContainerRef * @return ListenerV2UpdateBuilder */ diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/LoadBalancerV2Builder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/LoadBalancerV2Builder.java index dacbdac7c..09d03178d 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/LoadBalancerV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/LoadBalancerV2Builder.java @@ -5,9 +5,8 @@ public interface LoadBalancerV2Builder extends Buildable.Builder { /** - * @param tenantId - * Owner of the loadbalancer. Only an admin user can specify a tenant ID - * other than its own. + * @param tenantId Owner of the loadbalancer. Only an admin user can specify a tenant ID + * other than its own. * @return LoadBalancerV2Builder */ LoadBalancerV2Builder tenantId(String tenantId); @@ -15,8 +14,7 @@ public interface LoadBalancerV2Builder extends Buildable.Builder { /** * Optional - * @param description - * Human-readable description for the load balancer. + * + * @param description Human-readable description for the load balancer. * @return LoadBalancerV2UpdateBuilder */ public LoadBalancerV2UpdateBuilder description(String description); /** - * @param name - * Human-readable name for the load balancer. + * @param name Human-readable name for the load balancer. * @return LoadBalancerV2UpdateBuilder */ public LoadBalancerV2UpdateBuilder name(String name); /** * Optional - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). + * + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). * @return LoadBalancerV2UpdateBuilder */ public LoadBalancerV2UpdateBuilder adminStateUp(boolean adminStateUp); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberBuilder.java index 6e421abbe..4f8e46c9f 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberBuilder.java @@ -5,56 +5,48 @@ /** * A Builder to create a member - * + * * @author liujunpeng */ public interface MemberBuilder extends Builder { - /** - * @param tenantId - * Owner of the member. Only an administrative user can specify a - * tenant ID other than its own. - * @return MemberBuilder - */ - public MemberBuilder tenantId(String tenantId); - - /** - * @param adminStateUp - * The administrative state of the member, which is up (true) or - * down (false). - * @return MemberBuilder - */ - public MemberBuilder adminStateUp(boolean adminStateUp); - - /** - * - * @param address - * The IP address of the member. - * @return MemberBuilder - */ - public MemberBuilder address(String address); - - /** - * @param protocolPort - * . The port on which the application is hosted..A valid value - * is from 1 to 65535 - * @return MemberBuilder - */ - public MemberBuilder protocolPort(Integer protocolPort); - - - /** - * @param weight - * Weight of member.from 1 to 256 - * @return MemberBuilder - */ - public MemberBuilder weight(Integer weight); - - /** - * - * @param lbPoolId - * the lb pool identifier - * @return MemberBuilder - */ - public MemberBuilder poolId(String lbPoolId); + /** + * @param tenantId Owner of the member. Only an administrative user can specify a + * tenant ID other than its own. + * @return MemberBuilder + */ + public MemberBuilder tenantId(String tenantId); + + /** + * @param adminStateUp The administrative state of the member, which is up (true) or + * down (false). + * @return MemberBuilder + */ + public MemberBuilder adminStateUp(boolean adminStateUp); + + /** + * @param address The IP address of the member. + * @return MemberBuilder + */ + public MemberBuilder address(String address); + + /** + * @param protocolPort . The port on which the application is hosted..A valid value + * is from 1 to 65535 + * @return MemberBuilder + */ + public MemberBuilder protocolPort(Integer protocolPort); + + + /** + * @param weight Weight of member.from 1 to 256 + * @return MemberBuilder + */ + public MemberBuilder weight(Integer weight); + + /** + * @param lbPoolId the lb pool identifier + * @return MemberBuilder + */ + public MemberBuilder poolId(String lbPoolId); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java index 9d51ca803..3380cec61 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java @@ -5,31 +5,27 @@ /** * A Builder to update a member - * + * * @author liujunpeng */ public interface MemberUpdateBuilder extends Builder { - - /** - * @param adminStateUp - * The administrative state of the member, which is up (true) or - * down (false). - * @return MemberUpdateBuilder - */ - public MemberUpdateBuilder adminStateUp(boolean adminStateUp); - /** - * @param weight - * Weight of member.from 1 to 256 - * @return MemberUpdateBuilder - */ - public MemberUpdateBuilder weight(Integer weight); - - /** - * - * @param poolId - * the lb pool identifier - * @return MemberUpdateBuilder - */ - public MemberUpdateBuilder poolId(String poolId); + /** + * @param adminStateUp The administrative state of the member, which is up (true) or + * down (false). + * @return MemberUpdateBuilder + */ + public MemberUpdateBuilder adminStateUp(boolean adminStateUp); + + /** + * @param weight Weight of member.from 1 to 256 + * @return MemberUpdateBuilder + */ + public MemberUpdateBuilder weight(Integer weight); + + /** + * @param poolId the lb pool identifier + * @return MemberUpdateBuilder + */ + public MemberUpdateBuilder poolId(String poolId); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberV2Builder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberV2Builder.java index 06c5ffdf3..4fc3bdf2e 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberV2Builder.java @@ -5,32 +5,27 @@ public interface MemberV2Builder extends Buildable.Builder { /** - * @param tenantId - * Owner of the member. Only an administrative user can specify a - * tenant ID other than its own. + * @param tenantId Owner of the member. Only an administrative user can specify a + * tenant ID other than its own. * @return MemberV2Builder */ MemberV2Builder tenantId(String tenantId); /** - * - * @param address - * The IP address of the member. + * @param address The IP address of the member. * @return MemberV2Builder */ MemberV2Builder address(String address); /** - * @param protocolPort - * The port on which the application is hosted. A valid value - * is from 1 to 65535 + * @param protocolPort The port on which the application is hosted. A valid value + * is from 1 to 65535 * @return MemberV2Builder */ MemberV2Builder protocolPort(Integer protocolPort); /** - * @param subnetId - * The subnet in which to access the member + * @param subnetId The subnet in which to access the member * @return MemberV2Builder */ MemberV2Builder subnetId(String subnetId); @@ -38,9 +33,8 @@ public interface MemberV2Builder extends Buildable.Builder { /** - * @param adminStateUp - * The administrative state of the member, which is up (true) or - * down (false). + * @param adminStateUp The administrative state of the member, which is up (true) or + * down (false). * @return MemberV2UpdateBuilder */ public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp); /** - * @param weight - * Weight of member.from 1 to 256 + * @param weight Weight of member.from 1 to 256 * @return MemberUpdateBuilder */ public MemberV2UpdateBuilder weight(Integer weight); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/PortChainBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/PortChainBuilder.java index ae6b96b6f..961c073f9 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/PortChainBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/PortChainBuilder.java @@ -1,15 +1,15 @@ package org.openstack4j.model.network.ext.builder; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.PortChain; +import java.util.List; +import java.util.Map; + /** - * A builder to create a port chain - * @author Dmitry Gerenrot + * A builder to create a port chain * + * @author Dmitry Gerenrot */ public interface PortChainBuilder extends Builder { diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairBuilder.java index 4fd5d7920..16d65810c 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairBuilder.java @@ -1,16 +1,16 @@ package org.openstack4j.model.network.ext.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.PortPair; +import java.util.Map; + /** - * A builder to create a port pair - * @author Dmitry Gerenrot + * A builder to create a port pair * + * @author Dmitry Gerenrot */ -public interface PortPairBuilder extends Builder { +public interface PortPairBuilder extends Builder { /** * @param id : Port Pair identifer diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairGroupBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairGroupBuilder.java index 6cc82b101..157bba488 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairGroupBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/PortPairGroupBuilder.java @@ -1,12 +1,12 @@ package org.openstack4j.model.network.ext.builder; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.network.ext.PortPairGroup; -public interface PortPairGroupBuilder extends Builder { +import java.util.List; +import java.util.Map; + +public interface PortPairGroupBuilder extends Builder { /** * @param id : Port Pair Group identifer * @return PortPairGroupBuilder @@ -39,7 +39,7 @@ public interface PortPairGroupBuilder extends Builder portPairGroupParameters); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/SessionPersistenceBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/SessionPersistenceBuilder.java index 23ae39845..703176d41 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/SessionPersistenceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/SessionPersistenceBuilder.java @@ -6,25 +6,24 @@ /** * A builder to create and update a SessionPersistence - * @author liujunpeng * + * @author liujunpeng */ -public interface SessionPersistenceBuilder extends Builder{ +public interface SessionPersistenceBuilder extends Builder { - /** - * required - * - * @param type - * APP_COOKIE,HTTP_COOKIE,SOURCE_IP - * @return SessionPersistenceBuilder - */ - public SessionPersistenceBuilder type(SessionPersistenceType type); + /** + * required + * + * @param type APP_COOKIE,HTTP_COOKIE,SOURCE_IP + * @return SessionPersistenceBuilder + */ + public SessionPersistenceBuilder type(SessionPersistenceType type); - /** - * optional - * - * @param cookieName - * @return SessionPersistenceBuilder - */ - public SessionPersistenceBuilder cookieName(String cookieName); + /** + * optional + * + * @param cookieName + * @return SessionPersistenceBuilder + */ + public SessionPersistenceBuilder cookieName(String cookieName); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/VipBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/VipBuilder.java index cefc7da6c..66c518fac 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/VipBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/VipBuilder.java @@ -7,113 +7,101 @@ /** * A builder to create a vip - * - * @author liujunpeng * + * @author liujunpeng */ public interface VipBuilder extends Builder { - /** - * @param tenantId - * Owner of the VIP. Only an admin user can specify a tenant ID - * other than its own. - * @return VipBuilder - */ - VipBuilder tenantId(String tenantId); + /** + * @param tenantId Owner of the VIP. Only an admin user can specify a tenant ID + * other than its own. + * @return VipBuilder + */ + VipBuilder tenantId(String tenantId); - /** - * Optional - * - * @param name - * Human-readable name for the VIP. Does not have to be unique. - * @return VipBuilder - */ - VipBuilder name(String name); + /** + * Optional + * + * @param name Human-readable name for the VIP. Does not have to be unique. + * @return VipBuilder + */ + VipBuilder name(String name); - /** - * Optional - * - * @param description - * Human-readable description for the VIP. - * @return VipBuilder - */ - VipBuilder description(String description); + /** + * Optional + * + * @param description Human-readable description for the VIP. + * @return VipBuilder + */ + VipBuilder description(String description); - /** - * Optional - * - * @param subnetId - * The ID of the subnet on which to allocate the VIP address. - * @return VipBuilder - */ - VipBuilder subnetId(String subnetId); + /** + * Optional + * + * @param subnetId The ID of the subnet on which to allocate the VIP address. + * @return VipBuilder + */ + VipBuilder subnetId(String subnetId); - /** - * Optional - * - * @param address - * The IP address of the VIP. - * @return VipBuilder - */ - VipBuilder address(String address); + /** + * Optional + * + * @param address The IP address of the VIP. + * @return VipBuilder + */ + VipBuilder address(String address); - /** - * @param protocol - * The protocol of the VIP address. A valid value is TCP, HTTP, - * or HTTPS. - * @return VipBuilder - */ - VipBuilder protocol(Protocol protocol); + /** + * @param protocol The protocol of the VIP address. A valid value is TCP, HTTP, + * or HTTPS. + * @return VipBuilder + */ + VipBuilder protocol(Protocol protocol); - /** - * @param protocolPort - * The port on which to listen to client traffic that is - * associated with the VIP address. A valid value is from 1 to - * 65535. - * @return VipBuilder - */ - VipBuilder protocolPort(Integer protocolPort); + /** + * @param protocolPort The port on which to listen to client traffic that is + * associated with the VIP address. A valid value is from 1 to + * 65535. + * @return VipBuilder + */ + VipBuilder protocolPort(Integer protocolPort); - /** - * Optional - * - * @param poolId - * The pool identifier - * @return VipBuilder - */ - VipBuilder poolId(String poolId); + /** + * Optional + * + * @param poolId The pool identifier + * @return VipBuilder + */ + VipBuilder poolId(String poolId); - /** - * Optional - * - * @param sessionPersistence - * . Session persistence parameters for the VIP. Omit the - * session_persistence parameter to prevent session persistence. - * When no session persistence is used, the session_persistence - * parameter does not appear in the API response. To clear - * session persistence for the VIP, set the session_persistence - * parameter to null in a VIP update request. - * @return VipBuilder - */ - VipBuilder sessionPersistence(SessionPersistence sessionPersistence); + /** + * Optional + * + * @param sessionPersistence . Session persistence parameters for the VIP. Omit the + * session_persistence parameter to prevent session persistence. + * When no session persistence is used, the session_persistence + * parameter does not appear in the API response. To clear + * session persistence for the VIP, set the session_persistence + * parameter to null in a VIP update request. + * @return VipBuilder + */ + VipBuilder sessionPersistence(SessionPersistence sessionPersistence); - /** - * Optional - * - * @param connectionLimit - * The maximum number of connections allowed for the VIP. Value - * is -1 if the limit is not set. - * @return VipBuilder - */ - VipBuilder connectionLimit(Integer connectionLimit); + /** + * Optional + * + * @param connectionLimit The maximum number of connections allowed for the VIP. Value + * is -1 if the limit is not set. + * @return VipBuilder + */ + VipBuilder connectionLimit(Integer connectionLimit); - /** - * Optional - * - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). - * @return VipBuilder - */ - VipBuilder adminStateUp(boolean adminStateUp); + /** + * Optional + * + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). + * @return VipBuilder + */ + VipBuilder adminStateUp(boolean adminStateUp); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/VipUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/VipUpdateBuilder.java index 9ed3c92c4..5d9795731 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/VipUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/VipUpdateBuilder.java @@ -6,70 +6,64 @@ /** * A Builder to update a vip - * + * * @author liujunpeng */ public interface VipUpdateBuilder extends Builder { - /** - * Optional - * - * @param name - * Human-readable name for the VIP. Does not have to be unique. - * @return VipUpdateBuilder - */ - VipUpdateBuilder name(String name); + /** + * Optional + * + * @param name Human-readable name for the VIP. Does not have to be unique. + * @return VipUpdateBuilder + */ + VipUpdateBuilder name(String name); - /** - * Optional - * - * @param description - * Human-readable description for the VIP. - * @return VipUpdateBuilder - */ - VipUpdateBuilder description(String description); + /** + * Optional + * + * @param description Human-readable description for the VIP. + * @return VipUpdateBuilder + */ + VipUpdateBuilder description(String description); - /** - * Optional - * - * @param poolId - * The ID of the pool with which the VIP is associated. - * @return VipUpdateBuilder - */ - VipUpdateBuilder poolId(String poolId); + /** + * Optional + * + * @param poolId The ID of the pool with which the VIP is associated. + * @return VipUpdateBuilder + */ + VipUpdateBuilder poolId(String poolId); - /** - * Optional - * - * @param sessionPersistence - * Session persistence parameters for the VIP. Omit the - * session_persistence parameter to prevent session persistence. - * When no session persistence is used, the session_persistence - * parameter does not appear in the API response. To clear - * session persistence for the VIP, set the session_persistence - * parameter to null in a VIP update request. - * @return VipUpdateBuilder - */ - VipUpdateBuilder sessionPersistence(SessionPersistence sessionPersistence); + /** + * Optional + * + * @param sessionPersistence Session persistence parameters for the VIP. Omit the + * session_persistence parameter to prevent session persistence. + * When no session persistence is used, the session_persistence + * parameter does not appear in the API response. To clear + * session persistence for the VIP, set the session_persistence + * parameter to null in a VIP update request. + * @return VipUpdateBuilder + */ + VipUpdateBuilder sessionPersistence(SessionPersistence sessionPersistence); - /** - * Optional - * - * @param connectionLimit - * . The maximum number of connections allowed for the VIP. Value - * is -1 if the limit is not set. - * @return VipUpdateBuilder - */ - VipUpdateBuilder connectionLimit(Integer connectionLimit); + /** + * Optional + * + * @param connectionLimit . The maximum number of connections allowed for the VIP. Value + * is -1 if the limit is not set. + * @return VipUpdateBuilder + */ + VipUpdateBuilder connectionLimit(Integer connectionLimit); - /** - * Optional - * - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). - * @return VipUpdateBuilder - */ - VipUpdateBuilder adminStateUp(boolean adminStateUp); + /** + * Optional + * + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). + * @return VipUpdateBuilder + */ + VipUpdateBuilder adminStateUp(boolean adminStateUp); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/HealthMonitorV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/HealthMonitorV2Status.java index 21ba9ac9a..f7a781864 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/HealthMonitorV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/HealthMonitorV2Status.java @@ -7,24 +7,28 @@ /** * The status of an lbaas v2 heathmonitor + * * @author emjburns */ @JsonDeserialize(as = NeutronHealthMonitorV2Status.class) public interface HealthMonitorV2Status extends ModelEntity { /** * The id of the healthmonitor + * * @return id */ public String getId(); /** - * The health monitor type + * The health monitor type + * * @return HealthMonitorType */ public HealthMonitorType getType(); /** * Provisioning status of the health monitor + * * @return provisioningStatus */ public String getProvisioningStatus(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/LbPoolV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/LbPoolV2Status.java index 9f5bf6ad3..2996775a0 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/LbPoolV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/LbPoolV2Status.java @@ -8,42 +8,49 @@ /** * The status of an lbaas v2 loadbalancer pool + * * @author emjburns */ @JsonDeserialize(as = NeutronLbPoolV2Status.class) public interface LbPoolV2Status extends ModelEntity { /** * The id of the loadbalancer pool + * * @return id */ public String getId(); /** * The name of the loadbalancer pool + * * @return name */ public String getName(); /** * The operating status of the loadbalancer pool + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the loadbalancer pool + * * @return provisioning status */ public String getProvisioningStatus(); /** * The status of the healthmonitor associated with this pool + * * @return HealthMonitorV2Status */ public HealthMonitorV2Status getHeathMonitorStatus(); /** * The status of the members of the loadbalancer pool + * * @return list of MemberV2Status */ public List getMemberStatuses(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java index 898a4b8b9..ed473c46e 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java @@ -10,30 +10,35 @@ public interface ListenerV2Status extends ModelEntity { /** * The name of the listener + * * @return name */ public String getName(); /** * The id of the listener + * * @return id */ public String getId(); /** * The operating status of the listener + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the listener + * * @return provisioning status */ public String getProvisioningStatus(); /** * The statuses of the pools associated with this listener + * * @return list of the status of the pools */ public List getLbPoolV2Statuses(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java index 00fd8e930..1651f9c60 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java @@ -8,36 +8,42 @@ /** * The status of an lbaas v2 loadbalancer + * * @author emjburns */ @JsonDeserialize(as = NeutronLoadBalancerV2Status.class) public interface LoadBalancerV2Status extends ModelEntity { /** * The id of the loadbalancer + * * @return id */ public String getId(); /** * The name of the loadbalancer + * * @return name */ public String getName(); /** * The operating status of the loadbalancer + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the loadbalancer + * * @return provisioning status */ public String getProvisioningStatus(); /** * The listeners associated with the loadbalancer + * * @return list of listener statuses */ public List getListenerStatuses(); diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java index 3390dd90e..c55f775d3 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java @@ -6,36 +6,42 @@ /** * The status of an lbaas v2 member + * * @author emjburns */ @JsonDeserialize(as = NeutronMemberV2Status.class) public interface MemberV2Status extends ModelEntity { /** * The id of the member + * * @return id */ public String getId(); /** * The address of the memeber + * * @return address */ public String getAddress(); /** * The protocol port of the member + * * @return protocol port */ public Integer getProtocolPort(); /** * The operating status of the member + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the member + * * @return provisioning status */ public String getProvisioningStatus(); diff --git a/core/src/main/java/org/openstack4j/model/network/options/PortListOptions.java b/core/src/main/java/org/openstack4j/model/network/options/PortListOptions.java index 2b8e5cfa3..b5039bd4c 100644 --- a/core/src/main/java/org/openstack4j/model/network/options/PortListOptions.java +++ b/core/src/main/java/org/openstack4j/model/network/options/PortListOptions.java @@ -1,65 +1,65 @@ package org.openstack4j.model.network.options; -import java.util.Map; - import com.google.common.collect.Maps; +import java.util.Map; + /** * Provides server-side filtering options for listing ports - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ public class PortListOptions { - - private Map queryParams = Maps.newHashMap(); - private PortListOptions() { } - + private Map queryParams = Maps.newHashMap(); + + private PortListOptions() { + } + public static PortListOptions create() { return new PortListOptions(); } - + /** * The ID of the entity that uses this port. For example, a DHCP agent. - * + * * @param deviceOwner the device owner * @return options */ public PortListOptions deviceOwner(String deviceOwner) { return add("device_owner", deviceOwner); } - + /** * The ID of the device that uses this port. For example, a virtual server. - * + * * @param deviceId the device id * @return options */ public PortListOptions deviceId(String deviceId) { return add("device_id", deviceId); } - + /** * The ID of the attached network - * + * * @param networkId the network id * @return options */ public PortListOptions networkId(String networkId) { return add("network_id", networkId); } - + /** * The administrative state of the router, which is up (true) or down (false) - * + * * @param adminState the admin state * @return options */ public PortListOptions adminState(boolean adminState) { return add("admin_state", String.valueOf(adminState)); } - + /** * DEPRECATED: This option is not valid anymore since * neutron port does not have attribute named "display_name". @@ -72,7 +72,7 @@ public PortListOptions adminState(boolean adminState) { public PortListOptions displayName(String displayName) { return add("display_name", displayName); } - + /** * The port name * @@ -82,33 +82,33 @@ public PortListOptions displayName(String displayName) { public PortListOptions name(String name) { return add("name", name); } - + /** * The ID of the tenant who owns the network - * + * * @param tenantId the tenant id * @return options */ public PortListOptions tenantId(String tenantId) { return add("tenant_id", tenantId); } - + /** * The MAC address of the port - * + * * @param macAddress the mac address * @return options */ public PortListOptions macAddress(String macAddress) { return add("mac_address", macAddress); } - + private PortListOptions add(String param, String value) { if (value != null) this.queryParams.put(param, value); return this; } - + public Map getOptions() { return queryParams; } diff --git a/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorType.java b/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorType.java index 95607a35f..d9861f12e 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorType.java +++ b/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorType.java @@ -1,19 +1,18 @@ package org.openstack4j.model.octavia; import com.fasterxml.jackson.annotation.JsonCreator; + /** * A Health Monitor Type - * - * @author wei * + * @author wei */ public enum HealthMonitorType { - PING, TCP, HTTP, HTTPS; - + PING, TCP, HTTP, HTTPS; + @JsonCreator public static HealthMonitorType forValue(String value) { - if (value != null) - { + if (value != null) { for (HealthMonitorType s : HealthMonitorType.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2.java b/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2.java index bfd7cde80..91635b614 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2.java +++ b/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2.java @@ -9,9 +9,10 @@ /** * A healthMonitor of a Lbaas V2 pool + * * @author wei */ -public interface HealthMonitorV2 extends ModelEntity, Buildable{ +public interface HealthMonitorV2 extends ModelEntity, Buildable { /** * @return id the healthMonitor identifier */ @@ -23,9 +24,8 @@ public interface HealthMonitorV2 extends ModelEntity, Buildable getPools(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2Update.java b/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2Update.java index 32a38172d..f77ac3628 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2Update.java +++ b/core/src/main/java/org/openstack4j/model/octavia/HealthMonitorV2Update.java @@ -21,31 +21,29 @@ public interface HealthMonitorV2Update extends ModelEntity, Buildable { @@ -43,19 +44,19 @@ public interface LbPoolV2 extends ModelEntity, Buildable { LbMethod getLbMethod(); /** - * * @return SessionPersistence */ SessionPersistence getSessionPersistence(); /** * @return The administrative state of the lb pool, which is up (true) or - * down (false). + * down (false). */ boolean isAdminStateUp(); /** * Listeners associated with the pool + * * @return listeners associated with the pool */ List getListeners(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java b/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java index 01d5b7eff..bf4e9f9b6 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java +++ b/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java @@ -6,37 +6,35 @@ /** * An entity for updating a lbaas v2 lb pool + * * @author wei */ public interface LbPoolV2Update extends ModelEntity, Buildable { /** - * * @return Pool name. Does not have to be unique. */ public String getName(); /** - * * @return Description for the pool. */ public String getDescription(); /** - * * @return The administrative state of the lb pool, which is up (true) or - * down (false). + * down (false). */ public boolean isAdminStateUp(); /** - * * @return The load-balancer algorithm, which is round-robin, least-connections, and so on. This value, which must be supported, is dependent on the load-balancer provider. Round-robin must be supported. */ public LbMethod getLbMethod(); /** * Optional + * * @see Vip#getSessionPersistence() */ public SessionPersistence getSessionPersistence(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/LbProvisioningStatus.java b/core/src/main/java/org/openstack4j/model/octavia/LbProvisioningStatus.java index f781562ce..faf7706ea 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/LbProvisioningStatus.java +++ b/core/src/main/java/org/openstack4j/model/octavia/LbProvisioningStatus.java @@ -15,8 +15,7 @@ public enum LbProvisioningStatus { @JsonCreator public static LbProvisioningStatus forValue(String value) { - if (value != null) - { + if (value != null) { for (LbProvisioningStatus s : LbProvisioningStatus.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/octavia/ListenerProtocol.java b/core/src/main/java/org/openstack4j/model/octavia/ListenerProtocol.java index ddc79e6e2..7b4c05461 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/ListenerProtocol.java +++ b/core/src/main/java/org/openstack4j/model/octavia/ListenerProtocol.java @@ -4,6 +4,7 @@ /** * Protocol options for lbaas v2 listener + * * @author wei */ public enum ListenerProtocol { @@ -14,8 +15,7 @@ public enum ListenerProtocol { @JsonCreator public static ListenerProtocol forValue(String value) { - if (value != null) - { + if (value != null) { for (ListenerProtocol s : ListenerProtocol.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/octavia/ListenerV2.java b/core/src/main/java/org/openstack4j/model/octavia/ListenerV2.java index d1870fc7f..111fae018 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/ListenerV2.java +++ b/core/src/main/java/org/openstack4j/model/octavia/ListenerV2.java @@ -11,6 +11,7 @@ /** * A listener for v2 loadbalancer + * * @author wei */ @JsonDeserialize(as = OctaviaListenerV2.class) @@ -69,7 +70,7 @@ public interface ListenerV2 extends ModelEntity, Buildable { /** * @return The administrative state of the listener, which is up (true) or - * down (false). + * down (false). */ boolean isAdminStateUp(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/ListenerV2Update.java b/core/src/main/java/org/openstack4j/model/octavia/ListenerV2Update.java index 707b0abd9..b1fa40c2b 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/ListenerV2Update.java +++ b/core/src/main/java/org/openstack4j/model/octavia/ListenerV2Update.java @@ -6,35 +6,41 @@ /** * An entity used to update an lbaas v2 listener + * * @author wei */ public interface ListenerV2Update extends ModelEntity, Buildable { /** * Optional + * * @see ListenerV2#isAdminStateUp() */ public boolean isAdminStateUp(); /** * Optional + * * @see ListenerV2#getDescription() */ public String getDescription(); /** * Optional + * * @see ListenerV2#getName() */ public String getName(); /** * Optional + * * @see ListenerV2#getConnectionLimit() */ public Integer getConnectionLimit(); /** * Optional + * * @see ListenerV2#getDefaultTlsContainerRef() */ public String getDefaultTlsContainerRef(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/LoadBalancerV2.java b/core/src/main/java/org/openstack4j/model/octavia/LoadBalancerV2.java index a197e5b06..2127022fb 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/LoadBalancerV2.java +++ b/core/src/main/java/org/openstack4j/model/octavia/LoadBalancerV2.java @@ -9,9 +9,10 @@ /** * An entity used to update an lbaas v2 loadbalancer + * * @author wei */ -public interface LoadBalancerV2 extends ModelEntity, Buildable { +public interface LoadBalancerV2 extends ModelEntity, Buildable { /** * @return id. The unique ID for the loadbalancer. */ @@ -54,7 +55,7 @@ public interface LoadBalancerV2 extends ModelEntity, Buildable { /** * Optional + * * @see LoadBalancerV2#getDescription() */ public String getDescription(); /** * Optional + * * @see LoadBalancerV2#getName() */ public String getName(); /** * Optional + * * @see LoadBalancerV2#isAdminStateUp() */ public boolean isAdminStateUp(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/MemberV2.java b/core/src/main/java/org/openstack4j/model/octavia/MemberV2.java index 382d07ba9..ef732ee98 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/MemberV2.java +++ b/core/src/main/java/org/openstack4j/model/octavia/MemberV2.java @@ -6,9 +6,10 @@ /** * A member of a Lbaas V2 pool + * * @author wei */ -public interface MemberV2 extends ModelEntity, Buildable { +public interface MemberV2 extends ModelEntity, Buildable { /** * @return the member identifier */ @@ -41,7 +42,7 @@ public interface MemberV2 extends ModelEntity, Buildable { /** * @return The administrative state of the member, which is up (true) or - * down (false). + * down (false). */ boolean isAdminStateUp(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/MemberV2Update.java b/core/src/main/java/org/openstack4j/model/octavia/MemberV2Update.java index c856ca686..753388fdc 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/MemberV2Update.java +++ b/core/src/main/java/org/openstack4j/model/octavia/MemberV2Update.java @@ -6,6 +6,7 @@ /** * An entity used to update a member of an lbaas v2 pool + * * @author wei */ public interface MemberV2Update extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/octavia/Protocol.java b/core/src/main/java/org/openstack4j/model/octavia/Protocol.java index ec2520de8..40c042c47 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/Protocol.java +++ b/core/src/main/java/org/openstack4j/model/octavia/Protocol.java @@ -13,8 +13,7 @@ public enum Protocol { @JsonCreator public static Protocol forValue(String value) { - if (value != null) - { + if (value != null) { for (Protocol s : Protocol.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/octavia/SessionPersistence.java b/core/src/main/java/org/openstack4j/model/octavia/SessionPersistence.java index 73b643bf8..5c3cab052 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/SessionPersistence.java +++ b/core/src/main/java/org/openstack4j/model/octavia/SessionPersistence.java @@ -12,22 +12,24 @@ * used, the session_persistence parameter does not appear in the API response. * To clear session persistence for the VIP, set the session_persistence * parameter to null in a VIP update request. - * - * @author wei * + * @author wei */ @JsonDeserialize(as = OctaviaSessionPersistence.class) -public interface SessionPersistence extends ModelEntity,Buildable{ +public interface SessionPersistence extends ModelEntity, Buildable { + + /** + * optional + * + * @return cookie name + */ + public String getCookieName(); - /** - * optional - * @return cookie name - */ - public String getCookieName(); - /** - * required - * @return type. APP_COOKIE,HTTP_COOKIE,SOURCE_IP - */ - public SessionPersistenceType getType(); + /** + * required + * + * @return type. APP_COOKIE,HTTP_COOKIE,SOURCE_IP + */ + public SessionPersistenceType getType(); } diff --git a/core/src/main/java/org/openstack4j/model/octavia/SessionPersistenceType.java b/core/src/main/java/org/openstack4j/model/octavia/SessionPersistenceType.java index 1e8b426dc..b39431fd9 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/SessionPersistenceType.java +++ b/core/src/main/java/org/openstack4j/model/octavia/SessionPersistenceType.java @@ -1,21 +1,20 @@ package org.openstack4j.model.octavia; import com.fasterxml.jackson.annotation.JsonCreator; + /** * SessionPersistence type - * - * @author wei * + * @author wei */ public enum SessionPersistenceType { - APP_COOKIE, + APP_COOKIE, HTTP_COOKIE, SOURCE_IP; - @JsonCreator + @JsonCreator public static SessionPersistenceType forValue(String value) { - if (value != null) - { + if (value != null) { for (SessionPersistenceType s : SessionPersistenceType.values()) { if (s.name().equalsIgnoreCase(value)) { return s; diff --git a/core/src/main/java/org/openstack4j/model/octavia/builder/HealthMonitorV2Builder.java b/core/src/main/java/org/openstack4j/model/octavia/builder/HealthMonitorV2Builder.java index 22524eccf..ed2f87241 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/builder/HealthMonitorV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/octavia/builder/HealthMonitorV2Builder.java @@ -6,58 +6,44 @@ public interface HealthMonitorV2Builder extends Buildable.Builder { /** - * - * @param projectId - * the ID of the project/tenant that owns the resource + * @param projectId the ID of the project/tenant that owns the resource * @return HealthMonitorV2Builder */ HealthMonitorV2Builder projectId(String projectId); /** - * - * @param type - * The type of probe, which is TCP, HTTP, or HTTPS, that is - * sent by the health monitor to verify the member state. + * @param type The type of probe, which is TCP, HTTP, or HTTPS, that is + * sent by the health monitor to verify the member state. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder type(HealthMonitorType type); /** - * - * @param delay - * The time, in seconds, between sending probes to members. + * @param delay The time, in seconds, between sending probes to members. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder delay(Integer delay); /** - * - * @param timeout - * Time in seconds to timeout each probe. + * @param timeout Time in seconds to timeout each probe. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder timeout(Integer timeout); /** - * - * @param maxRetries - * Maximum consecutive health probe tries. + * @param maxRetries Maximum consecutive health probe tries. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder maxRetries(Integer maxRetries); /** - * - * @param maxRetriesDown - * Maximum consecutive health probe tries. + * @param maxRetriesDown Maximum consecutive health probe tries. * @return HealthMonitorV2Builder */ HealthMonitorV2Builder maxRetriesDown(Integer maxRetriesDown); /** - * - * @param poolId - * Pool that this health monitor is assigned to + * @param poolId Pool that this health monitor is assigned to * @return HealthMonitorV2Builder */ HealthMonitorV2Builder poolId(String poolId); @@ -65,8 +51,7 @@ public interface HealthMonitorV2Builder extends Buildable.Builder { +public interface HealthMonitorV2UpdateBuilder extends Builder { /** - * @param delay - * The time, in seconds, between sending probes to members. + * @param delay The time, in seconds, between sending probes to members. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder delay(Integer delay); /** - * - * @param urlPath - * Path portion of URI that will be probed if type is HTTP(S). + * @param urlPath Path portion of URI that will be probed if type is HTTP(S). * @return HealthMonitorUpdateBuilder */ HealthMonitorV2UpdateBuilder urlPath(String urlPath); /** - * - * @param expectedCodes - * Expected HTTP codes for a passing HTTP(S) monitor. + * @param expectedCodes Expected HTTP codes for a passing HTTP(S) monitor. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes); /** - * - * @param httpMethod - * GET/PUT/POST + * @param httpMethod GET/PUT/POST * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder httpMethod(String httpMethod); /** - * - * @param maxRetries - * Maximum consecutive health probe tries. + * @param maxRetries Maximum consecutive health probe tries. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries); /** - * - * @param maxRetriesDown - * Maximum consecutive health probe tries. + * @param maxRetriesDown Maximum consecutive health probe tries. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder maxRetriesDown(Integer maxRetriesDown); /** - * - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp); /** - * - * @param timeout - * Time in seconds to timeout each probe. + * @param timeout Time in seconds to timeout each probe. * @return HealthMonitorV2UpdateBuilder */ HealthMonitorV2UpdateBuilder timeout(Integer timeout); diff --git a/core/src/main/java/org/openstack4j/model/octavia/builder/LbPoolV2Builder.java b/core/src/main/java/org/openstack4j/model/octavia/builder/LbPoolV2Builder.java index c0546c072..dd7817441 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/builder/LbPoolV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/octavia/builder/LbPoolV2Builder.java @@ -10,12 +10,10 @@ * A Builder to create a lbpoolV2 * * @author wei - * */ public interface LbPoolV2Builder extends Buildable.Builder { /** - * @param projectId - * the ID of the project/tenant that owns the resource + * @param projectId the ID of the project/tenant that owns the resource * @return LbPoolV2Builder */ LbPoolV2Builder projectId(String projectId); @@ -23,8 +21,7 @@ public interface LbPoolV2Builder extends Buildable.Builder { /** - * - * @param lbMethod - * The load-balancer algorithm, which is round-robin, - * least-connections, and so on. This value, which must be - * supported, is dependent on the load-balancer provider. Round - * robin must be supported. + * @param lbMethod The load-balancer algorithm, which is round-robin, + * least-connections, and so on. This value, which must be + * supported, is dependent on the load-balancer provider. Round + * robin must be supported. * @return LbPoolV2UpdateBuilder */ - public LbPoolV2UpdateBuilder lbMethod(LbMethod lbMethod); + public LbPoolV2UpdateBuilder lbMethod(LbMethod lbMethod); /** - * - * @param name - * Pool name. Does not have to be unique. + * @param name Pool name. Does not have to be unique. * @return LbPoolV2UpdateBuilder */ - public LbPoolV2UpdateBuilder name(String name); + public LbPoolV2UpdateBuilder name(String name); /** - * - * @param description - * Description for the pool. + * @param description Description for the pool. * @return LbPoolV2UpdateBuilder */ public LbPoolV2UpdateBuilder description(String description); + /** - * - * @param adminStateUp - * The administrative state of the lb pool, which is up (true) or - * down (false). + * @param adminStateUp The administrative state of the lb pool, which is up (true) or + * down (false). * @return LbPoolV2UpdateBuilder */ - public LbPoolV2UpdateBuilder adminStateUp(boolean adminStateUp); + public LbPoolV2UpdateBuilder adminStateUp(boolean adminStateUp); /** * Optional * - * @param sessionPersistence - * Session persistence parameters for the lbpool. Omit the - * session_persistence parameter to prevent session persistence. - * When no session persistence is used, the session_persistence - * parameter does not appear in the API response. To clear - * session persistence for the lbpool, set the session_persistence - * parameter to null in a lbpool update request. + * @param sessionPersistence Session persistence parameters for the lbpool. Omit the + * session_persistence parameter to prevent session persistence. + * When no session persistence is used, the session_persistence + * parameter does not appear in the API response. To clear + * session persistence for the lbpool, set the session_persistence + * parameter to null in a lbpool update request. * @return LbPoolV2UpdateBuilder */ - LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence); + LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence); } diff --git a/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2Builder.java b/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2Builder.java index 7f7baf5b0..5ba8dcea4 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2Builder.java @@ -8,22 +8,21 @@ public interface ListenerV2Builder extends Buildable.Builder { /** - * @param projectId - * the ID of the project/tenant that owns the resource + * @param projectId the ID of the project/tenant that owns the resource * @return ListenerV2Builder */ ListenerV2Builder projectId(String projectId); /** - * @param protocol - * The protocol of the VIP address. A valid value is TCP, HTTP, - * or HTTPS. + * @param protocol The protocol of the VIP address. A valid value is TCP, HTTP, + * or HTTPS. * @return ListenerV2Builder */ ListenerV2Builder protocol(ListenerProtocol protocol); /** * The port in which the frontend will be listening. Must be an integer in the range of 1-65535 + * * @param protocolPort * @return ListenerV2Builder */ @@ -32,6 +31,7 @@ public interface ListenerV2Builder extends Buildable.Builder * The default value for this attribute will be -1, indicating an infinite limit. + * * @param connectionLimit * @return ListenerV2Builder */ @@ -75,8 +74,9 @@ public interface ListenerV2Builder extends Buildable.Builder * Barbican container with tls policy + * * @param tlsContainerRef * @return ListenerV2Builder */ @@ -84,8 +84,9 @@ public interface ListenerV2Builder extends Buildable.Builder * Barbican container(s) with sni certificates + * * @param sniContainerRefs * @return ListenerV2Builder */ diff --git a/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2UpdateBuilder.java b/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2UpdateBuilder.java index 1667de8d0..2e3fa0bd7 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2UpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/octavia/builder/ListenerV2UpdateBuilder.java @@ -5,6 +5,7 @@ /** * A Builder to update a lbaas v2 listener + * * @author wei */ public interface ListenerV2UpdateBuilder extends Buildable.Builder { @@ -12,8 +13,7 @@ public interface ListenerV2UpdateBuilder extends Buildable.Builder * The tls container reference + * * @param defaultTlsContainerRef * @return ListenerV2UpdateBuilder */ diff --git a/core/src/main/java/org/openstack4j/model/octavia/builder/LoadBalancerV2Builder.java b/core/src/main/java/org/openstack4j/model/octavia/builder/LoadBalancerV2Builder.java index 4abb3d139..466d7c4bc 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/builder/LoadBalancerV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/octavia/builder/LoadBalancerV2Builder.java @@ -5,8 +5,7 @@ public interface LoadBalancerV2Builder extends Buildable.Builder { /** - * @param projectId - * the ID of the project/tenant that owns the resource + * @param projectId the ID of the project/tenant that owns the resource * @return LoadBalancerV2Builder */ LoadBalancerV2Builder projectId(String projectId); @@ -14,8 +13,7 @@ public interface LoadBalancerV2Builder extends Buildable.Builder { /** * Optional - * @param description - * Human-readable description for the load balancer. + * + * @param description Human-readable description for the load balancer. * @return LoadBalancerV2UpdateBuilder */ public LoadBalancerV2UpdateBuilder description(String description); /** - * @param name - * Human-readable name for the load balancer. + * @param name Human-readable name for the load balancer. * @return LoadBalancerV2UpdateBuilder */ public LoadBalancerV2UpdateBuilder name(String name); /** * Optional - * @param adminStateUp - * The administrative state of the VIP. A valid value is true - * (UP) or false (DOWN). + * + * @param adminStateUp The administrative state of the VIP. A valid value is true + * (UP) or false (DOWN). * @return LoadBalancerV2UpdateBuilder */ public LoadBalancerV2UpdateBuilder adminStateUp(boolean adminStateUp); diff --git a/core/src/main/java/org/openstack4j/model/octavia/builder/MemberV2Builder.java b/core/src/main/java/org/openstack4j/model/octavia/builder/MemberV2Builder.java index a0eeb6cd5..6f3acc29b 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/builder/MemberV2Builder.java +++ b/core/src/main/java/org/openstack4j/model/octavia/builder/MemberV2Builder.java @@ -5,31 +5,26 @@ public interface MemberV2Builder extends Buildable.Builder { /** - * @param projectId - * the ID of the project/tenant that owns the resource + * @param projectId the ID of the project/tenant that owns the resource * @return MemberV2Builder */ MemberV2Builder projectId(String projectId); /** - * - * @param address - * The IP address of the member. + * @param address The IP address of the member. * @return MemberV2Builder */ MemberV2Builder address(String address); /** - * @param protocolPort - * The port on which the application is hosted. A valid value - * is from 1 to 65535 + * @param protocolPort The port on which the application is hosted. A valid value + * is from 1 to 65535 * @return MemberV2Builder */ MemberV2Builder protocolPort(Integer protocolPort); /** - * @param subnetId - * The subnet in which to access the member + * @param subnetId The subnet in which to access the member * @return MemberV2Builder */ MemberV2Builder subnetId(String subnetId); @@ -37,9 +32,8 @@ public interface MemberV2Builder extends Buildable.Builder { /** - * @param adminStateUp - * The administrative state of the member, which is up (true) or - * down (false). + * @param adminStateUp The administrative state of the member, which is up (true) or + * down (false). * @return MemberV2UpdateBuilder */ public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp); /** - * @param weight - * Weight of member.from 1 to 256 + * @param weight Weight of member.from 1 to 256 * @return MemberUpdateBuilder */ public MemberV2UpdateBuilder weight(Integer weight); diff --git a/core/src/main/java/org/openstack4j/model/octavia/builder/SessionPersistenceBuilder.java b/core/src/main/java/org/openstack4j/model/octavia/builder/SessionPersistenceBuilder.java index 5ee282cf8..4f07185dc 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/builder/SessionPersistenceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/octavia/builder/SessionPersistenceBuilder.java @@ -6,25 +6,24 @@ /** * A builder to create and update a SessionPersistence - * @author wei * + * @author wei */ -public interface SessionPersistenceBuilder extends Builder{ +public interface SessionPersistenceBuilder extends Builder { - /** - * required - * - * @param type - * APP_COOKIE,HTTP_COOKIE,SOURCE_IP - * @return SessionPersistenceBuilder - */ - public SessionPersistenceBuilder type(SessionPersistenceType type); + /** + * required + * + * @param type APP_COOKIE,HTTP_COOKIE,SOURCE_IP + * @return SessionPersistenceBuilder + */ + public SessionPersistenceBuilder type(SessionPersistenceType type); - /** - * optional - * - * @param cookieName - * @return SessionPersistenceBuilder - */ - public SessionPersistenceBuilder cookieName(String cookieName); + /** + * optional + * + * @param cookieName + * @return SessionPersistenceBuilder + */ + public SessionPersistenceBuilder cookieName(String cookieName); } diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/HealthMonitorV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/HealthMonitorV2Status.java index b6948dd50..68445a2c7 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/HealthMonitorV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/HealthMonitorV2Status.java @@ -7,24 +7,28 @@ /** * The status of an lbaas v2 heathmonitor + * * @author wei */ @JsonDeserialize(as = OctaviaHealthMonitorV2Status.class) public interface HealthMonitorV2Status extends ModelEntity { /** * The id of the healthmonitor + * * @return id */ public String getId(); /** - * The health monitor type + * The health monitor type + * * @return HealthMonitorType */ public HealthMonitorType getType(); /** * Provisioning status of the health monitor + * * @return provisioningStatus */ public String getProvisioningStatus(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/LbPoolV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/LbPoolV2Status.java index 4146e7ad9..8358e554b 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/LbPoolV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/LbPoolV2Status.java @@ -8,42 +8,49 @@ /** * The status of an lbaas v2 loadbalancer pool + * * @author wei */ @JsonDeserialize(as = OctaviaLbPoolV2Status.class) public interface LbPoolV2Status extends ModelEntity { /** * The id of the loadbalancer pool + * * @return id */ public String getId(); /** * The name of the loadbalancer pool + * * @return name */ public String getName(); /** * The operating status of the loadbalancer pool + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the loadbalancer pool + * * @return provisioning status */ public String getProvisioningStatus(); /** * The status of the healthmonitor associated with this pool + * * @return HealthMonitorV2Status */ public HealthMonitorV2Status getHeathMonitorStatus(); /** * The status of the members of the loadbalancer pool + * * @return list of MemberV2Status */ public List getMemberStatuses(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java index acdfe9397..d149d0db8 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java @@ -10,30 +10,35 @@ public interface ListenerV2Status extends ModelEntity { /** * The name of the listener + * * @return name */ public String getName(); /** * The id of the listener + * * @return id */ public String getId(); /** * The operating status of the listener + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the listener + * * @return provisioning status */ public String getProvisioningStatus(); /** * The statuses of the pools associated with this listener + * * @return list of the status of the pools */ public List getLbPoolV2Statuses(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java index 0893c6522..03c2df873 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java @@ -8,36 +8,42 @@ /** * The status of an lbaas v2 loadbalancer + * * @author wei */ @JsonDeserialize(as = OctaviaLoadBalancerV2Status.class) public interface LoadBalancerV2Status extends ModelEntity { /** * The id of the loadbalancer + * * @return id */ public String getId(); /** * The name of the loadbalancer + * * @return name */ public String getName(); /** * The operating status of the loadbalancer + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the loadbalancer + * * @return provisioning status */ public String getProvisioningStatus(); /** * The listeners associated with the loadbalancer + * * @return list of listener statuses */ public List getListenerStatuses(); diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java index fbb3be7c5..36bbb6a1a 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java @@ -6,36 +6,42 @@ /** * The status of an lbaas v2 member + * * @author wei */ @JsonDeserialize(as = OctaviaMemberV2Status.class) public interface MemberV2Status extends ModelEntity { /** * The id of the member + * * @return id */ public String getId(); /** * The address of the memeber + * * @return address */ public String getAddress(); /** * The protocol port of the member + * * @return protocol port */ public Integer getProtocolPort(); /** * The operating status of the member + * * @return operating status */ public String getOperatingStatus(); /** * The provisioning status of the member + * * @return provisioning status */ public String getProvisioningStatus(); diff --git a/core/src/main/java/org/openstack4j/model/sahara/Cluster.java b/core/src/main/java/org/openstack4j/model/sahara/Cluster.java index 4d1c62dea..79dc056cd 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/Cluster.java +++ b/core/src/main/java/org/openstack4j/model/sahara/Cluster.java @@ -1,35 +1,34 @@ package org.openstack4j.model.sahara; -import java.util.Date; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonCreator; import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.ClusterBuilder; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * An OpenStack Cluster - * + * * @author ekasit.kijsipongse@nectec.or.th */ public interface Cluster extends ModelEntity, Buildable { enum Status { - /* - * Since it is being developed, this list is not stable yet. Note - * also that Sahara cluster status may appear in 2 words, e.g. - * "Adding Instances", but we match only the first word for simplicity - * until the list is stable. + /* + * Since it is being developed, this list is not stable yet. Note + * also that Sahara cluster status may appear in 2 words, e.g. + * "Adding Instances", but we match only the first word for simplicity + * until the list is stable. * See http://docs.openstack.org/developer/sahara/userdoc/statuses.html for more info. */ - UNRECOGNIZED, VALIDATING, INFRAUPDATING, SPAWNING, WAITING, PREPARING, CONFIGURING, STARTING, ACTIVE, SCALING, ADDING, DECOMMISSIONING, DELETING, ERROR; + UNRECOGNIZED, VALIDATING, INFRAUPDATING, SPAWNING, WAITING, PREPARING, CONFIGURING, STARTING, ACTIVE, SCALING, ADDING, DECOMMISSIONING, DELETING, ERROR; + @JsonCreator public static Status forValue(String value) { - if (value != null) - { + if (value != null) { for (Status s : Status.values()) { if (value.toUpperCase().startsWith(s.name())) return s; @@ -56,7 +55,7 @@ public static Status forValue(String value) { String getClusterTemplateId(); /** - * @return the if the cluster is transient + * @return the if the cluster is transient */ Boolean isTransient(); @@ -68,7 +67,7 @@ public static Status forValue(String value) { /** * @return the configurations of the cluster */ - Map getClusterConfigs(); + Map getClusterConfigs(); /** * @return the created date of the cluster diff --git a/core/src/main/java/org/openstack4j/model/sahara/ClusterTemplate.java b/core/src/main/java/org/openstack4j/model/sahara/ClusterTemplate.java index d0a4e0d12..2f8cc7595 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/ClusterTemplate.java +++ b/core/src/main/java/org/openstack4j/model/sahara/ClusterTemplate.java @@ -1,83 +1,83 @@ package org.openstack4j.model.sahara; -import java.util.Date; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.ClusterTemplateBuilder; +import java.util.Date; +import java.util.List; +import java.util.Map; + /** * A Sahara Cluster Template - * + * * @author Ekasit Kijsipongse */ public interface ClusterTemplate extends ModelEntity, Buildable { - /** - * @return the hadoop version - */ - String getHadoopVersion(); - - /** - * @return the default image identifier - */ - String getDefaultImageId(); - - /** - * @return the name of the node group template - */ - String getName(); - - /** - * @return the updated date - */ - Date getUpdatedAt(); - - /** - * @return the tenant ID - */ - String getTenantId(); - - /** - * @return the plugin name - */ - String getPluginName(); - - /** - * @return the list of anti affinity - */ - List getAntiAffinity(); - - /** - * @return the description of the node group template - */ - String getDescription(); - - /** - * @return the identifier - */ - String getId(); - - /** - * @return the list of node groups - */ - List getNodeGroups(); - - /** - * @return the id of neutron management network - */ - String getManagementNetworkId(); - - /** - * @return the created date - */ - Date getCreatedAt(); - - /** - * @return map of cluster configurations or null - */ - Map getClusterConfigs(); + /** + * @return the hadoop version + */ + String getHadoopVersion(); + + /** + * @return the default image identifier + */ + String getDefaultImageId(); + + /** + * @return the name of the node group template + */ + String getName(); + + /** + * @return the updated date + */ + Date getUpdatedAt(); + + /** + * @return the tenant ID + */ + String getTenantId(); + + /** + * @return the plugin name + */ + String getPluginName(); + + /** + * @return the list of anti affinity + */ + List getAntiAffinity(); + + /** + * @return the description of the node group template + */ + String getDescription(); + + /** + * @return the identifier + */ + String getId(); + + /** + * @return the list of node groups + */ + List getNodeGroups(); + + /** + * @return the id of neutron management network + */ + String getManagementNetworkId(); + + /** + * @return the created date + */ + Date getCreatedAt(); + + /** + * @return map of cluster configurations or null + */ + Map getClusterConfigs(); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/ConfigInfo.java b/core/src/main/java/org/openstack4j/model/sahara/ConfigInfo.java index 04a6193a0..67dfcf985 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/ConfigInfo.java +++ b/core/src/main/java/org/openstack4j/model/sahara/ConfigInfo.java @@ -1,58 +1,58 @@ package org.openstack4j.model.sahara; -import java.util.List; - import org.openstack4j.model.ModelEntity; +import java.util.List; + /** * A Sahara Config Information - * + * * @author ekasit.kijsipongse@nectec.or.th */ public interface ConfigInfo extends ModelEntity { - /** - * @return the default value - */ - String getDefaultValue(); - - /** - * @return the name - */ - String getName(); - - /** - * @return the priority - */ - Integer getPriority(); - - /** - * @return the type (string, int, bool, enum) - */ - String getType(); - - /** - * @return the applicable target - */ - String getApplicableTarget(); - - /** - * @return true if this config is optional - */ - Boolean isOptional(); - - /** - * @return the scope - */ - String getScope(); - - /** - * @return the description - */ - String getDescription(); - - /** - * @return the list of valid config values (if type is enum) - */ - List getConfigValues(); + /** + * @return the default value + */ + String getDefaultValue(); + + /** + * @return the name + */ + String getName(); + + /** + * @return the priority + */ + Integer getPriority(); + + /** + * @return the type (string, int, bool, enum) + */ + String getType(); + + /** + * @return the applicable target + */ + String getApplicableTarget(); + + /** + * @return true if this config is optional + */ + Boolean isOptional(); + + /** + * @return the scope + */ + String getScope(); + + /** + * @return the description + */ + String getDescription(); + + /** + * @return the list of valid config values (if type is enum) + */ + List getConfigValues(); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/DataSource.java b/core/src/main/java/org/openstack4j/model/sahara/DataSource.java index c43efb8cf..619377dd5 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/DataSource.java +++ b/core/src/main/java/org/openstack4j/model/sahara/DataSource.java @@ -1,14 +1,14 @@ package org.openstack4j.model.sahara; -import java.util.Date; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.DataSourceBuilder; +import java.util.Date; + /** * An OpenStack Data Source - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/DataSourceCredentials.java b/core/src/main/java/org/openstack4j/model/sahara/DataSourceCredentials.java index 4d83a5fc2..7092ce25a 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/DataSourceCredentials.java +++ b/core/src/main/java/org/openstack4j/model/sahara/DataSourceCredentials.java @@ -4,7 +4,7 @@ /** * Credentials for Data Source - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/Image.java b/core/src/main/java/org/openstack4j/model/sahara/Image.java index 772128221..a7d1d1a8c 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/Image.java +++ b/core/src/main/java/org/openstack4j/model/sahara/Image.java @@ -1,97 +1,96 @@ package org.openstack4j.model.sahara; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openstack4j.model.ModelEntity; + import java.util.Date; import java.util.List; import java.util.Map; -import org.openstack4j.model.ModelEntity; - -import com.fasterxml.jackson.annotation.JsonCreator; - /** * A Sahara image - * + * * @author ekasit.kijsipongse@nectec.or.th */ public interface Image extends ModelEntity { - enum Status { - UNRECOGNIZED, ACTIVE, SAVING, QUEUED, KILLED, PENDING_DELETE, DELETED, ERROR; // Use Glance Image Status - - @JsonCreator - public static Status forValue(String v) { - if (v == null) return UNRECOGNIZED; - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } + enum Status { + UNRECOGNIZED, ACTIVE, SAVING, QUEUED, KILLED, PENDING_DELETE, DELETED, ERROR; // Use Glance Image Status + + @JsonCreator + public static Status forValue(String v) { + if (v == null) return UNRECOGNIZED; + try { + return valueOf(v.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; } } + } + + /** + * @return the status of this image + */ + Status getStatus(); + + /** + * @return the username of this image + */ + String getUsername(); + + /** + * @return the date the image was last updated + */ + Date getUpdated(); + + /** + * @return the size in bytes + */ + long getSize(); + + /** + * @return the descriptive name of the image + */ + String getName(); + + /** + * @return the date the image was created + */ + Date getCreated(); + + /** + * @return the tags associated with this image + */ + List getTags(); + + /** + * @return the minimum disk in bytes + */ + int getMinDisk(); + + /** + * @return the progress of the image during upload or setup + */ + int getProgress(); + + /** + * @return the minimum ram in bytes + */ + int getMinRam(); + + /** + * @return extra metadata/specs associated with the image + */ + Map getMetaData(); + + /** + * @return the identifier of this image + */ + String getId(); + + /** + * @return the description of this image + */ + String getDescription(); - /** - * @return the status of this image - */ - Status getStatus(); - - /** - * @return the username of this image - */ - String getUsername(); - - /** - * @return the date the image was last updated - */ - Date getUpdated(); - - /** - * @return the size in bytes - */ - long getSize(); - - /** - * @return the descriptive name of the image - */ - String getName(); - - /** - * @return the date the image was created - */ - Date getCreated(); - - /** - * @return the tags associated with this image - */ - List getTags(); - - /** - * @return the minimum disk in bytes - */ - int getMinDisk(); - - /** - * @return the progress of the image during upload or setup - */ - int getProgress(); - - /** - * @return the minimum ram in bytes - */ - int getMinRam(); - - /** - * @return extra metadata/specs associated with the image - */ - Map getMetaData(); - - /** - * @return the identifier of this image - */ - String getId(); - - /** - * @return the description of this image - */ - String getDescription(); - } diff --git a/core/src/main/java/org/openstack4j/model/sahara/Instance.java b/core/src/main/java/org/openstack4j/model/sahara/Instance.java index 6a0f4b2e8..6a17d0705 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/Instance.java +++ b/core/src/main/java/org/openstack4j/model/sahara/Instance.java @@ -1,56 +1,57 @@ package org.openstack4j.model.sahara; +import org.openstack4j.model.ModelEntity; + import java.util.Date; import java.util.List; -import org.openstack4j.model.ModelEntity; - /** * An Openstack Sahara Instance - * + * * @author ekasit.kijsipongse@nectec.or.th */ public interface Instance extends ModelEntity { - /** - * @return the name of the instance - */ - String getName(); - - /** - * @return the created date of the instance - */ - Date getCreatedAt(); - - /** - * @return the updated date of the instance - */ - Date getUpdatedAt(); - - /** - * @return the NOVA instance identifier - */ - String getInstanceId(); - - /** - * @return the management IP of the instance - */ - String getManagementIp(); - - /** - * TODO: how volumes are presented? - * @return the volumes of the instance - */ - List getVolumes(); - - /** - * @return the internal IP of the instance - */ - String getInternalIp(); - - /** - * @return the Sahara instance identifier - */ - String getId(); - + /** + * @return the name of the instance + */ + String getName(); + + /** + * @return the created date of the instance + */ + Date getCreatedAt(); + + /** + * @return the updated date of the instance + */ + Date getUpdatedAt(); + + /** + * @return the NOVA instance identifier + */ + String getInstanceId(); + + /** + * @return the management IP of the instance + */ + String getManagementIp(); + + /** + * TODO: how volumes are presented? + * + * @return the volumes of the instance + */ + List getVolumes(); + + /** + * @return the internal IP of the instance + */ + String getInternalIp(); + + /** + * @return the Sahara instance identifier + */ + String getId(); + } diff --git a/core/src/main/java/org/openstack4j/model/sahara/Job.java b/core/src/main/java/org/openstack4j/model/sahara/Job.java index 198ce0fa1..85796e59b 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/Job.java +++ b/core/src/main/java/org/openstack4j/model/sahara/Job.java @@ -1,19 +1,19 @@ package org.openstack4j.model.sahara; -import java.util.Date; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.JobBuilder; +import java.util.Date; +import java.util.List; + /** * An Openstack Sahara Job - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ -public interface Job extends ModelEntity, Buildable { +public interface Job extends ModelEntity, Buildable { /** * @return the description of the job @@ -49,7 +49,7 @@ public interface Job extends ModelEntity, Buildable { * @return the type of the job */ String getType(); - + /** * @return mains */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobBinary.java b/core/src/main/java/org/openstack4j/model/sahara/JobBinary.java index 0c5d3b714..c94909ca9 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobBinary.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobBinary.java @@ -1,18 +1,18 @@ package org.openstack4j.model.sahara; -import java.util.Date; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.JobBinaryBuilder; +import java.util.Date; + /** * An Openstack Sahara Job Binary - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ -public interface JobBinary extends ModelEntity, Buildable { +public interface JobBinary extends ModelEntity, Buildable { /** * @return the description of the job binary diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobBinaryCredentials.java b/core/src/main/java/org/openstack4j/model/sahara/JobBinaryCredentials.java index a4d1cabb8..cab96e82b 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobBinaryCredentials.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobBinaryCredentials.java @@ -4,7 +4,7 @@ /** * Credentials for JobBinary - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobBinaryInternal.java b/core/src/main/java/org/openstack4j/model/sahara/JobBinaryInternal.java index de9a47e8e..7e86d2931 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobBinaryInternal.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobBinaryInternal.java @@ -1,12 +1,12 @@ package org.openstack4j.model.sahara; -import java.util.Date; - import org.openstack4j.model.ModelEntity; +import java.util.Date; + /** * An Openstack Sahara Job Binary Internal - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobConfig.java b/core/src/main/java/org/openstack4j/model/sahara/JobConfig.java index 453cdcd8d..6a43e4862 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobConfig.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobConfig.java @@ -1,15 +1,15 @@ package org.openstack4j.model.sahara; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.JobConfigBuilder; +import java.util.List; +import java.util.Map; + /** * An Configuration for Sahara Job Execution - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobConfigHint.java b/core/src/main/java/org/openstack4j/model/sahara/JobConfigHint.java index 8acf3ae68..eaf4bcfcc 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobConfigHint.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobConfigHint.java @@ -1,8 +1,9 @@ package org.openstack4j.model.sahara; -import java.util.List; import org.openstack4j.model.ModelEntity; +import java.util.List; + /** * Hints for job configuration that can be applied to job exeuctions. * diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobConfigHintConfig.java b/core/src/main/java/org/openstack4j/model/sahara/JobConfigHintConfig.java index a7e90785c..af52ad3cc 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobConfigHintConfig.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobConfigHintConfig.java @@ -7,7 +7,7 @@ * @author siwat.pru@outlook.com */ public interface JobConfigHintConfig { - + /** * @return name of the configuration */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobExecution.java b/core/src/main/java/org/openstack4j/model/sahara/JobExecution.java index f8a9ddd3c..2cd0b2c05 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobExecution.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobExecution.java @@ -1,14 +1,14 @@ package org.openstack4j.model.sahara; -import java.util.Date; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.JobExecutionBuilder; +import java.util.Date; + /** * An Openstack Sahara Job Execution - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobExecutionAction.java b/core/src/main/java/org/openstack4j/model/sahara/JobExecutionAction.java index cc9c18883..2c32d4dbf 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobExecutionAction.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobExecutionAction.java @@ -1,12 +1,12 @@ package org.openstack4j.model.sahara; -import java.util.Date; - import org.openstack4j.model.ModelEntity; +import java.util.Date; + /** * An Action of Sahara Job Execution - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ @@ -21,7 +21,7 @@ public interface JobExecutionAction extends ModelEntity { String getStats(); Date getStartTime(); - + Date getEndTime(); String getCred(); diff --git a/core/src/main/java/org/openstack4j/model/sahara/JobExecutionInfo.java b/core/src/main/java/org/openstack4j/model/sahara/JobExecutionInfo.java index c5cf4f616..6c29f40ee 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/JobExecutionInfo.java +++ b/core/src/main/java/org/openstack4j/model/sahara/JobExecutionInfo.java @@ -1,13 +1,13 @@ package org.openstack4j.model.sahara; +import org.openstack4j.model.ModelEntity; + import java.util.Date; import java.util.List; -import org.openstack4j.model.ModelEntity; - /** * An Info of Sahara Job Execution - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/NodeGroup.java b/core/src/main/java/org/openstack4j/model/sahara/NodeGroup.java index f51ef5564..549d93318 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/NodeGroup.java +++ b/core/src/main/java/org/openstack4j/model/sahara/NodeGroup.java @@ -1,97 +1,97 @@ package org.openstack4j.model.sahara; -import java.util.Date; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.NodeGroupBuilder; +import java.util.Date; +import java.util.List; +import java.util.Map; + /** - * A Sahara Node Group - * + * A Sahara Node Group + * * @author Ekasit Kijsipongse */ public interface NodeGroup extends ModelEntity, Buildable { - /** - * @return the name of the node group - */ - String getName(); - - /** - * @return the number of instances in node groups - */ - Integer getCount(); - - /** - * @return the id of node group template - */ - String getNodeGroupTemplateId(); - - /** - * @return the created date - */ - Date getCreatedAt(); - - /** - * @return the updated date - */ - Date getUpdatedAt(); - - /** - * @return the id of floating IP Pool - */ - String getFloatingNetworkId(); - - /** - * @return the number of volumes per node - */ - Integer getVolumesPerNode(); - - /** - * @return the volumes size - */ - Integer getVolumesSize(); - - /** - * @return the volume mount prefix - */ - String getVolumeMountPrefix(); - - /** - * @return the image identifier - */ - String getImageId(); - - /** - * @return the flavor identifier - */ - String getFlavorId(); - - /** - * @return the security groups - */ - List getSecurityGroups(); - - /** - * @return the auto security group - */ - Boolean isAutoSecurityGroup(); - - /** - * @return node processes - */ - List getNodeProcesses(); - - /** - * @return map of service configurations or null - */ - Map getServiceConfigs(); - - /** - * @return instances in the node group - */ - List< ? extends Instance> getInstances(); + /** + * @return the name of the node group + */ + String getName(); + + /** + * @return the number of instances in node groups + */ + Integer getCount(); + + /** + * @return the id of node group template + */ + String getNodeGroupTemplateId(); + + /** + * @return the created date + */ + Date getCreatedAt(); + + /** + * @return the updated date + */ + Date getUpdatedAt(); + + /** + * @return the id of floating IP Pool + */ + String getFloatingNetworkId(); + + /** + * @return the number of volumes per node + */ + Integer getVolumesPerNode(); + + /** + * @return the volumes size + */ + Integer getVolumesSize(); + + /** + * @return the volume mount prefix + */ + String getVolumeMountPrefix(); + + /** + * @return the image identifier + */ + String getImageId(); + + /** + * @return the flavor identifier + */ + String getFlavorId(); + + /** + * @return the security groups + */ + List getSecurityGroups(); + + /** + * @return the auto security group + */ + Boolean isAutoSecurityGroup(); + + /** + * @return node processes + */ + List getNodeProcesses(); + + /** + * @return map of service configurations or null + */ + Map getServiceConfigs(); + + /** + * @return instances in the node group + */ + List getInstances(); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/NodeGroupTemplate.java b/core/src/main/java/org/openstack4j/model/sahara/NodeGroupTemplate.java index a7c1f40b9..921be2084 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/NodeGroupTemplate.java +++ b/core/src/main/java/org/openstack4j/model/sahara/NodeGroupTemplate.java @@ -1,108 +1,108 @@ package org.openstack4j.model.sahara; -import java.util.Date; -import java.util.List; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.NodeGroupTemplateBuilder; +import java.util.Date; +import java.util.List; +import java.util.Map; + /** * A Sahara Node Group Template - * + * * @author Ekasit Kijsipongse */ public interface NodeGroupTemplate extends ModelEntity, Buildable { - /** - * @return the identifier - */ - String getId(); - - /** - * @return the name of the node group template - */ - String getName(); - - /** - * @return the description of the node group template - */ - String getDescription(); - - /** - * @return the hadoop version - */ - String getHadoopVersion(); - - /** - * @return the plugin name - */ - String getPluginName(); - - /** - * @return the tenant ID - */ - String getTenantId(); - - /** - * @return the created date - */ - Date getCreatedAt(); - - /** - * @return the updated date - */ - Date getUpdatedAt(); - - /** - * @return the id of floating IP Pool - */ - String getFloatingNetworkId(); - - /** - * @return the number of volumes per node - */ - Integer getVolumesPerNode(); - - /** - * @return the volumes size - */ - Integer getVolumesSize(); - - /** - * @return the volume mount prefix - */ - String getVolumeMountPrefix(); - - /** - * @return the image identifier - */ - String getImageId(); - - /** - * @return the flavor identifier - */ - String getFlavorId(); - - /** - * @return the security groups - */ - List getSecurityGroups(); - - /** - * @return the auto security group - */ - Boolean isAutoSecurityGroup(); - - /** - * @return node processes - */ - List getNodeProcesses(); - - /** - * @return map of service configurations or null - */ - Map getServiceConfigs(); + /** + * @return the identifier + */ + String getId(); + + /** + * @return the name of the node group template + */ + String getName(); + + /** + * @return the description of the node group template + */ + String getDescription(); + + /** + * @return the hadoop version + */ + String getHadoopVersion(); + + /** + * @return the plugin name + */ + String getPluginName(); + + /** + * @return the tenant ID + */ + String getTenantId(); + + /** + * @return the created date + */ + Date getCreatedAt(); + + /** + * @return the updated date + */ + Date getUpdatedAt(); + + /** + * @return the id of floating IP Pool + */ + String getFloatingNetworkId(); + + /** + * @return the number of volumes per node + */ + Integer getVolumesPerNode(); + + /** + * @return the volumes size + */ + Integer getVolumesSize(); + + /** + * @return the volume mount prefix + */ + String getVolumeMountPrefix(); + + /** + * @return the image identifier + */ + String getImageId(); + + /** + * @return the flavor identifier + */ + String getFlavorId(); + + /** + * @return the security groups + */ + List getSecurityGroups(); + + /** + * @return the auto security group + */ + Boolean isAutoSecurityGroup(); + + /** + * @return node processes + */ + List getNodeProcesses(); + + /** + * @return map of service configurations or null + */ + Map getServiceConfigs(); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/Plugin.java b/core/src/main/java/org/openstack4j/model/sahara/Plugin.java index f5618d265..3009b0280 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/Plugin.java +++ b/core/src/main/java/org/openstack4j/model/sahara/Plugin.java @@ -1,51 +1,51 @@ package org.openstack4j.model.sahara; +import org.openstack4j.model.ModelEntity; + import java.util.List; import java.util.Map; -import org.openstack4j.model.ModelEntity; - /** - * A Sahara Plugin - * + * A Sahara Plugin + * * @author ekasit.kijsipongse@nectec.or.th */ public interface Plugin extends ModelEntity { - /** - * @return the plugin description - */ - String getDescription(); - - /** - * @return the available plugin versions - */ - List getVersions(); - - /** - * @return the name of the plugin - */ - String getName(); - - /** - * @return the title of the plugin - */ - String getTitle(); - - /** - * @return the list of processes in a specific service (node_processes in Sahara plugin terminology) - */ - Map> getServiceProcesses(); - - - /** - * @return the list of required image tags - */ - List getRequiredImageTags(); - - /** - * @return the list of config information (definitions and default values) - */ - List getConfigInfos(); + /** + * @return the plugin description + */ + String getDescription(); + + /** + * @return the available plugin versions + */ + List getVersions(); + + /** + * @return the name of the plugin + */ + String getName(); + + /** + * @return the title of the plugin + */ + String getTitle(); + + /** + * @return the list of processes in a specific service (node_processes in Sahara plugin terminology) + */ + Map> getServiceProcesses(); + + + /** + * @return the list of required image tags + */ + List getRequiredImageTags(); + + /** + * @return the list of config information (definitions and default values) + */ + List getConfigInfos(); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/ServiceConfig.java b/core/src/main/java/org/openstack4j/model/sahara/ServiceConfig.java index 83a778c14..5ffda5a2a 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/ServiceConfig.java +++ b/core/src/main/java/org/openstack4j/model/sahara/ServiceConfig.java @@ -1,11 +1,11 @@ package org.openstack4j.model.sahara; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.builder.ServiceConfigBuilder; +import java.util.Map; + /** * Service Configuration Model * @@ -18,10 +18,10 @@ public interface ServiceConfig extends ModelEntity, Buildable getConfigs(); - + } diff --git a/core/src/main/java/org/openstack4j/model/sahara/ServiceInfo.java b/core/src/main/java/org/openstack4j/model/sahara/ServiceInfo.java index 588371301..d474e2f15 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/ServiceInfo.java +++ b/core/src/main/java/org/openstack4j/model/sahara/ServiceInfo.java @@ -1,9 +1,9 @@ package org.openstack4j.model.sahara; -import java.util.Map; - import org.openstack4j.model.ModelEntity; +import java.util.Map; + /** * Service Information Model * @@ -16,10 +16,10 @@ public interface ServiceInfo extends ModelEntity { * @return the information */ String get(String name); - + /** * @return map of all information or null */ Map getInfos(); - + } diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterBuilder.java index 434a2012b..094e3cf30 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterBuilder.java @@ -8,86 +8,86 @@ /** * Builder interface used for {@link Cluster} object. * For mapping from object builder to JSON request - * + * * @author ekasit.kijsipongse@nectec.or.th */ public interface ClusterBuilder extends Builder { - // - // Define setter apis for user to create a new cluster - // - - /** - * See {@link Cluster#getName()} - * - * @param name the name of the cluster - * @return ClusterBuilder - */ - ClusterBuilder name(String name); - - /** - * See {@link Cluster#getHadoopVersion()} - * - * @param hadoopVersion the version of hadoop - * @return ClusterBuilder - */ - ClusterBuilder hadoopVersion(String hadoopVersion); + // + // Define setter apis for user to create a new cluster + // - /** - * See {@link Cluster#getPluginName()} - * - * @param pluginName the name of the sahara plugin - * @return ClusterBuilder - */ - ClusterBuilder pluginName(String pluginName); + /** + * See {@link Cluster#getName()} + * + * @param name the name of the cluster + * @return ClusterBuilder + */ + ClusterBuilder name(String name); - /** - * See {@link Cluster#getClusterTemplateId()} - * - * @param clusterTemplateId the id of cluster template - * @return ClusterBuilder - */ - ClusterBuilder template(String clusterTemplateId); + /** + * See {@link Cluster#getHadoopVersion()} + * + * @param hadoopVersion the version of hadoop + * @return ClusterBuilder + */ + ClusterBuilder hadoopVersion(String hadoopVersion); - /** - * See {@link Cluster#getDefaultImageId()} - * - * @param imageId the id of image - * @return ClusterBuilder - */ - ClusterBuilder image(String imageId); + /** + * See {@link Cluster#getPluginName()} + * + * @param pluginName the name of the sahara plugin + * @return ClusterBuilder + */ + ClusterBuilder pluginName(String pluginName); - /** - * See {@link Cluster#getKeypairName()} - * - * @param keypairName the name of key pair - * @return ClusterBuilder - */ - ClusterBuilder keypairName(String keypairName); + /** + * See {@link Cluster#getClusterTemplateId()} + * + * @param clusterTemplateId the id of cluster template + * @return ClusterBuilder + */ + ClusterBuilder template(String clusterTemplateId); - /** - * See {@link Cluster#getManagementNetworkId()} - * - * @param networkId the id of management network - * @return ClusterBuilder - */ - ClusterBuilder managementNetworkId(String networkId); + /** + * See {@link Cluster#getDefaultImageId()} + * + * @param imageId the id of image + * @return ClusterBuilder + */ + ClusterBuilder image(String imageId); - /** - * Add a cluster config - * - * @param name the service name - * @param config the config - * @return this builder - */ - ClusterBuilder addServiceConfig(String name, ServiceConfig config); + /** + * See {@link Cluster#getKeypairName()} + * + * @param keypairName the name of key pair + * @return ClusterBuilder + */ + ClusterBuilder keypairName(String keypairName); - /** - * Add a node group - * - * @param nodeGroup the node group - * @return this builder - */ - ClusterBuilder addNodeGroup(NodeGroup nodeGroup); + /** + * See {@link Cluster#getManagementNetworkId()} + * + * @param networkId the id of management network + * @return ClusterBuilder + */ + ClusterBuilder managementNetworkId(String networkId); + + /** + * Add a cluster config + * + * @param name the service name + * @param config the config + * @return this builder + */ + ClusterBuilder addServiceConfig(String name, ServiceConfig config); + + /** + * Add a node group + * + * @param nodeGroup the node group + * @return this builder + */ + ClusterBuilder addNodeGroup(NodeGroup nodeGroup); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterTemplateBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterTemplateBuilder.java index e23befa24..cdb558e4a 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterTemplateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/ClusterTemplateBuilder.java @@ -4,75 +4,74 @@ import org.openstack4j.model.sahara.ClusterTemplate; import org.openstack4j.model.sahara.NodeGroup; import org.openstack4j.model.sahara.ServiceConfig; -import org.openstack4j.model.sahara.builder.ClusterTemplateBuilder; /** * Builder interface used for {@link ClusterTemplate} object. - * + * * @author Ekasit Kijsipongse */ public interface ClusterTemplateBuilder extends Builder { - // - // Define setter apis for user to create a new cluster template - // - - /** - * See {@link ClusterTemplate#getPluginName()} - * - * @param pluginName the name of the sahara plugin - * @return ClusterTemplateBuilder - */ - ClusterTemplateBuilder pluginName(String pluginName); + // + // Define setter apis for user to create a new cluster template + // - /** - * See {@link ClusterTemplate#getHadoopVersion()} - * - * @param hadoopVersion the version of hadoop - * @return ClusterTemplateBuilder - */ - ClusterTemplateBuilder hadoopVersion(String hadoopVersion); + /** + * See {@link ClusterTemplate#getPluginName()} + * + * @param pluginName the name of the sahara plugin + * @return ClusterTemplateBuilder + */ + ClusterTemplateBuilder pluginName(String pluginName); - /** - * Add a node group - * - * @param nodeGroup the node group - * @return this builder - */ - ClusterTemplateBuilder addNodeGroup(NodeGroup nodeGroup); + /** + * See {@link ClusterTemplate#getHadoopVersion()} + * + * @param hadoopVersion the version of hadoop + * @return ClusterTemplateBuilder + */ + ClusterTemplateBuilder hadoopVersion(String hadoopVersion); - /** - * See {@link ClusterTemplate#getName()} - * - * @param name the name of the cluster template - * @return ClusterTemplateBuilder - */ - ClusterTemplateBuilder name(String name); - - /** - * See {@link ClusterTemplate#getDescription()} - * - * @param description the description of cluster template - * @return ClusterTemplateBuilder - */ - ClusterTemplateBuilder description(String description); + /** + * Add a node group + * + * @param nodeGroup the node group + * @return this builder + */ + ClusterTemplateBuilder addNodeGroup(NodeGroup nodeGroup); + /** + * See {@link ClusterTemplate#getName()} + * + * @param name the name of the cluster template + * @return ClusterTemplateBuilder + */ + ClusterTemplateBuilder name(String name); - /** - * See {@link ClusterTemplate#getNeutronManagementNetworkId()} - * - * @param networkId the id of management network - * @return ClusterTemplateBuilder - */ - ClusterTemplateBuilder managementNetworkId(String networkId); + /** + * See {@link ClusterTemplate#getDescription()} + * + * @param description the description of cluster template + * @return ClusterTemplateBuilder + */ + ClusterTemplateBuilder description(String description); - /** - * Add a cluster config - * - * @param name the service name - * @param config the config - * @return this builder - */ - ClusterTemplateBuilder addServiceConfig(String name, ServiceConfig config); + + /** + * See {@link ClusterTemplate#getNeutronManagementNetworkId()} + * + * @param networkId the id of management network + * @return ClusterTemplateBuilder + */ + ClusterTemplateBuilder managementNetworkId(String networkId); + + /** + * Add a cluster config + * + * @param name the service name + * @param config the config + * @return this builder + */ + ClusterTemplateBuilder addServiceConfig(String name, ServiceConfig config); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java b/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java index 128c2f17f..e7fda2aae 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java @@ -1,7 +1,5 @@ package org.openstack4j.model.sahara.builder; -import org.openstack4j.model.sahara.DataSource; - /** * The Data Processing (Sahara) builders */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/DataSourceBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/DataSourceBuilder.java index 9e1e92724..39da9751d 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/DataSourceBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/DataSourceBuilder.java @@ -5,7 +5,7 @@ /** * Builder interface used for {@link DataSource} object. - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ @@ -13,7 +13,7 @@ public interface DataSourceBuilder extends Builder { /** * See {@link JobBinary#getDescription()} - * + * * @param description the description of the job binary * @return JobBinaryBuilder */ @@ -21,7 +21,7 @@ public interface JobBinaryBuilder extends Builder { /** * See {@link JobBinary#getURL()} - * + * * @param url the URL of the job binary * @return JobBinaryBuilder */ @@ -29,7 +29,7 @@ public interface JobBinaryBuilder extends Builder { /** * See {@link JobBinary#getName()} - * + * * @param name the name of the job binary * @return JobBinaryBuilder */ @@ -37,8 +37,8 @@ public interface JobBinaryBuilder extends Builder { /** * See {@link JobBinary#getCredentials()} - * - * @param user username of the credentials + * + * @param user username of the credentials * @param password password of the credentials * @return JobBinaryBuilder */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/JobBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/JobBuilder.java index 5876bddbc..fa1ca19be 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/JobBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/JobBuilder.java @@ -13,7 +13,7 @@ public interface JobBuilder extends Builder { /** * See {@link Job#getDescription()} - * + * * @param description the description of the job * @return JobBuilder */ @@ -21,7 +21,7 @@ public interface JobBuilder extends Builder { /** * See {@link Job#getType()} - * + * * @param type the type of the job * @return JobBuilder */ @@ -29,7 +29,7 @@ public interface JobBuilder extends Builder { /** * See {@link Job#getName()} - * + * * @param name the name of the job * @return JobBuilder */ @@ -37,7 +37,7 @@ public interface JobBuilder extends Builder { /** * See {@link Job#getMainIds()} - * + * * @param id the id of the job binary * @return JobBuilder */ @@ -45,7 +45,7 @@ public interface JobBuilder extends Builder { /** * See {@link Job#getLibId()} - * + * * @param name the name of the job * @return JobBuilder */ diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/JobConfigBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/JobConfigBuilder.java index dd3c3e73d..8517da480 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/JobConfigBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/JobConfigBuilder.java @@ -13,8 +13,8 @@ public interface JobConfigBuilder extends Builder { /** * See {@link JobConfig#getConfigs()} - * - * @param name the name of the configuration + * + * @param name the name of the configuration * @param value the value of the configuration * @return JobConfigBuilder */ @@ -22,7 +22,7 @@ public interface JobConfigBuilder extends Builder { /** * See {@link JobConfig#getArgs()} - * + * * @param arg the argument * @return JobConfigBuilder */ @@ -30,7 +30,7 @@ public interface JobConfigBuilder extends Builder { /** * See {@link JobConfig#getParams()} - * + * * @param param the name of the parameter * @param value the value of the parameter * @return JobConfigBuilder diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/JobExecutionBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/JobExecutionBuilder.java index d20f1c5ef..a1c40257c 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/JobExecutionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/JobExecutionBuilder.java @@ -14,7 +14,7 @@ public interface JobExecutionBuilder extends Builder { - // - // Define setter apis for user to create a new node group - // - - /** - * See {@link NodeGroup#getName()} - * - * @param name the name of the node group - * @return NodeGroupBuilder - */ - NodeGroupBuilder name(String name); - - /** - * See {@link NodeGroup#getCount()} - * - * @param count the number of instances in the node group - * @return NodeGroupBuilder - */ - NodeGroupBuilder count(int count); + // + // Define setter apis for user to create a new node group + // - /** - * See {@link NodeGroup#getNodeGroupTemplateId()} - * - * @param templateId the id of the node group template - * @return NodeGroupBuilder - */ - NodeGroupBuilder nodeGroupTemplateId(String templateId); - - /** - * See {@link NodeGroup#getFloatingNetworkId()} - * - * @param networkId the id of floating IP Pool - * @return NodeGroupBuilder - */ - NodeGroupBuilder floatingIpPool(String networkId); + /** + * See {@link NodeGroup#getName()} + * + * @param name the name of the node group + * @return NodeGroupBuilder + */ + NodeGroupBuilder name(String name); - /** - * See {@link NodeGroup#getFlavorId()} - * - * @param flavorId the id of flavor - * @return NodeGroupBuilder - */ - NodeGroupBuilder flavor(String flavorId); + /** + * See {@link NodeGroup#getCount()} + * + * @param count the number of instances in the node group + * @return NodeGroupBuilder + */ + NodeGroupBuilder count(int count); - /** - * Set the security group. - * - * @param isAutoSecurityGroup true or false - * @return this builder - */ - NodeGroupBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup); + /** + * See {@link NodeGroup#getNodeGroupTemplateId()} + * + * @param templateId the id of the node group template + * @return NodeGroupBuilder + */ + NodeGroupBuilder nodeGroupTemplateId(String templateId); - /** - * Add the security group. - * - * @param id the id - * @return this builder - */ - NodeGroupBuilder addSecurityGroup(String id); + /** + * See {@link NodeGroup#getFloatingNetworkId()} + * + * @param networkId the id of floating IP Pool + * @return NodeGroupBuilder + */ + NodeGroupBuilder floatingIpPool(String networkId); - /** - * Add a node process - * - * @param name the name - * @return this builder - */ - NodeGroupBuilder addNodeProcess(String name); + /** + * See {@link NodeGroup#getFlavorId()} + * + * @param flavorId the id of flavor + * @return NodeGroupBuilder + */ + NodeGroupBuilder flavor(String flavorId); - /** - * Add a service config - * - * @param name the service name - * @param config the config - * @return this builder - */ - NodeGroupBuilder addServiceConfig(String name, ServiceConfig config); + /** + * Set the security group. + * + * @param isAutoSecurityGroup true or false + * @return this builder + */ + NodeGroupBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup); + + /** + * Add the security group. + * + * @param id the id + * @return this builder + */ + NodeGroupBuilder addSecurityGroup(String id); + + /** + * Add a node process + * + * @param name the name + * @return this builder + */ + NodeGroupBuilder addNodeProcess(String name); + + /** + * Add a service config + * + * @param name the service name + * @param config the config + * @return this builder + */ + NodeGroupBuilder addServiceConfig(String name, ServiceConfig config); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/NodeGroupTemplateBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/NodeGroupTemplateBuilder.java index 8e2599dab..d00e55ecc 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/NodeGroupTemplateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/NodeGroupTemplateBuilder.java @@ -3,98 +3,97 @@ import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.sahara.NodeGroupTemplate; import org.openstack4j.model.sahara.ServiceConfig; -import org.openstack4j.model.sahara.builder.NodeGroupTemplateBuilder; /** * Builder interface used for {@link NodeGroupTemplate} object. - * + * * @author Ekasit Kijsipongse */ public interface NodeGroupTemplateBuilder extends Builder { - // - // Define setter apis for user to create a new node group template - // - - /** - * See {@link NodeGroupTemplate#getName()} - * - * @param name the name of the node group template - * @return NodeGroupTemplateBuilder - */ - NodeGroupTemplateBuilder name(String name); - - /** - * See {@link NodeGroupTemplate#getDescription()} - * - * @param description the description of the node group template - * @return NodeGroupTemplateBuilder - */ - NodeGroupTemplateBuilder description(String description); + // + // Define setter apis for user to create a new node group template + // - /** - * See {@link NodeGroupTemplate#getHadoopVersion()} - * - * @param hadoopVersion the version of hadoop - * @return NodeGroupTemplateBuilder - */ - NodeGroupTemplateBuilder hadoopVersion(String hadoopVersion); + /** + * See {@link NodeGroupTemplate#getName()} + * + * @param name the name of the node group template + * @return NodeGroupTemplateBuilder + */ + NodeGroupTemplateBuilder name(String name); - /** - * See {@link NodeGroupTemplate#getPluginName()} - * - * @param pluginName the name of the sahara plugin - * @return NodeGroupTemplateBuilder - */ - NodeGroupTemplateBuilder pluginName(String pluginName); + /** + * See {@link NodeGroupTemplate#getDescription()} + * + * @param description the description of the node group template + * @return NodeGroupTemplateBuilder + */ + NodeGroupTemplateBuilder description(String description); - /** - * See {@link NodeGroupTemplate#getFloatingNetworkId()} - * - * @param networkId the id of floating IP Pool - * @return NodeGroupTemplateBuilder - */ - NodeGroupTemplateBuilder floatingIpPool(String networkId); + /** + * See {@link NodeGroupTemplate#getHadoopVersion()} + * + * @param hadoopVersion the version of hadoop + * @return NodeGroupTemplateBuilder + */ + NodeGroupTemplateBuilder hadoopVersion(String hadoopVersion); - /** - * See {@link NodeGroupTemplate#getFlavorId()} - * - * @param flavorId the id of flavor - * @return NodeGroupTemplateBuilder - */ - NodeGroupTemplateBuilder flavor(String flavorId); + /** + * See {@link NodeGroupTemplate#getPluginName()} + * + * @param pluginName the name of the sahara plugin + * @return NodeGroupTemplateBuilder + */ + NodeGroupTemplateBuilder pluginName(String pluginName); - /** - * Set the security group. - * - * @param isAutoSecurityGroup true or false - * @return this builder - */ - NodeGroupTemplateBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup); + /** + * See {@link NodeGroupTemplate#getFloatingNetworkId()} + * + * @param networkId the id of floating IP Pool + * @return NodeGroupTemplateBuilder + */ + NodeGroupTemplateBuilder floatingIpPool(String networkId); - /** - * Add the security group. - * - * @param id the id - * @return this builder - */ - NodeGroupTemplateBuilder addSecurityGroup(String id); + /** + * See {@link NodeGroupTemplate#getFlavorId()} + * + * @param flavorId the id of flavor + * @return NodeGroupTemplateBuilder + */ + NodeGroupTemplateBuilder flavor(String flavorId); - /** - * Add a node process - * - * @param name the name - * @return this builder - */ - NodeGroupTemplateBuilder addNodeProcess(String name); + /** + * Set the security group. + * + * @param isAutoSecurityGroup true or false + * @return this builder + */ + NodeGroupTemplateBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup); - /** - * Add a service config - * - * @param name the service name - * @param config the config - * @return this builder - */ - NodeGroupTemplateBuilder addServiceConfig(String name, ServiceConfig config); + /** + * Add the security group. + * + * @param id the id + * @return this builder + */ + NodeGroupTemplateBuilder addSecurityGroup(String id); + + /** + * Add a node process + * + * @param name the name + * @return this builder + */ + NodeGroupTemplateBuilder addNodeProcess(String name); + + /** + * Add a service config + * + * @param name the service name + * @param config the config + * @return this builder + */ + NodeGroupTemplateBuilder addServiceConfig(String name, ServiceConfig config); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/ServiceConfigBuilder.java b/core/src/main/java/org/openstack4j/model/sahara/builder/ServiceConfigBuilder.java index a5bee0fe8..c6bd4751e 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/ServiceConfigBuilder.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/ServiceConfigBuilder.java @@ -5,22 +5,22 @@ /** * Builder interface used for {@link ServiceConfig} object. - * + * * @author Ekasit Kijsipongse */ public interface ServiceConfigBuilder extends Builder { - // - // Define setter apis for user to create a new service configuration - // - - /** - * See {@link ServiceConfig#get()} - * - * @param name name of the parameter - * @param value value of the parameter - * @return ServiceConfigBuilder - */ - ServiceConfigBuilder set(String name, Object value); - + // + // Define setter apis for user to create a new service configuration + // + + /** + * See {@link ServiceConfig#get()} + * + * @param name name of the parameter + * @param value value of the parameter + * @return ServiceConfigBuilder + */ + ServiceConfigBuilder set(String name, Object value); + } diff --git a/core/src/main/java/org/openstack4j/model/senlin/Action.java b/core/src/main/java/org/openstack4j/model/senlin/Action.java index 5365827c0..a5be66780 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Action.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Action.java @@ -10,11 +10,9 @@ * This interface describes the getter-methods (and thus components) of a Action. * All getters map to the possible return values of * GET /v1/actions/​{action_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Action extends ResourceEntity { diff --git a/core/src/main/java/org/openstack4j/model/senlin/ActionID.java b/core/src/main/java/org/openstack4j/model/senlin/ActionID.java index d2d6d19e4..3ed0268e2 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ActionID.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ActionID.java @@ -1,19 +1,12 @@ package org.openstack4j.model.senlin; import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.ResourceEntity; - -import java.util.Date; -import java.util.List; -import java.util.Map; /** * This interface describes the getter-methods (and thus components) of a response Action. - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface ActionID extends ModelEntity { diff --git a/core/src/main/java/org/openstack4j/model/senlin/BuildInfo.java b/core/src/main/java/org/openstack4j/model/senlin/BuildInfo.java index 21200e787..dc3a08fac 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/BuildInfo.java +++ b/core/src/main/java/org/openstack4j/model/senlin/BuildInfo.java @@ -8,11 +8,9 @@ * This interface describes the getter-methods (and thus components) of a BuildInfo. * All getters map to the possible return values of * GET /v1/build-info - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface BuildInfo extends ModelEntity { diff --git a/core/src/main/java/org/openstack4j/model/senlin/Cluster.java b/core/src/main/java/org/openstack4j/model/senlin/Cluster.java index b026916a1..ad3bfb871 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Cluster.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Cluster.java @@ -2,7 +2,6 @@ import org.openstack4j.model.ResourceEntity; -import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -11,11 +10,9 @@ * This interface describes the getter-methods (and thus components) of a Cluster. * All getters map to the possible return values of * GET /v1/clusters/​{cluster_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Cluster extends ResourceEntity { diff --git a/core/src/main/java/org/openstack4j/model/senlin/ClusterActionCreate.java b/core/src/main/java/org/openstack4j/model/senlin/ClusterActionCreate.java index 703ecb1fb..8cd75d020 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ClusterActionCreate.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ClusterActionCreate.java @@ -7,9 +7,8 @@ /** * This interface describes the model of a {@link Cluster}, before it is sent to * the server for creation - * + * * @author lion - * */ public interface ClusterActionCreate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/senlin/ClusterCreate.java b/core/src/main/java/org/openstack4j/model/senlin/ClusterCreate.java index 7089db22b..6d73719fb 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ClusterCreate.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ClusterCreate.java @@ -7,9 +7,8 @@ /** * This interface describes the model of a {@link Cluster}, before it is sent to * the server for creation - * + * * @author lion - * */ public interface ClusterCreate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/senlin/ClusterPolicy.java b/core/src/main/java/org/openstack4j/model/senlin/ClusterPolicy.java index fc14afeef..4e8e61fc3 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ClusterPolicy.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ClusterPolicy.java @@ -1,66 +1,63 @@ package org.openstack4j.model.senlin; import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.ResourceEntity; /** * This interface describes the getter-methods (and thus components) of a ClusterPolicy. * All getters map to the possible return values of * GET /v1/clusters/​{cluster_id}​/policies/​{policy_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface ClusterPolicy extends ModelEntity { - /** - * Returns the id of the ClusterPolicy - * - * @return the id of the ClusterPolicy - */ - String getId(); - - /** - * Returns the policy type of the ClusterPolicy - * - * @return the policy type of the ClusterPolicy - */ - String getPolicyType(); - - /** - * Returns the cluster id of the ClusterPolicy - * - * @return the cluster id of the ClusterPolicy - */ - String getClusterID(); - - /** - * Returns the cluster name of the ClusterPolicy - * - * @return the cluster name of the ClusterPolicy - */ - String getClusterName(); - - /** - * Returns the enabled or not of the ClusterPolicy - * - * @return the enabled or not of the ClusterPolicy - */ - Boolean getEnabled(); - - /** - * Returns the policy id of the ClusterPolicy - * - * @return the policy id of the ClusterPolicy - */ - String getPolicyID(); - - /** - * Returns the policy name of the ClusterPolicy - * - * @return the policy name of the ClusterPolicy - */ - String getPolicyName(); + /** + * Returns the id of the ClusterPolicy + * + * @return the id of the ClusterPolicy + */ + String getId(); + + /** + * Returns the policy type of the ClusterPolicy + * + * @return the policy type of the ClusterPolicy + */ + String getPolicyType(); + + /** + * Returns the cluster id of the ClusterPolicy + * + * @return the cluster id of the ClusterPolicy + */ + String getClusterID(); + + /** + * Returns the cluster name of the ClusterPolicy + * + * @return the cluster name of the ClusterPolicy + */ + String getClusterName(); + + /** + * Returns the enabled or not of the ClusterPolicy + * + * @return the enabled or not of the ClusterPolicy + */ + Boolean getEnabled(); + + /** + * Returns the policy id of the ClusterPolicy + * + * @return the policy id of the ClusterPolicy + */ + String getPolicyID(); + + /** + * Returns the policy name of the ClusterPolicy + * + * @return the policy name of the ClusterPolicy + */ + String getPolicyName(); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/ClusterStatus.java b/core/src/main/java/org/openstack4j/model/senlin/ClusterStatus.java index c4533d269..e32b58d21 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ClusterStatus.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ClusterStatus.java @@ -6,27 +6,49 @@ * @author lion */ public enum ClusterStatus { - /** Initialization of the server */ - INIT, - /** Server is running */ - ACTIVE, - /** Server is creating */ - CREATING, - /** Server is updating */ - UPDATING, - /** Server is resizing */ - RESIZING, - /** Server is deleting */ - DELETING, - /** Server is checking */ - CHECKING, - /** Server is recovering */ - RECOVERING, - /** Server is critical */ - CRITICAL, - /** Failed in some conditions,eg. - * failed to create*/ - ERROR, - /** Warning */ - WARNING + /** + * Initialization of the server + */ + INIT, + /** + * Server is running + */ + ACTIVE, + /** + * Server is creating + */ + CREATING, + /** + * Server is updating + */ + UPDATING, + /** + * Server is resizing + */ + RESIZING, + /** + * Server is deleting + */ + DELETING, + /** + * Server is checking + */ + CHECKING, + /** + * Server is recovering + */ + RECOVERING, + /** + * Server is critical + */ + CRITICAL, + /** + * Failed in some conditions,eg. + * failed to create + */ + ERROR, + /** + * Warning + */ + WARNING } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/senlin/Event.java b/core/src/main/java/org/openstack4j/model/senlin/Event.java index d5a65b5af..e151c4434 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Event.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Event.java @@ -8,95 +8,93 @@ * This interface describes the getter-methods (and thus components) of a Event. * All getters map to the possible return values of * GET /v1/events/​{event_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Event extends ModelEntity { - /** - * Returns the id of the Event - * - * @return the id of the Event - */ - String getId(); + /** + * Returns the id of the Event + * + * @return the id of the Event + */ + String getId(); - /** - * Returns the action of the Event - * - * @return the action of the Event - */ - String getAction(); + /** + * Returns the action of the Event + * + * @return the action of the Event + */ + String getAction(); - /** - * Returns the cluster id of the Event - * - * @return the cluster id of the Event - */ - String getClusterID(); + /** + * Returns the cluster id of the Event + * + * @return the cluster id of the Event + */ + String getClusterID(); - /** - * Returns the level of the Event - * - * @return the level of the Event - */ - Integer getLevel(); + /** + * Returns the level of the Event + * + * @return the level of the Event + */ + Integer getLevel(); - /** - * Returns the obj id of the Event - * - * @return the obj id of the Event - */ - String getObjID(); + /** + * Returns the obj id of the Event + * + * @return the obj id of the Event + */ + String getObjID(); - /** - * Returns the obj name of the Event - * - * @return the obj name of the Event - */ - String getObjName(); + /** + * Returns the obj name of the Event + * + * @return the obj name of the Event + */ + String getObjName(); - /** - * Returns the obj type of the Event - * - * @return the obj type of the Event - */ - String getObjType(); + /** + * Returns the obj type of the Event + * + * @return the obj type of the Event + */ + String getObjType(); - /** - * Returns the project of the Event - * - * @return the project of the Event - */ - String getProject(); + /** + * Returns the project of the Event + * + * @return the project of the Event + */ + String getProject(); - /** - * Returns the status of the Event - * - * @return the status of the Event - */ - String getStatus(); + /** + * Returns the status of the Event + * + * @return the status of the Event + */ + String getStatus(); - /** - * Returns the status reason of the Event - * - * @return the status reason of the Event - */ - String getStatusReason(); + /** + * Returns the status reason of the Event + * + * @return the status reason of the Event + */ + String getStatusReason(); - /** - * Returns the timestamp of the Event - * - * @return the timestamp of the Event - */ - Date getTimestamp(); + /** + * Returns the timestamp of the Event + * + * @return the timestamp of the Event + */ + Date getTimestamp(); - /** - * Returns the user of the Event - * - * @return the user of the Event - */ - String getUser(); + /** + * Returns the user of the Event + * + * @return the user of the Event + */ + String getUser(); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/Node.java b/core/src/main/java/org/openstack4j/model/senlin/Node.java index 2235c1bc3..ac10559ca 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Node.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Node.java @@ -9,11 +9,9 @@ * This interface describes the getter-methods (and thus components) of a Node. * All getters map to the possible return values of * GET /v1/nodes/​{node_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Node extends ResourceEntity { diff --git a/core/src/main/java/org/openstack4j/model/senlin/NodeActionCreate.java b/core/src/main/java/org/openstack4j/model/senlin/NodeActionCreate.java index 879cd27fa..e84b00890 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/NodeActionCreate.java +++ b/core/src/main/java/org/openstack4j/model/senlin/NodeActionCreate.java @@ -7,9 +7,8 @@ /** * This interface describes the model of a {@link Node}, before it is sent to * the server for creation - * + * * @author Matthias Reisser - * */ public interface NodeActionCreate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/senlin/NodeCreate.java b/core/src/main/java/org/openstack4j/model/senlin/NodeCreate.java index 4e511362e..b18ebf9c0 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/NodeCreate.java +++ b/core/src/main/java/org/openstack4j/model/senlin/NodeCreate.java @@ -7,9 +7,8 @@ /** * This interface describes the model of a {@link Node}, before it is sent to * the server for creation - * + * * @author lion - * */ public interface NodeCreate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/senlin/Policy.java b/core/src/main/java/org/openstack4j/model/senlin/Policy.java index 623eb797d..125319624 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Policy.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Policy.java @@ -9,11 +9,9 @@ * This interface describes the getter-methods (and thus components) of a Policy. * All getters map to the possible return values of * GET /v1/policies/​{policy_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Policy extends ResourceEntity { diff --git a/core/src/main/java/org/openstack4j/model/senlin/PolicyCreate.java b/core/src/main/java/org/openstack4j/model/senlin/PolicyCreate.java index b62235b46..fd1ccd567 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/PolicyCreate.java +++ b/core/src/main/java/org/openstack4j/model/senlin/PolicyCreate.java @@ -7,9 +7,8 @@ /** * This interface describes the model of a {@link Policy}, before it is sent to * the server for creation - * + * * @author lion - * */ public interface PolicyCreate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/senlin/PolicyType.java b/core/src/main/java/org/openstack4j/model/senlin/PolicyType.java index d130ed683..8a69d022a 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/PolicyType.java +++ b/core/src/main/java/org/openstack4j/model/senlin/PolicyType.java @@ -8,25 +8,23 @@ * This interface describes the getter-methods (and thus components) of a PolicyType. * All getters map to the possible return values of * GET /v1/policy-types/​{policy_type}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface PolicyType extends ModelEntity { - /** - * Returns the name of the PolicyType - * - * @return the name of the PolicyType - */ - String getName(); + /** + * Returns the name of the PolicyType + * + * @return the name of the PolicyType + */ + String getName(); - /** - * Returns the schema of the PolicyType - * - * @return the schema of the PolicyType - */ - Map getSchema(); + /** + * Returns the schema of the PolicyType + * + * @return the schema of the PolicyType + */ + Map getSchema(); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/Profile.java b/core/src/main/java/org/openstack4j/model/senlin/Profile.java index 29827e3ed..e671bf66b 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Profile.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Profile.java @@ -9,11 +9,9 @@ * This interface describes the getter-methods (and thus components) of a Profile. * All getters map to the possible return values of * GET /v1/profiles/​{profile_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Profile extends ResourceEntity { diff --git a/core/src/main/java/org/openstack4j/model/senlin/ProfileCreate.java b/core/src/main/java/org/openstack4j/model/senlin/ProfileCreate.java index 8c17d7528..1320412df 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ProfileCreate.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ProfileCreate.java @@ -7,9 +7,8 @@ /** * This interface describes the model of a {@link Profile}, before it is sent to * the server for creation - * + * * @author lion - * */ public interface ProfileCreate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/senlin/ProfileType.java b/core/src/main/java/org/openstack4j/model/senlin/ProfileType.java index faa63ab51..37c1401cb 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ProfileType.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ProfileType.java @@ -8,25 +8,23 @@ * This interface describes the getter-methods (and thus components) of a ProfileType. * All getters map to the possible return values of * GET /v1/profile-types/​{profile_type}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface ProfileType extends ModelEntity { - /** - * Returns the name of the ProfileType - * - * @return the name of the ProfileType - */ - String getName(); + /** + * Returns the name of the ProfileType + * + * @return the name of the ProfileType + */ + String getName(); - /** - * Returns the schema of the ProfileType - * - * @return the schema of the ProfileType - */ - Map getSchema(); + /** + * Returns the schema of the ProfileType + * + * @return the schema of the ProfileType + */ + Map getSchema(); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/Receiver.java b/core/src/main/java/org/openstack4j/model/senlin/Receiver.java index 068cf7a00..ba0cfbba6 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Receiver.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Receiver.java @@ -2,7 +2,6 @@ import org.openstack4j.model.ResourceEntity; -import java.util.ArrayList; import java.util.Date; import java.util.Map; @@ -10,95 +9,93 @@ * This interface describes the getter-methods (and thus components) of a Receiver. * All getters map to the possible return values of * GET /v1/receivers/​{receiver_id}​ - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Receiver extends ResourceEntity { - /** - * Returns the action of the receiver - * - * @return the action of the receiver - */ - String getAction(); + /** + * Returns the action of the receiver + * + * @return the action of the receiver + */ + String getAction(); - /** - * Returns the cluster id of the receiver - * - * @return the cluster id of the receiver - */ - String getClusterID(); + /** + * Returns the cluster id of the receiver + * + * @return the cluster id of the receiver + */ + String getClusterID(); - /** - * Returns the created at time of the receiver - * - * @return the created at time of the receiver - */ - Date getCreatedAt(); + /** + * Returns the created at time of the receiver + * + * @return the created at time of the receiver + */ + Date getCreatedAt(); - /** - * Returns the domain of the receiver - * - * @return the domain of the receiver - */ - String getDomain(); + /** + * Returns the domain of the receiver + * + * @return the domain of the receiver + */ + String getDomain(); - /** - * Returns the project of the receiver - * - * @return the project of the receiver - */ - String getProject(); + /** + * Returns the project of the receiver + * + * @return the project of the receiver + */ + String getProject(); - /** - * Returns the type of the receiver - * - * @return the type of the receiver - */ - String getType(); + /** + * Returns the type of the receiver + * + * @return the type of the receiver + */ + String getType(); - /** - * Returns the updated at time of the receiver - * - * @return the updated at time of the receiver - */ - Date getUpdatedAt(); + /** + * Returns the updated at time of the receiver + * + * @return the updated at time of the receiver + */ + Date getUpdatedAt(); - /** - * Returns the user of the receiver - * - * @return the user of the receiver - */ - String getUser(); + /** + * Returns the user of the receiver + * + * @return the user of the receiver + */ + String getUser(); - /** - * Returns the actor of the receiver - * - * @return the actor of the receiver - */ - Map getActor(); + /** + * Returns the actor of the receiver + * + * @return the actor of the receiver + */ + Map getActor(); - /** - * Returns the channel of the receiver - * - * @return the channel of the receiver - */ - Map getChannel(); + /** + * Returns the channel of the receiver + * + * @return the channel of the receiver + */ + Map getChannel(); - /** - * Returns the params of the receiver - * - * @return the params of the receiver - */ - Map getParams(); + /** + * Returns the params of the receiver + * + * @return the params of the receiver + */ + Map getParams(); - /** - * Returns the WebHook of the receiver - * - * @return the WebHook of the receiver - */ - String getWebHook(); + /** + * Returns the WebHook of the receiver + * + * @return the WebHook of the receiver + */ + String getWebHook(); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/ReceiverCreate.java b/core/src/main/java/org/openstack4j/model/senlin/ReceiverCreate.java index dcbd2eabc..bb084b0fb 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/ReceiverCreate.java +++ b/core/src/main/java/org/openstack4j/model/senlin/ReceiverCreate.java @@ -7,9 +7,8 @@ /** * This interface describes the model of a {@link Receiver}, before it is sent to * the server for creation - * + * * @author lion - * */ public interface ReceiverCreate extends ModelEntity, Buildable { diff --git a/core/src/main/java/org/openstack4j/model/senlin/Version.java b/core/src/main/java/org/openstack4j/model/senlin/Version.java index bd4828ed9..70b12eef6 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/Version.java +++ b/core/src/main/java/org/openstack4j/model/senlin/Version.java @@ -2,7 +2,6 @@ import org.openstack4j.model.ModelEntity; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -10,32 +9,30 @@ * This interface describes the getter-methods (and thus components) of the version of senlin. * All getters map to the possible return values of * GET / - * - * @see http://developer.openstack.org/api-ref-clustering-v1.html - * + * * @author lion - * + * @see http://developer.openstack.org/api-ref-clustering-v1.html */ public interface Version extends ModelEntity { - /** - * Returns the status of the senlin version - * - * @return the status of the senlin version - */ - String getStatus(); + /** + * Returns the status of the senlin version + * + * @return the status of the senlin version + */ + String getStatus(); - /** - * Returns the id of the senlin version - * - * @return the id of the senlin version - */ - String getId(); + /** + * Returns the id of the senlin version + * + * @return the id of the senlin version + */ + String getId(); - /** - * Returns the links of the senlin version - * - * @return the links of the senlin version - */ - List> getLinks(); + /** + * Returns the links of the senlin version + * + * @return the links of the senlin version + */ + List> getLinks(); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterActionCreateBuilder.java b/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterActionCreateBuilder.java index a804d753d..2a5407fcc 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterActionCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterActionCreateBuilder.java @@ -8,89 +8,89 @@ /** * This interface describes a builder for {@link ClusterActionCreate} objects - * + * * @author lion */ public interface ClusterActionCreateBuilder extends Buildable.Builder { - /** - * Add one or more nodes, as a list, to a cluster - * - * @param addNodes the list of node - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder addNodes(Map> addNodes); + /** + * Add one or more nodes, as a list, to a cluster + * + * @param addNodes the list of node + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder addNodes(Map> addNodes); - /** - * Delete one or more nodes, as a list, from a cluster - * - * @param delNodes the list of node - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder delNodes(Map> delNodes); + /** + * Delete one or more nodes, as a list, from a cluster + * + * @param delNodes the list of node + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder delNodes(Map> delNodes); - /** - * Enlarge the cluster by count number of nodes - * - * @param scaleOut count number of nodes - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder scaleOut(Map scaleOut); + /** + * Enlarge the cluster by count number of nodes + * + * @param scaleOut count number of nodes + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder scaleOut(Map scaleOut); - /** - * Shrink the cluster by count number of nodes - * - * @param scaleIn count number of nodes - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder scaleIn(Map scaleIn); + /** + * Shrink the cluster by count number of nodes + * + * @param scaleIn count number of nodes + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder scaleIn(Map scaleIn); - /** - * Change the size of the cluster - * - * @param resize size of the cluster - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder resize(Map resize); + /** + * Change the size of the cluster + * + * @param resize size of the cluster + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder resize(Map resize); - /** - * Check the health status of a cluster - * - * @param check check info - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder check(Map check); + /** + * Check the health status of a cluster + * + * @param check check info + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder check(Map check); - /** - * Recover a cluster from its current unhealthy status - * - * @param recover its current unhealthy status - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder recover(Map recover); + /** + * Recover a cluster from its current unhealthy status + * + * @param recover its current unhealthy status + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder recover(Map recover); - /** - * Attach a policy to a cluster - * - * @param policyAttach parameters for the policy attachment - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder policyAttach(Map policyAttach); + /** + * Attach a policy to a cluster + * + * @param policyAttach parameters for the policy attachment + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder policyAttach(Map policyAttach); - /** - * Detach a policy from a cluster - * - * @param policyDetach parameters for the policy attachment - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder policyDetach(Map policyDetach); + /** + * Detach a policy from a cluster + * + * @param policyDetach parameters for the policy attachment + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder policyDetach(Map policyDetach); - /** - * Update the policy attachment - * - * @param policyUpdate property settings - * @return ClusterActionCreateBuilder - */ - ClusterActionCreateBuilder policyUpdate(Map policyUpdate); + /** + * Update the policy attachment + * + * @param policyUpdate property settings + * @return ClusterActionCreateBuilder + */ + ClusterActionCreateBuilder policyUpdate(Map policyUpdate); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterCreateBuilder.java b/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterCreateBuilder.java index 7dff69f03..19033641c 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/senlin/builder/ClusterCreateBuilder.java @@ -7,65 +7,65 @@ /** * This interface describes a builder for {@link ClusterCreate} objects - * + * * @author lion */ public interface ClusterCreateBuilder extends Buildable.Builder { - /** - * Add the name of the cluster. - * - * @param name The name of the cluster. - * @return ClusterCreateBuilder - */ - ClusterCreateBuilder name(String name); + /** + * Add the name of the cluster. + * + * @param name The name of the cluster. + * @return ClusterCreateBuilder + */ + ClusterCreateBuilder name(String name); - /** - * Add a set of key and value pairs to associate with the cluster. - * - * @param metadata A set of key and value pairs to associate with the cluster. - * @return ClusterCreateBuilder - */ - ClusterCreateBuilder metadata(Map metadata); + /** + * Add a set of key and value pairs to associate with the cluster. + * + * @param metadata A set of key and value pairs to associate with the cluster. + * @return ClusterCreateBuilder + */ + ClusterCreateBuilder metadata(Map metadata); - /** - * Add the capacity, or initial size, of the cluster - * - * @param desiredCapacity The capacity, or initial size, of the cluster - * @return ClusterCreateBuilder - */ - ClusterCreateBuilder desiredCapacity(int desiredCapacity); + /** + * Add the capacity, or initial size, of the cluster + * + * @param desiredCapacity The capacity, or initial size, of the cluster + * @return ClusterCreateBuilder + */ + ClusterCreateBuilder desiredCapacity(int desiredCapacity); - /** - * Add the maximum size of the cluster. - * - * @param maxSize The maximum size of the cluster. - * @return ClusterCreateBuilder - */ - ClusterCreateBuilder maxSize(int maxSize); + /** + * Add the maximum size of the cluster. + * + * @param maxSize The maximum size of the cluster. + * @return ClusterCreateBuilder + */ + ClusterCreateBuilder maxSize(int maxSize); - /** - * Add the minimum size of the cluster. - * - * @param minSize The minimum size of the cluster. - * @return ClusterCreateBuilder - */ - ClusterCreateBuilder minSize(int minSize); + /** + * Add the minimum size of the cluster. + * + * @param minSize The minimum size of the cluster. + * @return ClusterCreateBuilder + */ + ClusterCreateBuilder minSize(int minSize); - /** - * Add the ID or name of the profile for the cluster. - * - * @param profileID The ID or name of the profile for the cluster. - * @return ClusterCreateBuilder - */ - ClusterCreateBuilder profileID(String profileID); + /** + * Add the ID or name of the profile for the cluster. + * + * @param profileID The ID or name of the profile for the cluster. + * @return ClusterCreateBuilder + */ + ClusterCreateBuilder profileID(String profileID); - /** - * Add the timeout value, in minutes, for cluster creation. - * - * @param timeout The timeout value, in minutes, for cluster creation. - * @return ClusterCreateBuilder - */ - ClusterCreateBuilder timeout(int timeout); + /** + * Add the timeout value, in minutes, for cluster creation. + * + * @param timeout The timeout value, in minutes, for cluster creation. + * @return ClusterCreateBuilder + */ + ClusterCreateBuilder timeout(int timeout); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/builder/NodeActionCreateBuilder.java b/core/src/main/java/org/openstack4j/model/senlin/builder/NodeActionCreateBuilder.java index 315c5219f..1f61c55e1 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/builder/NodeActionCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/senlin/builder/NodeActionCreateBuilder.java @@ -7,25 +7,25 @@ /** * This interface describes a builder for {@link NodeActionCreate} objects - * + * * @author lion */ public interface NodeActionCreateBuilder extends Buildable.Builder { - /** - * Check the health status of a node - * - * @param check check info - * @return NodeActionCreateBuilder - */ - NodeActionCreateBuilder check(Map check); + /** + * Check the health status of a node + * + * @param check check info + * @return NodeActionCreateBuilder + */ + NodeActionCreateBuilder check(Map check); - /** - * Recover a node from its current unhealthy status - * - * @param recover the operation of node - * @return NodeActionCreateBuilder - */ - NodeActionCreateBuilder recover(Map recover); + /** + * Recover a node from its current unhealthy status + * + * @param recover the operation of node + * @return NodeActionCreateBuilder + */ + NodeActionCreateBuilder recover(Map recover); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/builder/NodeCreateBuilder.java b/core/src/main/java/org/openstack4j/model/senlin/builder/NodeCreateBuilder.java index 84eea0362..538539074 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/builder/NodeCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/senlin/builder/NodeCreateBuilder.java @@ -7,49 +7,49 @@ /** * This interface describes a builder for {@link NodeCreate} objects - * + * * @author lion */ public interface NodeCreateBuilder extends Buildable.Builder { - /** - * Add the ID or shortID or name of the cluster the node lives in. - * If not specified, the node created will be an orphaned node. - * - * @param clusterID The ID or shortID or name of the cluster - * @return NodeCreateBuilder - */ - NodeCreateBuilder clusterID(String clusterID); - - /** - * Add a set of key and value pairs to associate with the node. - * - * @param metadata A set of key and value pairs - * @return NodeCreateBuilder - */ - NodeCreateBuilder metadata(Map metadata); - - /** - * Add the name of the node to be created. - * - * @param name The name of the node - * @return NodeCreateBuilder - */ - NodeCreateBuilder name(String name); - - /** - * Add the ID or shortID or name of the profile for the node. - * - * @param profileID The ID or shortID or name of the profile - * @return NodeCreateBuilder - */ - NodeCreateBuilder profileID(String profileID); - - /** - * Add a string indicating the role this node plays in a cluster. - * - * @param role a string indicating the role this node plays - * @return NodeCreateBuilder - */ - NodeCreateBuilder role(String role); + /** + * Add the ID or shortID or name of the cluster the node lives in. + * If not specified, the node created will be an orphaned node. + * + * @param clusterID The ID or shortID or name of the cluster + * @return NodeCreateBuilder + */ + NodeCreateBuilder clusterID(String clusterID); + + /** + * Add a set of key and value pairs to associate with the node. + * + * @param metadata A set of key and value pairs + * @return NodeCreateBuilder + */ + NodeCreateBuilder metadata(Map metadata); + + /** + * Add the name of the node to be created. + * + * @param name The name of the node + * @return NodeCreateBuilder + */ + NodeCreateBuilder name(String name); + + /** + * Add the ID or shortID or name of the profile for the node. + * + * @param profileID The ID or shortID or name of the profile + * @return NodeCreateBuilder + */ + NodeCreateBuilder profileID(String profileID); + + /** + * Add a string indicating the role this node plays in a cluster. + * + * @param role a string indicating the role this node plays + * @return NodeCreateBuilder + */ + NodeCreateBuilder role(String role); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/builder/PolicyCreateBuilder.java b/core/src/main/java/org/openstack4j/model/senlin/builder/PolicyCreateBuilder.java index cb07fa5fe..8ca536b04 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/builder/PolicyCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/senlin/builder/PolicyCreateBuilder.java @@ -7,89 +7,89 @@ /** * This interface describes a builder for {@link PolicyCreate} objects - * + * * @author lion */ public interface PolicyCreateBuilder extends Buildable.Builder { - /** - * Add the name for the policy. - * - * @param name The name for the policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder name(String name); + /** + * Add the name for the policy. + * + * @param name The name for the policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder name(String name); - /** - * Add a detailed specification based on the policy type. - * - * @param spec A detailed specification based on the policy type. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder spec(Map spec); + /** + * Add a detailed specification based on the policy type. + * + * @param spec A detailed specification based on the policy type. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder spec(Map spec); - /** - * Add the properties of the spec. - * - * @param properties The properties of the spec. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder properties(Map properties); + /** + * Add the properties of the spec. + * + * @param properties The properties of the spec. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder properties(Map properties); - /** - * Add the adjustment of the policy. - * - * @param adjustment The adjustment of the policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder adjustment(Map adjustment); + /** + * Add the adjustment of the policy. + * + * @param adjustment The adjustment of the policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder adjustment(Map adjustment); - /** - * Add the value of the min_step for policy. - * - * @param minStep The value of the min_step for policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder minStep(int minStep); + /** + * Add the value of the min_step for policy. + * + * @param minStep The value of the min_step for policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder minStep(int minStep); - /** - * Add the number of the policy. - * - * @param number The number of the policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder number(int number); + /** + * Add the number of the policy. + * + * @param number The number of the policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder number(int number); - /** - * Add the type of the adjustment for the policy. - * - * @param adjustmentType The type of the adjustment for the policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder adjustmentType(String adjustmentType); + /** + * Add the type of the adjustment for the policy. + * + * @param adjustmentType The type of the adjustment for the policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder adjustmentType(String adjustmentType); - /** - * Add the event of the properties for the policy. - * - * @param event The event of the properties for the policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder event(String event); + /** + * Add the event of the properties for the policy. + * + * @param event The event of the properties for the policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder event(String event); - /** - * Add the type of the spec for the policy. - * - * @param specType The type of the spec for the policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder specType(String specType); + /** + * Add the type of the spec for the policy. + * + * @param specType The type of the spec for the policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder specType(String specType); - /** - * Add the version of the spec for the policy. - * - * @param version The version of the spec for the policy. - * @return PolicyCreateBuilder - */ - PolicyCreateBuilder version(String version); + /** + * Add the version of the spec for the policy. + * + * @param version The version of the spec for the policy. + * @return PolicyCreateBuilder + */ + PolicyCreateBuilder version(String version); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/builder/ProfileCreateBuilder.java b/core/src/main/java/org/openstack4j/model/senlin/builder/ProfileCreateBuilder.java index 5319cf6d7..44ce57e05 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/builder/ProfileCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/senlin/builder/ProfileCreateBuilder.java @@ -7,34 +7,34 @@ /** * This interface describes a builder for {@link ProfileCreate} objects - * + * * @author lion */ public interface ProfileCreateBuilder extends Buildable.Builder { - /** - * Add the name for the profile. - * - * @param name The name for the profile. - * @return ProfileCreateBuilder - */ - ProfileCreateBuilder name(String name); - - /** - * Add detailed specification based on the chosen profile type. - * - * @param spec The detailed specification based on the chosen profile type. - * @return ProfileCreateBuilder - */ - ProfileCreateBuilder spec(Map spec); - - /** - * Add a list of key and value pairs to associate with the profile. - * - * @param metadata The list of key and value pairs to associate with the profile. - * @return ProfileCreateBuilder - */ - ProfileCreateBuilder metadata(Map metadata); + /** + * Add the name for the profile. + * + * @param name The name for the profile. + * @return ProfileCreateBuilder + */ + ProfileCreateBuilder name(String name); + + /** + * Add detailed specification based on the chosen profile type. + * + * @param spec The detailed specification based on the chosen profile type. + * @return ProfileCreateBuilder + */ + ProfileCreateBuilder spec(Map spec); + + /** + * Add a list of key and value pairs to associate with the profile. + * + * @param metadata The list of key and value pairs to associate with the profile. + * @return ProfileCreateBuilder + */ + ProfileCreateBuilder metadata(Map metadata); } diff --git a/core/src/main/java/org/openstack4j/model/senlin/builder/ReceiverCreateBuilder.java b/core/src/main/java/org/openstack4j/model/senlin/builder/ReceiverCreateBuilder.java index 10565dcfc..efaab4b75 100644 --- a/core/src/main/java/org/openstack4j/model/senlin/builder/ReceiverCreateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/senlin/builder/ReceiverCreateBuilder.java @@ -7,51 +7,51 @@ /** * This interface describes a builder for {@link ReceiverCreate} objects - * + * * @author lion */ public interface ReceiverCreateBuilder extends Buildable.Builder { - /** - * Add the action to initiate when the receiver is triggered. - * A valid value should be the name of an action that can be applied on a cluster. - * - * @param action The action to initiate. - * @return ReceiverCreateBuilder - */ - ReceiverCreateBuilder action(String action); - - /** - * Add the name, ID, or short ID of the object targeted by the receiver - * - * @param clusterID The Name, ID, or short ID of the object targeted by the receiver - * @return ReceiverCreateBuilder - */ - ReceiverCreateBuilder clusterID(String clusterID); - - /** - * Add the name for the receiver - * - * @param name The name for the receiver - * @return ReceiverCreateBuilder - */ - ReceiverCreateBuilder name(String name); - - /** - * Add the type of the receiver where the only valid value is webhook currently - * - * @param type The type of the receiver - * @return ReceiverCreateBuilder - */ - ReceiverCreateBuilder type(String type); - - /** - * Add the map of key and value pairs to use for action creation. - * Some actions might require certain input parameters - * - * @param params A map of key and value pairs to use for action creation. - * @return ReceiverCreateBuilder - */ - ReceiverCreateBuilder params(Map params); + /** + * Add the action to initiate when the receiver is triggered. + * A valid value should be the name of an action that can be applied on a cluster. + * + * @param action The action to initiate. + * @return ReceiverCreateBuilder + */ + ReceiverCreateBuilder action(String action); + + /** + * Add the name, ID, or short ID of the object targeted by the receiver + * + * @param clusterID The Name, ID, or short ID of the object targeted by the receiver + * @return ReceiverCreateBuilder + */ + ReceiverCreateBuilder clusterID(String clusterID); + + /** + * Add the name for the receiver + * + * @param name The name for the receiver + * @return ReceiverCreateBuilder + */ + ReceiverCreateBuilder name(String name); + + /** + * Add the type of the receiver where the only valid value is webhook currently + * + * @param type The type of the receiver + * @return ReceiverCreateBuilder + */ + ReceiverCreateBuilder type(String type); + + /** + * Add the map of key and value pairs to use for action creation. + * Some actions might require certain input parameters + * + * @param params A map of key and value pairs to use for action creation. + * @return ReceiverCreateBuilder + */ + ReceiverCreateBuilder params(Map params); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java b/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java index 6c62383e3..0a230db68 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java @@ -2,60 +2,60 @@ /** * Show absolute limits for a tenant - * + * * @author Jeremy Unruh */ public interface BlockLimits { Absolute getAbsolute(); - + public interface Absolute { - + /** * @return the total snapshots used */ int getTotalSnapshotsUsed(); - + /** * @return the maximum total backups */ int getMaxTotalBackups(); - + /** * @return the max total volume in GB */ int getMaxTotalVolumeGigabytes(); - + /** * @return the max total number of snapshots */ int getMaxTotalSnapshots(); - + /** * @return the max total backup in GB */ int getMaxTotalBackupGigabytes(); - + /** * @return the total backup GB used */ int getTotalBackupGigabytesUsed(); - + /** * @return the max total volumes */ int getMaxTotalVolumes(); - + /** * @return the total volumes used */ int getTotalVolumesUsed(); - + /** * @return total backups used */ int getTotalBackupsUsed(); - + /** * @return total GB used */ diff --git a/core/src/main/java/org/openstack4j/model/storage/block/BlockQuotaSet.java b/core/src/main/java/org/openstack4j/model/storage/block/BlockQuotaSet.java index f9ee34add..407d18223 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/BlockQuotaSet.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/BlockQuotaSet.java @@ -17,19 +17,16 @@ public interface BlockQuotaSet extends ModelEntity, Buildable { - /** - * The current Volume Status - * - */ - public enum Status { - AVAILABLE, ATTACHING, BACKING_UP, CREATING, DELETING, DOWNLOADING, UPLOADING, ERROR, ERROR_DELETING, ERROR_RESTORING, IN_USE, RESTORING_BACKUP, DETACHING, UNRECOGNIZED; - - @JsonValue - public String value() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static Status fromValue(String status) { - try { - return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public enum MigrationStatus { - NONE, MIGRATING - ; - - @JsonValue + /** + * The current Volume Status + */ + public enum Status { + AVAILABLE, ATTACHING, BACKING_UP, CREATING, DELETING, DOWNLOADING, UPLOADING, ERROR, ERROR_DELETING, ERROR_RESTORING, IN_USE, RESTORING_BACKUP, DETACHING, UNRECOGNIZED; + + @JsonValue + public String value() { + return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static Status fromValue(String status) { + try { + return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status"))); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + + public enum MigrationStatus { + NONE, MIGRATING; + + @JsonValue public String value() { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); } - @Override + @Override public String toString() { return value(); } @JsonCreator public static MigrationStatus fromValue(String migrationStatus) { - if (migrationStatus != null) - { + if (migrationStatus != null) { try { return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(migrationStatus, "migrationStatus"))); } catch (IllegalArgumentException e) { @@ -74,114 +71,112 @@ public static MigrationStatus fromValue(String migrationStatus) { } return NONE; } - } - - /** - * @return the identifier for the volume - */ - String getId(); - - /** - * @return the name of the volume - */ - String getName(); - - /** - * @return the display name of the volume - */ - @Deprecated - String getDisplayName(); - - /** - * @return the description of the volume - */ - String getDescription(); - - /** - * @return the display description of the volume - */ - @Deprecated - String getDisplayDescription(); - - /** - * @return the status of the volume - */ - Status getStatus(); - - /** - * @return the size in GB of the volume - */ - int getSize(); - - /** - * @return the zone of availability to use - */ - String getZone(); - - /** - * @return the created date of the volume - */ - Date getCreated(); - - /** - * @return the type of volume - */ - String getVolumeType(); - - /** - * @return the snapshot identifier - */ - String getSnapshotId(); - - /** - * @return the image reference identifier (if an image was associated) otherwise null - */ - String getImageRef(); - - /** - * @return To enable this volume to attach - */ - Boolean multiattach(); - - /** - * @return ID of source volume to clone from - */ - String getSourceVolid(); - - /** - * @return extended meta data information. key value pair of String key, String value - */ - Map getMetaData(); - - /** - * @return volume attachment data information. - */ - List getAttachments(); - - /** - * @return the status of volume migrate status, default null - */ - MigrationStatus getMigrateStatus(); - - /** - * @return the tenant id - */ - String getTenantId(); - - /** - * @return whether the volume is bootable - */ - boolean bootable(); - - /** - * - * @return whether this volume is encrypted. - */ - boolean encrypted(); - - /** - * - * @return current back-end of the volume. - */ - String host(); + } + + /** + * @return the identifier for the volume + */ + String getId(); + + /** + * @return the name of the volume + */ + String getName(); + + /** + * @return the display name of the volume + */ + @Deprecated + String getDisplayName(); + + /** + * @return the description of the volume + */ + String getDescription(); + + /** + * @return the display description of the volume + */ + @Deprecated + String getDisplayDescription(); + + /** + * @return the status of the volume + */ + Status getStatus(); + + /** + * @return the size in GB of the volume + */ + int getSize(); + + /** + * @return the zone of availability to use + */ + String getZone(); + + /** + * @return the created date of the volume + */ + Date getCreated(); + + /** + * @return the type of volume + */ + String getVolumeType(); + + /** + * @return the snapshot identifier + */ + String getSnapshotId(); + + /** + * @return the image reference identifier (if an image was associated) otherwise null + */ + String getImageRef(); + + /** + * @return To enable this volume to attach + */ + Boolean multiattach(); + + /** + * @return ID of source volume to clone from + */ + String getSourceVolid(); + + /** + * @return extended meta data information. key value pair of String key, String value + */ + Map getMetaData(); + + /** + * @return volume attachment data information. + */ + List getAttachments(); + + /** + * @return the status of volume migrate status, default null + */ + MigrationStatus getMigrateStatus(); + + /** + * @return the tenant id + */ + String getTenantId(); + + /** + * @return whether the volume is bootable + */ + boolean bootable(); + + /** + * @return whether this volume is encrypted. + */ + boolean encrypted(); + + /** + * @return current back-end of the volume. + */ + String host(); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeAttachment.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeAttachment.java index e63971d66..4602b41d3 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeAttachment.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeAttachment.java @@ -3,39 +3,45 @@ import org.openstack4j.model.ModelEntity; - /** * Provides volume attachment result - * + * * @author Octopus Zhang */ public interface VolumeAttachment extends ModelEntity { - - /** - * the device name in the server,like /dev/vdd - * @return device name - */ - String getDevice(); - /** - * return the host where volume is on - * @return hostname - */ - String getHostname(); + + /** + * the device name in the server,like /dev/vdd + * + * @return device name + */ + String getDevice(); + + /** + * return the host where volume is on + * + * @return hostname + */ + String getHostname(); + + /** + * Gets the id of this volume attachment + * + * @return the id + */ + String getId(); + + /** + * the server's id in this volume attachment + * + * @return the id of a server + */ + String getServerId(); + /** - * Gets the id of this volume attachment - * @return the id - */ - String getId(); - - /** - * the server's id in this volume attachment - * @return the id of a server - */ - String getServerId(); - - /** - * the volume's id in this volume attachment - * @return the id of a volume - */ - String getVolumeId(); + * the volume's id in this volume attachment + * + * @return the id of a volume + */ + String getVolumeId(); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java index a90e7278e..b556c2be3 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java @@ -1,113 +1,110 @@ package org.openstack4j.model.storage.block; -import static com.google.common.base.Preconditions.checkNotNull; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.base.CaseFormat; +import org.openstack4j.model.ModelEntity; import java.util.Date; -import org.openstack4j.model.ModelEntity; +import static com.google.common.base.Preconditions.checkNotNull; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.base.CaseFormat; +public interface VolumeBackup extends ModelEntity { + + /** + * The volume backup Status + */ + + public enum Status { + AVAILABLE, CREATING, DELETING, ERROR, ERROR_RESTORING, RESTORING, UNRECOGNIZED; + + @JsonValue + public String value() { + return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static Status fromValue(String status) { + try { + return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status"))); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + + String getId(); + + /** + * @return the name of the Volume Transfer. + */ + String getName(); + + /** + * @return the description of the volume backup + */ + String getDescription(); + + /** + * @return The UUID of the volume. + */ + String getVolumeId(); + + /** + * @return The container name or null. + */ + String getContainer(); + + + /** + * @return The backup mode. A valid value is true for incremental backup mode or false for full backup mode + */ + Boolean isIncremental(); + + /** + * @return the zone of availability to use + */ + String getZone(); + + /** + * @return the status of the volume + */ + Status getStatus(); + + + /** + * @return The size of the volume, in gibibytes (GiB). + */ + int getSize(); + + /** + * @return the created date of the volume + */ + Date getCreated(); + + /** + * @return If the backup failed, the reason for the failure. Otherwise, null. + */ + String getFailReason(); + + /** + * @return The number of objects in the backup. + */ + int getObjectCount(); + + /** + * @return True if the backup depends on other backups. + */ + Boolean hasDependent(); -public interface VolumeBackup extends ModelEntity { - - /** - * The volume backup Status - * - */ - - public enum Status { - AVAILABLE, CREATING, DELETING, ERROR, ERROR_RESTORING, RESTORING , UNRECOGNIZED; - - @JsonValue - public String value() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name()); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static Status fromValue(String status) { - try { - return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - String getId(); - - /** - * @return the name of the Volume Transfer. - */ - String getName(); - - /** - * @return the description of the volume backup - */ - String getDescription(); - - /** - * @return The UUID of the volume. - */ - String getVolumeId(); - - /** - * @return The container name or null. - */ - String getContainer(); - - - /** - * @return The backup mode. A valid value is true for incremental backup mode or false for full backup mode - */ - Boolean isIncremental(); - - /** - * @return the zone of availability to use - */ - String getZone(); - - /** - * @return the status of the volume - */ - Status getStatus(); - - - /** - * @return The size of the volume, in gibibytes (GiB). - */ - int getSize(); - - /** - * @return the created date of the volume - */ - Date getCreated(); - - /** - * @return If the backup failed, the reason for the failure. Otherwise, null. - */ - String getFailReason(); - - /** - * @return The number of objects in the backup. - */ - int getObjectCount(); - - /** - * - * @return True if the backup depends on other backups. - */ - Boolean hasDependent(); - - /** - * @return If the backup was created from snapshot, the snapshot id. Otherwise, null. - */ - String getSnapshotId(); + /** + * @return If the backup was created from snapshot, the snapshot id. Otherwise, null. + */ + String getSnapshotId(); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupCreate.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupCreate.java index 5206250c5..6c9598d20 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupCreate.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupCreate.java @@ -5,46 +5,46 @@ import org.openstack4j.model.storage.block.builder.VolumeBackupCreateBuilder; /** - * Represents entity which is used for creating a volume backup - * @author Huang Yi + * Represents entity which is used for creating a volume backup * + * @author Huang Yi */ -public interface VolumeBackupCreate extends ModelEntity, Buildable { - - /** - * @return the name of the Volume Transfer. - */ +public interface VolumeBackupCreate extends ModelEntity, Buildable { + + /** + * @return the name of the Volume Transfer. + */ String getName(); - - /** - * @return the description of the volume backup - */ - String getDescription(); - - /** - * @return The UUID of the volume. - */ - String getVolumeId(); - - /** - * @return The container name or null. - */ - String getContainer(); - - /** - * @return The backup mode. A valid value is true for incremental backup mode or false for full backup mode - */ - boolean isIncremental(); - - /** - * @return Force mode. True to do backup while a volume is attached. Default is false. - */ - boolean isForce(); - - /** - * @return Force mode. True to do backup while a volume is attached. Default is false. - */ - String getSnapshotId(); + + /** + * @return the description of the volume backup + */ + String getDescription(); + + /** + * @return The UUID of the volume. + */ + String getVolumeId(); + + /** + * @return The container name or null. + */ + String getContainer(); + + /** + * @return The backup mode. A valid value is true for incremental backup mode or false for full backup mode + */ + boolean isIncremental(); + + /** + * @return Force mode. True to do backup while a volume is attached. Default is false. + */ + boolean isForce(); + + /** + * @return Force mode. True to do backup while a volume is attached. Default is false. + */ + String getSnapshotId(); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupRestore.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupRestore.java index 3ba018487..62c1f38b2 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupRestore.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackupRestore.java @@ -2,18 +2,18 @@ import org.openstack4j.model.ModelEntity; -public interface VolumeBackupRestore extends ModelEntity{ - - /** +public interface VolumeBackupRestore extends ModelEntity { + + /** * @return the UUID for a backup */ String getBackupId(); - + /** * @return indicates the volume identifier of the volume being transfer */ String getVolumeId(); - + /** * @return the name of the transfer */ diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeSnapshot.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeSnapshot.java index fc9883dc5..a0f15229d 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeSnapshot.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeSnapshot.java @@ -1,12 +1,13 @@ package org.openstack4j.model.storage.block; -import java.util.Date; -import java.util.Map; import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.storage.block.Volume.Status; import org.openstack4j.model.storage.block.builder.VolumeSnapshotBuilder; +import java.util.Date; +import java.util.Map; + /** * An OpenStack Volume Snapshot which is a point-in-time copy of a volume * @@ -14,59 +15,59 @@ */ public interface VolumeSnapshot extends ModelEntity, Buildable { - /** - * @return the snapshot identifier - */ - String getId(); + /** + * @return the snapshot identifier + */ + String getId(); - /** - * @return the name of the snapshot - */ - String getName(); + /** + * @return the name of the snapshot + */ + String getName(); - /** - * @return the display name of the snapshot - */ - @Deprecated - String getDisplayName(); + /** + * @return the display name of the snapshot + */ + @Deprecated + String getDisplayName(); - /** - * @return the description of the snapshot - */ - String getDescription(); + /** + * @return the description of the snapshot + */ + String getDescription(); - /** - * @return the display description of the snapshot - */ - @Deprecated - String getDisplayDescription(); + /** + * @return the display description of the snapshot + */ + @Deprecated + String getDisplayDescription(); - /** - * The volume identifier of an existing volume - * - * @return the volume identifier or null - */ - String getVolumeId(); + /** + * The volume identifier of an existing volume + * + * @return the volume identifier or null + */ + String getVolumeId(); - /** - * @return the status of the snapshot - */ - Status getStatus(); + /** + * @return the status of the snapshot + */ + Status getStatus(); - /** - * Size in GBs - * - * @return the size of the snapshot in GB - */ - int getSize(); + /** + * Size in GBs + * + * @return the size of the snapshot in GB + */ + int getSize(); - /** - * @return the created data of the snapshot - */ - Date getCreated(); + /** + * @return the created data of the snapshot + */ + Date getCreated(); - /** - * @return extended meta data information. key value pair of String key, String value - */ - Map getMetaData(); + /** + * @return extended meta data information. key value pair of String key, String value + */ + Map getMetaData(); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeTransfer.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeTransfer.java index ed2da2c1e..9340f1ab6 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeTransfer.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeTransfer.java @@ -1,14 +1,14 @@ package org.openstack4j.model.storage.block; -import java.util.Date; -import java.util.List; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.Link; +import java.util.Date; +import java.util.List; + /** * Represents a Volume Transfer Entity which is used for creating a volume transfer - * + * * @author Jeremy Unruh */ public interface VolumeTransfer extends ModelEntity { @@ -17,31 +17,31 @@ public interface VolumeTransfer extends ModelEntity { * @return the identifier assigned to the transfer */ String getId(); - + /** * @return indicates the volume identifier of the volume being transfer */ String getVolumeId(); - + /** * @return the name of the transfer */ String getName(); - + /** * @return the authorization key of the transfer */ String getAuthKey(); - + /** * @return the date/time the transfer was created */ Date getCreatedAt(); - + /** - * @return List of External Links + * @return List of External Links **/ List getLinks(); - - + + } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeType.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeType.java index 8a609c44f..05e1a789e 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeType.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeType.java @@ -1,34 +1,34 @@ package org.openstack4j.model.storage.block; -import java.util.Map; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.storage.block.builder.VolumeTypeBuilder; +import java.util.Map; + /** * The volume type defines the characteristics of a volume. It usually maps to a set of capabilities - * of the storage back-end driver to be used for this volume. - * Examples: "Performance", "SSD", "Backup", etc. - * + * of the storage back-end driver to be used for this volume. + * Examples: "Performance", "SSD", "Backup", etc. + * * @author Jeremy Unruh */ public interface VolumeType extends ModelEntity, Buildable { - /** - * @return the identifier for the volume type - */ - String getId(); - - /** - * @return the name of the volume type - */ - String getName(); - - /** - * @return the extra specifications (meta-data) associated with the volume type - */ - Map getExtraSpecs(); - - + /** + * @return the identifier for the volume type + */ + String getId(); + + /** + * @return the name of the volume type + */ + String getName(); + + /** + * @return the extra specifications (meta-data) associated with the volume type + */ + Map getExtraSpecs(); + + } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeUploadImage.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeUploadImage.java index 6f28d34c6..ccfb00a1d 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeUploadImage.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeUploadImage.java @@ -1,15 +1,15 @@ package org.openstack4j.model.storage.block; -import java.util.Date; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.image.ContainerFormat; import org.openstack4j.model.image.DiskFormat; import org.openstack4j.model.storage.block.Volume.Status; +import java.util.Date; + /** * Represents an action state when uploading a volume to the image service - * + * * @author Jeremy Unruh */ public interface VolumeUploadImage extends ModelEntity { @@ -18,7 +18,7 @@ public interface VolumeUploadImage extends ModelEntity { * @return the identifier for this transactions */ String getId(); - + /** * @return the display description */ @@ -28,36 +28,36 @@ public interface VolumeUploadImage extends ModelEntity { * @return the last update date */ Date getUpdatedAt(); - + /** * @return the current status */ Status getStatus(); - + /** * @return the assigned image identifier */ String getImageId(); - + /** * @return the image name */ String getImageName(); - + /** * @return the container format */ ContainerFormat getContainerFormat(); - + /** * @return the overall size */ int getSize(); - + /** * @return the disk format */ DiskFormat getDiskFormat(); - - + + } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/builder/BlockQuotaSetBuilder.java b/core/src/main/java/org/openstack4j/model/storage/block/builder/BlockQuotaSetBuilder.java index 3f1ade1b6..fad330996 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/builder/BlockQuotaSetBuilder.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/builder/BlockQuotaSetBuilder.java @@ -5,14 +5,14 @@ /** * Builder for a QuotaSet model class. - * + * * @author Jeremy Unruh */ public interface BlockQuotaSetBuilder extends Builder { /** * Volumes Quota for Block Storage - * + * * @param volumes * @return volumes consumed in the Block Storage. */ @@ -28,6 +28,7 @@ public interface BlockQuotaSetBuilder extends Builder { - - - VolumeBackupCreateBuilder name(String name); - - VolumeBackupCreateBuilder description(String description ); - - VolumeBackupCreateBuilder volumeId(String volumeId); - - VolumeBackupCreateBuilder container(String container); - - VolumeBackupCreateBuilder incremental(boolean incremental); - - VolumeBackupCreateBuilder force(boolean force); - - VolumeBackupCreateBuilder snapshotId(String snapshotId); +public interface VolumeBackupCreateBuilder extends Builder { + + + VolumeBackupCreateBuilder name(String name); + + VolumeBackupCreateBuilder description(String description); + + VolumeBackupCreateBuilder volumeId(String volumeId); + + VolumeBackupCreateBuilder container(String container); + + VolumeBackupCreateBuilder incremental(boolean incremental); + + VolumeBackupCreateBuilder force(boolean force); + + VolumeBackupCreateBuilder snapshotId(String snapshotId); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeBuilder.java b/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeBuilder.java index a53b89951..35bb4ed6d 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeBuilder.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeBuilder.java @@ -1,103 +1,103 @@ package org.openstack4j.model.storage.block.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.storage.block.Volume; +import java.util.Map; + /** * Builder used for Creating or Updating Volumes - * + * * @author Jeremy Unruh */ public interface VolumeBuilder extends Builder { - /** - * See {@link Volume#getName()} - * - * @param name the name of the volume - * @return VolumeBuilder - */ - VolumeBuilder name(String name); - - /** - * See {@link Volume#getDescription()} Optional - * - * @param description the description of the volume - * @return VolumeBuilder - */ - VolumeBuilder description(String description); - - /** - * To create a volume from an existing volume, specify the ID of the existing volume. Optional - * - * @param uuid the id of an existing volume - * @return VolumeBuilder - */ - VolumeBuilder source_volid(String uuid); - - /** - * To create a volume from an existing snapshot, specify the ID of the existing volume snapshot. Optional - * - * @param snapshotId the id of an existing volume snapshot - * @return VolumeBuilder - */ - VolumeBuilder snapshot(String snapshotId); - - /** - * The ID of the image from which you want to create the volume. Required to create a bootable volume. Optional - * - * @param imageRef the id of an existing image - * @return VolumeBuilder - */ - VolumeBuilder imageRef(String imageRef); - - /** - * To enable this volume to attach to more than one server Optional - * - * @param To enable this volume to attach to more than one server set this value to true - * @return VolumeBuilder - */ - VolumeBuilder multiattach(Boolean multiattach); - - /** - * The size of the volume, in GB. - * - * @param size the size in GB - * @return VolumeBuilder - */ - VolumeBuilder size(int size); - - /** - * The associated volume type. Optional - * - * @param volumeType The associated volume type. - * @return VolumeBuilder - */ - VolumeBuilder volumeType(String volumeType); - - /** - * Enables or disables the bootable attribute. You can boot an instance from a bootable volume. Optional - * - * @param isBootable true to enable the bootable flag - * @return VolumeBuilder - */ - VolumeBuilder bootable(boolean isBootable); - - /** - * One or more metadata key and value pairs to associate with the volume. Optional - * - * @param metadata metadata to set - * @return VolumeBuilder - */ - VolumeBuilder metadata(Map metadata); - - /** + /** + * See {@link Volume#getName()} + * + * @param name the name of the volume + * @return VolumeBuilder + */ + VolumeBuilder name(String name); + + /** + * See {@link Volume#getDescription()} Optional + * + * @param description the description of the volume + * @return VolumeBuilder + */ + VolumeBuilder description(String description); + + /** + * To create a volume from an existing volume, specify the ID of the existing volume. Optional + * + * @param uuid the id of an existing volume + * @return VolumeBuilder + */ + VolumeBuilder source_volid(String uuid); + + /** + * To create a volume from an existing snapshot, specify the ID of the existing volume snapshot. Optional + * + * @param snapshotId the id of an existing volume snapshot + * @return VolumeBuilder + */ + VolumeBuilder snapshot(String snapshotId); + + /** + * The ID of the image from which you want to create the volume. Required to create a bootable volume. Optional + * + * @param imageRef the id of an existing image + * @return VolumeBuilder + */ + VolumeBuilder imageRef(String imageRef); + + /** + * To enable this volume to attach to more than one server Optional + * + * @param To enable this volume to attach to more than one server set this value to true + * @return VolumeBuilder + */ + VolumeBuilder multiattach(Boolean multiattach); + + /** + * The size of the volume, in GB. + * + * @param size the size in GB + * @return VolumeBuilder + */ + VolumeBuilder size(int size); + + /** + * The associated volume type. Optional + * + * @param volumeType The associated volume type. + * @return VolumeBuilder + */ + VolumeBuilder volumeType(String volumeType); + + /** + * Enables or disables the bootable attribute. You can boot an instance from a bootable volume. Optional + * + * @param isBootable true to enable the bootable flag + * @return VolumeBuilder + */ + VolumeBuilder bootable(boolean isBootable); + + /** + * One or more metadata key and value pairs to associate with the volume. Optional + * + * @param metadata metadata to set + * @return VolumeBuilder + */ + VolumeBuilder metadata(Map metadata); + + /** * The associated availability zone. Optional - * + * * @param zone The associated availability zone. * @return VolumeBuilder */ VolumeBuilder zone(String zone); - + } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeSnapshotBuilder.java b/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeSnapshotBuilder.java index b0e748ae7..7b42d650c 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeSnapshotBuilder.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeSnapshotBuilder.java @@ -1,12 +1,13 @@ package org.openstack4j.model.storage.block.builder; -import java.util.Map; import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.storage.block.VolumeSnapshot; +import java.util.Map; + /** * A Builder which creates a Volume Snapshot. - * + *

* NOTE: The only REQUIRED field when creating a snapshot is * {@link #volume(String)} . All other fields are optional * @@ -14,44 +15,44 @@ */ public interface VolumeSnapshotBuilder extends Builder { - /** - * Name of the snapshot - * - * @param name the name - * @return the volume snapshot builder - */ - VolumeSnapshotBuilder name(String name); - - /** - * Description of the snapshot - * - * @param description the description - * @return the volume snapshot builder - */ - VolumeSnapshotBuilder description(String description); - - /** - * The ID of of the existing Volume (REQUIRED) - * - * @param volumeId the volume id - * @return the volume snapshot builder - */ - VolumeSnapshotBuilder volume(String volumeId); - - /** - * One or more metadata key and value pairs to associate with the volume snapshot. Optional - * - * @param metadata metadata to set - * @return VolumeSnapshotBuilder - */ - VolumeSnapshotBuilder metadata(Map metadata); - - /** - * [True/False] Indicate whether to snapshot, even if the volume is attached. - * - * @param force true to force an attached volume to be a snapshot - * @return the volume snapshot builder - */ - VolumeSnapshotBuilder force(boolean force); + /** + * Name of the snapshot + * + * @param name the name + * @return the volume snapshot builder + */ + VolumeSnapshotBuilder name(String name); + + /** + * Description of the snapshot + * + * @param description the description + * @return the volume snapshot builder + */ + VolumeSnapshotBuilder description(String description); + + /** + * The ID of of the existing Volume (REQUIRED) + * + * @param volumeId the volume id + * @return the volume snapshot builder + */ + VolumeSnapshotBuilder volume(String volumeId); + + /** + * One or more metadata key and value pairs to associate with the volume snapshot. Optional + * + * @param metadata metadata to set + * @return VolumeSnapshotBuilder + */ + VolumeSnapshotBuilder metadata(Map metadata); + + /** + * [True/False] Indicate whether to snapshot, even if the volume is attached. + * + * @param force true to force an attached volume to be a snapshot + * @return the volume snapshot builder + */ + VolumeSnapshotBuilder force(boolean force); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeTypeBuilder.java b/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeTypeBuilder.java index 76641358e..ad6954a1c 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeTypeBuilder.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/builder/VolumeTypeBuilder.java @@ -1,25 +1,25 @@ package org.openstack4j.model.storage.block.builder; -import java.util.Map; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.storage.block.VolumeType; +import java.util.Map; + public interface VolumeTypeBuilder extends Builder { - /** - * See {@link VolumeType#getName()} - * - * @param name the name of the volume type - * @return VolumeTypeBuilder - */ - VolumeTypeBuilder name(String name); + /** + * See {@link VolumeType#getName()} + * + * @param name the name of the volume type + * @return VolumeTypeBuilder + */ + VolumeTypeBuilder name(String name); - /** - * See {@link VolumeType#getExtraSpecs()} Optional - * - * @param extraSpecs Defining extra specs for the volume type as a key-value map. - * @return VolumeTypeBuilder - */ - VolumeTypeBuilder extraSpecs(Map extraSpecs); + /** + * See {@link VolumeType#getExtraSpecs()} Optional + * + * @param extraSpecs Defining extra specs for the volume type as a key-value map. + * @return VolumeTypeBuilder + */ + VolumeTypeBuilder extraSpecs(Map extraSpecs); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java b/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java index e3511785a..670d11e10 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java @@ -1,10 +1,9 @@ package org.openstack4j.model.storage.block.ext; -import java.util.Date; - +import com.fasterxml.jackson.annotation.JsonCreator; import org.openstack4j.model.ModelEntity; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Date; /** * A Service represents a Block storage service @@ -81,7 +80,6 @@ public static State forValue(String value) { Status getStatus(); /** - * * @return last updated time */ Date getUpdatedAt(); diff --git a/core/src/main/java/org/openstack4j/model/storage/block/options/DownloadOptions.java b/core/src/main/java/org/openstack4j/model/storage/block/options/DownloadOptions.java index 7aec0ed16..b0baf6f07 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/options/DownloadOptions.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/options/DownloadOptions.java @@ -1,34 +1,33 @@ package org.openstack4j.model.storage.block.options; -import java.util.List; - +import com.google.common.collect.Lists; import org.openstack4j.model.common.functions.RangesToHeaderNameValue; import org.openstack4j.model.common.header.HeaderNameValue; import org.openstack4j.model.common.header.IfCondition; import org.openstack4j.model.common.header.Range; -import com.google.common.collect.Lists; +import java.util.List; /** * Download options used to determine how the data is returned or if it is returned depending on various conditional * options - * + * * @author Jeremy Unruh */ public class DownloadOptions { List headers = Lists.newArrayList(); - - private DownloadOptions() { + + private DownloadOptions() { } - + public static DownloadOptions create() { return new DownloadOptions(); } - + /** - * Download select ranges of bytes - * + * Download select ranges of bytes + * * @param ranges one or more Range objects * @return DownloadOptions for method chaining */ @@ -38,11 +37,11 @@ public DownloadOptions range(Range... ranges) { headers.add(h); return this; } - + /** * Adds a user specified header name and value - * - * @param name the header name + * + * @param name the header name * @param value the header value * @return DownloadOptions for method chaining */ @@ -52,11 +51,11 @@ public DownloadOptions header(String name, Object value) { } return this; } - + /** - * Adds one or more If based conditions to the header chain to offer conditional matching + * Adds one or more If based conditions to the header chain to offer conditional matching * before the data is streamed - * + * * @param condition one or more IfCondition objects * @return DownloadOptions for method chaining * @see http://www.ietf.org/rfc/rfc2616.txt @@ -68,7 +67,7 @@ public DownloadOptions conditions(IfCondition... condition) { } return this; } - + /** * @return all headers configured from this options object */ diff --git a/core/src/main/java/org/openstack4j/model/storage/block/options/UploadImageData.java b/core/src/main/java/org/openstack4j/model/storage/block/options/UploadImageData.java index 02a0afdd1..bec11f5d1 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/options/UploadImageData.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/options/UploadImageData.java @@ -5,7 +5,7 @@ /** * Options to Upload volume to image service as image - * + * * @author Jeremy Unruh */ public class UploadImageData { @@ -14,22 +14,24 @@ public class UploadImageData { private ContainerFormat containerFormat = ContainerFormat.BARE; private DiskFormat diskFormat = DiskFormat.RAW; private boolean force; - + private UploadImageData(String imageName) { this.imageName = imageName; } - + /** * Creates new UploadImageOptions with the specified image name + * * @param imageName the image name for upload * @return UploadImageOptions */ public static UploadImageData create(String imageName) { return new UploadImageData(imageName); } - + /** * The container format for this volume image (default is BARE) + * * @param containerFormat the container format * @return UploadImageOptions */ @@ -37,9 +39,10 @@ public UploadImageData containerFormat(ContainerFormat containerFormat) { this.containerFormat = containerFormat; return this; } - + /** * The disk format for this volume image (default is RAW) + * * @param diskFormat the disk format * @return UploadImageOptions */ @@ -47,14 +50,15 @@ public UploadImageData diskFormat(DiskFormat diskFormat) { this.diskFormat = diskFormat; return this; } - + public UploadImageData force(boolean isForce) { this.force = isForce; return this; } - + /** * The image name used as a display name for the upload + * * @param imageName the image name * @return UploadImageOptions */ @@ -78,7 +82,6 @@ public DiskFormat getDiskFormat() { public boolean isForce() { return force; } - - - + + } diff --git a/core/src/main/java/org/openstack4j/model/storage/object/SwiftAccount.java b/core/src/main/java/org/openstack4j/model/storage/object/SwiftAccount.java index 2138bcba4..046056c97 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/SwiftAccount.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/SwiftAccount.java @@ -1,12 +1,12 @@ package org.openstack4j.model.storage.object; -import java.util.Map; - import org.openstack4j.model.ModelEntity; +import java.util.Map; + /** * An Account representation for OpenStack Object Storage (Swift) - * + * * @author Jeremy Unruh */ public interface SwiftAccount extends ModelEntity { @@ -15,30 +15,30 @@ public interface SwiftAccount extends ModelEntity { /** * The total number of objects that are stored in storage for the account. - * + * * @return total number of objects */ long getObjectCount(); - + /** * The total number of bytes that are stored in storage for the account. - * + * * @return total number of bytes */ long getBytesUsed(); - + /** * The secret key value for temporary URLs. If not set (null), this header is not returned by this operation. - * + * * @return the secret key value or null */ String getTemporaryUrlKey(); - + /** * The custom account metadata map - * + * * @return map of name to value of metadata */ Map getMetadata(); - + } diff --git a/core/src/main/java/org/openstack4j/model/storage/object/SwiftContainer.java b/core/src/main/java/org/openstack4j/model/storage/object/SwiftContainer.java index ffadd2e4f..7846331d5 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/SwiftContainer.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/SwiftContainer.java @@ -1,40 +1,41 @@ package org.openstack4j.model.storage.object; -import java.util.Map; - import org.openstack4j.model.ModelEntity; +import java.util.Map; + /** * Represents an OpenStack Swift Container which holds Objects - * + * * @author Jeremy Unruh */ public interface SwiftContainer extends ModelEntity { /** * The name of the Container - * + * * @return the container name */ String getName(); /** * The current object count for this container - * + * * @return the number of objects */ int getObjectCount(); /** * The total size of all the objects within this contain in bytes - * + * * @return total size in bytes */ long getTotalSize(); - + /** * The metadata for the current container. NOTE: This is a lazy call to the server and will invoke each time this * method is called. + * * @return The metadata for this container */ Map getMetadata(); diff --git a/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java b/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java index 92fe15787..a6f8cba84 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/SwiftHeaders.java @@ -2,7 +2,7 @@ /** * Common Object Storage (Swift) headers - * + * * @author Jeremy Unruh */ public final class SwiftHeaders { @@ -18,19 +18,19 @@ public final class SwiftHeaders { // Container Headers public static final String CONTAINER_METADATA_PREFIX = "X-Container-Meta-"; public static final String CONTAINER_REMOVE_METADATA_PREFIX = "X-Remove-Container-Meta-"; - + // Object Headers public static final String OBJECT_METADATA_PREFIX = "X-Object-Meta-"; // Versioning public static final String VERSIONS_LOCATION = "X-Versions-Location"; - + // ACL's (not all implementations support this) public static final String CONTAINER_READ = "X-Container-Read"; public static final String CONTAINER_WRITE = "X-Container-Write"; public static final String CONTAINER_ACL_ANYBODY_READ = ".r:*,.rlistings"; - - + + // Generic public static final String CONTENT_TYPE = "Content-Type"; public static final String ETAG = "Etag"; diff --git a/core/src/main/java/org/openstack4j/model/storage/object/SwiftObject.java b/core/src/main/java/org/openstack4j/model/storage/object/SwiftObject.java index 3e12576e3..2a894813d 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/SwiftObject.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/SwiftObject.java @@ -1,43 +1,43 @@ package org.openstack4j.model.storage.object; -import java.util.Date; -import java.util.Map; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.DLPayload; import org.openstack4j.model.storage.block.options.DownloadOptions; +import java.util.Date; +import java.util.Map; + /** * Represents an Object which is a File or Directory within a Container - * + * * @author Jeremy Unruh */ public interface SwiftObject extends ModelEntity { - + /** * The MD5 checksum value of the object content. - * + * * @return the MD5 checksum */ String getETag(); - + /** * The date and time when the object was last modified. - * + * * @return the last modified date */ Date getLastModified(); - + /** * The total number of bytes that are stored in Object Storage for the account - * + * * @return total number of bytes */ long getSizeInBytes(); - + /** * The name of the object - * + * * @return the name of the object */ String getName(); @@ -48,43 +48,43 @@ public interface SwiftObject extends ModelEntity { * @return the name of the directory */ String getDirectoryName(); - + /** * The content type of the object - * + * * @return the content type */ String getMimeType(); - + /** * @return the container name this object belongs to */ String getContainerName(); - + /** * Determines if this object is a pseudo directory - * + * * @return true if this is a directory */ boolean isDirectory(); - + /** * Gets the object metadata (this is a lazy fetch) - * + * * @return the metadata for this object */ Map getMetadata(); - + /** * Retrieves the Payload for the data backing the current object - * + * * @return the download payload */ DLPayload download(); - + /** * Retrieves the Payload for the data backing the current object - * + * * @param options the download options * @return the download payload */ diff --git a/core/src/main/java/org/openstack4j/model/storage/object/options/ContainerListOptions.java b/core/src/main/java/org/openstack4j/model/storage/object/options/ContainerListOptions.java index 0f386e1f2..94bdeee22 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/options/ContainerListOptions.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/options/ContainerListOptions.java @@ -1,94 +1,96 @@ package org.openstack4j.model.storage.object.options; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; +import com.google.common.collect.Maps; + import java.util.Map; -import com.google.common.collect.Maps; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; /** * List options used for Container and Object based queries - * + * * @author Jeremy Unruh */ public final class ContainerListOptions { - private Map queryParams = Maps.newHashMap(); - - private ContainerListOptions() { } - + private Map queryParams = Maps.newHashMap(); + + private ContainerListOptions() { + } + public static ContainerListOptions create() { return new ContainerListOptions(); } - + /** * Prefix value. Named items in the response begin with this value. - * + * * @param prefix the prefix (starts with) * @return ContainerListOptions */ public ContainerListOptions startsWith(String prefix) { - return add("prefix", checkNotNull(prefix)); + return add("prefix", checkNotNull(prefix)); } - - /** + + /** * For an integer value n, limits the number of results to n. */ public ContainerListOptions limit(int limit) { - checkState(limit >= 0, "limit must be >= 0"); - checkState(limit <= 10000, "limit must be <= 10000"); - add("limit", Integer.toString(limit)); - return this; + checkState(limit >= 0, "limit must be >= 0"); + checkState(limit <= 10000, "limit must be <= 10000"); + add("limit", Integer.toString(limit)); + return this; } - /** + /** * For a string value x, returns container names that are greater in value than the specified marker. - * + * * @param marker the marker value * @return ContainerListOptions */ public ContainerListOptions marker(String marker) { - add("marker", checkNotNull(marker, "marker")); - return this; + add("marker", checkNotNull(marker, "marker")); + return this; } - /** + /** * For a string value x, returns container names that are less in value than the specified marker. - * + * * @param endMarker the endMarker value * @return ContainerListOptions */ public ContainerListOptions endMarker(String endMarker) { - add("end_marker", checkNotNull(endMarker, "endMarker")); - return this; + add("end_marker", checkNotNull(endMarker, "endMarker")); + return this; } - + /** * Delimiter value, which returns the object names that are nested in the container. - * + * * @param delimiter the delimiter value * @return ContainerListOptions */ public ContainerListOptions delimiter(char delimiter) { return add("delimiter", Character.toString(delimiter)); } - + /** - * For a string value, returns the object names that are nested in the pseudo path. + * For a string value, returns the object names that are nested in the pseudo path. * Equivalent to setting delimiter to / and prefix to the path with a / at the end. - * + * * @param path the path value * @return ContainerListOptions */ public ContainerListOptions path(String path) { return add("path", checkNotNull(path)); } - + private ContainerListOptions add(String param, String value) { this.queryParams.put(param, value); return this; } - + public Map getOptions() { return queryParams; } diff --git a/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java b/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java index 44a88604b..32e6de31a 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/options/CreateUpdateContainerOptions.java @@ -1,36 +1,36 @@ package org.openstack4j.model.storage.object.options; -import static org.openstack4j.model.storage.object.SwiftHeaders.*; +import com.google.common.collect.Maps; +import org.openstack4j.openstack.storage.object.functions.MetadataToHeadersFunction; import java.util.Map; -import org.openstack4j.openstack.storage.object.functions.MetadataToHeadersFunction; - -import com.google.common.collect.Maps; +import static org.openstack4j.model.storage.object.SwiftHeaders.*; /** * Options for creating or updating a container - * + * * @author Jeremy Unruh */ public final class CreateUpdateContainerOptions { private Map headers = Maps.newHashMap(); - + private CreateUpdateContainerOptions() { } - + /** * Creates a new CreateUpdateContainerOptions + * * @return CreateUpdateContainerOptions */ public static final CreateUpdateContainerOptions create() { return new CreateUpdateContainerOptions(); } - + /** * Adds additional headers to the create or update request - * + * * @param headers the headers to add * @return CreateUpdateContainerOptions */ @@ -38,10 +38,10 @@ public CreateUpdateContainerOptions headers(Map headers) { this.headers.putAll(headers); return this; } - + /** * Sets the metadata against the container being created or updated - * + * * @param metadata the metadata to set * @return CreateUpdateContainerOptions */ @@ -49,12 +49,12 @@ public CreateUpdateContainerOptions metadata(Map metadata) { this.headers.putAll(MetadataToHeadersFunction.create(CONTAINER_METADATA_PREFIX).apply(metadata)); return this; } - + /** - * Enables versioning on this container. The value is the name of another container. - * You must UTF-8-encode and then URL-encode the name before you include it in the header. + * Enables versioning on this container. The value is the name of another container. + * You must UTF-8-encode and then URL-encode the name before you include it in the header. * To disable versioning, set the header to an empty string. - * + * * @param containerName the container name of the other container * @return CreateUpdateContainerOptions */ @@ -62,20 +62,20 @@ public CreateUpdateContainerOptions versionsLocation(String containerName) { add(VERSIONS_LOCATION, containerName); return this; } - + /** * Sets the read ACL (if supported) to allow public access - * + * * @return CreateUpdateContainerOptions */ public CreateUpdateContainerOptions accessAnybodyRead() { add(CONTAINER_READ, CONTAINER_ACL_ANYBODY_READ); return this; } - + /** * Sets the read ACL (if supported) - * + * * @param acl the read access control list * @return CreateUpdateContainerOptions */ @@ -83,10 +83,10 @@ public CreateUpdateContainerOptions accessRead(String acl) { add(CONTAINER_READ, acl); return this; } - + /** * Sets the write ACL (if supported) - * + * * @param acl the write access control list * @return CreateUpdateContainerOptions */ @@ -94,11 +94,11 @@ public CreateUpdateContainerOptions accessWrite(String acl) { add(CONTAINER_WRITE, acl); return this; } - + public Map getOptions() { return headers; } - + private void add(String key, String value) { this.headers.put(key, value); } diff --git a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectDeleteOptions.java b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectDeleteOptions.java index f212188fc..0d9f53773 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectDeleteOptions.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectDeleteOptions.java @@ -1,11 +1,11 @@ package org.openstack4j.model.storage.object.options; +import com.google.common.collect.Maps; + import java.util.ArrayList; import java.util.List; import java.util.Map; -import com.google.common.collect.Maps; - /** * Options used for the deletion of Objects */ @@ -15,7 +15,8 @@ public final class ObjectDeleteOptions { private Map> queryParams = Maps.newHashMap(); - private ObjectDeleteOptions() { } + private ObjectDeleteOptions() { + } public static ObjectDeleteOptions create() { return new ObjectDeleteOptions(); diff --git a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectListOptions.java b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectListOptions.java index 16af98119..594bf26cc 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectListOptions.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectListOptions.java @@ -1,77 +1,78 @@ package org.openstack4j.model.storage.object.options; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; +import com.google.common.collect.Maps; import java.util.Map; -import com.google.common.collect.Maps; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; /** * List options used for Object based queries - * + * * @author Jeremy Unruh */ public final class ObjectListOptions { - private Map queryParams = Maps.newHashMap(); - - private ObjectListOptions() { } - + private Map queryParams = Maps.newHashMap(); + + private ObjectListOptions() { + } + public static ObjectListOptions create() { return new ObjectListOptions(); } - - /** - * list operation returns no more than this amount. + + /** + * list operation returns no more than this amount. */ public ObjectListOptions limit(int limit) { - checkState(limit >= 0, "limit must be >= 0"); - checkState(limit <= 10000, "limit must be <= 10000"); - queryParams.put("limit", Integer.toString(limit)); - return this; + checkState(limit >= 0, "limit must be >= 0"); + checkState(limit <= 10000, "limit must be <= 10000"); + queryParams.put("limit", Integer.toString(limit)); + return this; } - /** + /** * Objects greater in value than the specified marker are returned. */ public ObjectListOptions marker(String marker) { - queryParams.put("marker", checkNotNull(marker, "marker")); - return this; + queryParams.put("marker", checkNotNull(marker, "marker")); + return this; } - /** + /** * Objects less in value than the specified marker are returned. */ public ObjectListOptions endMarker(String endMarker) { - queryParams.put("end_marker", checkNotNull(endMarker, "endMarker")); - return this; + queryParams.put("end_marker", checkNotNull(endMarker, "endMarker")); + return this; } - /** + /** * Objects beginning with this substring are returned. */ public ObjectListOptions startsWith(String prefix) { - queryParams.put("prefix", checkNotNull(prefix, "prefix")); - return this; + queryParams.put("prefix", checkNotNull(prefix, "prefix")); + return this; } - /** + /** * Objects nested in the container are returned. */ public ObjectListOptions delimiter(char delimiter) { - queryParams.put("delimiter", Character.toString(delimiter)); - return this; + queryParams.put("delimiter", Character.toString(delimiter)); + return this; } - /** + /** * Objects nested in the pseudo path are returned. */ public ObjectListOptions path(String path) { - queryParams.put("path", checkNotNull(path, "path")); - return this; + queryParams.put("path", checkNotNull(path, "path")); + return this; } - + public Map getOptions() { return queryParams; } diff --git a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectLocation.java b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectLocation.java index 816d92014..3650f50ce 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectLocation.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectLocation.java @@ -4,15 +4,15 @@ /** * Holds location information for an Object (Container and Object name including path) - * + * * @author Jeremy Unruh */ public final class ObjectLocation { private String containerName; private String objectName; - - + + private ObjectLocation(String containerName, String objectName) { super(); checkNotNull(containerName, "ContainerName cannot be null"); @@ -21,7 +21,7 @@ private ObjectLocation(String containerName, String objectName) { this.containerName = containerName; this.objectName = objectName; } - + public static ObjectLocation create(String containerName, String objectName) { return new ObjectLocation(containerName, objectName); } @@ -33,7 +33,7 @@ public String getContainerName() { public String getObjectName() { return objectName; } - + public String getURI() { return String.format("/%s/%s", containerName, objectName); } diff --git a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectPutOptions.java b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectPutOptions.java index 240bb8f0b..7590806c7 100644 --- a/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectPutOptions.java +++ b/core/src/main/java/org/openstack4j/model/storage/object/options/ObjectPutOptions.java @@ -1,19 +1,18 @@ package org.openstack4j.model.storage.object.options; -import static org.openstack4j.model.storage.object.SwiftHeaders.OBJECT_METADATA_PREFIX; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTENT_TYPE; +import com.google.common.collect.Maps; +import org.openstack4j.openstack.storage.object.functions.MetadataToHeadersFunction; import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.openstack4j.openstack.storage.object.functions.MetadataToHeadersFunction; - -import com.google.common.collect.Maps; +import static org.openstack4j.model.storage.object.SwiftHeaders.CONTENT_TYPE; +import static org.openstack4j.model.storage.object.SwiftHeaders.OBJECT_METADATA_PREFIX; /** * Options used for the creation and update of Objects - * + * * @author Jeremy Unruh */ public final class ObjectPutOptions { @@ -22,16 +21,17 @@ public final class ObjectPutOptions { Map headers = Maps.newHashMap(); private Map> queryParams = Maps.newHashMap(); private String path; - - private ObjectPutOptions() { } - + + private ObjectPutOptions() { + } + public static ObjectPutOptions create() { return new ObjectPutOptions(); } /** * Specifies the MIME type/Content Type of the uploaded payload - * + * * @param contentType the content type/mime type * @return ObjectPutOptions */ @@ -39,16 +39,16 @@ public ObjectPutOptions contentType(String contentType) { headers.put(CONTENT_TYPE, contentType); return this; } - + public ObjectPutOptions path(String path) { if (path != null) this.path = (path.startsWith("/") ? path.substring(1) : path); return this; } - + /** * Additional metadata associated with the Object - * + * * @param metadata the metadata * @return ObjectPutOptions */ @@ -56,19 +56,19 @@ public ObjectPutOptions metadata(Map metadata) { this.headers.putAll(MetadataToHeadersFunction.create(OBJECT_METADATA_PREFIX).apply(metadata)); return this; } - + public Map getOptions() { return headers; } - + public String getContentType() { return headers.get(CONTENT_TYPE); } - + public String getPath() { return path; } - + public ObjectPutOptions queryParam(String key, Object value) { if (value == null) return this; @@ -83,7 +83,7 @@ public ObjectPutOptions queryParam(String key, Object value) { } return this; } - + public Map> getQueryParams() { return queryParams; } diff --git a/core/src/main/java/org/openstack4j/model/tacker/Vim.java b/core/src/main/java/org/openstack4j/model/tacker/Vim.java index 5fef6a2fe..bfd65f4f3 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/Vim.java +++ b/core/src/main/java/org/openstack4j/model/tacker/Vim.java @@ -9,76 +9,64 @@ import org.openstack4j.openstack.tacker.domain.VimProject; /** - * * @author Vishvesh Deshmukh * @date Aug 18, 2016 */ public interface Vim extends ModelEntity, Buildable { - - /** - * - * @return id : Unique identifier for the Vim. - */ - String getId(); - - /** - * - * @return name : Human readable name for the Vim (255 characters limit). Does not have to be unique. - */ - String getName(); - /** - * - * @return tenantId : Owner of the Vim. Only an administrative user can specify a tenant ID other than its own. - */ - String getTenantId(); + /** + * @return id : Unique identifier for the Vim. + */ + String getId(); - /** - * - * @return description : Human readable description for the Vim (1024 characters limit). - */ - String getDescription(); - - /** - * - * @return type - */ - String getType(); - - /** - * - * @return isDefault - */ - Boolean isDefault(); - - /** - * - * @return authUrl - */ - String getAuthUrl(); - - /** - * - * @return authCredentials - */ - AuthCredentials getAuthCredentials(); - - /** - * - * @return vimProject - */ - VimProject getVimProject(); - - /** - * - * @return the status - */ - TackerVimStatus getStatus(); + /** + * @return name : Human readable name for the Vim (255 characters limit). Does not have to be unique. + */ + String getName(); - /** - * - * @return the placementAttribute - */ - VimPlacementAttribute getPlacementAttribute(); + /** + * @return tenantId : Owner of the Vim. Only an administrative user can specify a tenant ID other than its own. + */ + String getTenantId(); + + /** + * @return description : Human readable description for the Vim (1024 characters limit). + */ + String getDescription(); + + /** + * @return type + */ + String getType(); + + /** + * @return isDefault + */ + Boolean isDefault(); + + /** + * @return authUrl + */ + String getAuthUrl(); + + /** + * @return authCredentials + */ + AuthCredentials getAuthCredentials(); + + /** + * @return vimProject + */ + VimProject getVimProject(); + + /** + * @return the status + */ + TackerVimStatus getStatus(); + + /** + * @return the placementAttribute + */ + VimPlacementAttribute getPlacementAttribute(); } diff --git a/core/src/main/java/org/openstack4j/model/tacker/Vnf.java b/core/src/main/java/org/openstack4j/model/tacker/Vnf.java index 338c7b77d..24fb59190 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/Vnf.java +++ b/core/src/main/java/org/openstack4j/model/tacker/Vnf.java @@ -8,81 +8,68 @@ import org.openstack4j.openstack.tacker.domain.VnfPlacementAttribute; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public interface Vnf extends ModelEntity, Buildable { - /** - * - * @return id : Unique identifier for the Vnf. - */ - String getId(); - - /** - * - * @return name : Human readable name for the Vnf (255 characters limit). Does not have to be unique. - */ - String getName(); + /** + * @return id : Unique identifier for the Vnf. + */ + String getId(); - /** - * - * @return tenantId : Owner of the Vnf. Only an administrative user can specify a tenant ID other than its own. - */ - String getTenantId(); + /** + * @return name : Human readable name for the Vnf (255 characters limit). Does not have to be unique. + */ + String getName(); - /** - * - * @return description : Human readable description for the Vnf (1024 characters limit). - */ - String getDescription(); - - /** - * - * @return attributes - */ - VnfAttributes getAttributes(); - - /** - * - * @return managementUrl - */ - String getManagementUrl(); + /** + * @return tenantId : Owner of the Vnf. Only an administrative user can specify a tenant ID other than its own. + */ + String getTenantId(); - /** - * - * @return the vnfdId - */ - String getVnfdId(); + /** + * @return description : Human readable description for the Vnf (1024 characters limit). + */ + String getDescription(); - /** - * - * @return the errorReason - */ - String getErrorReason(); + /** + * @return attributes + */ + VnfAttributes getAttributes(); - /** - * - * @return the vimId - */ - String getVimId(); + /** + * @return managementUrl + */ + String getManagementUrl(); - /** - * - * @return the instanceId - */ - String getInstanceId(); - - /** - * - * @return the status - */ - TackerVnfStatus getStatus(); + /** + * @return the vnfdId + */ + String getVnfdId(); - /** - * - * @return the placementAttribute - */ - VnfPlacementAttribute getPlacementAttribute(); + /** + * @return the errorReason + */ + String getErrorReason(); + + /** + * @return the vimId + */ + String getVimId(); + + /** + * @return the instanceId + */ + String getInstanceId(); + + /** + * @return the status + */ + TackerVnfStatus getStatus(); + + /** + * @return the placementAttribute + */ + VnfPlacementAttribute getPlacementAttribute(); } diff --git a/core/src/main/java/org/openstack4j/model/tacker/VnfUpdate.java b/core/src/main/java/org/openstack4j/model/tacker/VnfUpdate.java index e69c1f199..53f2fb37b 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/VnfUpdate.java +++ b/core/src/main/java/org/openstack4j/model/tacker/VnfUpdate.java @@ -7,13 +7,13 @@ /** * A Builder to Update Firewall of FwaaS - * + * * @author Vishvesh Deshmukh */ public interface VnfUpdate extends ModelEntity, Buildable { - /** - * @return attributes : VnfUpdateAttributes - */ - VnfUpdateAttributes getAttributes(); + /** + * @return attributes : VnfUpdateAttributes + */ + VnfUpdateAttributes getAttributes(); } diff --git a/core/src/main/java/org/openstack4j/model/tacker/Vnfd.java b/core/src/main/java/org/openstack4j/model/tacker/Vnfd.java index 86e866846..2f69029a0 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/Vnfd.java +++ b/core/src/main/java/org/openstack4j/model/tacker/Vnfd.java @@ -1,65 +1,56 @@ package org.openstack4j.model.tacker; -import java.util.List; - import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.tacker.builder.VnfdBuilder; import org.openstack4j.openstack.tacker.domain.VnfdAttributes; import org.openstack4j.openstack.tacker.domain.VnfdServiceTypes; +import java.util.List; + /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public interface Vnfd extends ModelEntity, Buildable { - /** - * - * @return id : Unique identifier for the Vnfd. - */ - String getId(); - - /** - * - * @return name : Human readable name for the Vnfd (255 characters limit). Does not have to be unique. - */ - String getName(); + /** + * @return id : Unique identifier for the Vnfd. + */ + String getId(); + + /** + * @return name : Human readable name for the Vnfd (255 characters limit). Does not have to be unique. + */ + String getName(); + + /** + * @return tenantId : Owner of the Vnfd. Only an administrative user can specify a tenant ID other than its own. + */ + String getTenantId(); + + /** + * @return description : Human readable description for the Vnfd (1024 characters limit). + */ + String getDescription(); + + /** + * @return managementDriver + */ + String getManagementDriver(); + + /** + * @return infrastructureDriver + */ + String getInfrastructureDriver(); - /** - * - * @return tenantId : Owner of the Vnfd. Only an administrative user can specify a tenant ID other than its own. - */ - String getTenantId(); + /** + * @return attributes + */ + VnfdAttributes getAttributes(); - /** - * - * @return description : Human readable description for the Vnfd (1024 characters limit). - */ - String getDescription(); - - /** - * - * @return managementDriver - */ - String getManagementDriver(); - - /** - * - * @return infrastructureDriver - */ - String getInfrastructureDriver(); - - /** - * - * @return attributes - */ - VnfdAttributes getAttributes(); - - /** - * - * @return serviceTypes - */ - List getServiceTypes(); + /** + * @return serviceTypes + */ + List getServiceTypes(); } diff --git a/core/src/main/java/org/openstack4j/model/tacker/builder/NfvBuilders.java b/core/src/main/java/org/openstack4j/model/tacker/builder/NfvBuilders.java index b576509df..4070eef9b 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/builder/NfvBuilders.java +++ b/core/src/main/java/org/openstack4j/model/tacker/builder/NfvBuilders.java @@ -2,19 +2,19 @@ /** * NFV Builders.. - * + * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public interface NfvBuilders { - - /** + + /** * The builder to create a Vnfd * * @return the vnfd builder */ VnfdBuilder vnfd(); - + /** * The builder to create a Vnf * @@ -28,7 +28,7 @@ public interface NfvBuilders { * @return VnfUpdateBuilder */ VnfUpdateBuilder vnfUpdate(); - + /** * The builder to create a Vim * diff --git a/core/src/main/java/org/openstack4j/model/tacker/builder/VimBuilder.java b/core/src/main/java/org/openstack4j/model/tacker/builder/VimBuilder.java index cab8c46b0..edb96658f 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/builder/VimBuilder.java +++ b/core/src/main/java/org/openstack4j/model/tacker/builder/VimBuilder.java @@ -6,52 +6,51 @@ import org.openstack4j.openstack.tacker.domain.VimProject; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public interface VimBuilder extends Builder { - - /** - * @param name : Human readable name for the Vim (255 characters limit). Does not have to be unique. - * @return VimBuilder - */ - VimBuilder name(String name); - - /** - * @param description : Human readable description for the Vim (1024 characters limit). - * @return VimBuilder - */ - VimBuilder description(String description); - - /** - * @param authUrl - * @return VimBuilder - */ - VimBuilder authUrl(String authUrl); - - /** - * @param vimProject - * @return VimBuilder - */ - VimBuilder vimProject(VimProject vimProject); - - /** - * @param authCredentials - * @return VimBuilder - */ - VimBuilder authCredentials(AuthCredentials authCredentials); - - /** - * @param isDefault - * @return VimBuilder - */ - VimBuilder isDefault(Boolean isDefault); - - /** - * @param type - * @return VimBuilder - */ - VimBuilder type(String type); - + + /** + * @param name : Human readable name for the Vim (255 characters limit). Does not have to be unique. + * @return VimBuilder + */ + VimBuilder name(String name); + + /** + * @param description : Human readable description for the Vim (1024 characters limit). + * @return VimBuilder + */ + VimBuilder description(String description); + + /** + * @param authUrl + * @return VimBuilder + */ + VimBuilder authUrl(String authUrl); + + /** + * @param vimProject + * @return VimBuilder + */ + VimBuilder vimProject(VimProject vimProject); + + /** + * @param authCredentials + * @return VimBuilder + */ + VimBuilder authCredentials(AuthCredentials authCredentials); + + /** + * @param isDefault + * @return VimBuilder + */ + VimBuilder isDefault(Boolean isDefault); + + /** + * @param type + * @return VimBuilder + */ + VimBuilder type(String type); + } diff --git a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfBuilder.java b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfBuilder.java index 3fb2f799f..b34b2a6a7 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfBuilder.java +++ b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfBuilder.java @@ -5,46 +5,45 @@ import org.openstack4j.openstack.tacker.domain.VnfAttributes; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public interface VnfBuilder extends Builder { - /** - * @param tenantId : Owner of the Vnf. Only an administrative user can specify a tenant ID other than its own. - * @return VnfBuilder - */ - VnfBuilder tenantId(String tenantId); - - /** - * @param name : Human readable name for the Vnf (255 characters limit). Does not have to be unique. - * @return VnfBuilder - */ - VnfBuilder name(String name); - - /** - * @param description : Human readable description for the Vnf (1024 characters limit). - * @return VnfBuilder - */ - VnfBuilder description(String description); - - /** - * @param attributes - * @return VnfBuilder - */ - VnfBuilder attributes(VnfAttributes attributes); - - /** - * @param vnfdId - * @return VnfBuilder - */ - VnfBuilder vnfdId(String vnfdId); - - /** - * @param vimId - * @return VnfBuilder - */ - VnfBuilder vimId(String vimId); - + /** + * @param tenantId : Owner of the Vnf. Only an administrative user can specify a tenant ID other than its own. + * @return VnfBuilder + */ + VnfBuilder tenantId(String tenantId); + + /** + * @param name : Human readable name for the Vnf (255 characters limit). Does not have to be unique. + * @return VnfBuilder + */ + VnfBuilder name(String name); + + /** + * @param description : Human readable description for the Vnf (1024 characters limit). + * @return VnfBuilder + */ + VnfBuilder description(String description); + + /** + * @param attributes + * @return VnfBuilder + */ + VnfBuilder attributes(VnfAttributes attributes); + + /** + * @param vnfdId + * @return VnfBuilder + */ + VnfBuilder vnfdId(String vnfdId); + + /** + * @param vimId + * @return VnfBuilder + */ + VnfBuilder vimId(String vimId); + } diff --git a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java index 39d688604..d845a7326 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java @@ -6,14 +6,14 @@ /** * A Builder to Update Vnf - * + * * @author Vishvesh Deshmukh */ public interface VnfUpdateBuilder extends Builder { - /** - * @param attributes : VnfUpdateAttributes - * @return VnfUpdateBuilder - */ - public VnfUpdateBuilder attributes(VnfUpdateAttributes attributes); + /** + * @param attributes : VnfUpdateAttributes + * @return VnfUpdateBuilder + */ + public VnfUpdateBuilder attributes(VnfUpdateAttributes attributes); } diff --git a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfdBuilder.java b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfdBuilder.java index 99ecc2b37..27ee47fb8 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfdBuilder.java +++ b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfdBuilder.java @@ -1,59 +1,58 @@ package org.openstack4j.model.tacker.builder; -import java.util.List; - import org.openstack4j.common.Buildable.Builder; import org.openstack4j.model.tacker.Vnfd; import org.openstack4j.openstack.tacker.domain.VnfdAttributes; import org.openstack4j.openstack.tacker.domain.VnfdServiceTypes; +import java.util.List; + /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public interface VnfdBuilder extends Builder { - /** - * @param tenantId : Owner of the Vnfd. Only an administrative user can specify a tenant ID other than its own. - * @return VnfdBuilder - */ - VnfdBuilder tenantId(String tenantId); - - /** - * @param name : Human readable name for the Vnfd (255 characters limit). Does not have to be unique. - * @return VnfdBuilder - */ - VnfdBuilder name(String name); - - /** - * @param description : Human readable description for the Vnfd (1024 characters limit). - * @return VnfdBuilder - */ - VnfdBuilder description(String description); - - /** - * @param managementDriver - * @return VnfdBuilder - */ - VnfdBuilder managementDriver(String managementDriver); - - /** - * @param infrastructureDriver - * @return VnfdBuilder - */ - VnfdBuilder infrastructureDriver(String infrastructureDriver); - - /** - * @param attributes - * @return VnfdBuilder - */ - VnfdBuilder attributes(VnfdAttributes attributes); - - /** - * @param serviceTypes - * @return VnfdBuilder - */ - VnfdBuilder serviceTypes(List serviceTypes); - + /** + * @param tenantId : Owner of the Vnfd. Only an administrative user can specify a tenant ID other than its own. + * @return VnfdBuilder + */ + VnfdBuilder tenantId(String tenantId); + + /** + * @param name : Human readable name for the Vnfd (255 characters limit). Does not have to be unique. + * @return VnfdBuilder + */ + VnfdBuilder name(String name); + + /** + * @param description : Human readable description for the Vnfd (1024 characters limit). + * @return VnfdBuilder + */ + VnfdBuilder description(String description); + + /** + * @param managementDriver + * @return VnfdBuilder + */ + VnfdBuilder managementDriver(String managementDriver); + + /** + * @param infrastructureDriver + * @return VnfdBuilder + */ + VnfdBuilder infrastructureDriver(String infrastructureDriver); + + /** + * @param attributes + * @return VnfdBuilder + */ + VnfdBuilder attributes(VnfdAttributes attributes); + + /** + * @param serviceTypes + * @return VnfdBuilder + */ + VnfdBuilder serviceTypes(List serviceTypes); + } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java b/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java index 1dbe1a59b..a72c24a6c 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java @@ -16,385 +16,474 @@ * * @author Massimiliano Romano */ -public interface Alarm extends ModelEntity,BasicResource, Buildable { +public interface Alarm extends ModelEntity, BasicResource, Buildable { - List getAlarmActions(); + List getAlarmActions(); - String getAlarmId(); + String getAlarmId(); - String getDescription(); + String getDescription(); - boolean isEnabled(); + boolean isEnabled(); - void isEnabled(boolean newValue); + void isEnabled(boolean newValue); - List getInsufficientDataActions(); + List getInsufficientDataActions(); - /** - * @return the unique name of the alarm - */ - String getName(); + /** + * @return the unique name of the alarm + */ + String getName(); - List getOkActions(); + List getOkActions(); - /** - * @return the ID of the project/tenant that owns the resource - */ - String getProjectId(); + /** + * @return the ID of the project/tenant that owns the resource + */ + String getProjectId(); - boolean getRepeatActions(); + boolean getRepeatActions(); - String getState(); + String getState(); - String getStateTimestamp(); + String getStateTimestamp(); - ThresholdRule getThresholdRule(); + ThresholdRule getThresholdRule(); - CombinationRule getCombinationRule(); + CombinationRule getCombinationRule(); - Map getCompositeRule(); + Map getCompositeRule(); - GnocchiResourcesThresholdRule getGnocchiResourcesThresholdRule(); + GnocchiResourcesThresholdRule getGnocchiResourcesThresholdRule(); - GnocchiAggregationByMetricsThresholdRule getGnocchiAggregationByMetricsThresholdRule(); + GnocchiAggregationByMetricsThresholdRule getGnocchiAggregationByMetricsThresholdRule(); - GnocchiAggregationByResourcesThresholdRule getGnocchiAggregationByResourcesThresholdRule(); + GnocchiAggregationByResourcesThresholdRule getGnocchiAggregationByResourcesThresholdRule(); - String getTimestamp(); + String getTimestamp(); - /** - * @return the alarm type - */ - Type getType(); + /** + * @return the alarm type + */ + Type getType(); - /** - * @return The user id who last modified the resource - */ - String getUserId(); - - /** - * The Alarm Type - */ - public enum Type { - GNOCCHI_AGGREGATION_BY_METRICS_THRESHOLD, COMPOSITE, GNOCCHI_RESOURCES_THRESHOLD, GNOCCHI_AGGREGATION_BY_RESOURCES_THRESHOLD, THRESHOLD, EVENT,COMBINATION, UNRECOGNIZED; - //THRESHOLD, COMBINATION, UNRECOGNIZED; - - @JsonValue - public String value() { - return this.name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static Type fromValue(String type) { - try { - return valueOf(type.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public enum Statistic { - MAX, MIN, AVG, SUM, COUNT, UNRECOGNIZED; - - @JsonValue - public String value() { - return this.name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static Statistic fromValue(String statistic) { - try { - return valueOf(statistic.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public enum ComparisonOperator { - LT, LE, EQ, NE, GE, GT, UNRECOGNIZED; - - @JsonValue - public String value() { - return this.name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static ComparisonOperator fromValue(String operator) { - try { - return valueOf(operator.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public enum Operator { - AND, OR, UNRECOGNIZED; - - @JsonValue - public String value() { - return this.name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static Operator fromValue(String operator) { - try { - return valueOf(operator.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public enum AggregationMethod{ - COUNT, MAX, SUM, MIN, MEAN, UNRECOGNIZED; - @JsonValue - public String value() { - return this.name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static AggregationMethod fromValue(String method) { - try { - return valueOf(method.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - public interface CombinationRule{ - List getAlarmIds(); - Operator getOperator(); - - void setAlarmIds(List alarmIds); - void setOperator(Operator operator); - } - - public interface ThresholdRule{ - String getMeterName(); - int getEvaluationPeriods(); - Statistic getStatistic(); - int getPeriod(); - float getThreshold(); - List getQuery(); - ComparisonOperator getComparisonOperator(); - boolean getExcludeOutliers(); - - void setMeterName(String meterName); - void setEvaluationPeriods(int evaluationPeriod); - void setStatistic(Statistic statistic); - void setPeriod(int period); - void setThreshold(float threshold); - void setQuery(List query); - void setComparisonOperator(ComparisonOperator comparisonOperator); - void setExcludeOutliers(boolean excludeOutliers); - - } - - public interface Query{ - String getField(); - String getValue(); - ComparisonOperator getOp(); - void setField(String field); - void setValue(String value); - void setOp(ComparisonOperator comparisonOperator); - } - - //gnocchi_resources_threshold - public interface GnocchiResourcesThresholdRule { - String getMetric(); - String getResourceId(); - String getResourceType(); - ComparisonOperator getComparisonOperator(); - AggregationMethod getAggregationMethod(); - int getEvaluationPeriods(); - float getThreshold(); - long getGranularity(); - - void setMetric(String metric); - void setResourceId(String resourceId); - void setResourceType(String resourceType); - void setComparisonOperator(ComparisonOperator comparisonOperator); - void setAggregationMethod(AggregationMethod aggregationMethod); - void setEvaluationPeriods(int evaluationPeriod); - void setThreshold(float threshold); - void setGranularity(long granularity); - } - - //gnocchi_aggregation_by_metrics_threshold - public interface GnocchiAggregationByMetricsThresholdRule { - List getMetrics(); - ComparisonOperator getComparisonOperator(); - AggregationMethod getAggregationMethod(); - float getThreshold(); - int getEvaluationPeriods(); - long getGranularity(); - - void setMetrics(List metrics); - void setComparisonOperator(ComparisonOperator comparisonOperator); - void setAggregationMethod(AggregationMethod aggregationMethod); - void setThreshold(float threshold); - void setEvaluationPeriods(int evaluationPeriod); - void setGranularity(long granularity); - } - - //gnocchi_aggregation_by_resources_threshold - public interface GnocchiAggregationByResourcesThresholdRule { - String getMetric(); - String getResourceType(); - ComparisonOperator getComparisonOperator(); - AggregationMethod getAggregationMethod(); - int getEvaluationPeriods(); - float getThreshold(); - long getGranularity(); - Query getQuery(); - - void setMetric(String metric); - void setResourceType(String resourceType); - void setComparisonOperator(ComparisonOperator comparisonOperator); - void setAggregationMethod(AggregationMethod aggregationMethod); - void setEvaluationPeriods(int evaluationPeriod); - void setThreshold(float threshold); - void setGranularity(long granularity); - void setQuery(CeilometerQuery query); - } - - //event - public interface GnocchiEvent{ - - } - - public interface MetricOfResourceRule{ - String getMetric(); - String getResourceId(); - String getResourceType(); - - void setMetric(String metric); - void setResourceId(String resourceId); - void setResourceType(String resourceType); - } - - public interface AggregationMetricByResourcesLookupRule{ - String getMetric(); - String getResourceType(); - - void setMetric(String metric); - void setResourceType(String resourceType); - } - - public interface AggregationMetricsByIdLookupRule{ - String getMetric(); - - void setMetric(String metric); - } - - public interface AlarmTimeConstraint{ - String getDescription(); - int getDuration(); - String getName(); - String getStart(); - String getTimezone(); - - void setDescription(String description); - void setDuration(int duration); - void setName(String name); - void setStart(String String); - void setTimezone(String timezone); - } - - public interface AlarmChange{ - String getAlarmId(); - String getDetail(); - String getEventId(); - String getOnBehalfOf(); - String getProjectId(); - String getTimestamp(); - ChangeType getChangeType(); - String getUserId(); - - void setAlarmId(String alarmId); - void setDetail(String detail); - void setEventId(String eventId); - void setOnBehalfOf(String onBehalfOf); - void setProjectId(String projectId); - void setTimestamp(String timestamp); - void setChangeType(ChangeType changeType); - void setUserId(String userId); - //The type of change - public enum ChangeType{ - CREATION, RULE_CHANGE, STATE_TRANSITION, DELETION,UNRECOGNIZED; - - @JsonValue - public String value() { - return this.name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } - - @JsonCreator - public static ChangeType fromValue(String type) { - try { - return valueOf(type.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - } - - void setName(String name); - - void setType(Type type); - - void setUserId(String userId); - - void setAlarmActions(List alarmActions); - - void setDescription(String description); - - void setInsufficientDataActions(List insufficientDataActions); - - void setOkActions(List okActions); + /** + * @return The user id who last modified the resource + */ + String getUserId(); - void setRepeateActions(Boolean repeatActions); - - void setThresholdRule(CeilometerThresholdRule tr); - - void setGnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThresholdRule); - - void setGnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThresholdRule); - - void setGnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThresholdRule); + /** + * The Alarm Type + */ + public enum Type { + GNOCCHI_AGGREGATION_BY_METRICS_THRESHOLD, COMPOSITE, GNOCCHI_RESOURCES_THRESHOLD, GNOCCHI_AGGREGATION_BY_RESOURCES_THRESHOLD, THRESHOLD, EVENT, COMBINATION, UNRECOGNIZED; + //THRESHOLD, COMBINATION, UNRECOGNIZED; + + @JsonValue + public String value() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static Type fromValue(String type) { + try { + return valueOf(type.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + + public enum Statistic { + MAX, MIN, AVG, SUM, COUNT, UNRECOGNIZED; + + @JsonValue + public String value() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static Statistic fromValue(String statistic) { + try { + return valueOf(statistic.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + + public enum ComparisonOperator { + LT, LE, EQ, NE, GE, GT, UNRECOGNIZED; + + @JsonValue + public String value() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static ComparisonOperator fromValue(String operator) { + try { + return valueOf(operator.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + + public enum Operator { + AND, OR, UNRECOGNIZED; + + @JsonValue + public String value() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static Operator fromValue(String operator) { + try { + return valueOf(operator.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + + public enum AggregationMethod { + COUNT, MAX, SUM, MIN, MEAN, UNRECOGNIZED; + + @JsonValue + public String value() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static AggregationMethod fromValue(String method) { + try { + return valueOf(method.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + + public interface CombinationRule { + List getAlarmIds(); + + Operator getOperator(); + + void setAlarmIds(List alarmIds); + + void setOperator(Operator operator); + } + + public interface ThresholdRule { + String getMeterName(); + + int getEvaluationPeriods(); + + Statistic getStatistic(); + + int getPeriod(); + + float getThreshold(); + + List getQuery(); + + ComparisonOperator getComparisonOperator(); + + boolean getExcludeOutliers(); + + void setMeterName(String meterName); + + void setEvaluationPeriods(int evaluationPeriod); + + void setStatistic(Statistic statistic); + + void setPeriod(int period); + + void setThreshold(float threshold); + + void setQuery(List query); + + void setComparisonOperator(ComparisonOperator comparisonOperator); + + void setExcludeOutliers(boolean excludeOutliers); + + } + + public interface Query { + String getField(); + + String getValue(); + + ComparisonOperator getOp(); + + void setField(String field); + + void setValue(String value); + + void setOp(ComparisonOperator comparisonOperator); + } + + //gnocchi_resources_threshold + public interface GnocchiResourcesThresholdRule { + String getMetric(); + + String getResourceId(); + + String getResourceType(); + + ComparisonOperator getComparisonOperator(); + + AggregationMethod getAggregationMethod(); + + int getEvaluationPeriods(); + + float getThreshold(); + + long getGranularity(); + + void setMetric(String metric); + + void setResourceId(String resourceId); + + void setResourceType(String resourceType); + + void setComparisonOperator(ComparisonOperator comparisonOperator); + + void setAggregationMethod(AggregationMethod aggregationMethod); + + void setEvaluationPeriods(int evaluationPeriod); + + void setThreshold(float threshold); + + void setGranularity(long granularity); + } + + //gnocchi_aggregation_by_metrics_threshold + public interface GnocchiAggregationByMetricsThresholdRule { + List getMetrics(); + + ComparisonOperator getComparisonOperator(); + + AggregationMethod getAggregationMethod(); + + float getThreshold(); + + int getEvaluationPeriods(); + + long getGranularity(); + + void setMetrics(List metrics); + + void setComparisonOperator(ComparisonOperator comparisonOperator); + + void setAggregationMethod(AggregationMethod aggregationMethod); + + void setThreshold(float threshold); + + void setEvaluationPeriods(int evaluationPeriod); + + void setGranularity(long granularity); + } + + //gnocchi_aggregation_by_resources_threshold + public interface GnocchiAggregationByResourcesThresholdRule { + String getMetric(); + + String getResourceType(); + + ComparisonOperator getComparisonOperator(); + + AggregationMethod getAggregationMethod(); + + int getEvaluationPeriods(); + + float getThreshold(); + + long getGranularity(); + + Query getQuery(); + + void setMetric(String metric); + + void setResourceType(String resourceType); + + void setComparisonOperator(ComparisonOperator comparisonOperator); + + void setAggregationMethod(AggregationMethod aggregationMethod); + + void setEvaluationPeriods(int evaluationPeriod); + + void setThreshold(float threshold); + + void setGranularity(long granularity); + + void setQuery(CeilometerQuery query); + } + + //event + public interface GnocchiEvent { + + } + + public interface MetricOfResourceRule { + String getMetric(); + + String getResourceId(); + + String getResourceType(); + + void setMetric(String metric); + + void setResourceId(String resourceId); + + void setResourceType(String resourceType); + } + + public interface AggregationMetricByResourcesLookupRule { + String getMetric(); + + String getResourceType(); + + void setMetric(String metric); + + void setResourceType(String resourceType); + } + + public interface AggregationMetricsByIdLookupRule { + String getMetric(); + + void setMetric(String metric); + } + + public interface AlarmTimeConstraint { + String getDescription(); + + int getDuration(); + + String getName(); + + String getStart(); + + String getTimezone(); + + void setDescription(String description); + + void setDuration(int duration); + + void setName(String name); + + void setStart(String String); + + void setTimezone(String timezone); + } + + public interface AlarmChange { + String getAlarmId(); + + String getDetail(); + + String getEventId(); + + String getOnBehalfOf(); + + String getProjectId(); + + String getTimestamp(); + + ChangeType getChangeType(); + + String getUserId(); + + void setAlarmId(String alarmId); + + void setDetail(String detail); + + void setEventId(String eventId); + + void setOnBehalfOf(String onBehalfOf); + + void setProjectId(String projectId); + + void setTimestamp(String timestamp); + + void setChangeType(ChangeType changeType); + + void setUserId(String userId); + + //The type of change + public enum ChangeType { + CREATION, RULE_CHANGE, STATE_TRANSITION, DELETION, UNRECOGNIZED; + + @JsonValue + public String value() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } + + @JsonCreator + public static ChangeType fromValue(String type) { + try { + return valueOf(type.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } + } + + void setName(String name); + + void setType(Type type); + + void setUserId(String userId); + + void setAlarmActions(List alarmActions); + + void setDescription(String description); + + void setInsufficientDataActions(List insufficientDataActions); + + void setOkActions(List okActions); + + void setRepeateActions(Boolean repeatActions); + + void setThresholdRule(CeilometerThresholdRule tr); + + void setGnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThresholdRule); + + void setGnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThresholdRule); + + void setGnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThresholdRule); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/telemetry/Event.java b/core/src/main/java/org/openstack4j/model/telemetry/Event.java index ef11f6ffa..51593f43d 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/Event.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/Event.java @@ -7,7 +7,7 @@ /** * Event represents the state of an object in an OpenStack service * at a point in time when something of interest has occurred - * + * * @author Miroslav Lacina */ public interface Event extends ModelEntity { diff --git a/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java b/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java index ec25a67ba..39cda7ee5 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java @@ -10,42 +10,53 @@ /** * Query options used in retrieving Events - * + * * @author Jeremy Unruh * @author Miroslav Lacina */ public class EventCriteria { public enum Oper { - /** Less Than : < */ + /** + * Less Than : < + */ LT("lt"), - /** Greater Than : > */ + /** + * Greater Than : > + */ GT("gt"), - /** Less Than Equals : <= */ + /** + * Less Than Equals : <= + */ LTE("le"), - /** Greater Than Equals : >= */ + /** + * Greater Than Equals : >= + */ GTE("ge"), - /** Equals : = */ - EQUALS("eq") - ; + /** + * Equals : = + */ + EQUALS("eq"); private final String queryValue; + Oper(String queryValue) { this.queryValue = queryValue; } - + public String getQueryValue() { return queryValue; } } - + private List params = Lists.newArrayList(); - + public static EventCriteria create() { return new EventCriteria(); } /** * Matches the given event type + * * @param eventType the resource id * @return EventCriteria */ @@ -56,6 +67,7 @@ public EventCriteria eventType(String eventType) { /** * Matches the given message identifier + * * @param messageId the message id * @return EventCriteria */ @@ -63,11 +75,12 @@ public EventCriteria messageId(String messageId) { checkNotNull(messageId, "messageId must not be null"); return add("message_id", Oper.EQUALS, messageId); } - + /** * Adds the start timestamp event criteria + * * @param operator the operator - * @param value the date for this timestamp + * @param value the date for this timestamp * @return EventCriteria */ public EventCriteria startTimestamp(Oper operator, Date value) { @@ -77,20 +90,22 @@ public EventCriteria startTimestamp(Oper operator, Date value) { /** * Adds the end timestamp event criteria + * * @param operator the operator - * @param value the date for this timestamp + * @param value the date for this timestamp * @return EventCriteria */ public EventCriteria endTimestamp(Oper operator, Date value) { checkNotNull(value, "Date must not be null"); return add("end_timestamp", operator, Parser.toISO8601DateFormat(value)); } - + /** * Adds an adhoc field criteria - * @param field the field name (will be treated as trait name and applied on trait) + * + * @param field the field name (will be treated as trait name and applied on trait) * @param operator the operator - * @param value the value + * @param value the value * @return EventCriteria */ public EventCriteria add(String field, Oper operator, Number value) { @@ -100,9 +115,10 @@ public EventCriteria add(String field, Oper operator, Number value) { /** * Adds an adhoc field criteria - * @param field the field name (will be treated as trait name and applied on trait) + * + * @param field the field name (will be treated as trait name and applied on trait) * @param operator the operator - * @param value the value + * @param value the value * @return EventCriteria */ public EventCriteria add(String field, Oper operator, String value) { @@ -113,36 +129,36 @@ public EventCriteria add(String field, Oper operator, String value) { params.add(new NameOpValue(field, operator, value)); return this; } - + /** * @return the criteria parameters for this query */ public List getCriteriaParams() { return params; } - + public static class NameOpValue { private final String field; private final Oper operator; private String value; - + NameOpValue(String field, Oper operator, Comparable value) { this.field = field; this.operator = operator; - if (value instanceof Date) + if (value instanceof Date) this.value = Parser.toISO8601DateFormat(Date.class.cast(value)); else this.value = String.valueOf(value); } - + public String getField() { return field; } - + public Oper getOperator() { return operator; } - + public String getValue() { return value; } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/Meter.java b/core/src/main/java/org/openstack4j/model/telemetry/Meter.java index 686e36e55..96b1b5deb 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/Meter.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/Meter.java @@ -1,76 +1,75 @@ package org.openstack4j.model.telemetry; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import org.openstack4j.model.ModelEntity; /** * A Meter is a category of Measurement - * + * * @author Jeremy Unruh */ public interface Meter extends ModelEntity { - /** - * The Meter Type - */ - public enum Type { - GAUGE, DELTA, CUMULATIVE, UNRECOGNIZED; + /** + * The Meter Type + */ + public enum Type { + GAUGE, DELTA, CUMULATIVE, UNRECOGNIZED; + + @JsonValue + public String value() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return value(); + } - @JsonValue - public String value() { - return this.name().toLowerCase(); - } + @JsonCreator + public static Type fromValue(String type) { + try { + return valueOf(type.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + } - @Override - public String toString() { - return value(); - } + /** + * @return the unique identifier for the meter + */ + String getId(); - @JsonCreator - public static Type fromValue(String type) { - try { - return valueOf(type.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } + /** + * @return the unique name of the meter + */ + String getName(); - /** - * @return the unique identifier for the meter - */ - String getId(); + /** + * @return the ID of the Resource for which the measurements are taken + */ + String getResourceId(); - /** - * @return the unique name of the meter - */ - String getName(); + /** + * @return the ID of the project/tenant that owns the resource + */ + String getProjectId(); - /** - * @return the ID of the Resource for which the measurements are taken - */ - String getResourceId(); + /** + * @return the meter type + */ + Type getType(); - /** - * @return the ID of the project/tenant that owns the resource - */ - String getProjectId(); + /** + * @return the unit of measure + */ + String getUnit(); - /** - * @return the meter type - */ - Type getType(); - - /** - * @return the unit of measure - */ - String getUnit(); - - /** - * @return The user id who last modified the resource - */ - String getUserId(); + /** + * @return The user id who last modified the resource + */ + String getUserId(); } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/MeterSample.java b/core/src/main/java/org/openstack4j/model/telemetry/MeterSample.java index 4d5829b25..e1db63a9d 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/MeterSample.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/MeterSample.java @@ -1,133 +1,133 @@ package org.openstack4j.model.telemetry; -import java.util.Map; - import org.openstack4j.model.ModelEntity; +import java.util.Map; + /** * A single measurement for a given meter and resource. - * + * * @author Jeremy Unruh */ public interface MeterSample extends ModelEntity { - /** - * @return the name of the meter - */ - String getCounterName(); - - /** - * @return the type of meter - */ - Meter.Type getCounterType(); - - /** - * @return The unit of measure for the value in the counter volume - */ - String getCounterUnit(); - - /** - * @return the actual measured value - */ - Float getCounterVolume(); - - /** - * @return The ID of the source that identifies where the sample comes from - */ - String getSource(); - - /** - * @return he ID of the project or tenant that owns the resource - */ - String getProjectId(); - - /** - * @return The ID of the user who last triggered an update to the resource - */ - String getUserId(); - - /** - * @return The ID of the Resource for which the measurements are taken - */ - String getResourceId(); - - /** - * @return UTC date and time when the measurement was made - */ - String getTimestamp(); - - /** - * @return UTC date and time when the sample was recorded - */ - String getRecordedAt(); - - /** - * @return A unique identifier for the sample - */ - String getMessageId(); - - /** - * @return Arbitrary metadata associated with the resource - */ - Map getMetadata(); - - /** - * @return the name of the meter - */ - void setCounterName(String counterName); - - /** - * @return the type of meter - */ - void setCounterType(Meter.Type meterType); - - /** - * @return The unit of measure for the value in the counter volume - */ - void setCounterUnit(String counterUnit); - - /** - * @return the actual measured value - */ - void setCounterVolume(Float counterVolume); - - /** - * @return The ID of the source that identifies where the sample comes from - */ - void setSource(String source); - - /** - * @return he ID of the project or tenant that owns the resource - */ - void setProjectId(String projectId); - - /** - * @return The ID of the user who last triggered an update to the resource - */ - void setUserId(String userId); - - /** - * @return The ID of the Resource for which the measurements are taken - */ - void setResourceId(String resourceId); - - /** - * @return UTC date and time when the measurement was made - */ - void setTimestamp(String timestamp); - - /** - * @return UTC date and time when the sample was recorded - */ - void setRecordedAt(String date); - - /** - * @return A unique identifier for the sample - */ - void setMessageId(String messageId); - - /** - * @return Arbitrary metadata associated with the resource - */ - void setMetadata(Map metadata); + /** + * @return the name of the meter + */ + String getCounterName(); + + /** + * @return the type of meter + */ + Meter.Type getCounterType(); + + /** + * @return The unit of measure for the value in the counter volume + */ + String getCounterUnit(); + + /** + * @return the actual measured value + */ + Float getCounterVolume(); + + /** + * @return The ID of the source that identifies where the sample comes from + */ + String getSource(); + + /** + * @return he ID of the project or tenant that owns the resource + */ + String getProjectId(); + + /** + * @return The ID of the user who last triggered an update to the resource + */ + String getUserId(); + + /** + * @return The ID of the Resource for which the measurements are taken + */ + String getResourceId(); + + /** + * @return UTC date and time when the measurement was made + */ + String getTimestamp(); + + /** + * @return UTC date and time when the sample was recorded + */ + String getRecordedAt(); + + /** + * @return A unique identifier for the sample + */ + String getMessageId(); + + /** + * @return Arbitrary metadata associated with the resource + */ + Map getMetadata(); + + /** + * @return the name of the meter + */ + void setCounterName(String counterName); + + /** + * @return the type of meter + */ + void setCounterType(Meter.Type meterType); + + /** + * @return The unit of measure for the value in the counter volume + */ + void setCounterUnit(String counterUnit); + + /** + * @return the actual measured value + */ + void setCounterVolume(Float counterVolume); + + /** + * @return The ID of the source that identifies where the sample comes from + */ + void setSource(String source); + + /** + * @return he ID of the project or tenant that owns the resource + */ + void setProjectId(String projectId); + + /** + * @return The ID of the user who last triggered an update to the resource + */ + void setUserId(String userId); + + /** + * @return The ID of the Resource for which the measurements are taken + */ + void setResourceId(String resourceId); + + /** + * @return UTC date and time when the measurement was made + */ + void setTimestamp(String timestamp); + + /** + * @return UTC date and time when the sample was recorded + */ + void setRecordedAt(String date); + + /** + * @return A unique identifier for the sample + */ + void setMessageId(String messageId); + + /** + * @return Arbitrary metadata associated with the resource + */ + void setMetadata(Map metadata); } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/Sample.java b/core/src/main/java/org/openstack4j/model/telemetry/Sample.java index 1c850eaba..d30d5adc2 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/Sample.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/Sample.java @@ -1,12 +1,12 @@ package org.openstack4j.model.telemetry; -import java.util.Map; - import org.openstack4j.model.ModelEntity; +import java.util.Map; + /** * A single measurement for Sample. - * + * * @author Shital Patil */ diff --git a/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java b/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java index cde3decfa..d98b97f3e 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java @@ -1,76 +1,88 @@ package org.openstack4j.model.telemetry; -import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.base.Preconditions; +import org.openstack4j.openstack.internal.Parser; import java.util.ArrayList; import java.util.Date; import java.util.List; -import org.openstack4j.openstack.internal.Parser; - -import com.google.common.base.Preconditions; +import static com.google.common.base.Preconditions.checkNotNull; /** * Query options used in retreiving Samples - * + * * @author Jeremy Unruh */ public class SampleCriteria { public enum Oper { - /** Less Than : < */ + /** + * Less Than : < + */ LT("lt"), - /** Greater Than : > */ + /** + * Greater Than : > + */ GT("gt"), - /** Less Than Equals : <= */ + /** + * Less Than Equals : <= + */ LTE("le"), - /** Greater Than Equals : >= */ + /** + * Greater Than Equals : >= + */ GTE("ge"), - /** Equals : = */ - EQUALS("eq") - ; + /** + * Equals : = + */ + EQUALS("eq"); private final String queryValue; + private Oper(String queryValue) { this.queryValue = queryValue; } - + public String getQueryValue() { return queryValue; } } - + private List params = new ArrayList<>(); - + private int limit; public static SampleCriteria create() { return new SampleCriteria(); } - + /** * Adds a timestamp sample criteria + * * @param operator the operator - * @param value the date for this timestamp + * @param value the date for this timestamp * @return SampleCriteria */ public SampleCriteria timestamp(Oper operator, Date value) { checkNotNull(value, "Date must not be null"); return add("timestamp", operator, Parser.toISO8601DateFormat(value)); } - + /** * Adds a timestamp sample criteria + * * @param operator the operator - * @param value the date for this timestamp + * @param value the date for this timestamp * @return SampleCriteria */ public SampleCriteria timestamp(Oper operator, long value) { checkNotNull(value, "Date must not be null"); return add("timestamp", operator, Parser.toISO8601DateFormat(new Date(value))); } - + /** * Matches the given resource identifier + * * @param resourceId the resource id * @return SampleCriteria */ @@ -78,9 +90,10 @@ public SampleCriteria resource(String resourceId) { checkNotNull(resourceId, "resourceId must not be null"); return add("resource_id", Oper.EQUALS, resourceId); } - + /** * Matches the given project identifier + * * @param projectId the project id * @return SampleCriteria */ @@ -88,19 +101,20 @@ public SampleCriteria project(String projectId) { checkNotNull(projectId, "projectId must not be null"); return add("project_id", Oper.EQUALS, projectId); } - + /** * Adds an adhoc field criteria - * @param field the field name (must be the JSON name) + * + * @param field the field name (must be the JSON name) * @param operator the operator - * @param value the value + * @param value the value * @return SampleCriteria */ public SampleCriteria add(String field, Oper operator, Number value) { checkNotNull(value, "Value must not be null"); return add(field, operator, value.toString()); } - + public SampleCriteria add(String field, Oper operator, String value) { checkNotNull(field, "Field must not be null"); checkNotNull(operator, "Operator must not be null"); @@ -109,7 +123,7 @@ public SampleCriteria add(String field, Oper operator, String value) { params.add(new NameOpValue(field, operator, value)); return this; } - + public SampleCriteria limit(int limit) { Preconditions.checkArgument(limit > 0, "Limit must be greater than zero"); this.limit = limit; @@ -122,7 +136,7 @@ public SampleCriteria limit(int limit) { public List getCriteriaParams() { return params; } - + public int getLimit() { return limit; } @@ -131,25 +145,25 @@ public static class NameOpValue { private final String field; private final Oper operator; private String value; - + NameOpValue(String field, Oper operator, Comparable value) { this.field = field; this.operator = operator; if (value instanceof Date) { - this.value = Parser.toISO8601DateFormat(Date.class.cast(value)); + this.value = Parser.toISO8601DateFormat(Date.class.cast(value)); } else { - this.value = String.valueOf(value); + this.value = String.valueOf(value); } } - + public String getField() { return field; } - + public Oper getOperator() { return operator; } - + public String getValue() { return value; } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/Statistics.java b/core/src/main/java/org/openstack4j/model/telemetry/Statistics.java index 5b5ef52c6..7ffffa4d5 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/Statistics.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/Statistics.java @@ -1,78 +1,78 @@ package org.openstack4j.model.telemetry; -import java.util.Date; - import org.openstack4j.model.ModelEntity; +import java.util.Date; + /** * Computed Statistics for a Query against a Meter - * + * * @author Jeremy Unruh */ public interface Statistics extends ModelEntity { - /** - * @return The average of all of the volume values seen in the data - */ - Double getAvg(); - - /** - * @return The number of samples seen - */ - Integer getCount(); - - /** - * @return The difference, in seconds, between the oldest and newest timestamp - */ - Double getDuration(); - - /** - * @return UTC date and time of the earliest timestamp, or the query start time - */ - Date getDurationStart(); - - /** - * @return UTC date and time of the oldest timestamp, or the query end time - */ - Date getDurationEnd(); - - /** - * @return The maximum volume seen in the data - */ - Double getMax(); - - /** - * @return The minimum volume seen in the data - */ - Double getMin(); - - /** - * @return The total of all of the volume values seen in the data - */ - Double getSum(); - - /** - * @return The difference, in seconds, between the period start and end - */ - Integer getPeriod(); - - /** - * @return UTC date and time of the period start - */ - Date getPeriodStart(); - - /** - * @return UTC date and time of the period end - */ - Date getPeriodEnd(); - - /** - * @return The unit type of the data set - */ - String getUnit(); - - /** - * @return The group-by of the data set - */ - String getGroupBy(); + /** + * @return The average of all of the volume values seen in the data + */ + Double getAvg(); + + /** + * @return The number of samples seen + */ + Integer getCount(); + + /** + * @return The difference, in seconds, between the oldest and newest timestamp + */ + Double getDuration(); + + /** + * @return UTC date and time of the earliest timestamp, or the query start time + */ + Date getDurationStart(); + + /** + * @return UTC date and time of the oldest timestamp, or the query end time + */ + Date getDurationEnd(); + + /** + * @return The maximum volume seen in the data + */ + Double getMax(); + + /** + * @return The minimum volume seen in the data + */ + Double getMin(); + + /** + * @return The total of all of the volume values seen in the data + */ + Double getSum(); + + /** + * @return The difference, in seconds, between the period start and end + */ + Integer getPeriod(); + + /** + * @return UTC date and time of the period start + */ + Date getPeriodStart(); + + /** + * @return UTC date and time of the period end + */ + Date getPeriodEnd(); + + /** + * @return The unit type of the data set + */ + String getUnit(); + + /** + * @return The group-by of the data set + */ + String getGroupBy(); } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/builder/AlarmBuilder.java b/core/src/main/java/org/openstack4j/model/telemetry/builder/AlarmBuilder.java index e9432569f..0a668d9a9 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/builder/AlarmBuilder.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/builder/AlarmBuilder.java @@ -16,33 +16,33 @@ public interface AlarmBuilder extends Builder { - AlarmBuilder name(String name); + AlarmBuilder name(String name); - AlarmBuilder okActions(List okActions); + AlarmBuilder okActions(List okActions); - AlarmBuilder alarmActions(List alarmActions); + AlarmBuilder alarmActions(List alarmActions); - AlarmBuilder type(Type type); + AlarmBuilder type(Type type); - AlarmBuilder thresholeRule(CeilometerThresholdRule te); + AlarmBuilder thresholeRule(CeilometerThresholdRule te); - AlarmBuilder combinationRule(CeilometerCombinationRule ce); + AlarmBuilder combinationRule(CeilometerCombinationRule ce); - AlarmBuilder compositeRule(Map cr); + AlarmBuilder compositeRule(Map cr); - AlarmBuilder gnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThreshold); + AlarmBuilder gnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThreshold); - AlarmBuilder gnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThreshold); + AlarmBuilder gnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThreshold); - AlarmBuilder gnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThreshold); + AlarmBuilder gnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThreshold); - AlarmBuilder repeatActions(boolean repeatActions); + AlarmBuilder repeatActions(boolean repeatActions); - AlarmBuilder description(String description); + AlarmBuilder description(String description); - AlarmBuilder isEnabled(boolean isEnabled); + AlarmBuilder isEnabled(boolean isEnabled); - AlarmBuilder insufficientDataActions(List insufficientDataActions) ; + AlarmBuilder insufficientDataActions(List insufficientDataActions); } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java b/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java index b58bf7efb..d7779e9d1 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java @@ -1,7 +1,5 @@ package org.openstack4j.model.telemetry.builder; -import org.openstack4j.model.telemetry.Alarm; - /** * The Ceilometer builders */ diff --git a/core/src/main/java/org/openstack4j/model/trove/DBCharacterSet.java b/core/src/main/java/org/openstack4j/model/trove/DBCharacterSet.java index 07f64c3f5..9bb40dce9 100644 --- a/core/src/main/java/org/openstack4j/model/trove/DBCharacterSet.java +++ b/core/src/main/java/org/openstack4j/model/trove/DBCharacterSet.java @@ -11,18 +11,18 @@ public enum DBCharacterSet { UTF8, UTF16, UTF32, - UNRECOGNIZED - ; + UNRECOGNIZED; @JsonValue - public String value() { return name().toLowerCase(); } + public String value() { + return name().toLowerCase(); + } @JsonCreator public static DBCharacterSet value(String paramType) { try { return valueOf(paramType.toUpperCase()); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } diff --git a/core/src/main/java/org/openstack4j/model/trove/DBCollation.java b/core/src/main/java/org/openstack4j/model/trove/DBCollation.java index 65c79f3f6..a03e5773d 100644 --- a/core/src/main/java/org/openstack4j/model/trove/DBCollation.java +++ b/core/src/main/java/org/openstack4j/model/trove/DBCollation.java @@ -11,18 +11,18 @@ public enum DBCollation { UTF8_GENERAL_CI, UTF16_GENERAL_CI, UTF32_GENERAL_CI, - UNRECOGNIZED - ; + UNRECOGNIZED; @JsonValue - public String value() { return name().toLowerCase(); } + public String value() { + return name().toLowerCase(); + } @JsonCreator public static DBCollation value(String paramType) { try { return valueOf(paramType.toUpperCase()); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } diff --git a/core/src/main/java/org/openstack4j/model/trove/Database.java b/core/src/main/java/org/openstack4j/model/trove/Database.java index c901ae217..7a23a95fe 100644 --- a/core/src/main/java/org/openstack4j/model/trove/Database.java +++ b/core/src/main/java/org/openstack4j/model/trove/Database.java @@ -12,7 +12,9 @@ public interface Database extends ModelEntity, Buildable { String getName(); + String getDbCharacterSet(); + String getDbCollation(); } diff --git a/core/src/main/java/org/openstack4j/model/trove/DatabaseUser.java b/core/src/main/java/org/openstack4j/model/trove/DatabaseUser.java index f952a2bac..0357ce5ed 100644 --- a/core/src/main/java/org/openstack4j/model/trove/DatabaseUser.java +++ b/core/src/main/java/org/openstack4j/model/trove/DatabaseUser.java @@ -15,5 +15,6 @@ public interface DatabaseUser extends ModelEntity, Buildable { String getUsername(); + List getTroveDatabaseList(); } diff --git a/core/src/main/java/org/openstack4j/model/trove/Datastore.java b/core/src/main/java/org/openstack4j/model/trove/Datastore.java index b90bab16b..88d5bdc87 100644 --- a/core/src/main/java/org/openstack4j/model/trove/Datastore.java +++ b/core/src/main/java/org/openstack4j/model/trove/Datastore.java @@ -1,10 +1,10 @@ package org.openstack4j.model.trove; -import java.util.List; - import org.openstack4j.model.ModelEntity; import org.openstack4j.openstack.trove.domain.TroveDatastoreVersion; +import java.util.List; + /** * Datastore Model Entity * diff --git a/core/src/main/java/org/openstack4j/model/trove/DatastoreVersion.java b/core/src/main/java/org/openstack4j/model/trove/DatastoreVersion.java index b3fc90c3c..38e09173e 100644 --- a/core/src/main/java/org/openstack4j/model/trove/DatastoreVersion.java +++ b/core/src/main/java/org/openstack4j/model/trove/DatastoreVersion.java @@ -10,9 +10,14 @@ public interface DatastoreVersion extends ModelEntity { String getName(); + String getId(); + String getDatastoreId(); + int getIsActive(); + String getImage(); + String getPackageName(); } diff --git a/core/src/main/java/org/openstack4j/model/trove/Flavor.java b/core/src/main/java/org/openstack4j/model/trove/Flavor.java index 03a76a87f..611df619c 100644 --- a/core/src/main/java/org/openstack4j/model/trove/Flavor.java +++ b/core/src/main/java/org/openstack4j/model/trove/Flavor.java @@ -10,9 +10,14 @@ public interface Flavor extends ModelEntity { String getName(); + String getId(); + String getStrId(); + int getRam(); + int getVcpus(); + int getDisk(); } diff --git a/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseBuilder.java b/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseBuilder.java index e2f5594f6..73baa2801 100644 --- a/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseBuilder.java +++ b/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseBuilder.java @@ -6,10 +6,12 @@ /** * Created by sumit gandhi on 8/19/2016. */ -public interface DatabaseBuilder extends Buildable.Builder{ +public interface DatabaseBuilder extends Buildable.Builder { DatabaseBuilder name(String name); + DatabaseBuilder dbCharacterSet(String dbCharacterSet); + DatabaseBuilder dbCollation(String dbCollation); } diff --git a/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseUserBuilder.java b/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseUserBuilder.java index 10f4667d4..1c8576381 100644 --- a/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseUserBuilder.java +++ b/core/src/main/java/org/openstack4j/model/trove/builder/DatabaseUserBuilder.java @@ -12,7 +12,9 @@ public interface DatabaseUserBuilder extends Buildable.Builder { DatabaseUserBuilder username(String username); + DatabaseUserBuilder password(String password); + DatabaseUserBuilder troveDatabaseList(List troveDatabaseList); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/ActionDefinition.java b/core/src/main/java/org/openstack4j/model/workflow/ActionDefinition.java index 2c417a62b..ccf59ffbf 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/ActionDefinition.java +++ b/core/src/main/java/org/openstack4j/model/workflow/ActionDefinition.java @@ -1,12 +1,8 @@ /* - * + * */ package org.openstack4j.model.workflow; -import org.openstack4j.common.Buildable; -import org.openstack4j.model.workflow.builder.ActionDefinitionBuilder; - - /** * An action definition. * diff --git a/core/src/main/java/org/openstack4j/model/workflow/ActionExecution.java b/core/src/main/java/org/openstack4j/model/workflow/ActionExecution.java index d1479746d..07f8e1b54 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/ActionExecution.java +++ b/core/src/main/java/org/openstack4j/model/workflow/ActionExecution.java @@ -1,12 +1,8 @@ /* - * + * */ package org.openstack4j.model.workflow; -import org.openstack4j.common.Buildable; -import org.openstack4j.model.workflow.builder.ActionExecutionBuilder; - -import java.util.List; import java.util.Map; diff --git a/core/src/main/java/org/openstack4j/model/workflow/Definition.java b/core/src/main/java/org/openstack4j/model/workflow/Definition.java index 600a937c1..95a2d2026 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/Definition.java +++ b/core/src/main/java/org/openstack4j/model/workflow/Definition.java @@ -1,12 +1,11 @@ /* - * + * */ package org.openstack4j.model.workflow; import org.openstack4j.common.Buildable; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.workflow.builder.DefinitionBuilder; -import org.openstack4j.model.workflow.builder.WorkflowDefinitionBuilder; import java.util.Date; import java.util.List; @@ -14,53 +13,53 @@ /** * Base interface for all definition objects. - * + * * @author Renat Akhmerov */ public interface Definition extends ModelEntity, Buildable { - /** - * @return The id of this definition. - */ - String getId(); - - /** - * @return The name of this definition. - */ - String getName(); + /** + * @return The id of this definition. + */ + String getId(); + + /** + * @return The name of this definition. + */ + String getName(); /** * @return The text of this definition. */ - String getDefinition(); + String getDefinition(); - /** - * @return the createdAt - */ - Date getCreatedAt(); + /** + * @return the createdAt + */ + Date getCreatedAt(); - /** - * @return the updatedAt - */ - Date getUpdatedAt(); + /** + * @return the updatedAt + */ + Date getUpdatedAt(); - /** - * @return {@code True} if the definition is system (not createdAt by user). - */ - Boolean isSystem(); + /** + * @return {@code True} if the definition is system (not createdAt by user). + */ + Boolean isSystem(); /** * @return User tags. */ - List getTags(); + List getTags(); - /** - * @return Definition scope. - */ - Scope getScope(); + /** + * @return Definition scope. + */ + Scope getScope(); - /** - * @return Definition project ID. - */ - String getProjectId(); + /** + * @return Definition project ID. + */ + String getProjectId(); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/EventTrigger.java b/core/src/main/java/org/openstack4j/model/workflow/EventTrigger.java index e70cd763c..83bc67f63 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/EventTrigger.java +++ b/core/src/main/java/org/openstack4j/model/workflow/EventTrigger.java @@ -1,5 +1,5 @@ /* - * + * */ package org.openstack4j.model.workflow; @@ -27,6 +27,7 @@ public interface EventTrigger extends ModelEntity, Buildable * @return The name of this definition. */ String getName(); + /** * @return The name of workflow that this trigger needs to run. */ diff --git a/core/src/main/java/org/openstack4j/model/workflow/Execution.java b/core/src/main/java/org/openstack4j/model/workflow/Execution.java index 2b3c36463..61a83a24a 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/Execution.java +++ b/core/src/main/java/org/openstack4j/model/workflow/Execution.java @@ -1,5 +1,5 @@ /* - * + * */ package org.openstack4j.model.workflow; @@ -13,14 +13,14 @@ /** * Base interface for all execution objects. - * + * * @author Renat Akhmerov */ public interface Execution extends ModelEntity, Buildable { - /** - * @return The id of this execution. - */ - String getId(); + /** + * @return The id of this execution. + */ + String getId(); /** * @return The description of this execution. @@ -32,15 +32,15 @@ public interface Execution extends ModelEntity, Buildable { */ String getWorkflowName(); - /** - * @return Execution state. - */ - State getState(); + /** + * @return Execution state. + */ + State getState(); - /** - * @return Execution state info. - */ - String getStateInfo(); + /** + * @return Execution state info. + */ + String getStateInfo(); /** * @return The list of tags. @@ -48,12 +48,12 @@ public interface Execution extends ModelEntity, Buildable { List getTags(); /** - * @return The time that this entity was created at. - */ - Date getCreatedAt(); + * @return The time that this entity was created at. + */ + Date getCreatedAt(); - /** - * @return The time that this entity was last updated at. - */ - Date getUpdatedAt(); + /** + * @return The time that this entity was last updated at. + */ + Date getUpdatedAt(); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/TaskExecution.java b/core/src/main/java/org/openstack4j/model/workflow/TaskExecution.java index 6607cc407..7392bdfac 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/TaskExecution.java +++ b/core/src/main/java/org/openstack4j/model/workflow/TaskExecution.java @@ -1,11 +1,8 @@ /* - * + * */ package org.openstack4j.model.workflow; -import org.openstack4j.common.Buildable; -import org.openstack4j.model.workflow.builder.TaskExecutionBuilder; - import java.util.Map; diff --git a/core/src/main/java/org/openstack4j/model/workflow/WorkbookDefinition.java b/core/src/main/java/org/openstack4j/model/workflow/WorkbookDefinition.java index 11d783e58..c485a9a50 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/WorkbookDefinition.java +++ b/core/src/main/java/org/openstack4j/model/workflow/WorkbookDefinition.java @@ -1,5 +1,5 @@ /* - * + * */ package org.openstack4j.model.workflow; diff --git a/core/src/main/java/org/openstack4j/model/workflow/WorkflowDefinition.java b/core/src/main/java/org/openstack4j/model/workflow/WorkflowDefinition.java index 6e75f3e1c..916183f27 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/WorkflowDefinition.java +++ b/core/src/main/java/org/openstack4j/model/workflow/WorkflowDefinition.java @@ -1,12 +1,8 @@ /* - * + * */ package org.openstack4j.model.workflow; -import org.openstack4j.common.Buildable; -import org.openstack4j.model.workflow.builder.WorkflowDefinitionBuilder; - - /** * A workflow definition. * diff --git a/core/src/main/java/org/openstack4j/model/workflow/WorkflowExecution.java b/core/src/main/java/org/openstack4j/model/workflow/WorkflowExecution.java index bfae2f63f..873618be1 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/WorkflowExecution.java +++ b/core/src/main/java/org/openstack4j/model/workflow/WorkflowExecution.java @@ -1,11 +1,8 @@ /* - * + * */ package org.openstack4j.model.workflow; -import org.openstack4j.common.Buildable; -import org.openstack4j.model.workflow.builder.WorkflowExecutionBuilder; - import javax.annotation.Nullable; import java.util.Map; @@ -18,8 +15,8 @@ public interface WorkflowExecution extends Execution { /** * @return The meta parameters of workflow execution specific to workflow type. - * Example: a reverse workflow requires the parameter 'task_name' which - * specifies the target task in the workflow graph. + * Example: a reverse workflow requires the parameter 'task_name' which + * specifies the target task in the workflow graph. */ Map getParameters(); diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/ActionDefinitionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/ActionDefinitionBuilder.java index 51e4265e4..fda40aaad 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/ActionDefinitionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/ActionDefinitionBuilder.java @@ -4,14 +4,14 @@ /** * Builder for a {@link ActionDefinition} model class - * + * * @author Renat Akhmerov */ public interface ActionDefinitionBuilder, M extends ActionDefinition> - extends DefinitionBuilder { + extends DefinitionBuilder { - /** - * @see ActionDefinition#getInput() - */ - T input(String input); + /** + * @see ActionDefinition#getInput() + */ + T input(String input); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/ActionExecutionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/ActionExecutionBuilder.java index 2f274156e..b8e3f8ec0 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/ActionExecutionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/ActionExecutionBuilder.java @@ -6,11 +6,11 @@ /** * Builder for a {@link ActionExecution} model class - * + * * @author Renat Akhmerov */ public interface ActionExecutionBuilder, M extends ActionExecution> - extends ExecutionBuilder { + extends ExecutionBuilder { /** * @see ActionExecution#getName() @@ -18,14 +18,14 @@ public interface ActionExecutionBuilder, T name(String name); /** - * @see ActionExecution#getTaskName() - */ - T taskName(String taskName); - - /** - * @see ActionExecution#getTaskExecutionId() - */ - T taskExecutionId(String taskExecId); + * @see ActionExecution#getTaskName() + */ + T taskName(String taskName); + + /** + * @see ActionExecution#getTaskExecutionId() + */ + T taskExecutionId(String taskExecId); /** * @see ActionExecution#isAccepted() diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/CronTriggerBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/CronTriggerBuilder.java index 709805cf0..d15e36d04 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/CronTriggerBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/CronTriggerBuilder.java @@ -9,73 +9,73 @@ /** * Builder for a {@link CronTrigger} model class - * + * * @author Renat Akhmerov */ public interface CronTriggerBuilder, M extends CronTrigger> - extends Builder { - /** - * @see CronTrigger#getId() - */ - T id(String id); + extends Builder { + /** + * @see CronTrigger#getId() + */ + T id(String id); - /** - * @see CronTrigger#getCreatedAt() - */ - T createdAt(Date createdAt); + /** + * @see CronTrigger#getCreatedAt() + */ + T createdAt(Date createdAt); - /** - * @see CronTrigger#getUpdatedAt() - */ - T updatedAt(Date updatedAt); + /** + * @see CronTrigger#getUpdatedAt() + */ + T updatedAt(Date updatedAt); - /** - * @see CronTrigger#getScope() - */ - T scope(Scope scope); + /** + * @see CronTrigger#getScope() + */ + T scope(Scope scope); - /** - * @see CronTrigger#getName() - */ - T name(String name); + /** + * @see CronTrigger#getName() + */ + T name(String name); - /** - * @see CronTrigger#getPattern() - */ - T pattern(String pattern); + /** + * @see CronTrigger#getPattern() + */ + T pattern(String pattern); - /** - * @see CronTrigger#getWorkflowName() - */ - T workflowName(String wfName); + /** + * @see CronTrigger#getWorkflowName() + */ + T workflowName(String wfName); - /** - * @see CronTrigger#getWorkflowId() - */ - T workflowId(String wfId); + /** + * @see CronTrigger#getWorkflowId() + */ + T workflowId(String wfId); - /** - * @see CronTrigger#getWorkflowInput() - */ - T workflowInput(Map wfInput); + /** + * @see CronTrigger#getWorkflowInput() + */ + T workflowInput(Map wfInput); - /** - * @see CronTrigger#getWorkflowParameters() - */ - T workflowParameters(Map wfParams); + /** + * @see CronTrigger#getWorkflowParameters() + */ + T workflowParameters(Map wfParams); - /** - * @see CronTrigger#getRemainingExecutionsCount() - */ - T remainingExecutionsCount(Integer cnt); + /** + * @see CronTrigger#getRemainingExecutionsCount() + */ + T remainingExecutionsCount(Integer cnt); /** * @see CronTrigger#getFirstExecutionTime() */ T firstExecutionTime(Date firstExecTime); - /** - * @see CronTrigger#getNextExecutionTime() - */ - T nextExecutionTime(Date nextExecTime); + /** + * @see CronTrigger#getNextExecutionTime() + */ + T nextExecutionTime(Date nextExecTime); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/DefinitionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/DefinitionBuilder.java index 3dd89986e..0487969c2 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/DefinitionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/DefinitionBuilder.java @@ -9,53 +9,53 @@ /** * Builder for {@link Definition} model class. - * + * * @author Renat Akhmerov */ public interface DefinitionBuilder, M extends Definition> extends Builder { - /** - * @see Definition#getId() - */ - T id(String id); - - /** - * @see Definition#getName() - */ - T name(String name); - - /** - * @see Definition#getDefinition() - */ - T definition(String definition); - - /** - * @see Definition#getCreatedAt() - */ - T created(Date created); - - /** - * @see Definition#getUpdatedAt() - */ - T updated(Date definition); - - /** - * @see Definition#isSystem() - */ - T system(Boolean system); - - /** - * @see Definition#getTags() - */ - T tags(List tags); - - /** - * @see Definition#getScope() - */ - T scope(Scope scope); - - /** - * @see Definition#getProjectId() - */ - T projectId(String projectId); + /** + * @see Definition#getId() + */ + T id(String id); + + /** + * @see Definition#getName() + */ + T name(String name); + + /** + * @see Definition#getDefinition() + */ + T definition(String definition); + + /** + * @see Definition#getCreatedAt() + */ + T created(Date created); + + /** + * @see Definition#getUpdatedAt() + */ + T updated(Date definition); + + /** + * @see Definition#isSystem() + */ + T system(Boolean system); + + /** + * @see Definition#getTags() + */ + T tags(List tags); + + /** + * @see Definition#getScope() + */ + T scope(Scope scope); + + /** + * @see Definition#getProjectId() + */ + T projectId(String projectId); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/EventTriggerBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/EventTriggerBuilder.java index c88cfff4b..397bc00b7 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/EventTriggerBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/EventTriggerBuilder.java @@ -5,20 +5,20 @@ /** * Builder for a {@link EventTrigger} model class - * + * * @author Renat Akhmerov */ public interface EventTriggerBuilder extends Builder { - /** - * @see EventTrigger#getId() - */ - EventTriggerBuilder id(String id); + /** + * @see EventTrigger#getId() + */ + EventTriggerBuilder id(String id); - /** - * @see EventTrigger#getName() - */ - EventTriggerBuilder name(String name); + /** + * @see EventTrigger#getName() + */ + EventTriggerBuilder name(String name); - // TODO(rakhmerov): add all methods + // TODO(rakhmerov): add all methods } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/ExecutionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/ExecutionBuilder.java index 379d26eda..c1bfbe702 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/ExecutionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/ExecutionBuilder.java @@ -1,7 +1,6 @@ package org.openstack4j.model.workflow.builder; import org.openstack4j.common.Buildable.Builder; -import org.openstack4j.model.workflow.Definition; import org.openstack4j.model.workflow.Execution; import java.util.Date; @@ -9,38 +8,38 @@ /** * Builder for {@link Execution} model class. - * + * * @author Renat Akhmerov */ public interface ExecutionBuilder, M extends Execution> extends Builder { - /** - * @see Execution#getId() - */ - T id(String id); - - /** - * @see Execution#getDescription() - */ - T description(String id); - - /** - * @see Execution#getWorkflowName() - */ - T workflowName(String wfName); - - /** - * @see Execution#getCreatedAt() - */ - T createdAt(Date createdAt); - - /** - * @see Execution#getUpdatedAt() - */ - T updatedAt(Date updatedAt); - - /** - * @see Execution#getTags() - */ - T tags(List tags); + /** + * @see Execution#getId() + */ + T id(String id); + + /** + * @see Execution#getDescription() + */ + T description(String id); + + /** + * @see Execution#getWorkflowName() + */ + T workflowName(String wfName); + + /** + * @see Execution#getCreatedAt() + */ + T createdAt(Date createdAt); + + /** + * @see Execution#getUpdatedAt() + */ + T updatedAt(Date updatedAt); + + /** + * @see Execution#getTags() + */ + T tags(List tags); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/TaskExecutionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/TaskExecutionBuilder.java index ebd1d0f9c..36de4c93e 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/TaskExecutionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/TaskExecutionBuilder.java @@ -6,54 +6,54 @@ /** * Builder for a {@link TaskExecution} model class - * + * * @author Renat Akhmerov */ public interface TaskExecutionBuilder, M extends TaskExecution> - extends ExecutionBuilder { - - /** - * @see TaskExecution#getType() - */ - T type(String type); - - /** - * @see TaskExecution#getWorkflowDefinitionId() - */ - T workflowDefinitionId(String wfDefId); - - /** - * @see TaskExecution#getWorkflowExecutionId() - */ - T workflowExecutionId(String wfExecId); - - /** - * @see TaskExecution#getRuntimeContext() - */ - T runtimeContext(Map runtimeContext); - - /** - * @see TaskExecution#getResult() - */ - T result(Object result); - - /** - * @see TaskExecution#getPublished() - */ - T published(Map published); - - /** - * @see TaskExecution#isProcessed() - */ - T processed(Boolean processed); - - /** - * @see TaskExecution#isReset() - */ - T reset(Boolean reset); - - /** - * @see TaskExecution#getEnvironment() - */ - T environment(Map env); + extends ExecutionBuilder { + + /** + * @see TaskExecution#getType() + */ + T type(String type); + + /** + * @see TaskExecution#getWorkflowDefinitionId() + */ + T workflowDefinitionId(String wfDefId); + + /** + * @see TaskExecution#getWorkflowExecutionId() + */ + T workflowExecutionId(String wfExecId); + + /** + * @see TaskExecution#getRuntimeContext() + */ + T runtimeContext(Map runtimeContext); + + /** + * @see TaskExecution#getResult() + */ + T result(Object result); + + /** + * @see TaskExecution#getPublished() + */ + T published(Map published); + + /** + * @see TaskExecution#isProcessed() + */ + T processed(Boolean processed); + + /** + * @see TaskExecution#isReset() + */ + T reset(Boolean reset); + + /** + * @see TaskExecution#getEnvironment() + */ + T environment(Map env); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkbookDefinitionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkbookDefinitionBuilder.java index 9b8b41d07..6237f1162 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkbookDefinitionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkbookDefinitionBuilder.java @@ -4,10 +4,10 @@ /** * Builder for a {@link WorkbookDefinition} model class - * + * * @author Renat Akhmerov */ -public interface WorkbookDefinitionBuilder , M extends WorkbookDefinition> - extends DefinitionBuilder { - // No-op. +public interface WorkbookDefinitionBuilder, M extends WorkbookDefinition> + extends DefinitionBuilder { + // No-op. } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowDefinitionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowDefinitionBuilder.java index 54e31e4a0..cb994345a 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowDefinitionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowDefinitionBuilder.java @@ -4,14 +4,14 @@ /** * Builder for {@link WorkflowDefinition} model class. - * + * * @author Renat Akhmerov */ public interface WorkflowDefinitionBuilder, M extends WorkflowDefinition> extends DefinitionBuilder { - /** - * @see WorkflowDefinition#getInput() - */ - T input(String input); + /** + * @see WorkflowDefinition#getInput() + */ + T input(String input); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowEnvironmentBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowEnvironmentBuilder.java index c16c8597a..4a58a83fc 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowEnvironmentBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowEnvironmentBuilder.java @@ -9,45 +9,45 @@ /** * Builder for a {@link WorkflowEnvironment} model class - * + * * @author Renat Akhmerov */ public interface WorkflowEnvironmentBuilder, M extends WorkflowEnvironment> extends Builder { - /** - * @see WorkflowEnvironment#getId() - */ - T id(String id); - - /** - * @see WorkflowEnvironment#getCreatedAt() - */ - T createdAt(Date createdAt); - - /** - * @see WorkflowEnvironment#getUpdatedAt() - */ - T updatedAt(Date updatedAt); - - /** - * @see WorkflowEnvironment#getProjectId() - */ - T projectId(String projectId); - - /** - * @see WorkflowEnvironment#getScope() - */ - T scope(Scope scope); - - /** - * @see WorkflowEnvironment#getName() - */ - T name(String name); - - /** - * @see WorkflowEnvironment#getDescription() - */ - T description(String description); + /** + * @see WorkflowEnvironment#getId() + */ + T id(String id); + + /** + * @see WorkflowEnvironment#getCreatedAt() + */ + T createdAt(Date createdAt); + + /** + * @see WorkflowEnvironment#getUpdatedAt() + */ + T updatedAt(Date updatedAt); + + /** + * @see WorkflowEnvironment#getProjectId() + */ + T projectId(String projectId); + + /** + * @see WorkflowEnvironment#getScope() + */ + T scope(Scope scope); + + /** + * @see WorkflowEnvironment#getName() + */ + T name(String name); + + /** + * @see WorkflowEnvironment#getDescription() + */ + T description(String description); /** * @see WorkflowEnvironment#getVariables() diff --git a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowExecutionBuilder.java b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowExecutionBuilder.java index c6bea28e8..9cacd8b10 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowExecutionBuilder.java +++ b/core/src/main/java/org/openstack4j/model/workflow/builder/WorkflowExecutionBuilder.java @@ -6,11 +6,11 @@ /** * Builder for a {@link WorkflowExecution} model class - * + * * @author Renat Akhmerov */ public interface WorkflowExecutionBuilder, M extends WorkflowExecution> - extends ExecutionBuilder { + extends ExecutionBuilder { /** * @see WorkflowExecution#getParameters() @@ -18,9 +18,9 @@ public interface WorkflowExecutionBuilder params); /** - * @see WorkflowExecution#getInput() - */ - T input(Map input); + * @see WorkflowExecution#getInput() + */ + T input(Map input); /** * @see WorkflowExecution#getOutput() diff --git a/core/src/main/java/org/openstack4j/openstack/OSFactory.java b/core/src/main/java/org/openstack4j/openstack/OSFactory.java index 045582682..3ba47112a 100644 --- a/core/src/main/java/org/openstack4j/openstack/OSFactory.java +++ b/core/src/main/java/org/openstack4j/openstack/OSFactory.java @@ -20,7 +20,8 @@ */ public abstract class OSFactory> { - private OSFactory() { } + private OSFactory() { + } /** * Skips Authentication and created the API around a previously cached Token object. This can be useful in multi-threaded environments @@ -37,7 +38,7 @@ public static OSClientV3 clientFromToken(Token token) { * Skips Authentication and created the API around a previously cached Token object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours * - * @param token an authorized token entity which is to be used to create the API + * @param token an authorized token entity which is to be used to create the API * @param perspective the current endpoint perspective to use * @return the OSClient */ @@ -49,7 +50,7 @@ public static OSClientV3 clientFromToken(Token token, Facing perspective) { * Skips Authentication and created the API around a previously cached Token object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours * - * @param token an authorized token entity which is to be used to create the API + * @param token an authorized token entity which is to be used to create the API * @param config OpenStack4j configuration options * @return the OSClient */ @@ -61,9 +62,9 @@ public static OSClientV3 clientFromToken(Token token, Config config) { * Skips Authentication and created the API around a previously cached Token object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours * - * @param token an authorized token entity which is to be used to create the API + * @param token an authorized token entity which is to be used to create the API * @param perspective the current endpoint perspective to use - * @param config OpenStack4j configuration options + * @param config OpenStack4j configuration options * @return the OSClient */ public static OSClientV3 clientFromToken(Token token, Facing perspective, Config config) { @@ -74,43 +75,43 @@ public static OSClientV3 clientFromToken(Token token, Facing perspective, Config * Skips Authentication and created the API around a previously cached Token object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours * - * @param token an authorized token entity which is to be used to create the API + * @param token an authorized token entity which is to be used to create the API * @param perspective the current endpoint perspective to use - * @param provider the cloud provider - * @param config OpenStack4j configuration options + * @param provider the cloud provider + * @param config OpenStack4j configuration options * @return the OSClient */ public static OSClientV3 clientFromToken(Token token, Facing perspective, CloudProvider provider, Config config) { return OSClientSessionV3.createSession(token, perspective, provider, config); } - + /** * Skips Authentication and created the API around a previously cached Access object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours - * + * * @param access an authorized access entity which is to be used to create the API * @return the OSCLient */ public static OSClientV2 clientFromAccess(Access access) { return OSClientSessionV2.createSession(access); } - + /** * Skips Authentication and created the API around a previously cached Access object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours - * - * @param access an authorized access entity which is to be used to create the API + * + * @param access an authorized access entity which is to be used to create the API * @param perspective the current endpoint perspective to use * @return the OSCLient */ public static OSClientV2 clientFromAccess(Access access, Facing perspective) { return OSClientSessionV2.createSession(access, perspective, null, null); } - + /** * Skips Authentication and created the API around a previously cached Access object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours - * + * * @param access an authorized access entity which is to be used to create the API * @param config OpenStack4j configuration options * @return the OSCLient @@ -118,28 +119,28 @@ public static OSClientV2 clientFromAccess(Access access, Facing perspective) { public static OSClientV2 clientFromAccess(Access access, Config config) { return OSClientSessionV2.createSession(access, null, null, config); } - + /** * Skips Authentication and created the API around a previously cached Access object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours - * - * @param access an authorized access entity which is to be used to create the API + * + * @param access an authorized access entity which is to be used to create the API * @param perspective the current endpoint perspective to use - * @param config OpenStack4j configuration options + * @param config OpenStack4j configuration options * @return the OSCLient */ public static OSClientV2 clientFromAccess(Access access, Facing perspective, Config config) { return OSClientSessionV2.createSession(access, perspective, null, config); } - + /** * Skips Authentication and created the API around a previously cached Access object. This can be useful in multi-threaded environments * or scenarios where a client should not be re-authenticated due to a token lasting 24 hours - * - * @param access an authorized access entity which is to be used to create the API + * + * @param access an authorized access entity which is to be used to create the API * @param perspective the current endpoint perspective to use - * @param provider the cloud provider - * @param config OpenStack4j configuration options + * @param provider the cloud provider + * @param config OpenStack4j configuration options * @return the OSCLient */ public static OSClientV2 clientFromAccess(Access access, Facing perspective, CloudProvider provider, Config config) { @@ -148,6 +149,7 @@ public static OSClientV2 clientFromAccess(Access access, Facing perspective, Clo /** * Globally enables or disables verbose HTTP Request and Response logging useful for debugging + * * @param enabled true to enable, false to enable */ public static void enableHttpLoggingFilter(boolean enabled) { @@ -156,14 +158,16 @@ public static void enableHttpLoggingFilter(boolean enabled) { /** * Creates builder for OpenStack V2 based authentication + * * @return V2 Authentication builder */ public static IOSClientBuilder.V2 builderV2() { return new OSClientBuilder.ClientV2(); } - - /** + + /** * Creates builder for OpenStack V3 based authentication + * * @return V3 Authentication builder */ public static IOSClientBuilder.V3 builderV3() { diff --git a/core/src/main/java/org/openstack4j/openstack/artifact/domain/ArtifactUpdateModel.java b/core/src/main/java/org/openstack4j/openstack/artifact/domain/ArtifactUpdateModel.java index d7490daaa..cf1b1a2af 100644 --- a/core/src/main/java/org/openstack4j/openstack/artifact/domain/ArtifactUpdateModel.java +++ b/core/src/main/java/org/openstack4j/openstack/artifact/domain/ArtifactUpdateModel.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.artifact.ArtifactUpdate; import org.openstack4j.model.artifact.builder.ArtifactUpdateBuilder; -import org.openstack4j.model.common.builder.BasicResourceBuilder; import org.openstack4j.openstack.common.ListResult; import java.util.List; diff --git a/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplates.java b/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplates.java index bed0a03b2..d608d4e42 100644 --- a/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplates.java +++ b/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplates.java @@ -49,7 +49,7 @@ public static ToscaTemplatesArtifactBuilder builder() { return new ToscaTemplatesConcreteBuilder(); } - public static class ToscaTemplatesConcreteBuilder extends BasicResourceBuilder implements ToscaTemplatesArtifactBuilder { + public static class ToscaTemplatesConcreteBuilder extends BasicResourceBuilder implements ToscaTemplatesArtifactBuilder { private ToscaTemplates artifact; diff --git a/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplatesList.java b/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplatesList.java index 5215c28d9..5eeec16f8 100644 --- a/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplatesList.java +++ b/core/src/main/java/org/openstack4j/openstack/artifact/domain/ToscaTemplatesList.java @@ -1,7 +1,6 @@ package org.openstack4j.openstack.artifact.domain; import com.fasterxml.jackson.annotation.JsonProperty; -import org.openstack4j.model.artifact.Artifacts; import org.openstack4j.model.artifact.ToscaTemplatesArtifacts; import java.util.List; diff --git a/core/src/main/java/org/openstack4j/openstack/artifact/internal/ArtifactServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/artifact/internal/ArtifactServiceImpl.java index c4d5c9cb4..f1165551a 100644 --- a/core/src/main/java/org/openstack4j/openstack/artifact/internal/ArtifactServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/artifact/internal/ArtifactServiceImpl.java @@ -3,9 +3,6 @@ import org.openstack4j.api.Apis; import org.openstack4j.api.artifact.ArtifactService; import org.openstack4j.api.artifact.ToscaTemplatesArtifactService; -import org.openstack4j.model.artifact.ArtifactType; -import org.openstack4j.model.artifact.Artifacts; -import org.openstack4j.model.artifact.ToscaTemplatesArtifacts; /** * Created by vadavi on 18-01-2017. diff --git a/core/src/main/java/org/openstack4j/openstack/artifact/internal/BaseArtifactServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/artifact/internal/BaseArtifactServiceImpl.java index 37f4b2f34..7e3f73959 100644 --- a/core/src/main/java/org/openstack4j/openstack/artifact/internal/BaseArtifactServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/artifact/internal/BaseArtifactServiceImpl.java @@ -2,7 +2,9 @@ import org.openstack4j.api.types.ServiceType; import org.openstack4j.core.transport.HttpResponse; -import org.openstack4j.model.artifact.*; +import org.openstack4j.model.artifact.ArtifactType; +import org.openstack4j.model.artifact.ArtifactUpdate; +import org.openstack4j.model.artifact.ToscaTemplatesArtifact; import org.openstack4j.model.artifact.builder.ArtifactUpdateBuilder; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.common.Payload; @@ -17,11 +19,7 @@ import java.util.ArrayList; import java.util.List; -import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_ARTIFACT_PATCH; -import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_OCTECT_STREAM; -import static org.openstack4j.core.transport.ClientConstants.HEADER_ACCEPT; -import static org.openstack4j.core.transport.ClientConstants.PATH_ARTIFACTS; -import static org.openstack4j.core.transport.ClientConstants.URI_SEP; +import static org.openstack4j.core.transport.ClientConstants.*; /** * Created by vadavi on 18-01-2017. @@ -38,27 +36,27 @@ protected BaseArtifactServiceImpl(ArtifactType artifactType) { protected T list(Class clazz) { - return get(clazz,uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value())).execute(); + return get(clazz, uri(PATH_ARTIFACTS + URI_SEP + artifactType.value())).execute(); } protected T get(String artifactId, Class clazz) { - return get(clazz,uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value()+"/%s",artifactId)).execute(); + return get(clazz, uri(PATH_ARTIFACTS + URI_SEP + artifactType.value() + "/%s", artifactId)).execute(); } protected T create(ToscaTemplatesArtifact toscaTemplatesArtifact, Class clazz) { - return post(clazz,uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value())).entity(toscaTemplatesArtifact).execute(); + return post(clazz, uri(PATH_ARTIFACTS + URI_SEP + artifactType.value())).entity(toscaTemplatesArtifact).execute(); } protected T upload(String artifactId, File file, Class clazz, String blobName) { Payload payload = new FilePayload(file); - Invocation invocation = put(clazz,uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value()+"/%s/%s",artifactId,blobName)); + Invocation invocation = put(clazz, uri(PATH_ARTIFACTS + URI_SEP + artifactType.value() + "/%s/%s", artifactId, blobName)); invocation.entity(payload); return invocation.execute(); } protected InputStream download(String artifactId, String blobName) { - Invocation invocation = get(Void.class, uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value()+"/%s/%s",artifactId, blobName)); + Invocation invocation = get(Void.class, uri(PATH_ARTIFACTS + URI_SEP + artifactType.value() + "/%s/%s", artifactId, blobName)); invocation.header(HEADER_ACCEPT, CONTENT_TYPE_OCTECT_STREAM); HttpResponse response = invocation.executeWithResponse(); if (response.getStatus() < 400) { @@ -68,18 +66,17 @@ protected InputStream download(String artifactId, String blobName) { } protected ActionResponse delete(String artifactId) { - return deleteWithResponse(uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value()+"/%s",artifactId)).execute(); + return deleteWithResponse(uri(PATH_ARTIFACTS + URI_SEP + artifactType.value() + "/%s", artifactId)).execute(); } protected T update(String artifactId, List artifactUpdates, Class clazz) { - Invocation invocation = patch(clazz,uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value()+"/%s",artifactId)); + Invocation invocation = patch(clazz, uri(PATH_ARTIFACTS + URI_SEP + artifactType.value() + "/%s", artifactId)); invocation.entity(new ListEntity(artifactUpdates)); invocation.contentType(CONTENT_TYPE_ARTIFACT_PATCH); return invocation.execute(); } - protected T update(String artifactId, String op, String path, String value, Class clazz) - { + protected T update(String artifactId, String op, String path, String value, Class clazz) { ArtifactUpdateBuilder updateBuilder = ArtifactUpdateModel.builder(); updateBuilder.op(op); updateBuilder.path(path); @@ -88,7 +85,7 @@ protected T update(String artifactId, String op, String path, String value, List artifactUpdates = new ArrayList<>(); artifactUpdates.add(updateBuilder.build()); - Invocation invocation = patch(clazz,uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value()+"/%s",artifactId)); + Invocation invocation = patch(clazz, uri(PATH_ARTIFACTS + URI_SEP + artifactType.value() + "/%s", artifactId)); invocation.entity(new ListEntity(artifactUpdates)); invocation.contentType(CONTENT_TYPE_ARTIFACT_PATCH); return invocation.execute(); diff --git a/core/src/main/java/org/openstack4j/openstack/artifact/internal/ToscaTemplatesArtifactServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/artifact/internal/ToscaTemplatesArtifactServiceImpl.java index 85fd17abc..f01f161d0 100644 --- a/core/src/main/java/org/openstack4j/openstack/artifact/internal/ToscaTemplatesArtifactServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/artifact/internal/ToscaTemplatesArtifactServiceImpl.java @@ -2,28 +2,18 @@ import com.google.common.base.Preconditions; import org.openstack4j.api.artifact.ToscaTemplatesArtifactService; -import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.model.artifact.ArtifactType; import org.openstack4j.model.artifact.ArtifactUpdate; import org.openstack4j.model.artifact.ToscaTemplatesArtifact; import org.openstack4j.model.artifact.ToscaTemplatesArtifacts; -import org.openstack4j.model.artifact.builder.ArtifactUpdateBuilder; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.common.Payload; -import org.openstack4j.model.common.payloads.FilePayload; -import org.openstack4j.openstack.artifact.domain.ArtifactUpdateModel; import org.openstack4j.openstack.artifact.domain.ToscaTemplates; import org.openstack4j.openstack.artifact.domain.ToscaTemplatesList; -import org.openstack4j.openstack.common.ListEntity; import java.io.File; import java.io.InputStream; -import java.util.ArrayList; import java.util.List; -import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_OCTECT_STREAM; -import static org.openstack4j.core.transport.ClientConstants.HEADER_ACCEPT; - /** * Created by vadavi on 19-01-2017. */ diff --git a/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainer.java b/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainer.java index eada27de2..f7a56d9d4 100644 --- a/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainer.java +++ b/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainer.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; -import org.openstack4j.model.barbican.ContainerConsumer; import org.openstack4j.model.barbican.Container; +import org.openstack4j.model.barbican.ContainerConsumer; import org.openstack4j.model.barbican.ContainerSecret; import org.openstack4j.model.barbican.builder.ContainerCreateBuilder; import org.openstack4j.openstack.common.ListResult; @@ -161,7 +161,7 @@ public Container build() { * {@inheritDoc} */ @Override - public ContainerCreateBuilder from(Container in){ + public ContainerCreateBuilder from(Container in) { internalContainer = (BarbicanContainer) in; return this; } @@ -170,17 +170,18 @@ public ContainerCreateBuilder from(Container in){ * {@inheritDoc} */ @Override - public ContainerCreateBuilder name(String name){ + public ContainerCreateBuilder name(String name) { internalContainer.name = name; return this; } /** * {@inheritDoc} + * * @param type */ @Override - public ContainerCreateBuilder type(String type){ + public ContainerCreateBuilder type(String type) { internalContainer.type = type; return this; } @@ -189,7 +190,7 @@ public ContainerCreateBuilder type(String type){ * {@inheritDoc} */ @Override - public ContainerCreateBuilder secretReferences(List references){ + public ContainerCreateBuilder secretReferences(List references) { internalContainer.secretReferences = (List) references; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainerSecret.java b/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainerSecret.java index 410e504f1..d6406ef5f 100644 --- a/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainerSecret.java +++ b/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanContainerSecret.java @@ -64,7 +64,7 @@ public ContainerSecret build() { * {@inheritDoc} */ @Override - public ContainerSecretBuilder from(ContainerSecret in){ + public ContainerSecretBuilder from(ContainerSecret in) { internalSecret = (BarbicanContainerSecret) in; return this; } @@ -73,7 +73,7 @@ public ContainerSecretBuilder from(ContainerSecret in){ * {@inheritDoc} */ @Override - public ContainerSecretBuilder name(String name){ + public ContainerSecretBuilder name(String name) { internalSecret.name = name; return this; } @@ -82,7 +82,7 @@ public ContainerSecretBuilder name(String name){ * {@inheritDoc} */ @Override - public ContainerSecretBuilder reference(String ref){ + public ContainerSecretBuilder reference(String ref) { internalSecret.reference = ref; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanSecret.java b/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanSecret.java index 42c57dc3b..92ee5289c 100644 --- a/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanSecret.java +++ b/core/src/main/java/org/openstack4j/openstack/barbican/domain/BarbicanSecret.java @@ -1,6 +1,5 @@ package org.openstack4j.openstack.barbican.domain; -import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import org.openstack4j.model.barbican.Secret; @@ -146,19 +145,25 @@ public String getStatus() { * {@inheritDoc} */ @Override - public String getPayload() { return payload; } + public String getPayload() { + return payload; + } /** * {@inheritDoc} */ @Override - public String getPayloadContentType() { return payloadContentType; } + public String getPayloadContentType() { + return payloadContentType; + } /** * {@inheritDoc} */ @Override - public String getPayloadContentEncoding() { return payloadContentEncoding; } + public String getPayloadContentEncoding() { + return payloadContentEncoding; + } /** * {@inheritDoc} diff --git a/core/src/main/java/org/openstack4j/openstack/barbican/internal/BarbicanServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/barbican/internal/BarbicanServiceImpl.java index 05f6ce891..2177cfc22 100644 --- a/core/src/main/java/org/openstack4j/openstack/barbican/internal/BarbicanServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/barbican/internal/BarbicanServiceImpl.java @@ -16,5 +16,7 @@ public ContainerService containers() { } @Override - public SecretService secrets() { return Apis.get(SecretService.class); } + public SecretService secrets() { + return Apis.get(SecretService.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/barbican/internal/ContainerServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/barbican/internal/ContainerServiceImpl.java index d6c6b8759..ae786d368 100644 --- a/core/src/main/java/org/openstack4j/openstack/barbican/internal/ContainerServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/barbican/internal/ContainerServiceImpl.java @@ -1,11 +1,8 @@ package org.openstack4j.openstack.barbican.internal; -import static com.google.common.base.Preconditions.checkNotNull; - import com.google.common.collect.ImmutableMap; import org.openstack4j.api.barbican.ContainerService; import org.openstack4j.model.barbican.Container; -import org.openstack4j.model.barbican.ContainerSecret; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.openstack.barbican.domain.BarbicanContainer; import org.openstack4j.openstack.barbican.domain.BarbicanContainer.Containers; @@ -13,6 +10,8 @@ import java.util.List; import java.util.Map; +import static com.google.common.base.Preconditions.checkNotNull; + /** * {@inheritDoc} */ diff --git a/core/src/main/java/org/openstack4j/openstack/barbican/internal/SecretServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/barbican/internal/SecretServiceImpl.java index f8bffa671..81af6487c 100644 --- a/core/src/main/java/org/openstack4j/openstack/barbican/internal/SecretServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/barbican/internal/SecretServiceImpl.java @@ -14,7 +14,7 @@ /** * Created by reneschollmeyer on 02.08.17. - * + *

* {@inheritDoc} */ public class SecretServiceImpl extends BaseBarbicanServices implements SecretService { diff --git a/core/src/main/java/org/openstack4j/openstack/client/OSClientBuilder.java b/core/src/main/java/org/openstack4j/openstack/client/OSClientBuilder.java index 0b630c19c..88868116d 100644 --- a/core/src/main/java/org/openstack4j/openstack/client/OSClientBuilder.java +++ b/core/src/main/java/org/openstack4j/openstack/client/OSClientBuilder.java @@ -1,7 +1,5 @@ package org.openstack4j.openstack.client; -import static com.google.common.base.Preconditions.checkArgument; - import org.openstack4j.api.OSClient.OSClientV2; import org.openstack4j.api.OSClient.OSClientV3; import org.openstack4j.api.client.CloudProvider; @@ -18,11 +16,12 @@ import org.openstack4j.openstack.identity.v3.domain.KeystoneAuth.AuthScope; import org.openstack4j.openstack.internal.OSAuthenticator; +import static com.google.common.base.Preconditions.checkArgument; + /** * Builder definitions for creating a Client * * @author Jeremy Unruh - * */ public abstract class OSClientBuilder> implements IOSClientBuilder { @@ -112,10 +111,10 @@ public OSClientV2 authenticate() throws AuthenticationException { } if (raxApiKey) { - return (OSClientV2) OSAuthenticator.invoke( new RaxApiKeyCredentials(user, password), endpoint, perspective, config, provider); + return (OSClientV2) OSAuthenticator.invoke(new RaxApiKeyCredentials(user, password), endpoint, perspective, config, provider); } - return (OSClientV2) OSAuthenticator.invoke( new Credentials(user, password, tenantName, tenantId), endpoint, perspective, config, provider); + return (OSClientV2) OSAuthenticator.invoke(new Credentials(user, password, tenantName, tenantId), endpoint, perspective, config, provider); } @Override @@ -123,7 +122,7 @@ public ClientV2 token(String tokenId) { this.tokenId = tokenId; return this; } - + } public static class ClientV3 extends OSClientBuilder implements IOSClientBuilder.V3 { diff --git a/core/src/main/java/org/openstack4j/openstack/common/Auth.java b/core/src/main/java/org/openstack4j/openstack/common/Auth.java index e0c977a05..d89bb0e9d 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/Auth.java +++ b/core/src/main/java/org/openstack4j/openstack/common/Auth.java @@ -4,6 +4,6 @@ public interface Auth extends ModelEntity { - public enum Type { CREDENTIALS, TOKEN, RAX_APIKEY, TOKENLESS } + public enum Type {CREDENTIALS, TOKEN, RAX_APIKEY, TOKENLESS} } diff --git a/core/src/main/java/org/openstack4j/openstack/common/BasicResourceEntity.java b/core/src/main/java/org/openstack4j/openstack/common/BasicResourceEntity.java index 81b518939..45b5bc726 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/BasicResourceEntity.java +++ b/core/src/main/java/org/openstack4j/openstack/common/BasicResourceEntity.java @@ -1,8 +1,7 @@ package org.openstack4j.openstack.common; -import org.openstack4j.model.common.BasicResource; - import com.google.common.base.MoreObjects; +import org.openstack4j.model.common.BasicResource; /** * Basic Id/Name based Entity Model implementation @@ -11,30 +10,30 @@ */ public class BasicResourceEntity extends IdResourceEntity implements BasicResource { - private static final long serialVersionUID = 1L; - - private String name; - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) { - this.name = name; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()).omitNullValues() - .add("id", getId()).add("name", name) - .toString(); - } + private static final long serialVersionUID = 1L; + + private String name; + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(getClass()).omitNullValues() + .add("id", getId()).add("name", name) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/common/DLPayloadEntity.java b/core/src/main/java/org/openstack4j/openstack/common/DLPayloadEntity.java index e87c397d3..92bec4e84 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/DLPayloadEntity.java +++ b/core/src/main/java/org/openstack4j/openstack/common/DLPayloadEntity.java @@ -1,20 +1,19 @@ package org.openstack4j.openstack.common; -import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.io.ByteStreams; +import org.openstack4j.core.transport.HttpResponse; +import org.openstack4j.model.common.DLPayload; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import org.openstack4j.core.transport.HttpResponse; -import org.openstack4j.model.common.DLPayload; - -import com.google.common.io.ByteStreams; +import static com.google.common.base.Preconditions.checkNotNull; /** * A Payload which encapsulates downstream data - * + * * @author Jeremy Unruh */ public class DLPayloadEntity implements DLPayload { @@ -29,11 +28,11 @@ public static DLPayloadEntity create(HttpResponse response) { return new DLPayloadEntity(response); } - @Override - public HttpResponse getHttpResponse() { - return response; - } - + @Override + public HttpResponse getHttpResponse() { + return response; + } + @Override public InputStream getInputStream() { return response.getInputStream(); @@ -42,8 +41,8 @@ public InputStream getInputStream() { @Override public void writeToFile(File file) throws IOException { checkNotNull(file); - try(InputStream inputStream = response.getInputStream(); - FileOutputStream fileOutputStream = new FileOutputStream(file) ){ + try (InputStream inputStream = response.getInputStream(); + FileOutputStream fileOutputStream = new FileOutputStream(file)) { ByteStreams.copy(inputStream, fileOutputStream); } } diff --git a/core/src/main/java/org/openstack4j/openstack/common/ExtensionValue.java b/core/src/main/java/org/openstack4j/openstack/common/ExtensionValue.java index 069469cb4..eede75e78 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/ExtensionValue.java +++ b/core/src/main/java/org/openstack4j/openstack/common/ExtensionValue.java @@ -18,90 +18,90 @@ */ public class ExtensionValue implements Extension { - private static final long serialVersionUID = 1L; - String name; - URI namespace; - String alias; - Date updated; - String description; - List links; - - /** - * {@inheritDoc} - */ - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - public URI getNamespace() { - return namespace; - } - - /** - * {@inheritDoc} - */ - public String getAlias() { - return alias; - } - - /** - * {@inheritDoc} - */ - @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ssX") - public Date getUpdated() { - return updated; - } - - /** - * {@inheritDoc} - */ - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - public List getLinks() { - return links; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(Extension.class).omitNullValues() - .add("name", name) - .add("namespace", namespace) - .add("description", description) - .add("alias", alias) - .add("updated", updated) - .add("links", links) - .addValue("\n") - .toString(); - } - - @JsonRootName("extensions") - public static class ExtensionList extends ListResult { - private static final long serialVersionUID = 1L; - - @JsonProperty("values") - private List list; - - public List value() { - return list; - } - } - - public static class Extensions extends ListResult { - private static final long serialVersionUID = 1L; - - @JsonProperty("extensions") - private List list; - - public List value() { - return list; - } - } + private static final long serialVersionUID = 1L; + String name; + URI namespace; + String alias; + Date updated; + String description; + List links; + + /** + * {@inheritDoc} + */ + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + public URI getNamespace() { + return namespace; + } + + /** + * {@inheritDoc} + */ + public String getAlias() { + return alias; + } + + /** + * {@inheritDoc} + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssX") + public Date getUpdated() { + return updated; + } + + /** + * {@inheritDoc} + */ + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + public List getLinks() { + return links; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(Extension.class).omitNullValues() + .add("name", name) + .add("namespace", namespace) + .add("description", description) + .add("alias", alias) + .add("updated", updated) + .add("links", links) + .addValue("\n") + .toString(); + } + + @JsonRootName("extensions") + public static class ExtensionList extends ListResult { + private static final long serialVersionUID = 1L; + + @JsonProperty("values") + private List list; + + public List value() { + return list; + } + } + + public static class Extensions extends ListResult { + private static final long serialVersionUID = 1L; + + @JsonProperty("extensions") + private List list; + + public List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/common/GenericLink.java b/core/src/main/java/org/openstack4j/openstack/common/GenericLink.java index 96d4397dd..fb2ef403b 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/GenericLink.java +++ b/core/src/main/java/org/openstack4j/openstack/common/GenericLink.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.common; +import com.google.common.base.MoreObjects; import org.openstack4j.model.common.Link; import org.openstack4j.model.common.builder.LinkBuilder; -import com.google.common.base.MoreObjects; - /** * A Link holds information about a URL, Relative URL and the type of the link * @@ -12,115 +11,116 @@ */ public class GenericLink implements Link { - private static final long serialVersionUID = 1L; - - private String rel; - private String href; - private String type; - - public GenericLink() { } - - public GenericLink(String rel, String href, String type) { - this.rel = rel; - this.type = type; - this.href = href; - } - - /** - * @return the link builder - */ - public static LinkBuilder builder() { - return new LinkConcreteBuilder(); - } - - @Override - public LinkBuilder toBuilder() { - return new LinkConcreteBuilder(this); - } - - /** - * @return the relative URL or null - */ - public String getRel() { - return rel; - } - - /** - * @return the href URL - */ - public String getHref() { - return href; - } - - /** - * @return the type of link or null - */ - public String getType() { - return type; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("href", href).add("rel", rel).add("type", type) - .toString(); - } - - public static class LinkConcreteBuilder implements LinkBuilder { - - GenericLink model; - - LinkConcreteBuilder() { - this(new GenericLink()); - } - - LinkConcreteBuilder(GenericLink link) { - this.model = link; - } - - /** - * @see GenericLink#getRel() - */ - public LinkConcreteBuilder rel(String rel) { - model.rel = rel; - return this; - } - - /** - * @see GenericLink#getHref() - */ - public LinkConcreteBuilder href(String href) { - model.href = href; - return this; - } - - /** - * @see GenericLink#getType() - */ - public LinkConcreteBuilder type(String type) { - model.type = type; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public Link build() { - return model; - } - - /** - * {@inheritDoc} - */ - @Override - public LinkBuilder from(Link in) { - this.model = (GenericLink)in; - return this; - } - } + private static final long serialVersionUID = 1L; + + private String rel; + private String href; + private String type; + + public GenericLink() { + } + + public GenericLink(String rel, String href, String type) { + this.rel = rel; + this.type = type; + this.href = href; + } + + /** + * @return the link builder + */ + public static LinkBuilder builder() { + return new LinkConcreteBuilder(); + } + + @Override + public LinkBuilder toBuilder() { + return new LinkConcreteBuilder(this); + } + + /** + * @return the relative URL or null + */ + public String getRel() { + return rel; + } + + /** + * @return the href URL + */ + public String getHref() { + return href; + } + + /** + * @return the type of link or null + */ + public String getType() { + return type; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("href", href).add("rel", rel).add("type", type) + .toString(); + } + + public static class LinkConcreteBuilder implements LinkBuilder { + + GenericLink model; + + LinkConcreteBuilder() { + this(new GenericLink()); + } + + LinkConcreteBuilder(GenericLink link) { + this.model = link; + } + + /** + * @see GenericLink#getRel() + */ + public LinkConcreteBuilder rel(String rel) { + model.rel = rel; + return this; + } + + /** + * @see GenericLink#getHref() + */ + public LinkConcreteBuilder href(String href) { + model.href = href; + return this; + } + + /** + * @see GenericLink#getType() + */ + public LinkConcreteBuilder type(String type) { + model.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Link build() { + return model; + } + + /** + * {@inheritDoc} + */ + @Override + public LinkBuilder from(Link in) { + this.model = (GenericLink) in; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/common/IdResourceEntity.java b/core/src/main/java/org/openstack4j/openstack/common/IdResourceEntity.java index 804f9a24f..aae886179 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/IdResourceEntity.java +++ b/core/src/main/java/org/openstack4j/openstack/common/IdResourceEntity.java @@ -1,9 +1,8 @@ package org.openstack4j.openstack.common; -import org.openstack4j.model.common.IdEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.common.IdEntity; /** * Basic Id based Entity Model implementation @@ -36,7 +35,7 @@ public void setId(String id) { @Override public String toString() { return MoreObjects.toStringHelper(getClass()).omitNullValues() - .add("id", id) - .toString(); + .add("id", id) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/common/ListEntity.java b/core/src/main/java/org/openstack4j/openstack/common/ListEntity.java index 1b99302a7..a632f9cbb 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/ListEntity.java +++ b/core/src/main/java/org/openstack4j/openstack/common/ListEntity.java @@ -8,7 +8,7 @@ /** * Simple name value pair based Entity - * + * * @author Jeremy Unruh */ public class ListEntity extends ArrayList implements ModelEntity { @@ -21,19 +21,19 @@ public static ListEntity create(String key, Object value) { } */ - public ListEntity(){ + public ListEntity() { super(); } - public ListEntity(List list){ - super(list); + public ListEntity(List list) { + super(list); } - - + + public boolean add(T value) { - return super.add(value); + return super.add(value); //super.put(value); //return this; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/common/ListResult.java b/core/src/main/java/org/openstack4j/openstack/common/ListResult.java index 373970e10..78938d77b 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/ListResult.java +++ b/core/src/main/java/org/openstack4j/openstack/common/ListResult.java @@ -1,11 +1,11 @@ package org.openstack4j.openstack.common; -import java.util.Collections; -import java.util.List; - import org.openstack4j.core.transport.ListType; import org.openstack4j.model.ModelEntity; +import java.util.Collections; +import java.util.List; + /** * A List result which wrappers a JSON Array * @@ -13,18 +13,18 @@ */ public abstract class ListResult implements ModelEntity, ListType { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + protected abstract List value(); + + public List getList() { + if (value() == null) + return Collections.emptyList(); + return value(); + } - protected abstract List value(); - - public List getList() { - if (value() == null) - return Collections.emptyList(); - return value(); - } - public T first() { - return value().isEmpty() ? null : value().get(0); + return value().isEmpty() ? null : value().get(0); } } diff --git a/core/src/main/java/org/openstack4j/openstack/common/MapEntity.java b/core/src/main/java/org/openstack4j/openstack/common/MapEntity.java index 861f157bf..c3472a59b 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/MapEntity.java +++ b/core/src/main/java/org/openstack4j/openstack/common/MapEntity.java @@ -1,12 +1,12 @@ package org.openstack4j.openstack.common; -import java.util.HashMap; - import org.openstack4j.model.ModelEntity; +import java.util.HashMap; + /** * Simple name value pair based Entity - * + * * @author Jeremy Unruh */ public class MapEntity extends HashMap implements ModelEntity { @@ -16,10 +16,10 @@ public class MapEntity extends HashMap implements ModelEntity { public static MapEntity create(String key, Object value) { return new MapEntity().add(key, value); } - + public MapEntity add(String key, Object value) { super.put(key, value); return this; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/common/Metadata.java b/core/src/main/java/org/openstack4j/openstack/common/Metadata.java index ee25c5f32..ff14cc10a 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/Metadata.java +++ b/core/src/main/java/org/openstack4j/openstack/common/Metadata.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.common; -import java.util.HashMap; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.ModelEntity; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.HashMap; +import java.util.Map; /** * A generic MetaData model class which is just a Map of Key to Value - * + * * @author Jeremy Unruh */ @JsonRootName("metadata") @@ -22,5 +21,5 @@ public static Metadata toMetadata(Map from) { md.putAll(from); return md; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/common/QuotaDetailsEntity.java b/core/src/main/java/org/openstack4j/openstack/common/QuotaDetailsEntity.java index 922ae6441..3bada13b0 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/QuotaDetailsEntity.java +++ b/core/src/main/java/org/openstack4j/openstack/common/QuotaDetailsEntity.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.common; -import static com.google.common.base.MoreObjects.toStringHelper; - +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.common.QuotaDetails; -import com.fasterxml.jackson.annotation.JsonProperty; +import static com.google.common.base.MoreObjects.toStringHelper; /** * Quota Details Entity describing quota usage diff --git a/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java b/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java index acf7d3e4e..d414c9bf2 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java +++ b/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java @@ -1,17 +1,17 @@ package org.openstack4j.openstack.common; -import java.io.IOException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.TimeZone; - import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.TimeZone; + /** * The date formats returned from the OpenStack telemetry APIs can be returned in multiple formats like: * "yyyy-MM-dd'T'HH:mm:ss" or "yyyy-MM-dd'T'HH:mm:ss.SSSSSS". This cannot be parsed correctly with a SimpleDateFormat, @@ -21,46 +21,46 @@ * @author pdube */ public class TelemetryDateDeserializer extends StdDeserializer { - private static final String MILLIS_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; + private static final String MILLIS_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; - public TelemetryDateDeserializer() { - this(null); - } + public TelemetryDateDeserializer() { + this(null); + } - public TelemetryDateDeserializer(Class vc) { - super(vc); - } + public TelemetryDateDeserializer(Class vc) { + super(vc); + } - @Override - public Date deserialize(JsonParser jsonParser, DeserializationContext ctxt) - throws IOException, JsonProcessingException { - String date = jsonParser.getText(); - SimpleDateFormat sdf = new SimpleDateFormat(MILLIS_DATE_FORMAT); - sdf.setTimeZone(TimeZone.getTimeZone("UTC")); - try { - return sdf.parse(getParseableDate(date)); - } catch (ParseException e) { - throw new JsonParseException(jsonParser, "Could not process telemetry date", e); - } - } + @Override + public Date deserialize(JsonParser jsonParser, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + String date = jsonParser.getText(); + SimpleDateFormat sdf = new SimpleDateFormat(MILLIS_DATE_FORMAT); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); + try { + return sdf.parse(getParseableDate(date)); + } catch (ParseException e) { + throw new JsonParseException(jsonParser, "Could not process telemetry date", e); + } + } - /** - * Modifies the date string to have the expected date format ("yyyy-MM-dd'T'HH:mm:ss.SSS") - * - * @param date - * @return the date with the correct format - */ - private String getParseableDate(String date) { - // e.g. [ "2017-06-20 13:00:00" , "395000" ] or [] if no decimal - String[] sdate = date.split("\\."); - if (sdate.length > 1) { - return sdate[0] + "." + getExpectedDecimals(sdate[1]); - } - return date + ".000"; - } + /** + * Modifies the date string to have the expected date format ("yyyy-MM-dd'T'HH:mm:ss.SSS") + * + * @param date + * @return the date with the correct format + */ + private String getParseableDate(String date) { + // e.g. [ "2017-06-20 13:00:00" , "395000" ] or [] if no decimal + String[] sdate = date.split("\\."); + if (sdate.length > 1) { + return sdate[0] + "." + getExpectedDecimals(sdate[1]); + } + return date + ".000"; + } - private String getExpectedDecimals(String decimals) { - return (decimals + "000").substring(0, 3); - } + private String getExpectedDecimals(String decimals) { + return (decimals + "000").substring(0, 3); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/common/functions/EnforceVersionToURL.java b/core/src/main/java/org/openstack4j/openstack/common/functions/EnforceVersionToURL.java index 382813c4e..07b0ac1ca 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/functions/EnforceVersionToURL.java +++ b/core/src/main/java/org/openstack4j/openstack/common/functions/EnforceVersionToURL.java @@ -4,34 +4,34 @@ /** * Removes a trailing version and appends the specified version to an endpoint URL - * + * * @author Jeremy Unruh */ public class EnforceVersionToURL implements Function { private static final String VALIDATE = "-VALID-"; - + private final String version; private boolean onlyIfAbsent; - + private EnforceVersionToURL(String version) { this(version, false); } - + private EnforceVersionToURL(String version, boolean onlyIfAbsent) { this.version = version; this.onlyIfAbsent = onlyIfAbsent; } - + public static EnforceVersionToURL instance(String version) { return new EnforceVersionToURL(version); } - - public static EnforceVersionToURL instance(String version, boolean onlyIfAbsent) { + + public static EnforceVersionToURL instance(String version, boolean onlyIfAbsent) { return new EnforceVersionToURL(version, onlyIfAbsent); } - - + + @Override public String apply(String input) { if (onlyIfAbsent && input.replaceFirst(RemoveVersionFromURL.VERSION_REGEX, VALIDATE).contains(VALIDATE)) diff --git a/core/src/main/java/org/openstack4j/openstack/common/functions/HeaderNameValuesToHeaderMap.java b/core/src/main/java/org/openstack4j/openstack/common/functions/HeaderNameValuesToHeaderMap.java index a67ef94af..d97ba979b 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/functions/HeaderNameValuesToHeaderMap.java +++ b/core/src/main/java/org/openstack4j/openstack/common/functions/HeaderNameValuesToHeaderMap.java @@ -1,26 +1,25 @@ package org.openstack4j.openstack.common.functions; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.common.header.HeaderNameValue; - import com.google.common.base.Function; import com.google.common.collect.Maps; +import org.openstack4j.model.common.header.HeaderNameValue; + +import java.util.List; +import java.util.Map; /** * Transforms a List of HeaderNameValue objects into a Header compatible Map - * + * * @author Jeremy Unruh */ public class HeaderNameValuesToHeaderMap implements Function, Map> { public static HeaderNameValuesToHeaderMap INSTANCE = new HeaderNameValuesToHeaderMap(); - + @Override public Map apply(List input) { Map result = Maps.newHashMap(); - + for (HeaderNameValue nv : input) { result.put(nv.getName(), nv.getValue()); } diff --git a/core/src/main/java/org/openstack4j/openstack/common/functions/OneOrNull.java b/core/src/main/java/org/openstack4j/openstack/common/functions/OneOrNull.java index e7a0e49a3..ab6ec0851 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/functions/OneOrNull.java +++ b/core/src/main/java/org/openstack4j/openstack/common/functions/OneOrNull.java @@ -1,21 +1,21 @@ package org.openstack4j.openstack.common.functions; -import java.util.List; - import com.google.common.base.Function; +import java.util.List; + /** * A Function which returns one entry from a List or null - * @author Jeremy Unruh - * + * * @param The return Type + * @author Jeremy Unruh */ public class OneOrNull implements Function, T> { public static OneOrNull create() { return new OneOrNull(); } - + @Override public T apply(List input) { if (input != null && input.size() > 0) diff --git a/core/src/main/java/org/openstack4j/openstack/common/functions/RemoveVersionFromURL.java b/core/src/main/java/org/openstack4j/openstack/common/functions/RemoveVersionFromURL.java index 451355c2a..ab4713010 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/functions/RemoveVersionFromURL.java +++ b/core/src/main/java/org/openstack4j/openstack/common/functions/RemoveVersionFromURL.java @@ -1,9 +1,9 @@ package org.openstack4j.openstack.common.functions; -import static org.openstack4j.core.transport.ClientConstants.URI_SEP; - import com.google.common.base.Function; +import static org.openstack4j.core.transport.ClientConstants.URI_SEP; + /** * A function that removes the API version from the tail end of a URL as well as any trailing "/". * *

* NOTE: This only removes the tail end of the path if it contains a version - * + * * @author Jeremy Unruh */ public class RemoveVersionFromURL implements Function { public static final String VERSION_REGEX = "/v[0-9]+(\\.[0-9])*"; public static final RemoveVersionFromURL INSTANCE = new RemoveVersionFromURL(); - + @Override public String apply(String url) { String result = url.replaceFirst(VERSION_REGEX, ""); @@ -27,11 +27,11 @@ public String apply(String url) { return result.substring(0, result.length() - 1); return result; } - + public String removeAndApply(String url, String version) { if (url == null) return url; - + return apply(url).concat(version); } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/AdminPass.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/AdminPass.java index 610d4abaf..6145071e5 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/AdminPass.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/AdminPass.java @@ -1,20 +1,19 @@ package org.openstack4j.openstack.compute.domain; +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.compute.ServerPassword; -import com.fasterxml.jackson.annotation.JsonProperty; /** * Administrative password - * - * @author taemin * + * @author taemin */ public class AdminPass implements ServerPassword { private static final long serialVersionUID = 1L; @JsonProperty private String adminPass; - + /** * {@inheritDoc} */ @@ -22,6 +21,6 @@ public class AdminPass implements ServerPassword { public String getPassword() { return adminPass; } - - + + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateAddHost.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateAddHost.java index 9a7b539f6..bc0a49b80 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateAddHost.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateAddHost.java @@ -1,37 +1,39 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; + /** * Adds a host to an aggregate. - * @author liujunpeng * + * @author liujunpeng */ @JsonRootName("add_host") public class AggregateAddHost implements ModelEntity { - - private static final long serialVersionUID = 1L; - /** - * host id - */ - @JsonProperty("host") - String host; - /** - * - * @param host - * @return AggregateAddHost - */ - public AggregateAddHost(String host){ - this.host=host; - } - public String getHost() { - return host; - } - public void setHost(String host) { - this.host = host; - } - + + private static final long serialVersionUID = 1L; + /** + * host id + */ + @JsonProperty("host") + String host; + + /** + * @param host + * @return AggregateAddHost + */ + public AggregateAddHost(String host) { + this.host = host; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateRemoveHost.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateRemoveHost.java index a5657fd03..6f1c98d9f 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateRemoveHost.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/AggregateRemoveHost.java @@ -1,35 +1,37 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; + /** * remove a host to an aggregate. - * @author liujunpeng * + * @author liujunpeng */ @JsonRootName("remove_host") public class AggregateRemoveHost implements ModelEntity { - - private static final long serialVersionUID = 1L; - /** - * host id - */ - @JsonProperty("host") - String host; - /** - * - * @param host - */ - public AggregateRemoveHost(String host){ - this.host=host; - } - public String getHost() { - return host; - } - public void setHost(String host) { - this.host = host; - } - + + private static final long serialVersionUID = 1L; + /** + * host id + */ + @JsonProperty("host") + String host; + + /** + * @param host + */ + public AggregateRemoveHost(String host) { + this.host = host; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutput.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutput.java index 337d57440..1d5d5eed1 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutput.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutput.java @@ -1,27 +1,25 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; +import org.openstack4j.model.ModelEntity; /** * A wrapper model class to return the console output from a server - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ public class ConsoleOutput implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + @JsonProperty + private String output; + + /** + * @return the console output from a VM/Server or null + */ + public String getOutput() { + return output; + } - @JsonProperty - private String output; - - /** - * @return the console output from a VM/Server or null - */ - public String getOutput() { - return output; - } - } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutputOptions.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutputOptions.java index 330f10f57..2d14d236d 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutputOptions.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ConsoleOutputOptions.java @@ -1,9 +1,8 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; /** * Represents the get Console Output action with related parameters. @@ -14,28 +13,29 @@ @JsonRootName("os-getConsoleOutput") public class ConsoleOutputOptions implements ModelEntity { - private static final long serialVersionUID = 1L; - - @JsonProperty("length") - private Integer length; - - /** - * To get the full console output. - */ - public ConsoleOutputOptions() { - this.length = null; - } - - /** - * To get the last length lines of the console output. - * @param length the number of lines to retrieve. - */ - public ConsoleOutputOptions(Integer length) { - this.length = length; - } - - public Integer getLength() { - return length; - } + private static final long serialVersionUID = 1L; + + @JsonProperty("length") + private Integer length; + + /** + * To get the full console output. + */ + public ConsoleOutputOptions() { + this.length = null; + } + + /** + * To get the last length lines of the console output. + * + * @param length the number of lines to retrieve. + */ + public ConsoleOutputOptions(Integer length) { + this.length = length; + } + + public Integer getLength() { + return length; + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ExtraSpecsWrapper.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ExtraSpecsWrapper.java index 5cc992755..3d110a672 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ExtraSpecsWrapper.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ExtraSpecsWrapper.java @@ -1,43 +1,44 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.ModelEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** * A Wrapper for flavor extra specs to get - * + * * @author Octopus Zhang */ public class ExtraSpecsWrapper implements ModelEntity { - private static final long serialVersionUID = 1L; - - @JsonProperty("extra_specs") - Map extraSpecs; - - public ExtraSpecsWrapper() { } - - public ExtraSpecsWrapper(Map extraSpecs) { - this.extraSpecs = extraSpecs; - } - /** - * Wraps the given extraSpecs into the wrapper - * - * @param extraSpecs - * @return extraSpecs wrapper - */ - public static ExtraSpecsWrapper wrap(Map extraSpecs) { - return new ExtraSpecsWrapper(extraSpecs); - } - - /** - * @return the extraSpecs - */ - public Map getExtraSpecs() { - return extraSpecs; - } + private static final long serialVersionUID = 1L; + + @JsonProperty("extra_specs") + Map extraSpecs; + + public ExtraSpecsWrapper() { + } + + public ExtraSpecsWrapper(Map extraSpecs) { + this.extraSpecs = extraSpecs; + } + + /** + * Wraps the given extraSpecs into the wrapper + * + * @param extraSpecs + * @return extraSpecs wrapper + */ + public static ExtraSpecsWrapper wrap(Map extraSpecs) { + return new ExtraSpecsWrapper(extraSpecs); + } + + /** + * @return the extraSpecs + */ + public Map getExtraSpecs() { + return extraSpecs; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/HostAggregateMetadata.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/HostAggregateMetadata.java index d9a0e39f8..57604f6ff 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/HostAggregateMetadata.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/HostAggregateMetadata.java @@ -1,38 +1,40 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.ModelEntity; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.Map; + /** * set metadata for an aggregate. + * * @author liujunpeng */ @JsonRootName("set_metadata") public class HostAggregateMetadata implements ModelEntity { - private static final long serialVersionUID = 1L; - - Map metadata; - /** - * @param metadata for hostAggregateMetadata - * @return HostAggregateMetadata - */ - public HostAggregateMetadata(Map metadata) { - this.metadata = metadata; - } - - public HostAggregateMetadata() { - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - + private static final long serialVersionUID = 1L; + + Map metadata; + + /** + * @param metadata for hostAggregateMetadata + * @return HostAggregateMetadata + */ + public HostAggregateMetadata(Map metadata) { + this.metadata = metadata; + } + + public HostAggregateMetadata() { + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/MetaDataWrapper.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/MetaDataWrapper.java index 54ede4cef..72033b4e2 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/MetaDataWrapper.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/MetaDataWrapper.java @@ -1,44 +1,44 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.ModelEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** * A Wrapper for Rest calls to set/update Meta Data - * + * * @author Jeremy Unruh */ public class MetaDataWrapper implements ModelEntity { - private static final long serialVersionUID = 1L; - - @JsonProperty("metadata") - Map metadata; - - public MetaDataWrapper() { } - - private MetaDataWrapper(Map metadata) { - this.metadata = metadata; - } - - /** - * Wraps the given MetaData map into the wrapper - * - * @param metadata the metadata - * @return the meta data wrapper - */ - public static MetaDataWrapper wrap(Map metadata) { - return new MetaDataWrapper(metadata); - } - - /** - * @return the meta data - */ - public Map getMetaData() { - return metadata; - } - + private static final long serialVersionUID = 1L; + + @JsonProperty("metadata") + Map metadata; + + public MetaDataWrapper() { + } + + private MetaDataWrapper(Map metadata) { + this.metadata = metadata; + } + + /** + * Wraps the given MetaData map into the wrapper + * + * @param metadata the metadata + * @return the meta data wrapper + */ + public static MetaDataWrapper wrap(Map metadata) { + return new MetaDataWrapper(metadata); + } + + /** + * @return the meta data + */ + public Map getMetaData() { + return metadata; + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAbsoluteLimit.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAbsoluteLimit.java index 642d9b438..bd004dcad 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAbsoluteLimit.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAbsoluteLimit.java @@ -1,288 +1,287 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.compute.AbsoluteLimit; - import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.AbsoluteLimit; /** * Absolute limits are specified as name/value pairs. The name of the absolute limit uniquely identifies the limit within a deployment. * Please consult your provider for an exhaustive list of absolute value names. An absolute limit value is always specified as an integer. * The name of the absolute limit determines the unit type of the integer value. - * + *

* For example, the name maxServerMeta implies that the value is in terms of server metadata items. - * + *

* Any limit which returns -1 indicates no value/no data/not supported by vendor * * @author Jeremy Unruh */ public class NovaAbsoluteLimit implements AbsoluteLimit { - private static final long serialVersionUID = 1L; - - private Integer maxServerMeta; - private Integer serverMetaUsed; - private Integer maxPersonality; - private Integer personalityUsed; - private Integer maxImageMeta; - private Integer imageMetaUsed; - private Integer maxPersonalitySize; - private Integer personalitySizeUsed; - private Integer maxTotalCores; - private Integer totalCoresUsed; - private Integer maxTotalInstances; - private Integer totalInstancesUsed; - private Integer maxTotalRAMSize; - private Integer totalRAMUsed; - private Integer maxSecurityGroupRules; - private Integer securityGroupRulesUsed; - private Integer maxTotalKeypairs; - private Integer totalKeyPairsUsed; - private Integer maxTotalVolumes; - private Integer totalVolumesUsed; - private Integer maxSecurityGroups; - private Integer totalSecurityGroupsUsed; - private Integer maxTotalFloatingIps; - private Integer totalFloatingIpsUsed; - private Integer maxTotalVolumeGigabytes; - private Integer totalVolumeGigabytesUsed; - private Integer maxServerGroups; - private Integer maxServerGroupMembers; - - /** - * Gets the max server meta. - * - * @return the max server meta - */ - public int getMaxServerMeta() { - return wrap(maxServerMeta); - } - - /** - * Gets the server meta used. - * - * @return the server meta used - */ - public int getServerMetaUsed() { - return wrap(serverMetaUsed); - } - - /** - * Gets the max personality. - * - * @return the max personality - */ - public int getMaxPersonality() { - return wrap(maxPersonality); - } - - /** - * Gets the personality used. - * - * @return the personality used - */ - public int getPersonalityUsed() { - return wrap(personalityUsed); - } - - /** - * Gets the max image meta. - * - * @return the max image meta - */ - public int getMaxImageMeta() { - return wrap(maxImageMeta); - } - - /** - * Gets the image meta used. - * - * @return the image meta used - */ - public int getImageMetaUsed() { - return wrap(imageMetaUsed); - } - - /** - * Gets the max personality size. - * - * @return the max personality size - */ - public int getMaxPersonalitySize() { - return wrap(maxPersonalitySize); - } - - /** - * Gets the personality size used. - * - * @return the personality size used - */ - public int getPersonalitySizeUsed() { - return wrap(personalitySizeUsed); - } - - /** - * Gets the max total cores. - * - * @return the max total cores - */ - public int getMaxTotalCores() { - return wrap(maxTotalCores); - } - - /** - * Gets the total cores used. - * - * @return the total cores used - */ - public int getTotalCoresUsed() { - return wrap(totalCoresUsed); - } - - /** - * Gets the max total instances. - * - * @return the max total instances - */ - public int getMaxTotalInstances() { - return wrap(maxTotalInstances); - } - - /** - * Gets the total instances used. - * - * @return the total instances used - */ - public int getTotalInstancesUsed() { - return wrap(totalInstancesUsed); - } - - /** - * Gets the max total ram size. - * - * @return the max total ram size - */ - public int getMaxTotalRAMSize() { - return wrap(maxTotalRAMSize); - } - - /** - * Gets the total ram used. - * - * @return the total ram used - */ - public int getTotalRAMUsed() { - return wrap(totalRAMUsed); - } - - /** - * Gets the max security group rules. - * - * @return the max security group rules - */ - public int getMaxSecurityGroupRules() { - return wrap(maxSecurityGroupRules); - } - - /** - * Gets the security group rules used. - * - * @return the security group rules used - */ - public int getSecurityGroupRulesUsed() { - return wrap(securityGroupRulesUsed); - } - - /** - * Gets the max total keypairs. - * - * @return the max total keypairs - */ - public int getMaxTotalKeypairs() { - return wrap(maxTotalKeypairs); - } - - /** - * Gets the total key pairs used. - * - * @return the total key pairs used - */ - public int getTotalKeyPairsUsed() { - return wrap(totalKeyPairsUsed); - } - - /** - * Gets the max total volumes. - * - * @return the max total volumes - */ - public int getMaxTotalVolumes() { - return wrap(maxTotalVolumes); - } - - /** - * Gets the total volumes used. - * - * @return the total volumes used - */ - public int getTotalVolumesUsed() { - return wrap(totalVolumesUsed); - } - - /** - * Gets the max security groups. - * - * @return the max security groups - */ - public int getMaxSecurityGroups() { - return wrap(maxSecurityGroups); - } - - /** - * Gets the total security groups used. - * - * @return the total security groups used - */ - public int getTotalSecurityGroupsUsed() { - return wrap(totalSecurityGroupsUsed); - } - - /** - * Gets the max total floating ips. - * - * @return the max total floating ips - */ - public int getMaxTotalFloatingIps() { - return wrap(maxTotalFloatingIps); - } - - /** - * Gets the total floating ips used. - * - * @return the total floating ips used - */ - public int getTotalFloatingIpsUsed() { - return wrap(totalFloatingIpsUsed); - } - - /** - * Gets the max total volume gigabytes. - * - * @return the max total volume gigabytes - */ - public int getMaxTotalVolumeGigabytes() { - return wrap(maxTotalVolumeGigabytes); - } - - /** - * Gets the total volume gigabytes used. - * - * @return the total volume gigabytes used - */ - public int getTotalVolumeGigabytesUsed() { - return wrap(totalVolumeGigabytesUsed); - } - - @Override + private static final long serialVersionUID = 1L; + + private Integer maxServerMeta; + private Integer serverMetaUsed; + private Integer maxPersonality; + private Integer personalityUsed; + private Integer maxImageMeta; + private Integer imageMetaUsed; + private Integer maxPersonalitySize; + private Integer personalitySizeUsed; + private Integer maxTotalCores; + private Integer totalCoresUsed; + private Integer maxTotalInstances; + private Integer totalInstancesUsed; + private Integer maxTotalRAMSize; + private Integer totalRAMUsed; + private Integer maxSecurityGroupRules; + private Integer securityGroupRulesUsed; + private Integer maxTotalKeypairs; + private Integer totalKeyPairsUsed; + private Integer maxTotalVolumes; + private Integer totalVolumesUsed; + private Integer maxSecurityGroups; + private Integer totalSecurityGroupsUsed; + private Integer maxTotalFloatingIps; + private Integer totalFloatingIpsUsed; + private Integer maxTotalVolumeGigabytes; + private Integer totalVolumeGigabytesUsed; + private Integer maxServerGroups; + private Integer maxServerGroupMembers; + + /** + * Gets the max server meta. + * + * @return the max server meta + */ + public int getMaxServerMeta() { + return wrap(maxServerMeta); + } + + /** + * Gets the server meta used. + * + * @return the server meta used + */ + public int getServerMetaUsed() { + return wrap(serverMetaUsed); + } + + /** + * Gets the max personality. + * + * @return the max personality + */ + public int getMaxPersonality() { + return wrap(maxPersonality); + } + + /** + * Gets the personality used. + * + * @return the personality used + */ + public int getPersonalityUsed() { + return wrap(personalityUsed); + } + + /** + * Gets the max image meta. + * + * @return the max image meta + */ + public int getMaxImageMeta() { + return wrap(maxImageMeta); + } + + /** + * Gets the image meta used. + * + * @return the image meta used + */ + public int getImageMetaUsed() { + return wrap(imageMetaUsed); + } + + /** + * Gets the max personality size. + * + * @return the max personality size + */ + public int getMaxPersonalitySize() { + return wrap(maxPersonalitySize); + } + + /** + * Gets the personality size used. + * + * @return the personality size used + */ + public int getPersonalitySizeUsed() { + return wrap(personalitySizeUsed); + } + + /** + * Gets the max total cores. + * + * @return the max total cores + */ + public int getMaxTotalCores() { + return wrap(maxTotalCores); + } + + /** + * Gets the total cores used. + * + * @return the total cores used + */ + public int getTotalCoresUsed() { + return wrap(totalCoresUsed); + } + + /** + * Gets the max total instances. + * + * @return the max total instances + */ + public int getMaxTotalInstances() { + return wrap(maxTotalInstances); + } + + /** + * Gets the total instances used. + * + * @return the total instances used + */ + public int getTotalInstancesUsed() { + return wrap(totalInstancesUsed); + } + + /** + * Gets the max total ram size. + * + * @return the max total ram size + */ + public int getMaxTotalRAMSize() { + return wrap(maxTotalRAMSize); + } + + /** + * Gets the total ram used. + * + * @return the total ram used + */ + public int getTotalRAMUsed() { + return wrap(totalRAMUsed); + } + + /** + * Gets the max security group rules. + * + * @return the max security group rules + */ + public int getMaxSecurityGroupRules() { + return wrap(maxSecurityGroupRules); + } + + /** + * Gets the security group rules used. + * + * @return the security group rules used + */ + public int getSecurityGroupRulesUsed() { + return wrap(securityGroupRulesUsed); + } + + /** + * Gets the max total keypairs. + * + * @return the max total keypairs + */ + public int getMaxTotalKeypairs() { + return wrap(maxTotalKeypairs); + } + + /** + * Gets the total key pairs used. + * + * @return the total key pairs used + */ + public int getTotalKeyPairsUsed() { + return wrap(totalKeyPairsUsed); + } + + /** + * Gets the max total volumes. + * + * @return the max total volumes + */ + public int getMaxTotalVolumes() { + return wrap(maxTotalVolumes); + } + + /** + * Gets the total volumes used. + * + * @return the total volumes used + */ + public int getTotalVolumesUsed() { + return wrap(totalVolumesUsed); + } + + /** + * Gets the max security groups. + * + * @return the max security groups + */ + public int getMaxSecurityGroups() { + return wrap(maxSecurityGroups); + } + + /** + * Gets the total security groups used. + * + * @return the total security groups used + */ + public int getTotalSecurityGroupsUsed() { + return wrap(totalSecurityGroupsUsed); + } + + /** + * Gets the max total floating ips. + * + * @return the max total floating ips + */ + public int getMaxTotalFloatingIps() { + return wrap(maxTotalFloatingIps); + } + + /** + * Gets the total floating ips used. + * + * @return the total floating ips used + */ + public int getTotalFloatingIpsUsed() { + return wrap(totalFloatingIpsUsed); + } + + /** + * Gets the max total volume gigabytes. + * + * @return the max total volume gigabytes + */ + public int getMaxTotalVolumeGigabytes() { + return wrap(maxTotalVolumeGigabytes); + } + + /** + * Gets the total volume gigabytes used. + * + * @return the total volume gigabytes used + */ + public int getTotalVolumeGigabytesUsed() { + return wrap(totalVolumeGigabytesUsed); + } + + @Override public int getMaxServerGroupMembers() { return wrap(maxServerGroupMembers); } @@ -292,32 +291,32 @@ public int getMaxServerGroups() { return wrap(maxServerGroups); } - /** - * Wrap. - * - * @param value the value - * @return the int - */ - private int wrap(Integer value) { - return value != null ? value : -1; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("maxServerMeta", maxServerMeta).add("serverMetaUsed", serverMetaUsed).add("maxPersonality", maxPersonality) - .add("personalityUsed", personalityUsed).add("maxImageMeta", maxImageMeta).add("imageMetaUsed", imageMetaUsed) - .add("maxPersonalitySize", maxPersonalitySize).add("personalitySizeUsed", personalitySizeUsed).add("maxTotalCores", maxTotalCores) - .add("totalCoresUsed", totalCoresUsed).add("maxTotalInstances", maxTotalInstances).add("totalInstancesUsed", totalInstancesUsed) - .add("maxTotalRAMSize", maxTotalRAMSize).add("totalRAMUsed", totalRAMUsed).add("maxSecurityGroupRules", maxSecurityGroupRules) - .add("securityGroupRulesUsed", securityGroupRulesUsed).add("maxTotalKeypairs", maxTotalKeypairs).add("totalKeyPairsUsed", totalKeyPairsUsed) - .add("maxTotalVolumes", maxTotalVolumes).add("totalVolumesUsed", totalVolumesUsed).add("maxSecurityGroups", maxSecurityGroups) - .add("totalSecurityGroupsUsed", totalSecurityGroupsUsed).add("maxTotalFloatingIps", maxTotalFloatingIps).add("totalFloatingIpsUsed", totalFloatingIpsUsed) - .add("maxTotalVolumeGigabytes", maxTotalVolumeGigabytes).add("totalVolumeGigabytesUsed", totalVolumeGigabytesUsed) - .add("maxServerGroups", maxSecurityGroups).add("maxServerGroupMembers", maxServerGroupMembers) - .toString(); - } + /** + * Wrap. + * + * @param value the value + * @return the int + */ + private int wrap(Integer value) { + return value != null ? value : -1; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("maxServerMeta", maxServerMeta).add("serverMetaUsed", serverMetaUsed).add("maxPersonality", maxPersonality) + .add("personalityUsed", personalityUsed).add("maxImageMeta", maxImageMeta).add("imageMetaUsed", imageMetaUsed) + .add("maxPersonalitySize", maxPersonalitySize).add("personalitySizeUsed", personalitySizeUsed).add("maxTotalCores", maxTotalCores) + .add("totalCoresUsed", totalCoresUsed).add("maxTotalInstances", maxTotalInstances).add("totalInstancesUsed", totalInstancesUsed) + .add("maxTotalRAMSize", maxTotalRAMSize).add("totalRAMUsed", totalRAMUsed).add("maxSecurityGroupRules", maxSecurityGroupRules) + .add("securityGroupRulesUsed", securityGroupRulesUsed).add("maxTotalKeypairs", maxTotalKeypairs).add("totalKeyPairsUsed", totalKeyPairsUsed) + .add("maxTotalVolumes", maxTotalVolumes).add("totalVolumesUsed", totalVolumesUsed).add("maxSecurityGroups", maxSecurityGroups) + .add("totalSecurityGroupsUsed", totalSecurityGroupsUsed).add("maxTotalFloatingIps", maxTotalFloatingIps).add("totalFloatingIpsUsed", totalFloatingIpsUsed) + .add("maxTotalVolumeGigabytes", maxTotalVolumeGigabytes).add("totalVolumeGigabytesUsed", totalVolumeGigabytesUsed) + .add("maxServerGroups", maxSecurityGroups).add("maxServerGroupMembers", maxServerGroupMembers) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAddresses.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAddresses.java index a0a1c461d..6bcd55e2d 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAddresses.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaAddresses.java @@ -1,103 +1,102 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.compute.Address; -import org.openstack4j.model.compute.Addresses; - import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import org.openstack4j.model.compute.Address; +import org.openstack4j.model.compute.Addresses; + +import java.util.List; +import java.util.Map; public class NovaAddresses implements Addresses { - private static final long serialVersionUID = 1L; - - @JsonProperty("addresses") - private Map> addresses = Maps.newHashMap(); - - @Override - public void add(String key, Address value) { - if (!addresses.containsKey(key)) - addresses.put(key, Lists.newArrayList()); - - addresses.get(key).add((NovaAddress) value); - } - - @JsonAnySetter - public void add(String key, List value) { - addresses.put(key, value); - } - - @Override - public Map> getAddresses() { - return encapsulate(); - } - - @Override - public List getAddresses(String type) { - return addresses.get(type); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("addresses", addresses).addValue("\n") - .toString(); - } - - @SuppressWarnings("unchecked") - private T encapsulate() { - return (T) addresses; - } - - public static class NovaAddress implements Address { - - private static final long serialVersionUID = 1L; - @JsonProperty("OS-EXT-IPS-MAC:mac_addr") - private String macAddr; - private int version; - private String addr; - @JsonProperty("OS-EXT-IPS:type") - private String type; - - @Override - public String getMacAddr() { - return macAddr; - } - - @Override - public int getVersion() { - return version; - } - - @Override - public String getAddr() { - return addr; - } - - @Override - public String getType() { - return type; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("address", addr).add("type", type).add("version", version) - .add("macaddr", macAddr).addValue("\n") - .toString(); - } - - } + private static final long serialVersionUID = 1L; + + @JsonProperty("addresses") + private Map> addresses = Maps.newHashMap(); + + @Override + public void add(String key, Address value) { + if (!addresses.containsKey(key)) + addresses.put(key, Lists.newArrayList()); + + addresses.get(key).add((NovaAddress) value); + } + + @JsonAnySetter + public void add(String key, List value) { + addresses.put(key, value); + } + + @Override + public Map> getAddresses() { + return encapsulate(); + } + + @Override + public List getAddresses(String type) { + return addresses.get(type); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("addresses", addresses).addValue("\n") + .toString(); + } + + @SuppressWarnings("unchecked") + private T encapsulate() { + return (T) addresses; + } + + public static class NovaAddress implements Address { + + private static final long serialVersionUID = 1L; + @JsonProperty("OS-EXT-IPS-MAC:mac_addr") + private String macAddr; + private int version; + private String addr; + @JsonProperty("OS-EXT-IPS:type") + private String type; + + @Override + public String getMacAddr() { + return macAddr; + } + + @Override + public int getVersion() { + return version; + } + + @Override + public String getAddr() { + return addr; + } + + @Override + public String getType() { + return type; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("address", addr).add("type", type).add("version", version) + .add("macaddr", macAddr).addValue("\n") + .toString(); + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaBlockDeviceMappingCreate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaBlockDeviceMappingCreate.java index 598bec1a5..4eb9d0598 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaBlockDeviceMappingCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaBlockDeviceMappingCreate.java @@ -1,33 +1,31 @@ package org.openstack4j.openstack.compute.domain; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.compute.BDMDestType; import org.openstack4j.model.compute.BDMSourceType; import org.openstack4j.model.compute.BlockDeviceMappingCreate; import org.openstack4j.model.compute.builder.BlockDeviceMappingBuilder; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - /** - * * @author jaroslav.sovicka@oracle.com */ public class NovaBlockDeviceMappingCreate implements BlockDeviceMappingCreate { - public String device_name; - public BDMSourceType source_type = BDMSourceType.VOLUME; - public BDMDestType destination_type = BDMDestType.VOLUME; - public String uuid; - public Integer boot_index; - public Integer volume_size; - public boolean delete_on_termination = false; + public String device_name; + public BDMSourceType source_type = BDMSourceType.VOLUME; + public BDMDestType destination_type = BDMDestType.VOLUME; + public String uuid; + public Integer boot_index; + public Integer volume_size; + public boolean delete_on_termination = false; - @JsonProperty("snapshot_id") - public String snapshotId; + @JsonProperty("snapshot_id") + public String snapshotId; - @JsonProperty("volume_id") - public String volumeId; + @JsonProperty("volume_id") + public String volumeId; @JsonInclude(Include.NON_NULL) @JsonProperty("disk_bus") @@ -37,73 +35,73 @@ public class NovaBlockDeviceMappingCreate implements BlockDeviceMappingCreate { @JsonProperty("device_type") public String deviceType; - public static NovaBlockDeviceMappingBuilder builder() { - return new NovaBlockDeviceMappingBuilder(new NovaBlockDeviceMappingCreate()); - } - - - @Override - public NovaBlockDeviceMappingBuilder toBuilder() { - return new NovaBlockDeviceMappingBuilder(this); - } - - public static class NovaBlockDeviceMappingBuilder implements BlockDeviceMappingBuilder { - - NovaBlockDeviceMappingCreate create; - - public NovaBlockDeviceMappingBuilder(NovaBlockDeviceMappingCreate create) { - this.create = create; - } - - @Override - public BlockDeviceMappingBuilder deviceName(String deviceName) { - create.device_name = deviceName; - return this; - } - - @Override - public BlockDeviceMappingBuilder uuid(String id) { - create.uuid = id; - return this; - } - - @Override - public BlockDeviceMappingBuilder bootIndex(int i) { - create.boot_index = i; - return this; - } - - @Override - public BlockDeviceMappingBuilder sourceType(BDMSourceType type){ - create.source_type = type; - return this; - } - - @Override - public BlockDeviceMappingBuilder destinationType(BDMDestType type){ - create.destination_type = type; - return this; - } - - @Override - public BlockDeviceMappingBuilder deleteOnTermination(boolean deleteOnTermination) { - create.delete_on_termination = deleteOnTermination; - return this; - } - - @Override - public BlockDeviceMappingBuilder snapshotId(String snapshotId) { - create.snapshotId = snapshotId; - return this; - } - - @Override - public BlockDeviceMappingBuilder volumeId(String volumeId) { - create.volumeId = volumeId; - return this; - } - - @Override + public static NovaBlockDeviceMappingBuilder builder() { + return new NovaBlockDeviceMappingBuilder(new NovaBlockDeviceMappingCreate()); + } + + + @Override + public NovaBlockDeviceMappingBuilder toBuilder() { + return new NovaBlockDeviceMappingBuilder(this); + } + + public static class NovaBlockDeviceMappingBuilder implements BlockDeviceMappingBuilder { + + NovaBlockDeviceMappingCreate create; + + public NovaBlockDeviceMappingBuilder(NovaBlockDeviceMappingCreate create) { + this.create = create; + } + + @Override + public BlockDeviceMappingBuilder deviceName(String deviceName) { + create.device_name = deviceName; + return this; + } + + @Override + public BlockDeviceMappingBuilder uuid(String id) { + create.uuid = id; + return this; + } + + @Override + public BlockDeviceMappingBuilder bootIndex(int i) { + create.boot_index = i; + return this; + } + + @Override + public BlockDeviceMappingBuilder sourceType(BDMSourceType type) { + create.source_type = type; + return this; + } + + @Override + public BlockDeviceMappingBuilder destinationType(BDMDestType type) { + create.destination_type = type; + return this; + } + + @Override + public BlockDeviceMappingBuilder deleteOnTermination(boolean deleteOnTermination) { + create.delete_on_termination = deleteOnTermination; + return this; + } + + @Override + public BlockDeviceMappingBuilder snapshotId(String snapshotId) { + create.snapshotId = snapshotId; + return this; + } + + @Override + public BlockDeviceMappingBuilder volumeId(String volumeId) { + create.volumeId = volumeId; + return this; + } + + @Override public BlockDeviceMappingBuilder volumeSize(Integer volumeSize) { create.volume_size = volumeSize; return this; @@ -121,14 +119,14 @@ public BlockDeviceMappingBuilder deviceType(String deviceType) { return this; } - @Override - public BlockDeviceMappingCreate build() { - return create; - } + @Override + public BlockDeviceMappingCreate build() { + return create; + } - @Override - public BlockDeviceMappingBuilder from(BlockDeviceMappingCreate in) { - return new NovaBlockDeviceMappingBuilder((NovaBlockDeviceMappingCreate) in); - } - } + @Override + public BlockDeviceMappingBuilder from(BlockDeviceMappingCreate in) { + return new NovaBlockDeviceMappingBuilder((NovaBlockDeviceMappingCreate) in); + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFault.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFault.java index 93e22fcdc..ca2af9891 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFault.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFault.java @@ -1,56 +1,56 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Date; - import org.openstack4j.model.compute.Fault; +import java.util.Date; + /** * A server Fault - * + * * @author Jeremy Unruh */ public class NovaFault implements Fault { - private static final long serialVersionUID = 1L; - private int code; - private String message; - private String details; - private Date created; - - /** - * {@inheritDoc} - */ - @Override - public int getCode() { - return code; - } - - /** - * {@inheritDoc} - */ - @Override - public String getMessage() { - return message; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDetails() { - return details; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreated() { - return created; - } - - @Override - public String toString() { - return String.format("NovaFault %d: %s", code, message); - } + private static final long serialVersionUID = 1L; + private int code; + private String message; + private String details; + private Date created; + + /** + * {@inheritDoc} + */ + @Override + public int getCode() { + return code; + } + + /** + * {@inheritDoc} + */ + @Override + public String getMessage() { + return message; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDetails() { + return details; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreated() { + return created; + } + + @Override + public String toString() { + return String.format("NovaFault %d: %s", code, message); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavor.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavor.java index 10f3f63c5..afb921fb5 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavor.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavor.java @@ -1,279 +1,275 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.*; +import com.google.common.base.MoreObjects; import org.openstack4j.model.common.Link; import org.openstack4j.model.compute.Flavor; import org.openstack4j.model.compute.builder.FlavorBuilder; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; + /** * An OpenStack Flavor which is a template used for configuration against running Instances * * @author Jeremy Unruh */ @JsonRootName("flavor") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NovaFlavor implements Flavor { - private static final long serialVersionUID = 1L; - - private String id; - private String name; - private Integer ram; - private Integer vcpus; - private Integer disk; - @JsonProperty("OS-FLV-EXT-DATA:ephemeral") - private int ephemeral; - private int swap; - @JsonProperty("rxtx_factor") - private float rxtxFactor = 1.0f; - @JsonProperty("OS-FLV-DISABLED:disabled") - @JsonInclude(JsonInclude.Include.NON_NULL) - private Boolean disabled; - @JsonProperty("rxtx_quota") - private Integer rxtxQuota; - @JsonProperty("rxtx_cap") - private Integer rxtxCap; - @JsonProperty("os-flavor-access:is_public") - @JsonInclude(JsonInclude.Include.NON_NULL) - private Boolean isPublic; - private List links; - - public static FlavorBuilder builder() { - return new FlavorConcreteBuilder(); - } - - @Override - public FlavorBuilder toBuilder() { - return new FlavorConcreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public int getRam() { - return (ram == null) ? 0 : ram; - } - - /** - * {@inheritDoc} - */ - @Override - public int getVcpus() { - return (vcpus == null) ? 0 : vcpus; - } - - /** - * {@inheritDoc} - */ - @Override - public int getDisk() { - return (disk == null) ? 0 : disk; - } - - /** - * {@inheritDoc} - */ - @Override - public int getSwap() { - return swap; - } - - /** - * {@inheritDoc} - */ - @Override - public float getRxtxFactor() { - return rxtxFactor; - } - - /** - * {@inheritDoc} - */ - @Override - public int getEphemeral() { - return ephemeral; - } - - /** - * {@inheritDoc} - */ - @JsonIgnore - @Override - public int getRxtxQuota() { - return (rxtxQuota == null) ? 0 : rxtxQuota; - } - - /** - * {@inheritDoc} - */ - @JsonIgnore - @Override - public int getRxtxCap() { - return (rxtxCap == null) ? 0 : rxtxCap; - } - - /** - * {@inheritDoc} - */ - @JsonIgnore - @Override - public Boolean isPublic() { - return isPublic; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean isDisabled() { - return disabled; - } - - /** - * {@inheritDoc} - */ - @Override - public List getLinks() { - return links; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("vcpus", vcpus) - .add("ram", ram).add("disk", disk).add("ephemeral", ephemeral) - .add("swap", swap).add("rxtx_factor", rxtxFactor).add("disabled", disabled) - .add("rxtx_quota", rxtxQuota).add("rxtx_cap", rxtxCap).add("is_public", isPublic) - .add("links", links).addValue("\n") - .toString(); - } - - public static class Flavors extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("flavors") - List flavors; - - @Override + private static final long serialVersionUID = 1L; + + private String id; + private String name; + private Integer ram; + private Integer vcpus; + private Integer disk; + @JsonProperty("OS-FLV-EXT-DATA:ephemeral") + private int ephemeral; + private int swap; + @JsonProperty("rxtx_factor") + private float rxtxFactor = 1.0f; + @JsonProperty("OS-FLV-DISABLED:disabled") + @JsonInclude(JsonInclude.Include.NON_NULL) + private Boolean disabled; + @JsonProperty("rxtx_quota") + private Integer rxtxQuota; + @JsonProperty("rxtx_cap") + private Integer rxtxCap; + @JsonProperty("os-flavor-access:is_public") + @JsonInclude(JsonInclude.Include.NON_NULL) + private Boolean isPublic; + private List links; + + public static FlavorBuilder builder() { + return new FlavorConcreteBuilder(); + } + + @Override + public FlavorBuilder toBuilder() { + return new FlavorConcreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public int getRam() { + return (ram == null) ? 0 : ram; + } + + /** + * {@inheritDoc} + */ + @Override + public int getVcpus() { + return (vcpus == null) ? 0 : vcpus; + } + + /** + * {@inheritDoc} + */ + @Override + public int getDisk() { + return (disk == null) ? 0 : disk; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSwap() { + return swap; + } + + /** + * {@inheritDoc} + */ + @Override + public float getRxtxFactor() { + return rxtxFactor; + } + + /** + * {@inheritDoc} + */ + @Override + public int getEphemeral() { + return ephemeral; + } + + /** + * {@inheritDoc} + */ + @JsonIgnore + @Override + public int getRxtxQuota() { + return (rxtxQuota == null) ? 0 : rxtxQuota; + } + + /** + * {@inheritDoc} + */ + @JsonIgnore + @Override + public int getRxtxCap() { + return (rxtxCap == null) ? 0 : rxtxCap; + } + + /** + * {@inheritDoc} + */ + @JsonIgnore + @Override + public Boolean isPublic() { + return isPublic; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean isDisabled() { + return disabled; + } + + /** + * {@inheritDoc} + */ + @Override + public List getLinks() { + return links; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("vcpus", vcpus) + .add("ram", ram).add("disk", disk).add("ephemeral", ephemeral) + .add("swap", swap).add("rxtx_factor", rxtxFactor).add("disabled", disabled) + .add("rxtx_quota", rxtxQuota).add("rxtx_cap", rxtxCap).add("is_public", isPublic) + .add("links", links).addValue("\n") + .toString(); + } + + public static class Flavors extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("flavors") + List flavors; + + @Override public List value() { - return flavors; - } - } + return flavors; + } + } - public static class FlavorConcreteBuilder implements FlavorBuilder { + public static class FlavorConcreteBuilder implements FlavorBuilder { - private NovaFlavor m; + private NovaFlavor m; - FlavorConcreteBuilder() { - this(new NovaFlavor()); - } + FlavorConcreteBuilder() { + this(new NovaFlavor()); + } - FlavorConcreteBuilder(NovaFlavor model) { - this.m = model; - } + FlavorConcreteBuilder(NovaFlavor model) { + this.m = model; + } - /** - * @see Flavor#getName() - */ - @Override + /** + * @see Flavor#getName() + */ + @Override public FlavorBuilder name(String name) { - m.name = name; - return this; - } - - /** - * @see Flavor#getRam() - */ - @Override + m.name = name; + return this; + } + + /** + * @see Flavor#getRam() + */ + @Override public FlavorBuilder ram(int ram) { - m.ram = ram; - return this; - } - - /** - * @see Flavor#getVcpus() - */ - @Override + m.ram = ram; + return this; + } + + /** + * @see Flavor#getVcpus() + */ + @Override public FlavorBuilder vcpus(int vcpus) { - m.vcpus = vcpus; - return this; - } - - /** - * @see Flavor#getDisk() - */ - @Override + m.vcpus = vcpus; + return this; + } + + /** + * @see Flavor#getDisk() + */ + @Override public FlavorBuilder disk(int disk) { - m.disk = disk; - return this; - } - - /** - * @see Flavor#getSwap() - */ - @Override + m.disk = disk; + return this; + } + + /** + * @see Flavor#getSwap() + */ + @Override public FlavorBuilder swap(int swap) { - m.swap = swap; - return this; - } - - /** - * @see Flavor#getRxtxFactor(); - */ - @Override + m.swap = swap; + return this; + } + + /** + * @see Flavor#getRxtxFactor(); + */ + @Override public FlavorBuilder rxtxFactor(float rxtxFactor) { - m.rxtxFactor = rxtxFactor; - return this; - } - - /** - * @see Flavor#isPublic() - */ - public FlavorBuilder isPublic(boolean isPublic) { - m.isPublic = isPublic; - return this; - } - - @Override - public Flavor build() { - return m; - } - - @Override - public FlavorBuilder from(Flavor in) { - m = (NovaFlavor) in; - return this; - } + m.rxtxFactor = rxtxFactor; + return this; + } + + /** + * @see Flavor#isPublic() + */ + public FlavorBuilder isPublic(boolean isPublic) { + m.isPublic = isPublic; + return this; + } + + @Override + public Flavor build() { + return m; + } + + @Override + public FlavorBuilder from(Flavor in) { + m = (NovaFlavor) in; + return this; + } @Override public FlavorBuilder ephemeral(int ephemeral) { @@ -287,6 +283,6 @@ public FlavorBuilder id(String id) { return this; } - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavorAccess.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavorAccess.java index e52f01f0c..20dd700c2 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavorAccess.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFlavorAccess.java @@ -1,17 +1,15 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; - -import org.openstack4j.model.compute.FlavorAccess; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.FlavorAccess; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** - * * An OpenStack Flavor Access for tenants implement * * @author Moodpo @@ -19,88 +17,88 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NovaFlavorAccess implements FlavorAccess { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("flavor_id") - private String flavorId; + @JsonProperty("flavor_id") + private String flavorId; - @JsonProperty("tenant_id") - private String tenantId; + @JsonProperty("tenant_id") + private String tenantId; - /** - * {@inheritDoc} - */ - @Override - public String getFlavorId() { - return flavorId; - } + /** + * {@inheritDoc} + */ + @Override + public String getFlavorId() { + return flavorId; + } - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("flavorId", flavorId).add("tenantId", tenantId) - .addValue("\n").toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("flavorId", flavorId).add("tenantId", tenantId) + .addValue("\n").toString(); + } - @JsonRootName("addTenantAccess") - public static class AddTenantAccess extends NovaFlavorAccess { + @JsonRootName("addTenantAccess") + public static class AddTenantAccess extends NovaFlavorAccess { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("tenant") - private String tenantId; + @JsonProperty("tenant") + private String tenantId; - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } - public String getTenantId() { - return tenantId; - } + public String getTenantId() { + return tenantId; + } - } + } - @JsonRootName("removeTenantAccess") - public static class RemoveTenantAccess extends NovaFlavorAccess { + @JsonRootName("removeTenantAccess") + public static class RemoveTenantAccess extends NovaFlavorAccess { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("tenant") - private String tenantId; + @JsonProperty("tenant") + private String tenantId; - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } - public String getTenantId() { - return tenantId; - } + public String getTenantId() { + return tenantId; + } - } + } - public static class FlavorAccesses extends ListResult { + public static class FlavorAccesses extends ListResult { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("flavor_access") - List flavorAccesses; + @JsonProperty("flavor_access") + List flavorAccesses; - @Override - protected List value() { - return flavorAccesses; - } + @Override + protected List value() { + return flavorAccesses; + } - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIP.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIP.java index e3c46f3f3..6ad5d2ec6 100755 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIP.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIP.java @@ -1,217 +1,214 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.compute.FloatingIP; import org.openstack4j.model.compute.builder.FloatingIPBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * The Class NovaFloatingIP. * - * * @author Nathan Anderson */ @JsonRootName("floating_ip") public class NovaFloatingIP implements FloatingIP { - private static final long serialVersionUID = -4441740897994315920L; - - @JsonProperty("id") - private String id; - - @JsonProperty("instance_id") - private String instanceId; - - @JsonProperty("ip") - private String floatingIpAddress; - - @JsonProperty("fixed_ip") - private String fixedIpAddress; - - @JsonProperty("pool") - private String pool; - - /** - * {@inheritDoc} - */ - public FloatingIPBuilder toBuilder() { - return new FloatingIPConcreteBuilder(this); - } - - /** - * @return the Floating IP Builder - */ - public static FloatingIPBuilder builder() { - return new FloatingIPConcreteBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getInstanceId() { - return this.instanceId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFloatingIpAddress() { - return this.floatingIpAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFixedIpAddress() { - return this.fixedIpAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPool() { - return this.pool; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("instanceId", instanceId) - .add("floatingIpAddress", floatingIpAddress) - .add("fixedIpAddress", fixedIpAddress) - .add("pool", pool) - .addValue("\n") - .toString(); - } - - /** - * The Class NovaFloatingIPs. - * - * @author Nathan Anderson - */ - public static class NovaFloatingIPs extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("floating_ips") - private List floatingIps; + private static final long serialVersionUID = -4441740897994315920L; - /** - * {@inheritDoc} - */ - @Override - protected List value() { - return floatingIps; - } - } + @JsonProperty("id") + private String id; - /** - * The Class FloatingIPConcreteBuilder. - * - * - * @author Nathan Anderson - */ - public static class FloatingIPConcreteBuilder implements FloatingIPBuilder { + @JsonProperty("instance_id") + private String instanceId; - NovaFloatingIP m = null; + @JsonProperty("ip") + private String floatingIpAddress; + + @JsonProperty("fixed_ip") + private String fixedIpAddress; + + @JsonProperty("pool") + private String pool; /** - * Instantiates a new floating ip concrete builder. + * {@inheritDoc} */ - public FloatingIPConcreteBuilder() { - this.m = new NovaFloatingIP(); + public FloatingIPBuilder toBuilder() { + return new FloatingIPConcreteBuilder(this); } /** - * Instantiates a new floating ip concrete builder. - * - * @param floatingIp the floating ip + * @return the Floating IP Builder */ - public FloatingIPConcreteBuilder(FloatingIP floatingIp) { - this.m = (NovaFloatingIP) floatingIp; + public static FloatingIPBuilder builder() { + return new FloatingIPConcreteBuilder(); } /** * {@inheritDoc} */ @Override - public FloatingIP build() { - return m; + public String getId() { + return this.id; } /** * {@inheritDoc} */ @Override - public FloatingIPBuilder from(FloatingIP in) { - m = (NovaFloatingIP) in; - return this; + public String getInstanceId() { + return this.instanceId; } /** * {@inheritDoc} */ @Override - public FloatingIPBuilder id(String id) { - m.id = id; - return this; + public String getFloatingIpAddress() { + return this.floatingIpAddress; } /** * {@inheritDoc} */ @Override - public FloatingIPBuilder fixedIpAddress(String fixedIp) { - m.fixedIpAddress = fixedIp; - return this; + public String getFixedIpAddress() { + return this.fixedIpAddress; } /** * {@inheritDoc} */ @Override - public FloatingIPBuilder floatingIpAddress(String floatingIpAddress) { - m.floatingIpAddress = floatingIpAddress; - return this; + public String getPool() { + return this.pool; } /** * {@inheritDoc} */ @Override - public FloatingIPBuilder instanceId(String instanceId) { - m.instanceId = instanceId; - return this; + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("instanceId", instanceId) + .add("floatingIpAddress", floatingIpAddress) + .add("fixedIpAddress", fixedIpAddress) + .add("pool", pool) + .addValue("\n") + .toString(); } /** - * {@inheritDoc} + * The Class NovaFloatingIPs. + * + * @author Nathan Anderson */ - @Override - public FloatingIPBuilder pool(String pool) { - m.pool = pool; - return this; + public static class NovaFloatingIPs extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("floating_ips") + private List floatingIps; + + /** + * {@inheritDoc} + */ + @Override + protected List value() { + return floatingIps; + } + } + + /** + * The Class FloatingIPConcreteBuilder. + * + * @author Nathan Anderson + */ + public static class FloatingIPConcreteBuilder implements FloatingIPBuilder { + + NovaFloatingIP m = null; + + /** + * Instantiates a new floating ip concrete builder. + */ + public FloatingIPConcreteBuilder() { + this.m = new NovaFloatingIP(); + } + + /** + * Instantiates a new floating ip concrete builder. + * + * @param floatingIp the floating ip + */ + public FloatingIPConcreteBuilder(FloatingIP floatingIp) { + this.m = (NovaFloatingIP) floatingIp; + } + + /** + * {@inheritDoc} + */ + @Override + public FloatingIP build() { + return m; + } + + /** + * {@inheritDoc} + */ + @Override + public FloatingIPBuilder from(FloatingIP in) { + m = (NovaFloatingIP) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FloatingIPBuilder id(String id) { + m.id = id; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FloatingIPBuilder fixedIpAddress(String fixedIp) { + m.fixedIpAddress = fixedIp; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FloatingIPBuilder floatingIpAddress(String floatingIpAddress) { + m.floatingIpAddress = floatingIpAddress; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FloatingIPBuilder instanceId(String instanceId) { + m.instanceId = instanceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FloatingIPBuilder pool(String pool) { + m.pool = pool; + return this; + } } - } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIPPools.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIPPools.java index ba717591a..c81255e8e 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIPPools.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaFloatingIPPools.java @@ -1,51 +1,49 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Collections; -import java.util.List; - -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.collect.Lists; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Collections; +import java.util.List; /** * Maps to the OpenStack Floating IP Pool specification and used internally to retrieve the list of pool names - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ public class NovaFloatingIPPools extends ListResult { - private static final long serialVersionUID = 1L; - - @JsonProperty("floating_ip_pools") - private List values; - - /** - * {@inheritDoc} - */ - @Override - protected List value() { - if (values != null) - return Lists.transform(values, WrapperToStringFunc.instance); - return Collections.emptyList(); - } - - static final class Wrapper { - @JsonProperty("name") - String name; - } - - private static class WrapperToStringFunc implements Function { - - static final WrapperToStringFunc instance = new WrapperToStringFunc(); - - @Override - public String apply(Wrapper input) { - return input.name; - } - - } - + private static final long serialVersionUID = 1L; + + @JsonProperty("floating_ip_pools") + private List values; + + /** + * {@inheritDoc} + */ + @Override + protected List value() { + if (values != null) + return Lists.transform(values, WrapperToStringFunc.instance); + return Collections.emptyList(); + } + + static final class Wrapper { + @JsonProperty("name") + String name; + } + + private static class WrapperToStringFunc implements Function { + + static final WrapperToStringFunc instance = new WrapperToStringFunc(); + + @Override + public String apply(Wrapper input) { + return input.name; + } + + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHost.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHost.java index 7564561ae..a26321c8f 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHost.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHost.java @@ -1,31 +1,30 @@ package org.openstack4j.openstack.compute.domain; -import java.util.ArrayList; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; /** * Nova OS Host contains a list of Nova Host Resources - * + * * @author Qin An */ public class NovaHost extends ListResult { - public static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; - @JsonProperty("host") - List hostItems; + @JsonProperty("host") + List hostItems; - @Override - protected List value() { - List hostResources = new ArrayList(); - for (NovaHostResourceBody body : hostItems) { - hostResources.add((NovaHostResource) body.getHostResource()); - } - return hostResources; - } + @Override + protected List value() { + List hostResources = new ArrayList(); + for (NovaHostResourceBody body : hostItems) { + hostResources.add((NovaHostResource) body.getHostResource()); + } + return hostResources; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregate.java index fec045a20..280c4e4ca 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregate.java @@ -1,154 +1,166 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.compute.HostAggregate; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.HostAggregate; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; +import java.util.Map; + /** * Nova HostAggregate - * @author liujunpeng * + * @author liujunpeng */ @JsonRootName("aggregate") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NovaHostAggregate implements HostAggregate { - private static final long serialVersionUID = 1L; - @JsonProperty("availability_zone") - public String availabilityZone; - @JsonProperty("created_at") - public Date createdAt; - public boolean deleted; - @JsonProperty("deleted_at") - public Date deletedAt; - public List hosts; - public String id; - public Map metadata; - public String name; - @JsonProperty("updated_at") - public Date updatedAt; - /** - * Used internally by the domain side of the API to create a new HostAggregate on an OpenStack server - * @param name - * @param availabilityZone - * @return NovaHostAggregate - */ - public static NovaHostAggregate create(String name,String availabilityZone){ - NovaHostAggregate hostAggregate = new NovaHostAggregate(); - hostAggregate.name = name; - hostAggregate.availabilityZone=availabilityZone; - return hostAggregate; - - } - /** - * {@inheritDoc} - */ - @Override - public String getAvailabilityZone() { - return availabilityZone; - } - /** - * {@inheritDoc} - */ - @Override - public Date getCreate() { - return createdAt; - } - /** - * {@inheritDoc} - */ - @Override - public boolean isDeleted() { - return deleted; - } - /** - * {@inheritDoc} - */ - @Override - public Date getDeletedAt() { - return deletedAt; - } - /** - * {@inheritDoc} - */ - @Override - public List getHosts() { - return hosts; - } - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - /** - * {@inheritDoc} - */ - @Override - public Map getMetadata() { - return metadata; - } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - @Override - public String toString() { - - return MoreObjects.toStringHelper(this).omitNullValues() - .add("availabilityZone", availabilityZone) - .add("createdAt", createdAt) - .add("deleted", deleted) - .add("deletedAt", deletedAt) - .add("hosts", hosts) - .add("id", id) - .add("metadata", metadata) - .add("name", name) - .add("updatedAt", updatedAt).toString(); - } - - /** - * host aggregates - * @author liujunpeng - * - */ - public static class NovaHostAggregates extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("aggregates") - private List aggregates; - /** - * NovaHostAggregates - */ - public List value() { - return aggregates; - } - - @Override - public String toString() { - return "HostAggregates [aggregates=" + aggregates + "]"; - } - - } + private static final long serialVersionUID = 1L; + @JsonProperty("availability_zone") + public String availabilityZone; + @JsonProperty("created_at") + public Date createdAt; + public boolean deleted; + @JsonProperty("deleted_at") + public Date deletedAt; + public List hosts; + public String id; + public Map metadata; + public String name; + @JsonProperty("updated_at") + public Date updatedAt; + + /** + * Used internally by the domain side of the API to create a new HostAggregate on an OpenStack server + * + * @param name + * @param availabilityZone + * @return NovaHostAggregate + */ + public static NovaHostAggregate create(String name, String availabilityZone) { + NovaHostAggregate hostAggregate = new NovaHostAggregate(); + hostAggregate.name = name; + hostAggregate.availabilityZone = availabilityZone; + return hostAggregate; + + } + + /** + * {@inheritDoc} + */ + @Override + public String getAvailabilityZone() { + return availabilityZone; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreate() { + return createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isDeleted() { + return deleted; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getDeletedAt() { + return deletedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public List getHosts() { + return hosts; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getMetadata() { + return metadata; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + @Override + public String toString() { + + return MoreObjects.toStringHelper(this).omitNullValues() + .add("availabilityZone", availabilityZone) + .add("createdAt", createdAt) + .add("deleted", deleted) + .add("deletedAt", deletedAt) + .add("hosts", hosts) + .add("id", id) + .add("metadata", metadata) + .add("name", name) + .add("updatedAt", updatedAt).toString(); + } + + /** + * host aggregates + * + * @author liujunpeng + */ + public static class NovaHostAggregates extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("aggregates") + private List aggregates; + + /** + * NovaHostAggregates + */ + public List value() { + return aggregates; + } + + @Override + public String toString() { + return "HostAggregates [aggregates=" + aggregates + "]"; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateCreate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateCreate.java index 35d6c8af7..35d840d09 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateCreate.java @@ -1,50 +1,50 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; + /** * The JSON object used to create an host aggregate - * @author chenyan * + * @author chenyan */ @JsonRootName("aggregate") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NovaHostAggregateCreate implements ModelEntity { - private static final long serialVersionUID = 1L; - @JsonProperty("availability_zone") - public String availabilityZone; - public String name; - - public NovaHostAggregateCreate(String name,String availabilityZone){ - this.availabilityZone = availabilityZone; - this.name=name; - - } - - public String getAvailabilityZone() { - return availabilityZone; - } - - public void setAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public String toString() { - return "NovaHostAggregateCreate [availabilityZone=" + availabilityZone - + ", name=" + name + "]"; - } - + private static final long serialVersionUID = 1L; + @JsonProperty("availability_zone") + public String availabilityZone; + public String name; + + public NovaHostAggregateCreate(String name, String availabilityZone) { + this.availabilityZone = availabilityZone; + this.name = name; + + } + + public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "NovaHostAggregateCreate [availabilityZone=" + availabilityZone + + ", name=" + name + "]"; + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateUpdate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateUpdate.java index acc0a74fd..fe477d3e5 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostAggregateUpdate.java @@ -1,50 +1,50 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; + /** * The JSON object used to update an existing aggregate - * + * * @author liujunpeng */ @JsonRootName("aggregate") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NovaHostAggregateUpdate implements ModelEntity { - private static final long serialVersionUID = 1L; - @JsonProperty("availability_zone") - public String availabilityZone; - public String name; - - public NovaHostAggregateUpdate(String name,String availabilityZone){ - this.availabilityZone = availabilityZone; - this.name=name; - - } - - public String getAvailabilityZone() { - return availabilityZone; - } - - public void setAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public String toString() { - return "NovaHostAggregateUpdate [availabilityZone=" + availabilityZone - + ", name=" + name + "]"; - } - + private static final long serialVersionUID = 1L; + @JsonProperty("availability_zone") + public String availabilityZone; + public String name; + + public NovaHostAggregateUpdate(String name, String availabilityZone) { + this.availabilityZone = availabilityZone; + this.name = name; + + } + + public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "NovaHostAggregateUpdate [availabilityZone=" + availabilityZone + + ", name=" + name + "]"; + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResource.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResource.java index ac60cf4d6..7366fed9c 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResource.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResource.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; - -import org.openstack4j.model.compute.HostResource; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.HostResource; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * Nova Host Resource describes the capacity and capability of a compute host that provides compute service @@ -21,126 +20,130 @@ public class NovaHostResource implements HostResource { public static final long serialVersionUID = 1L; private int cpu; - @JsonProperty("disk_gb") + @JsonProperty("disk_gb") private int diskGb; private String host; - @JsonProperty("memory_mb") + @JsonProperty("memory_mb") private int memoryMb; private String project; @JsonProperty("host_name") - public String hostName; - public String service; - public String zone; + public String hostName; + public String service; + public String zone; /** - * {@inheritDoc} - */ - @Override + * {@inheritDoc} + */ + @Override public int getCpu() { return cpu; } - /** - * {@inheritDoc} - */ - @Override + /** + * {@inheritDoc} + */ + @Override public int getDiskInGb() { return diskGb; } - /** - * {@inheritDoc} - */ - @Override + /** + * {@inheritDoc} + */ + @Override public String getHost() { return host; } - /** - * {@inheritDoc} - */ - @Override + /** + * {@inheritDoc} + */ + @Override public int getMemoryInMb() { return memoryMb; } - /** - * {@inheritDoc} - */ - @Override + /** + * {@inheritDoc} + */ + @Override public String getProject() { return project; } - /** - *

Author:Wang Ting/王婷

- * @Title: getService - * @return - * @see org.openstack4j.model.compute.Host#getService() - */ - @Override - public String getService() { - return service; - } - - /** - *

Author:Wang Ting/王婷

- * @Title: getZone - * @return - * @see org.openstack4j.model.compute.Host#getZone() - */ - @Override - public String getZone() { - return zone; - } - - /** - *

Author:Wang Ting/王婷

- * @Title: getHostName - * @return - * @see org.openstack4j.model.compute.Host#getHostName() - */ - @Override - public String getHostName() { - return hostName; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("cpu", cpu) - .add("diskGb", diskGb) - .add("host", host) - .add("memoryMb", memoryMb) - .add("project", project) - .add("hostName", hostName) - .add("service", service) - .add("zone", zone).toString(); - } - - /** - * host aggregates - * @author Wang Ting/王婷 - * - */ - public static class NovaHostResources extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("hosts") - private List hosts; - /** - * NovaHosts - */ - public List value() { - return hosts; - } - - @Override - public String toString() { - return "NovaHostResources [hosts=" + hosts + "]"; - } - - } + /** + *

Author:Wang Ting/王婷

+ * + * @return + * @Title: getService + * @see org.openstack4j.model.compute.Host#getService() + */ + @Override + public String getService() { + return service; + } + + /** + *

Author:Wang Ting/王婷

+ * + * @return + * @Title: getZone + * @see org.openstack4j.model.compute.Host#getZone() + */ + @Override + public String getZone() { + return zone; + } + + /** + *

Author:Wang Ting/王婷

+ * + * @return + * @Title: getHostName + * @see org.openstack4j.model.compute.Host#getHostName() + */ + @Override + public String getHostName() { + return hostName; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("cpu", cpu) + .add("diskGb", diskGb) + .add("host", host) + .add("memoryMb", memoryMb) + .add("project", project) + .add("hostName", hostName) + .add("service", service) + .add("zone", zone).toString(); + } + + /** + * host aggregates + * + * @author Wang Ting/王婷 + */ + public static class NovaHostResources extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("hosts") + private List hosts; + + /** + * NovaHosts + */ + public List value() { + return hosts; + } + + @Override + public String toString() { + return "NovaHostResources [hosts=" + hosts + "]"; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResourceBody.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResourceBody.java index 3f75e658e..ae63c74ad 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResourceBody.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaHostResourceBody.java @@ -1,27 +1,26 @@ package org.openstack4j.openstack.compute.domain; +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.compute.HostResource; import org.openstack4j.model.compute.HostResourceBody; -import com.fasterxml.jackson.annotation.JsonProperty; - /** * Nova Host Resource Body contains Nova host resource - * + * * @author Qin An */ public class NovaHostResourceBody implements HostResourceBody { - public static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; - @JsonProperty("resource") - private NovaHostResource resource; + @JsonProperty("resource") + private NovaHostResource resource; - /** - * {@inheritDoc} - */ - @Override - public HostResource getHostResource() { - return resource; - } + /** + * {@inheritDoc} + */ + @Override + public HostResource getHostResource() { + return resource; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaImage.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaImage.java index 688858393..7e9ba2efa 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaImage.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaImage.java @@ -1,18 +1,17 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Date; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.common.Link; import org.openstack4j.model.compute.Image; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * An OpenStack image is a collection of files used to create a Server. Users provide pre-built OS images by default and or custom @@ -23,153 +22,152 @@ @JsonRootName("image") public class NovaImage implements Image { - private static final long serialVersionUID = 1L; - - private String id; - private Status status; - private String name; - private int progress; - private int minRam; - private int minDisk; - private Date created; - private Date updated; - @JsonProperty("OS-EXT-IMG-SIZE:size") - private long size; - private List links; - @JsonProperty("metadata") - private Map metadata; - - public NovaImage() { - } - - public NovaImage(String empty) { - if (!"".equals(empty)) { - throw new IllegalArgumentException(); - } - } - - - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public long getSize() { - return size; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMinDisk() { - return minDisk; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMinRam() { - return minRam; - } - - /** - * {@inheritDoc} - */ - @Override - public int getProgress() { - return progress; - } - - /** - * {@inheritDoc} - */ - @Override - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreated() { - return created; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdated() { - return updated; - } - - /** - * {@inheritDoc} - */ - @Override - public List getLinks() { - return links; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getMetaData() { - return metadata; - } - - /** - * {@inheritDoc} - */ - @JsonIgnore + private static final long serialVersionUID = 1L; + + private String id; + private Status status; + private String name; + private int progress; + private int minRam; + private int minDisk; + private Date created; + private Date updated; + @JsonProperty("OS-EXT-IMG-SIZE:size") + private long size; + private List links; + @JsonProperty("metadata") + private Map metadata; + + public NovaImage() { + } + + public NovaImage(String empty) { + if (!"".equals(empty)) { + throw new IllegalArgumentException(); + } + } + + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public long getSize() { + return size; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMinDisk() { + return minDisk; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMinRam() { + return minRam; + } + + /** + * {@inheritDoc} + */ + @Override + public int getProgress() { + return progress; + } + + /** + * {@inheritDoc} + */ + @Override + public Status getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreated() { + return created; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdated() { + return updated; + } + + /** + * {@inheritDoc} + */ + @Override + public List getLinks() { + return links; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getMetaData() { + return metadata; + } + + /** + * {@inheritDoc} + */ + @JsonIgnore @Override public boolean isSnapshot() { return getMetaData() != null && getMetaData().containsKey("image_location") && "snapshot".equals(getMetaData().get("image_location")); } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("status", status).add("isSnapshot", isSnapshot()) - .add("progress", progress).add("size", size).add("minRam", minRam) - .add("minDisk", minDisk).add("created", created).add("updated", updated) - .add("metadata", metadata).add("links", links).addValue("\n") - .toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("status", status).add("isSnapshot", isSnapshot()) + .add("progress", progress).add("size", size).add("minRam", minRam) + .add("minDisk", minDisk).add("created", created).add("updated", updated) + .add("metadata", metadata).add("links", links).addValue("\n") + .toString(); + } - public static class NovaImages extends ListResult { + public static class NovaImages extends ListResult { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("images") - private List images; + @JsonProperty("images") + private List images; - public List value() { - return images; - } + public List value() { + return images; + } - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInstanceAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInstanceAction.java index 842eafbd8..a6cc50d9e 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInstanceAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInstanceAction.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.compute.InstanceAction; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.InstanceAction; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; @JsonRootName("instanceAction") public class NovaInstanceAction implements InstanceAction { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInterfaceAttachment.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInterfaceAttachment.java index 18144fcfe..15bbc4ccd 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInterfaceAttachment.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaInterfaceAttachment.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.compute.InterfaceAttachment; import org.openstack4j.model.compute.PortState; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonRootName("interfaceAttachment") public class NovaInterfaceAttachment implements InterfaceAttachment { @@ -61,9 +60,9 @@ public PortState getPortState() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("mac_addr", macAddr).add("net_id", netId).add("port_id", portId) - .add("port_state", portState).add("fixed_ips", fixedIps) - .toString(); + .add("mac_addr", macAddr).add("net_id", netId).add("port_id", portId) + .add("port_state", portState).add("fixed_ips", fixedIps) + .toString(); } public static class NovaInterfaceAttachments extends ListResult { @@ -102,7 +101,7 @@ public String getSubnetId() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("ip_address", ipAddress).add("subnet_id", subnetId).toString(); + .add("ip_address", ipAddress).add("subnet_id", subnetId).toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaKeypair.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaKeypair.java index 748b20639..d452032d2 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaKeypair.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaKeypair.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.compute.Keypair; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; +import org.openstack4j.model.compute.Keypair; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; /** * An OpenStack Keypair is an SSH Key @@ -19,154 +18,154 @@ @JsonRootName("keypair") public class NovaKeypair implements Keypair { - private static final long serialVersionUID = 1L; - - private String name; - @JsonProperty("public_key") - private String publicKey; - @JsonProperty("private_key") - private String privateKey; - private String fingerprint; - - @JsonProperty("user_id") - private String userId; - private Boolean deleted; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("updated_at") - private Date updatedAt; - @JsonProperty("deleted_at") - private Date deletedAt; - private Integer id; - - /** - * Used internally by the domain side of the API to create a new Keypair on an OpenStack server - * - * @param name the name of the keypair - * @param publicKey the public key or null to have OS generated one - * @return NovaKeypair - */ - public static NovaKeypair create(String name, String publicKey) { - NovaKeypair kp = new NovaKeypair(); - kp.name = name; - kp.publicKey = publicKey; - return kp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPublicKey() { - return publicKey; - } - - /** - * {@inheritDoc} - */ - @Override + private static final long serialVersionUID = 1L; + + private String name; + @JsonProperty("public_key") + private String publicKey; + @JsonProperty("private_key") + private String privateKey; + private String fingerprint; + + @JsonProperty("user_id") + private String userId; + private Boolean deleted; + @JsonProperty("created_at") + private Date createdAt; + @JsonProperty("updated_at") + private Date updatedAt; + @JsonProperty("deleted_at") + private Date deletedAt; + private Integer id; + + /** + * Used internally by the domain side of the API to create a new Keypair on an OpenStack server + * + * @param name the name of the keypair + * @param publicKey the public key or null to have OS generated one + * @return NovaKeypair + */ + public static NovaKeypair create(String name, String publicKey) { + NovaKeypair kp = new NovaKeypair(); + kp.name = name; + kp.publicKey = publicKey; + return kp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getPublicKey() { + return publicKey; + } + + /** + * {@inheritDoc} + */ + @Override public String getPrivateKey() { return privateKey; } - /** - * {@inheritDoc} - */ - @Override - public String getFingerprint() { - return fingerprint; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUserId() { - return this.userId; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean getDeleted() { - return this.deleted; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreatedAt() { - return this.createdAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return this.updatedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getDeletedAt() { - return this.deletedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getId() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("public_key", publicKey).add("private_key", privateKey).add("fingerprint", fingerprint) - .add("user_id", userId).add("deleted", deleted).add("created_at", createdAt).add("updated_at", updatedAt) - .add("deleted_at", deletedAt).add("id", id).toString(); - } - - public static class Keypairs extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("keypairs") - private List wrapped; - private transient List unwrapped; - - @Override - protected List value() { - if (wrapped != null && unwrapped == null) { - unwrapped = Lists.newArrayList(); - for (KeyPairWrapper kp : wrapped) - unwrapped.add(kp.keypair); - } - return unwrapped; - } - - static final class KeyPairWrapper { - @JsonProperty - private NovaKeypair keypair; - - } - - } + /** + * {@inheritDoc} + */ + @Override + public String getFingerprint() { + return fingerprint; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUserId() { + return this.userId; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean getDeleted() { + return this.deleted; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedAt() { + return this.createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return this.updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getDeletedAt() { + return this.deletedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getId() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", name).add("public_key", publicKey).add("private_key", privateKey).add("fingerprint", fingerprint) + .add("user_id", userId).add("deleted", deleted).add("created_at", createdAt).add("updated_at", updatedAt) + .add("deleted_at", deletedAt).add("id", id).toString(); + } + + public static class Keypairs extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("keypairs") + private List wrapped; + private transient List unwrapped; + + @Override + protected List value() { + if (wrapped != null && unwrapped == null) { + unwrapped = Lists.newArrayList(); + for (KeyPairWrapper kp : wrapped) + unwrapped.add(kp.keypair); + } + return unwrapped; + } + + static final class KeyPairWrapper { + @JsonProperty + private NovaKeypair keypair; + + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaLimits.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaLimits.java index dff41ee12..51c26d872 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaLimits.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaLimits.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.compute.AbsoluteLimit; import org.openstack4j.model.compute.Limits; import org.openstack4j.model.compute.RateLimit; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * Accounts may be pre-configured with a set of thresholds (or limits) to manage capacity and prevent abuse of the system. @@ -20,34 +19,35 @@ @JsonRootName("limits") public class NovaLimits implements Limits { - private static final long serialVersionUID = 1L; - - private List rate; - private NovaAbsoluteLimit absolute; - /** - * {@inheritDoc} - */ - @Override - public List getRate() { - return rate; - } - - /** - * {@inheritDoc} - */ - @Override - public AbsoluteLimit getAbsolute() { - return absolute; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("rate", rate).add("absolute", absolute) - .toString(); - } + private static final long serialVersionUID = 1L; + + private List rate; + private NovaAbsoluteLimit absolute; + + /** + * {@inheritDoc} + */ + @Override + public List getRate() { + return rate; + } + + /** + * {@inheritDoc} + */ + @Override + public AbsoluteLimit getAbsolute() { + return absolute; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("rate", rate).add("absolute", absolute) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaNetworkCreate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaNetworkCreate.java index f173abf9d..d01ead528 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaNetworkCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaNetworkCreate.java @@ -1,57 +1,57 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.compute.NetworkCreate; - import com.fasterxml.jackson.annotation.JsonProperty; +import org.openstack4j.model.compute.NetworkCreate; public class NovaNetworkCreate implements NetworkCreate { - private static final long serialVersionUID = 1L; - - @JsonProperty("uuid") - private String id; - @JsonProperty("fixed_ip") - private String fixedIp; - - private String port; - - public NovaNetworkCreate() { } - - public void setId(String id) { - this.id = id; - } - - public void setFixedIp(String fixedIp) { - this.fixedIp = fixedIp; - } - - public void setPort(String port) { - this.port = port; - } - - public NovaNetworkCreate(String id, String fixedIp) { - this.id = id; - this.fixedIp = fixedIp; - } - - public NovaNetworkCreate(String id, String fixedIp, String port) { - this.id = id; - this.fixedIp = fixedIp; - this.port = port; - } - - @Override - public String getId() { - return id; - } - - @Override - public String getFixedIp() { - return fixedIp; - } - - public String getPort() { - return port; - } + private static final long serialVersionUID = 1L; + + @JsonProperty("uuid") + private String id; + @JsonProperty("fixed_ip") + private String fixedIp; + + private String port; + + public NovaNetworkCreate() { + } + + public void setId(String id) { + this.id = id; + } + + public void setFixedIp(String fixedIp) { + this.fixedIp = fixedIp; + } + + public void setPort(String port) { + this.port = port; + } + + public NovaNetworkCreate(String id, String fixedIp) { + this.id = id; + this.fixedIp = fixedIp; + } + + public NovaNetworkCreate(String id, String fixedIp, String port) { + this.id = id; + this.fixedIp = fixedIp; + this.port = port; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getFixedIp() { + return fixedIp; + } + + public String getPort() { + return port; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaPassword.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaPassword.java index f20ffc69d..349f3d725 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaPassword.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaPassword.java @@ -1,20 +1,19 @@ package org.openstack4j.openstack.compute.domain; +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.compute.ServerPassword; -import com.fasterxml.jackson.annotation.JsonProperty; /** * A model class to return the password of the server - * - * @author vinod borole * + * @author vinod borole */ public class NovaPassword implements ServerPassword { private static final long serialVersionUID = 1L; @JsonProperty private String password; - + /** * {@inheritDoc} */ @@ -22,6 +21,6 @@ public class NovaPassword implements ServerPassword { public String getPassword() { return password; } - - + + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSet.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSet.java index 521632a67..d1c0f17cb 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSet.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSet.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.compute.QuotaSet; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.QuotaSet; /** * An OpenStack Quota-Set @@ -14,168 +13,168 @@ @JsonRootName("quota_set") public class NovaQuotaSet implements QuotaSet { - private static final long serialVersionUID = 1L; - - private String id; - - @JsonProperty("metadata_items") - private int metadataItems; - - @JsonProperty("injected_file_content_bytes") - private int injectedFileContentBytes; - - @JsonProperty("injected_files") - private int injectedFiles; - - private int gigabytes; - private int ram; - - @JsonProperty("floating_ips") - private int floatingIps; - - private int instances; - - private int volumes; - - private int cores; - - @JsonProperty("security_groups") - private int securityGroups; - - @JsonProperty("security_group_rules") - private int securityGroupRules; - - @JsonProperty("injected_file_path_bytes") - private int injectedFilePathBytes; - - @JsonProperty("key_pairs") - private int keyPairs; - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMetadataItems() { - return metadataItems; - } - - /** - * {@inheritDoc} - */ - @Override - public int getInjectedFileContentBytes() { - return injectedFileContentBytes; - } - - /** - * {@inheritDoc} - */ - @Override - public int getInjectedFiles() { - return injectedFiles; - } - - /** - * {@inheritDoc} - */ - @Override - public int getGigabytes() { - return gigabytes; - } - - /** - * {@inheritDoc} - */ - @Override - public int getRam() { - return ram; - } - - /** - * {@inheritDoc} - */ - @Override - public int getFloatingIps() { - return floatingIps; - } - - /** - * {@inheritDoc} - */ - @Override - public int getInstances() { - return instances; - } - - /** - * {@inheritDoc} - */ - @Override - public int getVolumes() { - return volumes; - } - - /** - * {@inheritDoc} - */ - @Override - public int getCores() { - return cores; - } - - /** - * {@inheritDoc} - */ - @Override - public int getSecurityGroups() { - return securityGroups; - } - - /** - * {@inheritDoc} - */ - @Override - public int getSecurityGroupRules() { - return securityGroupRules; - } - - /** - * {@inheritDoc} - */ - @Override - public int getInjectedFilePathBytes() { - return injectedFilePathBytes; - } - - /** - * {@inheritDoc} - */ - @Override - public int getKeyPairs() { - return keyPairs; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("metadataItems", metadataItems).add("injectedFileContentBytes", injectedFileContentBytes) - .add("injectedFileContentBytes", injectedFileContentBytes).add("injectedFiles", injectedFiles).add("gigabytes", gigabytes) - .add("ram", "ram").add("securityGroups", securityGroups).add("securityGroupRules", securityGroupRules) - .add("cores", cores).add("floatingIps", floatingIps).add("instances", instances).add("volumes", volumes) - .add("injectedFilePathBytes", injectedFilePathBytes).add("keyPairs", keyPairs) - .toString(); - } - - @JsonRootName("quota_class_set") - public static class NovaQuotaSetClass extends NovaQuotaSet { + private static final long serialVersionUID = 1L; + + private String id; + + @JsonProperty("metadata_items") + private int metadataItems; + + @JsonProperty("injected_file_content_bytes") + private int injectedFileContentBytes; + + @JsonProperty("injected_files") + private int injectedFiles; + + private int gigabytes; + private int ram; + + @JsonProperty("floating_ips") + private int floatingIps; + + private int instances; + + private int volumes; + + private int cores; + + @JsonProperty("security_groups") + private int securityGroups; + + @JsonProperty("security_group_rules") + private int securityGroupRules; + + @JsonProperty("injected_file_path_bytes") + private int injectedFilePathBytes; + + @JsonProperty("key_pairs") + private int keyPairs; + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMetadataItems() { + return metadataItems; + } + + /** + * {@inheritDoc} + */ + @Override + public int getInjectedFileContentBytes() { + return injectedFileContentBytes; + } + + /** + * {@inheritDoc} + */ + @Override + public int getInjectedFiles() { + return injectedFiles; + } + + /** + * {@inheritDoc} + */ + @Override + public int getGigabytes() { + return gigabytes; + } + + /** + * {@inheritDoc} + */ + @Override + public int getRam() { + return ram; + } + + /** + * {@inheritDoc} + */ + @Override + public int getFloatingIps() { + return floatingIps; + } + + /** + * {@inheritDoc} + */ + @Override + public int getInstances() { + return instances; + } + + /** + * {@inheritDoc} + */ + @Override + public int getVolumes() { + return volumes; + } + + /** + * {@inheritDoc} + */ + @Override + public int getCores() { + return cores; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSecurityGroups() { + return securityGroups; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSecurityGroupRules() { + return securityGroupRules; + } + + /** + * {@inheritDoc} + */ + @Override + public int getInjectedFilePathBytes() { + return injectedFilePathBytes; + } + + /** + * {@inheritDoc} + */ + @Override + public int getKeyPairs() { + return keyPairs; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("metadataItems", metadataItems).add("injectedFileContentBytes", injectedFileContentBytes) + .add("injectedFileContentBytes", injectedFileContentBytes).add("injectedFiles", injectedFiles).add("gigabytes", gigabytes) + .add("ram", "ram").add("securityGroups", securityGroups).add("securityGroupRules", securityGroupRules) + .add("cores", cores).add("floatingIps", floatingIps).add("instances", instances).add("volumes", volumes) + .add("injectedFilePathBytes", injectedFilePathBytes).add("keyPairs", keyPairs) + .toString(); + } + + @JsonRootName("quota_class_set") + public static class NovaQuotaSetClass extends NovaQuotaSet { private static final long serialVersionUID = 1L; - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSetUpdate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSetUpdate.java index def722f8b..867287e37 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSetUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSetUpdate.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.compute.QuotaSetUpdate; -import org.openstack4j.model.compute.builder.QuotaSetUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.QuotaSetUpdate; +import org.openstack4j.model.compute.builder.QuotaSetUpdateBuilder; public class NovaQuotaSetUpdate implements QuotaSetUpdate { @@ -18,7 +17,7 @@ public class NovaQuotaSetUpdate implements QuotaSetUpdate { @JsonProperty("injected_files") private Integer injectedFiles; - + @JsonProperty private Integer ram; @@ -44,52 +43,51 @@ public class NovaQuotaSetUpdate implements QuotaSetUpdate { private Integer keyPairs; public NovaQuotaSetUpdate() { - super(); + super(); } - - - + + protected NovaQuotaSetUpdate(Integer metadataItems, - Integer injectedFileContentBytes, Integer injectedFiles, - Integer ram, Integer floatingIps, Integer instances, - Integer cores, Integer securityGroups, - Integer securityGroupRules, Integer injectedFilePathBytes, - Integer keyPairs) { - super(); - this.metadataItems = metadataItems; - this.injectedFileContentBytes = injectedFileContentBytes; - this.injectedFiles = injectedFiles; - this.ram = ram; - this.floatingIps = floatingIps; - this.instances = instances; - this.cores = cores; - this.securityGroups = securityGroups; - this.securityGroupRules = securityGroupRules; - this.injectedFilePathBytes = injectedFilePathBytes; - this.keyPairs = keyPairs; - } - - @Override + Integer injectedFileContentBytes, Integer injectedFiles, + Integer ram, Integer floatingIps, Integer instances, + Integer cores, Integer securityGroups, + Integer securityGroupRules, Integer injectedFilePathBytes, + Integer keyPairs) { + super(); + this.metadataItems = metadataItems; + this.injectedFileContentBytes = injectedFileContentBytes; + this.injectedFiles = injectedFiles; + this.ram = ram; + this.floatingIps = floatingIps; + this.instances = instances; + this.cores = cores; + this.securityGroups = securityGroups; + this.securityGroupRules = securityGroupRules; + this.injectedFilePathBytes = injectedFilePathBytes; + this.keyPairs = keyPairs; + } + + @Override public QuotaSetUpdateBuilder toBuilder() { return new QuotaSetUpdateConcreteBuilder(this); } - + public static QuotaSetUpdateBuilder builder() { return new QuotaSetUpdateConcreteBuilder(); } - + public static class QuotaSetUpdateConcreteBuilder implements QuotaSetUpdateBuilder { private NovaQuotaSetUpdate model; - + public QuotaSetUpdateConcreteBuilder() { this.model = new NovaQuotaSetUpdate(); } - + public QuotaSetUpdateConcreteBuilder(QuotaSetUpdate model) { this.model = (NovaQuotaSetUpdate) model; } - + @Override public QuotaSetUpdate build() { return model; @@ -166,53 +164,53 @@ public QuotaSetUpdateBuilder keyPairs(int keyPairs) { return this; } } - + @JsonRootName("quota_set") public static class NovaQuotaSetUpdateTenant extends NovaQuotaSetUpdate { - private static final long serialVersionUID = 1L; - - public NovaQuotaSetUpdateTenant(Integer metadataItems, - Integer injectedFileContentBytes, Integer injectedFiles, - Integer ram, Integer floatingIps, - Integer instances, Integer cores, - Integer securityGroups, Integer securityGroupRules, - Integer injectedFilePathBytes, Integer keyPairs) { - super(metadataItems, injectedFileContentBytes, injectedFiles, ram, - floatingIps, instances, cores, securityGroups, securityGroupRules, - injectedFilePathBytes, keyPairs); - } - - public static NovaQuotaSetUpdateTenant from(QuotaSetUpdate qs) { - NovaQuotaSetUpdate nqs = (NovaQuotaSetUpdate) qs; - return new NovaQuotaSetUpdateTenant(nqs.metadataItems, nqs.injectedFileContentBytes, nqs.injectedFiles, - nqs.ram, nqs.floatingIps, nqs.instances, nqs.cores, nqs.securityGroups, - nqs.securityGroupRules, nqs.injectedFilePathBytes, nqs.keyPairs); - } + private static final long serialVersionUID = 1L; + + public NovaQuotaSetUpdateTenant(Integer metadataItems, + Integer injectedFileContentBytes, Integer injectedFiles, + Integer ram, Integer floatingIps, + Integer instances, Integer cores, + Integer securityGroups, Integer securityGroupRules, + Integer injectedFilePathBytes, Integer keyPairs) { + super(metadataItems, injectedFileContentBytes, injectedFiles, ram, + floatingIps, instances, cores, securityGroups, securityGroupRules, + injectedFilePathBytes, keyPairs); + } + + public static NovaQuotaSetUpdateTenant from(QuotaSetUpdate qs) { + NovaQuotaSetUpdate nqs = (NovaQuotaSetUpdate) qs; + return new NovaQuotaSetUpdateTenant(nqs.metadataItems, nqs.injectedFileContentBytes, nqs.injectedFiles, + nqs.ram, nqs.floatingIps, nqs.instances, nqs.cores, nqs.securityGroups, + nqs.securityGroupRules, nqs.injectedFilePathBytes, nqs.keyPairs); + } } - + @JsonRootName("quota_class_set") public static class NovaQuotaSetUpdateClass extends NovaQuotaSetUpdate { - private static final long serialVersionUID = 1L; - - public NovaQuotaSetUpdateClass(Integer metadataItems, - Integer injectedFileContentBytes, Integer injectedFiles, - Integer ram, Integer floatingIps, - Integer instances, Integer cores, - Integer securityGroups, Integer securityGroupRules, - Integer injectedFilePathBytes, Integer keyPairs) { - super(metadataItems, injectedFileContentBytes, injectedFiles, ram, - floatingIps, instances, cores, securityGroups, securityGroupRules, - injectedFilePathBytes, keyPairs); - } - - public static NovaQuotaSetUpdateClass from(QuotaSetUpdate qs) { - NovaQuotaSetUpdate nqs = (NovaQuotaSetUpdate) qs; - return new NovaQuotaSetUpdateClass(nqs.metadataItems, nqs.injectedFileContentBytes, nqs.injectedFiles, - nqs.ram, nqs.floatingIps, nqs.instances, nqs.cores, nqs.securityGroups, - nqs.securityGroupRules, nqs.injectedFilePathBytes, nqs.keyPairs); - } + private static final long serialVersionUID = 1L; + + public NovaQuotaSetUpdateClass(Integer metadataItems, + Integer injectedFileContentBytes, Integer injectedFiles, + Integer ram, Integer floatingIps, + Integer instances, Integer cores, + Integer securityGroups, Integer securityGroupRules, + Integer injectedFilePathBytes, Integer keyPairs) { + super(metadataItems, injectedFileContentBytes, injectedFiles, ram, + floatingIps, instances, cores, securityGroups, securityGroupRules, + injectedFilePathBytes, keyPairs); + } + + public static NovaQuotaSetUpdateClass from(QuotaSetUpdate qs) { + NovaQuotaSetUpdate nqs = (NovaQuotaSetUpdate) qs; + return new NovaQuotaSetUpdateClass(nqs.metadataItems, nqs.injectedFileContentBytes, nqs.injectedFiles, + nqs.ram, nqs.floatingIps, nqs.instances, nqs.cores, nqs.securityGroups, + nqs.securityGroupRules, nqs.injectedFilePathBytes, nqs.keyPairs); + } } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaRateLimit.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaRateLimit.java index 6baa6f60a..e05afaa21 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaRateLimit.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaRateLimit.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.compute.domain; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.RateLimit; + import java.io.Serializable; import java.util.Date; import java.util.List; -import org.openstack4j.model.compute.RateLimit; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; - /** * Rate limits are specified in terms of both a human-readable wild-card URI and a machine-processable regular expression. * The human-readable limit is intended for displaying in graphical user interfaces. The machine-processable form is @@ -18,117 +17,117 @@ */ public class NovaRateLimit implements RateLimit { - private static final long serialVersionUID = 1L; - - private String regex; - private String uri; - private List limit; - - /** - * {@inheritDoc} - */ - @Override - public String getRegex() { - return regex; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUri() { - return uri; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("limit", limit).add("regex", regex).add("uri", uri) - .toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public List getLimit() { - return limit; - } - - public static class NovaLimitEntry implements LimitEntry, Serializable { - - private static final long serialVersionUID = 1L; - - @JsonProperty("next-available") - private Date nextAvailable; - private String unit; - private String verb; - private int remaining; - private int available; - private int value; - - /** - * {@inheritDoc} - */ - @Override - public Date getNextAvailable() { - return nextAvailable; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUnit() { - return unit; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVerb() { - return verb; - } - - /** - * {@inheritDoc} - */ - @Override - public int getRemaining() { - return remaining; - } - - /** - * {@inheritDoc} - */ - @Override - public int getAvailable() { - return available; - } - - /** - * {@inheritDoc} - */ - @Override - public int getValue() { - return value; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("next-available", nextAvailable).add("remaining", remaining).add("unit", unit) - .add("value", value).add("available", available).add("verb", verb) - .toString(); - } - - } + private static final long serialVersionUID = 1L; + + private String regex; + private String uri; + private List limit; + + /** + * {@inheritDoc} + */ + @Override + public String getRegex() { + return regex; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUri() { + return uri; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("limit", limit).add("regex", regex).add("uri", uri) + .toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public List getLimit() { + return limit; + } + + public static class NovaLimitEntry implements LimitEntry, Serializable { + + private static final long serialVersionUID = 1L; + + @JsonProperty("next-available") + private Date nextAvailable; + private String unit; + private String verb; + private int remaining; + private int available; + private int value; + + /** + * {@inheritDoc} + */ + @Override + public Date getNextAvailable() { + return nextAvailable; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUnit() { + return unit; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVerb() { + return verb; + } + + /** + * {@inheritDoc} + */ + @Override + public int getRemaining() { + return remaining; + } + + /** + * {@inheritDoc} + */ + @Override + public int getAvailable() { + return available; + } + + /** + * {@inheritDoc} + */ + @Override + public int getValue() { + return value; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("next-available", nextAvailable).add("remaining", remaining).add("unit", unit) + .add("value", value).add("available", available).add("verb", verb) + .toString(); + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecGroupExtension.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecGroupExtension.java index 0a19e90de..e8692e1df 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecGroupExtension.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecGroupExtension.java @@ -1,7 +1,8 @@ package org.openstack4j.openstack.compute.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.common.Link; import org.openstack4j.model.compute.IPProtocol; import org.openstack4j.model.compute.SecGroupExtension; @@ -9,9 +10,7 @@ import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * A Security Group which is defined the the (os-security-groups) extension @@ -21,340 +20,339 @@ @JsonRootName("security_group") public class NovaSecGroupExtension implements SecGroupExtension { - private static final long serialVersionUID = 1L; - - private String id; - private String name; - private String description; - @JsonProperty("tenant_id") - private String tenantId; - private List rules; - private List links; - - /** - * Security Groups only need two fields populated when Created so instead of a builder the API can - * leverage this call to create a new Security Group - * - * @param name name of the security group - * @param description description of the security group - * @return - */ - public static NovaSecGroupExtension create(String name, String description) { - NovaSecGroupExtension sg = new NovaSecGroupExtension(); - sg.name = name; - sg.description = description; - return sg; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public List getRules() { - return rules; - } - - /** - * {@inheritDoc} - */ - @Override - public List getLinks() { - return links; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("description", description) - .add("tenantId", tenantId).add("rules", rules).add("links", links) - .toString(); - } - - - public static class SecurityGroups extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("security_groups") - private List groups; - - @Override - protected List value() { - return groups; - } - } - - /** - * Security Group Rule - */ - @JsonRootName("security_group_rule") - public static class SecurityGroupRule implements SecGroupExtension.Rule { - - private static final long serialVersionUID = 1L; - - private String id; - - private String name; - - @JsonProperty("parent_group_id") - private String parentGroupId; - - @JsonProperty("from_port") - private Integer fromPort; - - @JsonProperty("to_port") - private Integer toPort; - - @JsonProperty("ip_protocol") - private IPProtocol ipProtocol; - - @JsonProperty("ip_range") - private RuleIpRange ipRange; - private RuleGroup group; - - // Used for Create Only - @JsonProperty("cidr") - String cidr; - - @JsonProperty("group_id") - String groupId; - - /** - * {@inheritDoc} - */ - @Override - public IPProtocol getIPProtocol() { - return (ipProtocol != null) ? ipProtocol : IPProtocol.UNRECOGNIZED; - } - - /** - * {@inheritDoc} - */ - @Override - public Group getGroup() { - return group; - } - - /** - * {@inheritDoc} - */ - @Override - public IpRange getRange() { - return ipRange; - } - - /** - * {@inheritDoc} - */ - @Override - public int getToPort() { - return (toPort != null) ? toPort : 0; - } - - /** - * {@inheritDoc} - */ - @Override - public int getFromPort() { - return (fromPort != null) ? fromPort : 0; - } - - /** - * {@inheritDoc} - */ - @Override - public String getParentGroupId() { - return parentGroupId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - public String toString() { - return MoreObjects.toStringHelper("Rule").omitNullValues() - .add("id", id).add("name", name).add("parentGroupId", parentGroupId) - .add("fromPort", fromPort).add("toPort", toPort).add("ipProtocol", ipProtocol) - .add("range", ipRange).add("group", group) - .toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityGroupRuleBuilder toBuilder() { - return new RuleConcreteBuilder(this); - } - - public static SecurityGroupRuleBuilder builder() { - return new RuleConcreteBuilder(); - } - - public static class RuleConcreteBuilder implements SecurityGroupRuleBuilder - { - - private SecurityGroupRule m; - - RuleConcreteBuilder() { - this(new SecurityGroupRule()); - } - - RuleConcreteBuilder(SecurityGroupRule m) { - this.m = m; - } - - @Override - public SecurityGroupRuleBuilder protocol(IPProtocol protocol) { - m.ipProtocol = protocol; - return this; - } - - @Override - public SecurityGroupRuleBuilder range(int fromPort, int toPort) { - m.fromPort = fromPort; - m.toPort = toPort; - return this; - } - - @Override - public SecurityGroupRuleBuilder cidr(String cidr) { - m.cidr = cidr; - return this; - } - - @Override - public SecurityGroupRuleBuilder groupId(String groupId) { - m.groupId = groupId; - return this; - } - - @Override - public SecurityGroupRuleBuilder parentGroupId(String parentGroupId) { - m.parentGroupId = parentGroupId; - return this; - } - - @Override - public Rule build() { - return m; - } - - @Override - public SecurityGroupRuleBuilder from(Rule in) { - m = (SecurityGroupRule) in; - return this; - } - - } - - /** - * Security Group Rule -> Group - */ - public static class RuleGroup implements Group { - - private String name; - - @JsonProperty("tenant_id") - private String tenantId; - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues().add("name", name).add("tenantId", tenantId).toString(); - } - - } - - /** - * Security Group Rule -> IP Range - */ - public static class RuleIpRange implements IpRange { - - private String cidr; - - /** - * {@inheritDoc} - */ - @Override - public String getCidr() { - return cidr; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("cidr", cidr).toString(); - } - - } - } + private static final long serialVersionUID = 1L; + + private String id; + private String name; + private String description; + @JsonProperty("tenant_id") + private String tenantId; + private List rules; + private List links; + + /** + * Security Groups only need two fields populated when Created so instead of a builder the API can + * leverage this call to create a new Security Group + * + * @param name name of the security group + * @param description description of the security group + * @return + */ + public static NovaSecGroupExtension create(String name, String description) { + NovaSecGroupExtension sg = new NovaSecGroupExtension(); + sg.name = name; + sg.description = description; + return sg; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public List getRules() { + return rules; + } + + /** + * {@inheritDoc} + */ + @Override + public List getLinks() { + return links; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("description", description) + .add("tenantId", tenantId).add("rules", rules).add("links", links) + .toString(); + } + + + public static class SecurityGroups extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("security_groups") + private List groups; + + @Override + protected List value() { + return groups; + } + } + + /** + * Security Group Rule + */ + @JsonRootName("security_group_rule") + public static class SecurityGroupRule implements SecGroupExtension.Rule { + + private static final long serialVersionUID = 1L; + + private String id; + + private String name; + + @JsonProperty("parent_group_id") + private String parentGroupId; + + @JsonProperty("from_port") + private Integer fromPort; + + @JsonProperty("to_port") + private Integer toPort; + + @JsonProperty("ip_protocol") + private IPProtocol ipProtocol; + + @JsonProperty("ip_range") + private RuleIpRange ipRange; + private RuleGroup group; + + // Used for Create Only + @JsonProperty("cidr") + String cidr; + + @JsonProperty("group_id") + String groupId; + + /** + * {@inheritDoc} + */ + @Override + public IPProtocol getIPProtocol() { + return (ipProtocol != null) ? ipProtocol : IPProtocol.UNRECOGNIZED; + } + + /** + * {@inheritDoc} + */ + @Override + public Group getGroup() { + return group; + } + + /** + * {@inheritDoc} + */ + @Override + public IpRange getRange() { + return ipRange; + } + + /** + * {@inheritDoc} + */ + @Override + public int getToPort() { + return (toPort != null) ? toPort : 0; + } + + /** + * {@inheritDoc} + */ + @Override + public int getFromPort() { + return (fromPort != null) ? fromPort : 0; + } + + /** + * {@inheritDoc} + */ + @Override + public String getParentGroupId() { + return parentGroupId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + public String toString() { + return MoreObjects.toStringHelper("Rule").omitNullValues() + .add("id", id).add("name", name).add("parentGroupId", parentGroupId) + .add("fromPort", fromPort).add("toPort", toPort).add("ipProtocol", ipProtocol) + .add("range", ipRange).add("group", group) + .toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public SecurityGroupRuleBuilder toBuilder() { + return new RuleConcreteBuilder(this); + } + + public static SecurityGroupRuleBuilder builder() { + return new RuleConcreteBuilder(); + } + + public static class RuleConcreteBuilder implements SecurityGroupRuleBuilder { + + private SecurityGroupRule m; + + RuleConcreteBuilder() { + this(new SecurityGroupRule()); + } + + RuleConcreteBuilder(SecurityGroupRule m) { + this.m = m; + } + + @Override + public SecurityGroupRuleBuilder protocol(IPProtocol protocol) { + m.ipProtocol = protocol; + return this; + } + + @Override + public SecurityGroupRuleBuilder range(int fromPort, int toPort) { + m.fromPort = fromPort; + m.toPort = toPort; + return this; + } + + @Override + public SecurityGroupRuleBuilder cidr(String cidr) { + m.cidr = cidr; + return this; + } + + @Override + public SecurityGroupRuleBuilder groupId(String groupId) { + m.groupId = groupId; + return this; + } + + @Override + public SecurityGroupRuleBuilder parentGroupId(String parentGroupId) { + m.parentGroupId = parentGroupId; + return this; + } + + @Override + public Rule build() { + return m; + } + + @Override + public SecurityGroupRuleBuilder from(Rule in) { + m = (SecurityGroupRule) in; + return this; + } + + } + + /** + * Security Group Rule -> Group + */ + public static class RuleGroup implements Group { + + private String name; + + @JsonProperty("tenant_id") + private String tenantId; + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("name", name).add("tenantId", tenantId).toString(); + } + + } + + /** + * Security Group Rule -> IP Range + */ + public static class RuleIpRange implements IpRange { + + private String cidr; + + /** + * {@inheritDoc} + */ + @Override + public String getCidr() { + return cidr; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("cidr", cidr).toString(); + } + + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecurityGroup.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecurityGroup.java index feb2510c9..05044ab40 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecurityGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSecurityGroup.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.compute.SecurityGroup; - import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.SecurityGroup; @JsonRootName("security_groups") public class NovaSecurityGroup implements SecurityGroup { private static final long serialVersionUID = 1L; private String name; - + @Override public String getName() { return name; diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServer.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServer.java index 499ab0b1f..170068b62 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServer.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServer.java @@ -1,309 +1,300 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Collections; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; import org.openstack4j.api.Apis; import org.openstack4j.model.common.Link; import org.openstack4j.model.common.functions.IdEntityToString; -import org.openstack4j.model.compute.Addresses; -import org.openstack4j.model.compute.Fault; -import org.openstack4j.model.compute.Flavor; -import org.openstack4j.model.compute.Image; -import org.openstack4j.model.compute.Server; +import org.openstack4j.model.compute.*; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.IdResourceEntity; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; +import java.util.*; @JsonRootName("server") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NovaServer implements Server { - public static final long serialVersionUID = 1L; - public String id; - public String name; - public NovaAddresses addresses; - public List links; - public Object image; - public NovaFlavor flavor; - public String accessIPv4; - public String accessIPv6; - @JsonProperty("config_drive") - public String configDrive; - public Status status; - public Integer progress; - public NovaFault fault; - @JsonProperty("tenant_id") - public String tenantId; - @JsonProperty("user_id") - public String userId; - @JsonProperty("key_name") - public String keyName; - public String hostId; - public Date updated; - public Date created; - public Map metadata; - - @JsonProperty("security_groups") - private List securityGroups; - - @JsonProperty("OS-EXT-STS:task_state") - private String taskState; - @JsonProperty("OS-EXT-STS:power_state") - private String powerState; - @JsonProperty("OS-EXT-STS:vm_state") - private String vmState; - @JsonProperty("OS-EXT-SRV-ATTR:host") - private String host; - @JsonProperty("OS-EXT-SRV-ATTR:instance_name") - private String instanceName; - @JsonProperty("OS-EXT-SRV-ATTR:hypervisor_hostname") - private String hypervisorHostname; - @JsonProperty("OS-DCF:diskConfig") - private DiskConfig diskConfig; - @JsonProperty("OS-EXT-AZ:availability_zone") - private String availabilityZone; - @JsonProperty("OS-SRV-USG:launched_at") - private Date launchedAt; - @JsonProperty("OS-SRV-USG:terminated_at") - private Date terminatedAt; - @JsonProperty("os-extended-volumes:volumes_attached") - private List osExtendedVolumesAttached; - private String uuid; - private String adminPass; - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public Addresses getAddresses() { - return addresses; - } - - @Override - public List getLinks() { - return links; - } - - @JsonIgnore - @Override - public String getImageId() { + public static final long serialVersionUID = 1L; + public String id; + public String name; + public NovaAddresses addresses; + public List links; + public Object image; + public NovaFlavor flavor; + public String accessIPv4; + public String accessIPv6; + @JsonProperty("config_drive") + public String configDrive; + public Status status; + public Integer progress; + public NovaFault fault; + @JsonProperty("tenant_id") + public String tenantId; + @JsonProperty("user_id") + public String userId; + @JsonProperty("key_name") + public String keyName; + public String hostId; + public Date updated; + public Date created; + public Map metadata; + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonProperty("OS-EXT-STS:task_state") + private String taskState; + @JsonProperty("OS-EXT-STS:power_state") + private String powerState; + @JsonProperty("OS-EXT-STS:vm_state") + private String vmState; + @JsonProperty("OS-EXT-SRV-ATTR:host") + private String host; + @JsonProperty("OS-EXT-SRV-ATTR:instance_name") + private String instanceName; + @JsonProperty("OS-EXT-SRV-ATTR:hypervisor_hostname") + private String hypervisorHostname; + @JsonProperty("OS-DCF:diskConfig") + private DiskConfig diskConfig; + @JsonProperty("OS-EXT-AZ:availability_zone") + private String availabilityZone; + @JsonProperty("OS-SRV-USG:launched_at") + private Date launchedAt; + @JsonProperty("OS-SRV-USG:terminated_at") + private Date terminatedAt; + @JsonProperty("os-extended-volumes:volumes_attached") + private List osExtendedVolumesAttached; + private String uuid; + private String adminPass; + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public Addresses getAddresses() { + return addresses; + } + + @Override + public List getLinks() { + return links; + } + + @JsonIgnore + @Override + public String getImageId() { /*Image image = getImage(); return (image != null) ? image.getId() : null;*/ - if(image instanceof Map) { - Map map = (Map) image; - return map.get("id"); - } - return null; - } - - @SuppressWarnings("rawtypes") - @Override - public Image getImage() { - if (image instanceof LinkedHashMap) { - LinkedHashMap map = (LinkedHashMap) image; - String imageId = (String) map.get("id"); - if (imageId == null || imageId.isEmpty()) { - return null; - } - NovaImage novaImage = (NovaImage) Apis.getComputeServices().images().get(imageId); - return novaImage; - } - return null; - } - - @JsonIgnore - @Override - public String getFlavorId() { - return (flavor != null) ? flavor.getId() : null; - } - - @Override - public Flavor getFlavor() { - if (flavor != null && flavor.getName() == null) - flavor = (NovaFlavor) Apis.getComputeServices().flavors().get(flavor.getId()); - return flavor; - } - - @Override - public String getAccessIPv4() { - return accessIPv4; - } - - @Override - public String getAccessIPv6() { - return accessIPv6; - } - - @Override - public String getConfigDrive() { - return configDrive; - } - - @Override - public Status getStatus() { - return status; - } - - @Override - public int getProgress() { - return (progress != null) ? progress : 0; - } - - @Override - public Fault getFault() { - return fault; - } - - @Override - public String getTenantId() { - return tenantId; - } - - @Override - public String getUserId() { - return userId; - } - - @Override - public String getKeyName() { - return keyName; - } - - @Override - public String getHostId() { - return hostId; - } - - @Override - public Date getUpdated() { - return updated; - } - - @Override - public Date getCreated() { - return created; - } - - @Override - public Map getMetadata() { - return metadata; - } + if (image instanceof Map) { + Map map = (Map) image; + return map.get("id"); + } + return null; + } + + @SuppressWarnings("rawtypes") + @Override + public Image getImage() { + if (image instanceof LinkedHashMap) { + LinkedHashMap map = (LinkedHashMap) image; + String imageId = (String) map.get("id"); + if (imageId == null || imageId.isEmpty()) { + return null; + } + NovaImage novaImage = (NovaImage) Apis.getComputeServices().images().get(imageId); + return novaImage; + } + return null; + } + + @JsonIgnore + @Override + public String getFlavorId() { + return (flavor != null) ? flavor.getId() : null; + } + + @Override + public Flavor getFlavor() { + if (flavor != null && flavor.getName() == null) + flavor = (NovaFlavor) Apis.getComputeServices().flavors().get(flavor.getId()); + return flavor; + } + + @Override + public String getAccessIPv4() { + return accessIPv4; + } + + @Override + public String getAccessIPv6() { + return accessIPv6; + } + + @Override + public String getConfigDrive() { + return configDrive; + } + + @Override + public Status getStatus() { + return status; + } + + @Override + public int getProgress() { + return (progress != null) ? progress : 0; + } + + @Override + public Fault getFault() { + return fault; + } + + @Override + public String getTenantId() { + return tenantId; + } + + @Override + public String getUserId() { + return userId; + } + + @Override + public String getKeyName() { + return keyName; + } + + @Override + public String getHostId() { + return hostId; + } + + @Override + public Date getUpdated() { + return updated; + } + + @Override + public Date getCreated() { + return created; + } + + @Override + public Map getMetadata() { + return metadata; + } @Override public List getSecurityGroups() { return securityGroups; } - @Override - public String getTaskState() { - return taskState; - } - - @Override - public String getPowerState() { - return powerState; - } - - @Override - public String getVmState() { - return vmState; - } - - @Override - public String getHost() { - return host; - } - - @Override - public String getInstanceName() { - return instanceName; - } - - @Override - public String getHypervisorHostname() { - return hypervisorHostname; - } - - @Override - public DiskConfig getDiskConfig() { - return diskConfig; - } - - @Override - public String getAvailabilityZone() { - return availabilityZone; - } - - @Override - public Date getLaunchedAt() { - return launchedAt; - } - - @Override - public Date getTerminatedAt() { - return terminatedAt; - } - - @SuppressWarnings("unchecked") + @Override + public String getTaskState() { + return taskState; + } + + @Override + public String getPowerState() { + return powerState; + } + + @Override + public String getVmState() { + return vmState; + } + + @Override + public String getHost() { + return host; + } + + @Override + public String getInstanceName() { + return instanceName; + } + + @Override + public String getHypervisorHostname() { + return hypervisorHostname; + } + + @Override + public DiskConfig getDiskConfig() { + return diskConfig; + } + + @Override + public String getAvailabilityZone() { + return availabilityZone; + } + + @Override + public Date getLaunchedAt() { + return launchedAt; + } + + @Override + public Date getTerminatedAt() { + return terminatedAt; + } + + @SuppressWarnings("unchecked") @JsonIgnore - @Override - public List getOsExtendedVolumesAttached() { - return (List) ((osExtendedVolumesAttached == null) - ? Collections.emptyList() - : Lists.transform(osExtendedVolumesAttached, IdEntityToString.INSTANCE)); - } - - @Override - public String getUuid() { - return uuid; - } - - @Override - public String getAdminPass() { - return adminPass; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id",id).add("name", name).add("image", image).add("flavor", flavor) - .add("status", status).add("diskconfig", diskConfig).add("userId", userId) - .add("admin-pass", adminPass).add("created", created).add("updated", updated) - .add("launched at", launchedAt).add("tenantId", tenantId).add("hostId", hostId) - .add("addresses", addresses).add("hypervisor host", hypervisorHostname) - .add("uuid", uuid).add("powerstate", powerState).add("fault", fault).add("instanceName", instanceName) - .add("vmState", vmState).add("metadata", metadata) - .toString(); - } - - public static class Servers extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("servers") - private List servers; - - @Override + @Override + public List getOsExtendedVolumesAttached() { + return (List) ((osExtendedVolumesAttached == null) + ? Collections.emptyList() + : Lists.transform(osExtendedVolumesAttached, IdEntityToString.INSTANCE)); + } + + @Override + public String getUuid() { + return uuid; + } + + @Override + public String getAdminPass() { + return adminPass; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("image", image).add("flavor", flavor) + .add("status", status).add("diskconfig", diskConfig).add("userId", userId) + .add("admin-pass", adminPass).add("created", created).add("updated", updated) + .add("launched at", launchedAt).add("tenantId", tenantId).add("hostId", hostId) + .add("addresses", addresses).add("hypervisor host", hypervisorHostname) + .add("uuid", uuid).add("powerstate", powerState).add("fault", fault).add("instanceName", instanceName) + .add("vmState", vmState).add("metadata", metadata) + .toString(); + } + + public static class Servers extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("servers") + private List servers; + + @Override public List value() { - return servers; - } - } + return servers; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreate.java index f48cc4293..b08b9b9bf 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreate.java @@ -1,25 +1,18 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.compute.BlockDeviceMappingCreate; -import org.openstack4j.model.compute.Flavor; -import org.openstack4j.model.compute.Image; -import org.openstack4j.model.compute.NetworkCreate; -import org.openstack4j.model.compute.Personality; -import org.openstack4j.model.compute.SecurityGroup; -import org.openstack4j.model.compute.Server.DiskConfig; -import org.openstack4j.model.compute.ServerCreate; -import org.openstack4j.model.compute.builder.ServerCreateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.fasterxml.jackson.databind.node.BinaryNode; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import org.openstack4j.model.compute.*; +import org.openstack4j.model.compute.Server.DiskConfig; +import org.openstack4j.model.compute.builder.ServerCreateBuilder; + +import java.util.Collections; +import java.util.List; +import java.util.Map; @JsonRootName("server") public class NovaServerCreate implements ServerCreate { @@ -45,7 +38,7 @@ public class NovaServerCreate implements ServerCreate { private String availabilityZone; @JsonProperty("config_drive") private Boolean configDrive; - + @JsonIgnore private transient Map schedulerHints; @@ -73,14 +66,17 @@ public ServerCreateBuilder toBuilder() { public String getName() { return name; } + @Override public String getAdminPass() { return adminPass; } + @Override public String getImageRef() { return imageRef; } + @Override public String getFlavorRef() { return flavorRef; @@ -100,14 +96,17 @@ public String getAccessIPv6() { public Integer getMin() { return min; } + @Override public Integer getMax() { return max; } + @Override public DiskConfig getDiskConfig() { return diskConfig; } + @Override public String getKeyName() { return keyName; @@ -133,7 +132,7 @@ public List getSecurityGroups() { public String getAvailabilityZone() { return availabilityZone; } - + @JsonIgnore @Override public Map getSchedulerHints() { @@ -181,21 +180,25 @@ public void addNetwork(String id, String fixedIP) { @Override public void addNetworkPort(String id) { initNetworks(); - networks.add(new NovaNetworkCreate(null,null,id)); + networks.add(new NovaNetworkCreate(null, null, id)); } private void initNetworks() { if (networks == null) networks = Lists.newArrayList(); } - + static class SecurityGroupInternal implements SecurityGroup { private static final long serialVersionUID = 1L; private String name; - SecurityGroupInternal() { } - SecurityGroupInternal(String name) { this.name = name; } + SecurityGroupInternal() { + } + + SecurityGroupInternal(String name) { + this.name = name; + } @Override public String getName() { @@ -303,7 +306,7 @@ public ServerCreate build() { @Override public ServerCreateConcreteBuilder from(ServerCreate in) { - m = (NovaServerCreate)in; + m = (NovaServerCreate) in; return this; } @@ -327,7 +330,7 @@ public ServerCreateBuilder userData(String userData) { public ServerCreateBuilder addMetadataItem(String key, String value) { if (m.metadata == null) m.metadata = Maps.newHashMap(); - + m.metadata.put(key, value); return this; } @@ -342,16 +345,16 @@ public ServerCreateBuilder addMetadata(Map metadata) { public ServerCreateBuilder addSchedulerHint(String key, String value) { return addSchedulerHintItem(key, value); } - + @Override public ServerCreateBuilder addSchedulerHint(String key, List value) { return addSchedulerHintItem(key, value); } - + private ServerCreateBuilder addSchedulerHintItem(String key, Object value) { if (m.schedulerHints == null) m.schedulerHints = Maps.newHashMap(); - + m.schedulerHints.put(key, value); return this; } @@ -361,18 +364,18 @@ public ServerCreateBuilder addSchedulerHints(Map schedulerHints) m.schedulerHints = schedulerHints; return this; } - + @Override - public ServerCreateBuilder addAdminPass(String adminPass){ - m.adminPass = adminPass; - return this; + public ServerCreateBuilder addAdminPass(String adminPass) { + m.adminPass = adminPass; + return this; } - - @Override - public ServerCreateBuilder configDrive(boolean configDrive){ - m.configDrive=configDrive; - return this; - } - + + @Override + public ServerCreateBuilder configDrive(boolean configDrive) { + m.configDrive = configDrive; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreateWithHintsWrapper.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreateWithHintsWrapper.java index ccfe788a6..c579e1e2e 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreateWithHintsWrapper.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerCreateWithHintsWrapper.java @@ -1,38 +1,37 @@ package org.openstack4j.openstack.compute.domain; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.compute.ServerCreate; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** * An entity for build a Server with Scheduler hints - * + * * @author octopus zhang */ public class NovaServerCreateWithHintsWrapper implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("os:scheduler_hints") - private Map schedulerHints; - private ServerCreate server; + @JsonProperty("os:scheduler_hints") + private Map schedulerHints; + private ServerCreate server; - public Map getSchedulerHints() { - return schedulerHints; - } + public Map getSchedulerHints() { + return schedulerHints; + } - public ServerCreate getServer() { - return server; - } + public ServerCreate getServer() { + return server; + } - public static NovaServerCreateWithHintsWrapper wrap(ServerCreate server) { - NovaServerCreateWithHintsWrapper wrapper = new NovaServerCreateWithHintsWrapper(); - wrapper.server = server; - wrapper.schedulerHints = server.getSchedulerHints(); - return wrapper; - } + public static NovaServerCreateWithHintsWrapper wrap(ServerCreate server) { + NovaServerCreateWithHintsWrapper wrapper = new NovaServerCreateWithHintsWrapper(); + wrapper.server = server; + wrapper.schedulerHints = server.getSchedulerHints(); + return wrapper; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerGroup.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerGroup.java index 357d15359..f120f8bc0 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerGroup.java @@ -1,99 +1,97 @@ package org.openstack4j.openstack.compute.domain; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.compute.ServerGroup; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.ServerGroup; +import org.openstack4j.openstack.common.ListResult; -@JsonRootName("server_group") -@JsonIgnoreProperties(ignoreUnknown=true) -public class NovaServerGroup implements ServerGroup{ - - private static final long serialVersionUID = 1L; - - private String id; - private String name; - private List members; - private Map metadata; - private List policies; - - public static NovaServerGroup create(String name, String policy) { - NovaServerGroup ns = new NovaServerGroup(); - List policyList = new ArrayList(); - policyList.add(policy); - ns.name = name; - ns.policies = policyList; - return ns; - } - - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public List getMembers() { - return members; - } - @Override - public Map getMetadata() { - return metadata; - } - - @Override - public List getPolicies() { - return policies; - } - - - - public void setName(String name) { - this.name = name; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - public void setPolicies(List policies) { - this.policies = policies; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id",id).add("name", name).add("members", members) - .add("policies", policies).add("metadata", metadata) - .toString(); - } - - public static class ServerGroups extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("server_groups") - private List serverGroups; - - @Override - protected List value() { - return serverGroups; - } - - } +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +@JsonRootName("server_group") +@JsonIgnoreProperties(ignoreUnknown = true) +public class NovaServerGroup implements ServerGroup { + + private static final long serialVersionUID = 1L; + + private String id; + private String name; + private List members; + private Map metadata; + private List policies; + + public static NovaServerGroup create(String name, String policy) { + NovaServerGroup ns = new NovaServerGroup(); + List policyList = new ArrayList(); + policyList.add(policy); + ns.name = name; + ns.policies = policyList; + return ns; + } + + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public List getMembers() { + return members; + } + + @Override + public Map getMetadata() { + return metadata; + } + + @Override + public List getPolicies() { + return policies; + } + + + public void setName(String name) { + this.name = name; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public void setPolicies(List policies) { + this.policies = policies; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("members", members) + .add("policies", policies).add("metadata", metadata) + .toString(); + } + + public static class ServerGroups extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("server_groups") + private List serverGroups; + + @Override + protected List value() { + return serverGroups; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerTag.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerTag.java index 0f5bfeb33..7c0b14d17 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerTag.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerTag.java @@ -1,34 +1,33 @@ package org.openstack4j.openstack.compute.domain; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.base.MoreObjects; import org.openstack4j.model.ModelEntity; -import com.google.common.base.MoreObjects; +import java.util.ArrayList; +import java.util.List; public class NovaServerTag implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private List tags = new ArrayList(); + private List tags = new ArrayList(); - public List getTags() { - return tags; - } + public List getTags() { + return tags; + } - public void setTags(List tags) { - this.tags = tags; - } + public void setTags(List tags) { + this.tags = tags; + } - public void addTag(String... tags) { - for(String tag: tags) { - this.tags.add(tag); - } - } + public void addTag(String... tags) { + for (String tag : tags) { + this.tags.add(tag); + } + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues().add("tags", tags).toString(); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("tags", tags).toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerUpdate.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerUpdate.java index adeb51df3..7e1e88613 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaServerUpdate.java @@ -1,31 +1,30 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.compute.ServerUpdateOptions; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; +import org.openstack4j.model.compute.ServerUpdateOptions; /** * The JSON object used to update an existing server - * + * * @author Jeremy Unruh */ @JsonRootName("server") public class NovaServerUpdate implements ModelEntity { private static final long serialVersionUID = 1L; - + @JsonProperty("name") private String name; @JsonProperty("accessIPv4") private String accessIPv4; @JsonProperty("accessIPv6") private String accessIPv6; - + /** * Creates a NovaServerUpdate from Options - * + * * @param options the server update options * @return NovaServerUpdate instance */ @@ -36,5 +35,5 @@ public static NovaServerUpdate fromOptions(ServerUpdateOptions options) { su.accessIPv6 = options.getAccessIPv6(); return su; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSimpleTenantUsage.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSimpleTenantUsage.java index 6e5f06203..ea50ade3e 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSimpleTenantUsage.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaSimpleTenantUsage.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.compute.domain; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.compute.Server.Status; import org.openstack4j.model.compute.SimpleTenantUsage; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; /** * Provides simple usage reporting for tenants @@ -20,240 +19,240 @@ @JsonRootName("tenant_usage") public class NovaSimpleTenantUsage implements SimpleTenantUsage { - private static final long serialVersionUID = 1L; - @JsonProperty("total_memory_mb_usage") - private BigDecimal totalMemoryMbUsage; - @JsonProperty("total_vcpus_usage") - private BigDecimal totalVcpusUsage; - @JsonProperty("total_local_gb_usage") - private BigDecimal totalLocalGbUsage; - private Date start; - private Date stop; - @JsonProperty("tenant_id") - private String tenantId; - @JsonProperty("total_hours") - private String totalHours; - @JsonProperty("server_usages") - private List serverUsages; - - /** - * {@inheritDoc} - */ - @Override - public BigDecimal getTotalMemoryMbUsage() { - return totalMemoryMbUsage; - } - - /** - * {@inheritDoc} - */ - @Override - public BigDecimal getTotalVcpusUsage() { - return totalVcpusUsage; - } - - /** - * {@inheritDoc} - */ - @Override - public BigDecimal getTotalLocalGbUsage() { - return totalLocalGbUsage; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getStart() { - return start; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getStop() { - return stop; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTotalHours() { - return totalHours; - } - - /** - * {@inheritDoc} - */ - @Override - public List getServerUsages() { - return serverUsages; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("tenantId", tenantId).add("totalMemoryMbUsage", totalMemoryMbUsage).add("totalVcpusUsage", totalVcpusUsage).add("totalLocalGbUsage", totalLocalGbUsage) - .add("start", start).add("stop", stop).add("totalHours", totalHours).addValue("\n").add("serverUsages", serverUsages) - .toString(); - } - - /** - * Tenant usages for all tenants wrapper - */ - public static class NovaSimpleTenantUsages extends ListResult { - private static final long serialVersionUID = 1L; - - @JsonProperty("tenant_usages") - private List tenantUsages; - - public List value() { - return tenantUsages; - } - } - - public static class NovaServerUsage implements ServerUsage { - - private static final long serialVersionUID = 1L; - @JsonProperty("instance_id") - private String instanceId; - private int uptime; - @JsonProperty("started_at") - private Date startedAt; - @JsonProperty("ended_at") - private Date endedAt; - @JsonProperty("memory_mb") - private int memoryMb; - @JsonProperty("tenant_id") - private String tenantId; - private Status state; - private double hours; - private int vcpus; - private String flavor; - @JsonProperty("local_gb") - private int localDiskSize; - private String name; - - /** - * {@inheritDoc} - */ - @Override - public String getInstanceId() { - return instanceId; - } - - /** - * {@inheritDoc} - */ - @Override - public int getUptime() { - return uptime; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getStartedAt() { - return startedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getEndedAt() { - return endedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMemoryMb() { - return memoryMb; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public Status getState() { - return state; - } - - /** - * {@inheritDoc} - */ - @Override - public double getHours() { - return hours; - } - - /** - * {@inheritDoc} - */ - @Override - public int getVcpus() { - return vcpus; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFlavor() { - return flavor; - } - - /** - * {@inheritDoc} - */ - @Override - public int getLocalDiskSize() { - return localDiskSize; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("instanceId", instanceId).add("name", name).add("uptime", uptime).add("startedAt", startedAt) - .add("endedAt", endedAt).add("memoryMb", memoryMb).add("tenantId", tenantId).add("state", state) - .add("hours", hours).add("vcpus", vcpus).add("flavor", flavor).add("localDiskSize", localDiskSize) - .addValue("\n") - .toString(); - } - } + private static final long serialVersionUID = 1L; + @JsonProperty("total_memory_mb_usage") + private BigDecimal totalMemoryMbUsage; + @JsonProperty("total_vcpus_usage") + private BigDecimal totalVcpusUsage; + @JsonProperty("total_local_gb_usage") + private BigDecimal totalLocalGbUsage; + private Date start; + private Date stop; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("total_hours") + private String totalHours; + @JsonProperty("server_usages") + private List serverUsages; + + /** + * {@inheritDoc} + */ + @Override + public BigDecimal getTotalMemoryMbUsage() { + return totalMemoryMbUsage; + } + + /** + * {@inheritDoc} + */ + @Override + public BigDecimal getTotalVcpusUsage() { + return totalVcpusUsage; + } + + /** + * {@inheritDoc} + */ + @Override + public BigDecimal getTotalLocalGbUsage() { + return totalLocalGbUsage; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getStart() { + return start; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getStop() { + return stop; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTotalHours() { + return totalHours; + } + + /** + * {@inheritDoc} + */ + @Override + public List getServerUsages() { + return serverUsages; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("tenantId", tenantId).add("totalMemoryMbUsage", totalMemoryMbUsage).add("totalVcpusUsage", totalVcpusUsage).add("totalLocalGbUsage", totalLocalGbUsage) + .add("start", start).add("stop", stop).add("totalHours", totalHours).addValue("\n").add("serverUsages", serverUsages) + .toString(); + } + + /** + * Tenant usages for all tenants wrapper + */ + public static class NovaSimpleTenantUsages extends ListResult { + private static final long serialVersionUID = 1L; + + @JsonProperty("tenant_usages") + private List tenantUsages; + + public List value() { + return tenantUsages; + } + } + + public static class NovaServerUsage implements ServerUsage { + + private static final long serialVersionUID = 1L; + @JsonProperty("instance_id") + private String instanceId; + private int uptime; + @JsonProperty("started_at") + private Date startedAt; + @JsonProperty("ended_at") + private Date endedAt; + @JsonProperty("memory_mb") + private int memoryMb; + @JsonProperty("tenant_id") + private String tenantId; + private Status state; + private double hours; + private int vcpus; + private String flavor; + @JsonProperty("local_gb") + private int localDiskSize; + private String name; + + /** + * {@inheritDoc} + */ + @Override + public String getInstanceId() { + return instanceId; + } + + /** + * {@inheritDoc} + */ + @Override + public int getUptime() { + return uptime; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getStartedAt() { + return startedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getEndedAt() { + return endedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMemoryMb() { + return memoryMb; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public Status getState() { + return state; + } + + /** + * {@inheritDoc} + */ + @Override + public double getHours() { + return hours; + } + + /** + * {@inheritDoc} + */ + @Override + public int getVcpus() { + return vcpus; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFlavor() { + return flavor; + } + + /** + * {@inheritDoc} + */ + @Override + public int getLocalDiskSize() { + return localDiskSize; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("instanceId", instanceId).add("name", name).add("uptime", uptime).add("startedAt", startedAt) + .add("endedAt", endedAt).add("memoryMb", memoryMb).add("tenantId", tenantId).add("state", state) + .add("hours", hours).add("vcpus", vcpus).add("flavor", flavor).add("localDiskSize", localDiskSize) + .addValue("\n") + .toString(); + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVNCConsole.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVNCConsole.java index dc181c63f..eb5a0bdc9 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVNCConsole.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVNCConsole.java @@ -1,11 +1,10 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.compute.VNCConsole; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.ModelEntity; +import org.openstack4j.model.compute.VNCConsole; /** * Represents a VNC Console which provides VNC connection information for a remote server @@ -15,46 +14,46 @@ @JsonRootName("console") public class NovaVNCConsole implements VNCConsole { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty - private Type type; + @JsonProperty + private Type type; - @JsonProperty - private String url; + @JsonProperty + private String url; - /** - * {@inheritDoc} - */ - @Override - public Type getType() { - return type; - } + /** + * {@inheritDoc} + */ + @Override + public Type getType() { + return type; + } - /** - * {@inheritDoc} - */ - @Override - public String getURL() { - return url; - } + /** + * {@inheritDoc} + */ + @Override + public String getURL() { + return url; + } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues().add("type", type).add("url", url).toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("type", type).add("url", url).toString(); + } - public static NovaConsole getConsoleForType(Type type) { - if (type == Type.SPICE) - return new NovaConsoleSPICE(type); + public static NovaConsole getConsoleForType(Type type) { + if (type == Type.SPICE) + return new NovaConsoleSPICE(type); - return new NovaConsoleVNC(type); - } + return new NovaConsoleVNC(type); + } - public static class NovaConsole implements ModelEntity { + public static class NovaConsole implements ModelEntity { private static final long serialVersionUID = 1L; @@ -64,19 +63,19 @@ public static class NovaConsole implements ModelEntity { public NovaConsole(Type type) { this.type = type.value(); } - } + } - @JsonRootName("os-getVNCConsole") - public static class NovaConsoleVNC extends NovaConsole { + @JsonRootName("os-getVNCConsole") + public static class NovaConsoleVNC extends NovaConsole { private static final long serialVersionUID = 1L; public NovaConsoleVNC(Type type) { super(type); } - } + } - @JsonRootName("os-getSPICEConsole") + @JsonRootName("os-getSPICEConsole") public static class NovaConsoleSPICE extends NovaConsole { private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVolumeAttachment.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVolumeAttachment.java index d81966276..8309d4b9d 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVolumeAttachment.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/NovaVolumeAttachment.java @@ -1,11 +1,10 @@ package org.openstack4j.openstack.compute.domain; -import org.openstack4j.model.compute.VolumeAttachment; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.VolumeAttachment; /** * return a description for this volume attachment job @@ -13,61 +12,61 @@ * @author Octopus Zhang */ @JsonRootName("volumeAttachment") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NovaVolumeAttachment implements VolumeAttachment { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty - private String device; + @JsonProperty + private String device; - @JsonProperty - private String id; + @JsonProperty + private String id; - @JsonProperty - private String serverId; + @JsonProperty + private String serverId; - @JsonProperty - private String volumeId; + @JsonProperty + private String volumeId; - public NovaVolumeAttachment() { - } + public NovaVolumeAttachment() { + } private NovaVolumeAttachment(String volumeId, String device) { this.volumeId = volumeId; this.device = device; } - public static NovaVolumeAttachment create(String volumeId, String device) { - return new NovaVolumeAttachment(volumeId, device); - } - - @Override - public String getDevice() { - return device; - } - - @Override - public String getId() { - return id; - } - - @Override - public String getServerId() { - return serverId; - } - - @Override - public String getVolumeId() { - return volumeId; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("device", device).add("id", id).add("serverId", serverId) - .add("volumeId", volumeId).toString(); - - } + public static NovaVolumeAttachment create(String volumeId, String device) { + return new NovaVolumeAttachment(volumeId, device); + } + + @Override + public String getDevice() { + return device; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getServerId() { + return serverId; + } + + @Override + public String getVolumeId() { + return volumeId; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("device", device).add("id", id).add("serverId", serverId) + .add("volumeId", volumeId).toString(); + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BackupAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BackupAction.java index 72a67d2d5..c5affd16c 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BackupAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BackupAction.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.compute.domain.actions; -import org.openstack4j.model.compute.actions.BackupOptions; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.actions.BackupOptions; /** * Server Action which encapsulates a Backup - * + * * @author Jeremy Unruh */ @JsonRootName("createBackup") @@ -22,20 +21,21 @@ public class BackupAction implements ServerAction { private String backupType; @JsonProperty private Integer rotation; - - + + public String getName() { return name; } - + @JsonIgnore public String getBackupType() { return backupType; } + public int getRotation() { return rotation; } - + public static BackupAction create(BackupOptions options) { BackupAction action = new BackupAction(); action.name = options.getName(); @@ -49,5 +49,5 @@ public static BackupAction create(BackupOptions options) { BACKUP_TYPE("backup_type"), ROTATION("rotation") */ - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BasicActions.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BasicActions.java index 4c2754906..54505d23a 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BasicActions.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/BasicActions.java @@ -1,7 +1,6 @@ package org.openstack4j.openstack.compute.domain.actions; import com.fasterxml.jackson.annotation.JsonProperty; - import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.compute.Action; import org.openstack4j.model.compute.RebootType; @@ -16,55 +15,72 @@ public final class BasicActions { @JsonRootName("pause") - public static class Pause implements ServerAction { } + public static class Pause implements ServerAction { + } @JsonRootName("unpause") - public static class UnPause implements ServerAction { } + public static class UnPause implements ServerAction { + } @JsonRootName("lock") - public static class Lock implements ServerAction { } + public static class Lock implements ServerAction { + } @JsonRootName("unlock") - public static class UnLock implements ServerAction { } + public static class UnLock implements ServerAction { + } @JsonRootName("os-start") - public static class Start implements ServerAction { } + public static class Start implements ServerAction { + } @JsonRootName("os-stop") - public static class Stop implements ServerAction { } + public static class Stop implements ServerAction { + } @JsonRootName("resume") - public static class Resume implements ServerAction { } + public static class Resume implements ServerAction { + } @JsonRootName("rescue") - public static class Rescue implements ServerAction { } + public static class Rescue implements ServerAction { + } @JsonRootName("unrescue") - public static class UnRescue implements ServerAction { } + public static class UnRescue implements ServerAction { + } @JsonRootName("shelve") - public static class Shelve implements ServerAction { } + public static class Shelve implements ServerAction { + } @JsonRootName("shelveOffload") - public static class ShelveOffload implements ServerAction { } + public static class ShelveOffload implements ServerAction { + } @JsonRootName("unshelve") - public static class UnShelve implements ServerAction { } + public static class UnShelve implements ServerAction { + } @JsonRootName("suspend") - public static class Suspend implements ServerAction { } + public static class Suspend implements ServerAction { + } @JsonRootName("confirmResize") - public static class ConfirmResize implements ServerAction { } + public static class ConfirmResize implements ServerAction { + } @JsonRootName("revertResize") - public static class RevertResize implements ServerAction { } + public static class RevertResize implements ServerAction { + } @JsonRootName("migrate") - public static class Migrate implements ServerAction { } - + public static class Migrate implements ServerAction { + } + @JsonRootName("forceDelete") - public static class ForceDelete implements ServerAction { } + public static class ForceDelete implements ServerAction { + } @JsonRootName("reboot") public static class Reboot implements ServerAction { @@ -106,23 +122,36 @@ public ChangePassword(String adminPass) { * @param action the type of action to return an instance for * @return the ServerAction instance or null */ - public static ServerAction actionInstanceFor(Action action) - { + public static ServerAction actionInstanceFor(Action action) { switch (action) { - case PAUSE: return instanceFor(Pause.class); - case UNPAUSE: return instanceFor(UnPause.class); - case LOCK: return instanceFor(Lock.class); - case UNLOCK: return instanceFor(UnLock.class); - case START: return instanceFor( Start.class); - case STOP: return instanceFor(Stop.class); - case RESUME: return instanceFor(Resume.class); - case RESCUE: return instanceFor(Rescue.class); - case UNRESCUE: return instanceFor(UnRescue.class); - case SHELVE: return instanceFor(Shelve.class); - case SHELVE_OFFLOAD: return instanceFor(ShelveOffload.class); - case UNSHELVE: return instanceFor(UnShelve.class); - case SUSPEND: return instanceFor(Suspend.class); - case FORCEDELETE: return instanceFor(ForceDelete.class); + case PAUSE: + return instanceFor(Pause.class); + case UNPAUSE: + return instanceFor(UnPause.class); + case LOCK: + return instanceFor(Lock.class); + case UNLOCK: + return instanceFor(UnLock.class); + case START: + return instanceFor(Start.class); + case STOP: + return instanceFor(Stop.class); + case RESUME: + return instanceFor(Resume.class); + case RESCUE: + return instanceFor(Rescue.class); + case UNRESCUE: + return instanceFor(UnRescue.class); + case SHELVE: + return instanceFor(Shelve.class); + case SHELVE_OFFLOAD: + return instanceFor(ShelveOffload.class); + case UNSHELVE: + return instanceFor(UnShelve.class); + case SUSPEND: + return instanceFor(Suspend.class); + case FORCEDELETE: + return instanceFor(ForceDelete.class); default: return null; } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/CreateSnapshotAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/CreateSnapshotAction.java index 1545544ed..12b182ab3 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/CreateSnapshotAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/CreateSnapshotAction.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.compute.domain.actions; -import java.util.Map; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.Map; + /** - * * Create Snapshot action which creates a new Image snapshot from the present state of the server instance - * + * * @author Jeremy Unruh */ @JsonRootName("createImage") @@ -18,12 +17,13 @@ public class CreateSnapshotAction implements ServerAction { @JsonProperty private String name; - + @JsonProperty private Map metadata; - - public CreateSnapshotAction() { } - + + public CreateSnapshotAction() { + } + public CreateSnapshotAction(String name) { this.name = name; } @@ -32,7 +32,7 @@ public CreateSnapshotAction(String name, Map metadata) { this.name = name; this.metadata = metadata; } - + public static CreateSnapshotAction create(String name) { return new CreateSnapshotAction(name); } @@ -48,7 +48,6 @@ public String getName() { public Map getMetadata() { return metadata; } - - - + + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/EvacuateAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/EvacuateAction.java index 05da09161..d90bab16a 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/EvacuateAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/EvacuateAction.java @@ -1,14 +1,12 @@ package org.openstack4j.openstack.compute.domain.actions; -import org.openstack4j.model.compute.actions.EvacuateOptions; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.actions.EvacuateOptions; /** * Evacuate for a server from a failed host to a new host - * */ @JsonRootName("evacuate") public class EvacuateAction implements ServerAction { @@ -17,15 +15,15 @@ public class EvacuateAction implements ServerAction { @JsonProperty("host") private String host; - + @JsonProperty("adminPass") private String adminPass; - + @JsonProperty("onSharedStorage") private boolean onSharedStorage; - + public static EvacuateAction create(EvacuateOptions options) { - EvacuateAction action = new EvacuateAction(); + EvacuateAction action = new EvacuateAction(); action.host = options.getHost(); action.adminPass = options.getAdminPass(); action.onSharedStorage = options.isOnSharedStorage(); @@ -45,10 +43,10 @@ public String getAdminPass() { public boolean isOnSharedStorage() { return onSharedStorage; } - + @Override public String toString() { return "evacuate"; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/FloatingIpActions.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/FloatingIpActions.java index 1dd09e52b..9665f8fe4 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/FloatingIpActions.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/FloatingIpActions.java @@ -6,41 +6,41 @@ /** * Floating IP based Actions - * + * * @author Jeremy Unruh */ public class FloatingIpActions implements ServerAction { private static final long serialVersionUID = 1L; - + @JsonProperty private String address; protected FloatingIpActions(String address) { this.address = address; } - + public String getAddress() { return address; } - + @JsonRootName("addFloatingIp") public static class Add extends FloatingIpActions { private static final long serialVersionUID = 1L; - + @JsonProperty("fixed_address") private String fixedAddress; - + private Add(String address, String fixedAddress) { super(address); this.fixedAddress = fixedAddress; } - + public static Add create(String address, String fixedAddress) { return new Add(address, fixedAddress); } - + @JsonIgnore public String getFixedAddress() { return fixedAddress; @@ -55,11 +55,11 @@ public static class Remove extends FloatingIpActions { private Remove(String address) { super(address); } - + public static Remove create(String address) { return new Remove(address); } - + } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/LiveMigrationAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/LiveMigrationAction.java index 345274399..3fb6458df 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/LiveMigrationAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/LiveMigrationAction.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.compute.domain.actions; -import org.openstack4j.model.compute.actions.LiveMigrateOptions; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.actions.LiveMigrateOptions; /** * Live Migration Action for a Server - * + * * @author Jeremy Unruh */ @JsonRootName("os-migrateLive") @@ -18,13 +17,13 @@ public class LiveMigrationAction implements ServerAction { @JsonProperty private String host; - + @JsonProperty("block_migration") private boolean blockMigration; - + @JsonProperty("disk_over_commit") private boolean diskOverCommit; - + public static LiveMigrationAction create(LiveMigrateOptions options) { LiveMigrationAction action = new LiveMigrationAction(); action.host = options.getHost(); @@ -46,10 +45,10 @@ public boolean isBlockMigration() { public boolean isDiskOverCommit() { return diskOverCommit; } - + @Override public String toString() { return "os-migrateLive"; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/RebuildAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/RebuildAction.java index 7152e88cf..7113ce835 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/RebuildAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/RebuildAction.java @@ -1,34 +1,32 @@ package org.openstack4j.openstack.compute.domain.actions; -import org.openstack4j.model.compute.actions.RebuildOptions; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.actions.RebuildOptions; /** * An Action which Rebuilds an existing Server Instance - * + * * @author Jeremy Unruh */ @JsonRootName("rebuild") public class RebuildAction implements ServerAction { private static final long serialVersionUID = 1L; - + @JsonProperty private String imageRef; - + @JsonProperty private String name; - + @JsonProperty private String adminPass; - + public static RebuildAction create(RebuildOptions options) { RebuildAction action = new RebuildAction(); - - if (options != null) - { + + if (options != null) { action.name = options.getName(); action.adminPass = options.getAdminPass(); action.imageRef = options.getImageRef(); @@ -47,5 +45,5 @@ public String getName() { public String getAdminPass() { return adminPass; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ResetStateAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ResetStateAction.java index d89dd3104..f815efa1d 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ResetStateAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ResetStateAction.java @@ -1,27 +1,26 @@ package org.openstack4j.openstack.compute.domain.actions; -import org.openstack4j.model.compute.Server.Status; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.Server.Status; /** * Resets the state of a server to a specified state. - * + * * @author Jeremy Unruh */ @JsonRootName("os-resetState") public class ResetStateAction implements ServerAction { private static final long serialVersionUID = 1L; - + @JsonProperty("state") private final Status state; - + public ResetStateAction(Status state) { this.state = state; } - + public static ResetStateAction create(Status state) { return new ResetStateAction(state); } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/SecurityGroupActions.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/SecurityGroupActions.java index 9d4db06d5..f92153c38 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/SecurityGroupActions.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/SecurityGroupActions.java @@ -5,32 +5,32 @@ /** * SecurityGroup related Actions - * + * * @author Jeremy Unruh */ public class SecurityGroupActions implements ServerAction { private static final long serialVersionUID = 1L; - + @JsonProperty("name") private String name; - + protected SecurityGroupActions(String name) { this.name = name; } - + public String getName() { return name; } - + public static Add add(String name) { return new Add(name); } - + public static Remove remove(String name) { return new Remove(name); } - + @JsonRootName("addSecurityGroup") public static class Add extends SecurityGroupActions { @@ -40,7 +40,7 @@ public Add(String name) { super(name); } } - + @JsonRootName("removeSecurityGroup") public static class Remove extends SecurityGroupActions { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ServerAction.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ServerAction.java index b835f1710..dd978ac53 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ServerAction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/actions/ServerAction.java @@ -4,7 +4,7 @@ /** * Decorator interface for Server based Actions - * + * * @author Jeremy Unruh */ public interface ServerAction extends ModelEntity { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtAvailabilityZone.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtAvailabilityZone.java index 92197d757..af3bb20b1 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtAvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtAvailabilityZone.java @@ -1,6 +1,9 @@ package org.openstack4j.openstack.compute.domain.ext; -import static com.google.common.base.MoreObjects.toStringHelper; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.compute.ext.AvailabilityZone; +import org.openstack4j.openstack.common.ListResult; import java.util.Date; import java.util.HashMap; @@ -8,11 +11,7 @@ import java.util.Map; import java.util.Map.Entry; -import org.openstack4j.model.compute.ext.AvailabilityZone; -import org.openstack4j.openstack.common.ListResult; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import static com.google.common.base.MoreObjects.toStringHelper; public class ExtAvailabilityZone implements AvailabilityZone { @@ -44,8 +43,7 @@ public String getZoneName() { @Override public Map> getHosts() { Map> map = new HashMap>(); - if (hosts != null) - { + if (hosts != null) { for (Entry> entry : hosts.entrySet()) { map.put(entry.getKey(), entry.getValue()); } @@ -56,8 +54,8 @@ public String getZoneName() { @Override public String toString() { return toStringHelper(this).omitNullValues() - .add("zoneState", zoneState).add("zoneName", zoneName).add("hosts", hosts) - .toString(); + .add("zoneState", zoneState).add("zoneName", zoneName).add("hosts", hosts) + .toString(); } @JsonRootName("zoneState") @@ -77,8 +75,8 @@ public boolean getAvailable() { @Override public String toString() { return toStringHelper(this).omitNullValues() - .add("available", available) - .toString(); + .add("available", available) + .toString(); } } @@ -118,8 +116,8 @@ public Date getUpdateTime() { @Override public String toString() { return toStringHelper(this).omitNullValues() - .add("available", available).add("active", statusActive).add("updateTime", updateTime) - .toString(); + .add("available", available).add("active", statusActive).add("updateTime", updateTime) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDNSEntry.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDNSEntry.java index 7ae2392d7..1ee849c8a 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDNSEntry.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDNSEntry.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.compute.domain.ext; -import static com.google.common.base.MoreObjects.toStringHelper; - -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.compute.ext.DNSEntry; import org.openstack4j.model.compute.ext.DNSRecordType; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; + +import static com.google.common.base.MoreObjects.toStringHelper; /** * A Floating IP DNS Extension - DNS Entry @@ -72,9 +71,9 @@ public DNSRecordType getType() { @Override public String toString() { return toStringHelper(this).omitNullValues() - .add("id", id).add("domain", domain).add("ip", ipAddress) - .add("name", name).add("type", type) - .toString(); + .add("id", id).add("domain", domain).add("ip", ipAddress) + .add("name", name).add("type", type) + .toString(); } public static class DNSEntries extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDomainEntry.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDomainEntry.java index 0342cc08a..5e49e3579 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDomainEntry.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtDomainEntry.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.compute.domain.ext; -import java.util.List; - -import org.openstack4j.model.compute.ext.DomainEntry; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.ext.DomainEntry; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * A Floating IP DNS Extension - Domain Entry @@ -60,9 +59,9 @@ public Scope getScope() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("availabilityZone", availabilityZone).add("domain", domain) - .add("project", project).add("scope", scope) - .toString(); + .add("availabilityZone", availabilityZone).add("domain", domain) + .add("project", project).add("scope", scope) + .toString(); } public static class DomainEntries extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisor.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisor.java index be23338fe..10f7373f3 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisor.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisor.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; - import org.openstack4j.core.transport.ObjectMapperSingleton; import org.openstack4j.model.compute.ext.Hypervisor; import org.openstack4j.openstack.common.ListResult; diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisorStatistics.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisorStatistics.java index 42a564674..cf2d398ba 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisorStatistics.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtHypervisorStatistics.java @@ -1,109 +1,108 @@ package org.openstack4j.openstack.compute.domain.ext; -import org.openstack4j.model.compute.ext.HypervisorStatistics; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.ext.HypervisorStatistics; @JsonRootName("hypervisor_statistics") public class ExtHypervisorStatistics implements HypervisorStatistics { - private static final long serialVersionUID = 1L; - - @JsonProperty("count") - int count; - @JsonProperty("current_workload") - int currentWorkload; - @JsonProperty("disk_available_least") - int leastDiskAvail; - @JsonProperty("free_disk_gb") - int freeDisk; - @JsonProperty("free_ram_mb") - int freeRam; - @JsonProperty("local_gb") - int local; - @JsonProperty("local_gb_used") - int localUsed; - @JsonProperty("memory_mb") - int memory; - @JsonProperty("memory_mb_used") - int memoryUsed; - @JsonProperty("running_vms") - int running; - @JsonProperty("vcpus") - int vcpus; - @JsonProperty("vcpus_used") - int vcpusUsed; - - @Override - public int getCount() { - return count; - } - - @Override - public int getCurrentWorkload() { - return currentWorkload; - } - - @Override - public int getLeastAvailableDisk() { - return leastDiskAvail; - } - - @Override - public int getFreeDisk() { - return freeDisk; - } - - @Override - public int getFreeRam() { - return freeRam; - } - - @Override - public int getLocal() { - return local; - } - - @Override - public int getLocalUsed() { - return localUsed; - } - - @Override - public int getMemory() { - return memory; - } - - @Override - public int getMemoryUsed() { - return memoryUsed; - } - - @Override - public int getRunningVM() { - return running; - } - - @Override - public int getVirtualCPU() { - return vcpus; - } - - @Override - public int getVirtualUsedCPU() { - return vcpusUsed; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(HypervisorStatistics.class) - .add("count", count).add("current_workload", currentWorkload).add("least_disk_avail", leastDiskAvail) - .add("freeRam", freeRam).add("freeDisk", freeDisk).add("local", local).add("local_used", localUsed) - .add("memory", memory).add("memory_used", memoryUsed).add("running_vms", running).add("vcspus", vcpus) - .add("vcpus_used", vcpusUsed) - .toString(); - } + private static final long serialVersionUID = 1L; + + @JsonProperty("count") + int count; + @JsonProperty("current_workload") + int currentWorkload; + @JsonProperty("disk_available_least") + int leastDiskAvail; + @JsonProperty("free_disk_gb") + int freeDisk; + @JsonProperty("free_ram_mb") + int freeRam; + @JsonProperty("local_gb") + int local; + @JsonProperty("local_gb_used") + int localUsed; + @JsonProperty("memory_mb") + int memory; + @JsonProperty("memory_mb_used") + int memoryUsed; + @JsonProperty("running_vms") + int running; + @JsonProperty("vcpus") + int vcpus; + @JsonProperty("vcpus_used") + int vcpusUsed; + + @Override + public int getCount() { + return count; + } + + @Override + public int getCurrentWorkload() { + return currentWorkload; + } + + @Override + public int getLeastAvailableDisk() { + return leastDiskAvail; + } + + @Override + public int getFreeDisk() { + return freeDisk; + } + + @Override + public int getFreeRam() { + return freeRam; + } + + @Override + public int getLocal() { + return local; + } + + @Override + public int getLocalUsed() { + return localUsed; + } + + @Override + public int getMemory() { + return memory; + } + + @Override + public int getMemoryUsed() { + return memoryUsed; + } + + @Override + public int getRunningVM() { + return running; + } + + @Override + public int getVirtualCPU() { + return vcpus; + } + + @Override + public int getVirtualUsedCPU() { + return vcpusUsed; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(HypervisorStatistics.class) + .add("count", count).add("current_workload", currentWorkload).add("least_disk_avail", leastDiskAvail) + .add("freeRam", freeRam).add("freeDisk", freeDisk).add("local", local).add("local_used", localUsed) + .add("memory", memory).add("memory_used", memoryUsed).add("running_vms", running).add("vcspus", vcpus) + .add("vcpus_used", vcpusUsed) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtMigration.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtMigration.java index 6c60a91cd..261b99c9b 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtMigration.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtMigration.java @@ -1,21 +1,20 @@ package org.openstack4j.openstack.compute.domain.ext; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.compute.ext.Migration; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.ext.Migration; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; /** * A model class implementation which enables an administrative user to fetch in-progress migrations for a region or specified cell in a region * * @author Jeremy Unruh */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class ExtMigration implements Migration { private static final long serialVersionUID = 1L; @@ -108,11 +107,11 @@ public String getOldInstanceTypeId() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("id",id).add("instanceUUID", instanceUUID).add("status", status).add("createdAt", createdAt) - .add("updatedAt", updatedAt).add("destCompute", destCompute).add("destHost", destHost) - .add("destNode", destNode).add("sourceCompute", sourceCompute).add("sourceNode", sourceNode) - .add("newInstanceTypeId at", newInstanceTypeId).add("oldInstanceTypeId", oldInstanceTypeId) - .toString(); + .add("id", id).add("instanceUUID", instanceUUID).add("status", status).add("createdAt", createdAt) + .add("updatedAt", updatedAt).add("destCompute", destCompute).add("destHost", destHost) + .add("destNode", destNode).add("sourceCompute", sourceCompute).add("sourceNode", sourceNode) + .add("newInstanceTypeId at", newInstanceTypeId).add("oldInstanceTypeId", oldInstanceTypeId) + .toString(); } public static class Migrations extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtService.java b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtService.java index 296aa0281..cf5ccd54d 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtService.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/domain/ext/ExtService.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.compute.domain.ext; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.compute.ext.Service; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.compute.ext.Service; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; @JsonRootName("service") @JsonIgnoreProperties(ignoreUnknown = true) @@ -78,23 +77,24 @@ public String getZone() { return zone; } - /** - *

Author:Wang Ting

- * @Title: getDorcedDown - * @return - * @see org.openstack4j.model.compute.Service#getDorcedDown() - */ - @Override - public String getDorcedDown() { - return forcedDown; - } + /** + *

Author:Wang Ting

+ * + * @return + * @Title: getDorcedDown + * @see org.openstack4j.model.compute.Service#getDorcedDown() + */ + @Override + public String getDorcedDown() { + return forcedDown; + } @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("id", id).add("binary", binary).add("host", host) .add("zone", zone).add("status", status).add("state", state).add("updated_at", updatedAt) .add("disabled_reason", disabledReason) - .add("forcedDown",forcedDown) + .add("forcedDown", forcedDown) .toString(); } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/functions/JsonToMessageFunction.java b/core/src/main/java/org/openstack4j/openstack/compute/functions/JsonToMessageFunction.java index 0fe3f69d8..f27d5f610 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/functions/JsonToMessageFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/functions/JsonToMessageFunction.java @@ -1,22 +1,22 @@ package org.openstack4j.openstack.compute.functions; +import com.google.common.base.Function; + import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.google.common.base.Function; - /** - * Attempts to extract an error message from a JSON payload. If the message cannot be found then the original + * Attempts to extract an error message from a JSON payload. If the message cannot be found then the original * JSON string is returned - * + * * @author Jeremy Unruh */ public class JsonToMessageFunction implements Function { public static final JsonToMessageFunction INSTANCE = new JsonToMessageFunction(); private static final Pattern MESSAGE_PATTERN = Pattern.compile(".*message\\\":\\s\\\"([^\"]+)\\\".*"); - - + + @Override public String apply(String json) { if (json != null && json.contains("message")) { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/functions/ToActionResponseFunction.java b/core/src/main/java/org/openstack4j/openstack/compute/functions/ToActionResponseFunction.java index 62f238517..830910df0 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/functions/ToActionResponseFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/functions/ToActionResponseFunction.java @@ -1,7 +1,6 @@ package org.openstack4j.openstack.compute.functions; import com.google.common.base.Function; - import org.openstack4j.core.transport.HttpEntityHandler; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.core.transport.functions.ResponseToActionResponse; diff --git a/core/src/main/java/org/openstack4j/openstack/compute/functions/WrapServerIfApplicableFunction.java b/core/src/main/java/org/openstack4j/openstack/compute/functions/WrapServerIfApplicableFunction.java index 12fd23255..c9cac60e6 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/functions/WrapServerIfApplicableFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/functions/WrapServerIfApplicableFunction.java @@ -1,21 +1,20 @@ package org.openstack4j.openstack.compute.functions; +import com.google.common.base.Function; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.compute.ServerCreate; import org.openstack4j.openstack.compute.domain.NovaServerCreateWithHintsWrapper; -import com.google.common.base.Function; - /** * Wraps a ServerCreate entity to another type if applicable. For example if a server container scheduler hints - * this function is responsible for wrapping it in a higher level class to support booting. - * + * this function is responsible for wrapping it in a higher level class to support booting. + * * @author Jeremy Unruh */ -public class WrapServerIfApplicableFunction implements Function{ +public class WrapServerIfApplicableFunction implements Function { public static final WrapServerIfApplicableFunction INSTANCE = new WrapServerIfApplicableFunction(); - + /** * Wraps the ServerCreate if applicable or returns {@code server} if the operation is a no-op */ @@ -23,7 +22,7 @@ public class WrapServerIfApplicableFunction implements Function list() { - return list(true); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return list(true); + } - /** - * {@inheritDoc} - */ - @Override - public List list(boolean detailed) { - String uri = (detailed) ? "/images/detail" : "/images"; - return get(NovaImages.class, uri(uri)).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list(boolean detailed) { + String uri = (detailed) ? "/images/detail" : "/images"; + return get(NovaImages.class, uri(uri)).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public Image get(String imageId) { - checkNotNull(imageId); - return get(NovaImage.class, uri("/images/%s", imageId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public Image get(String imageId) { + checkNotNull(imageId); + return get(NovaImage.class, uri("/images/%s", imageId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String imageId) { - checkNotNull(imageId); - return deleteWithResponse(uri("/images/%s", imageId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String imageId) { + checkNotNull(imageId); + return deleteWithResponse(uri("/images/%s", imageId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public Map setMetaData(String imageId, Map metadata) { - checkNotNull(imageId); - checkNotNull(metadata); - return post(MetaDataWrapper.class, uri("/images/%s/metadata", imageId)).entity(MetaDataWrapper.wrap(metadata)).execute().getMetaData(); - } + /** + * {@inheritDoc} + */ + @Override + public Map setMetaData(String imageId, Map metadata) { + checkNotNull(imageId); + checkNotNull(metadata); + return post(MetaDataWrapper.class, uri("/images/%s/metadata", imageId)).entity(MetaDataWrapper.wrap(metadata)).execute().getMetaData(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse deleteMetaData(String imageId, String... keys) { - checkNotNull(imageId); - for (String k : keys) - { - ActionResponse resp = deleteWithResponse(uri("/images/%s/metadata/%s", imageId, k)).execute(); - if (!resp.isSuccess()) - return resp; - } - return ActionResponse.actionSuccess(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse deleteMetaData(String imageId, String... keys) { + checkNotNull(imageId); + for (String k : keys) { + ActionResponse resp = deleteWithResponse(uri("/images/%s/metadata/%s", imageId, k)).execute(); + if (!resp.isSuccess()) + return resp; + } + return ActionResponse.actionSuccess(); + } - /** - * {@inheritDoc} - */ - @Override - public Map getMetaData(String imageId) { - checkNotNull(imageId); - return get(MetaDataWrapper.class, uri("/images/%s/metadata", imageId)).execute().getMetaData(); - } + /** + * {@inheritDoc} + */ + @Override + public Map getMetaData(String imageId) { + checkNotNull(imageId); + return get(MetaDataWrapper.class, uri("/images/%s/metadata", imageId)).execute().getMetaData(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeSecurityGroupServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeSecurityGroupServiceImpl.java index c2a9b38d6..20f32aaba 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeSecurityGroupServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeSecurityGroupServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.compute.ComputeSecurityGroupService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.SecGroupExtension; @@ -12,88 +8,92 @@ import org.openstack4j.openstack.compute.domain.NovaSecGroupExtension.SecurityGroupRule; import org.openstack4j.openstack.compute.domain.NovaSecGroupExtension.SecurityGroups; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Provides operations against the Security Group extension in OpenStack - * + *

* Extension Mapping: (os-security-groups) - * + * * @author Jeremy Unruh */ public class ComputeSecurityGroupServiceImpl extends BaseComputeServices implements ComputeSecurityGroupService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(SecurityGroups.class, uri("/os-security-groups")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(SecurityGroups.class, uri("/os-security-groups")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List listServerGroups(String serverId) { - checkNotNull(serverId); - return get(SecurityGroups.class, uri("/servers/%s/os-security-groups", serverId)).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List listServerGroups(String serverId) { + checkNotNull(serverId); + return get(SecurityGroups.class, uri("/servers/%s/os-security-groups", serverId)).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public SecGroupExtension get(String securityGroupId) { - checkNotNull(securityGroupId); - return get(NovaSecGroupExtension.class, uri("/os-security-groups/%s", securityGroupId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public SecGroupExtension get(String securityGroupId) { + checkNotNull(securityGroupId); + return get(NovaSecGroupExtension.class, uri("/os-security-groups/%s", securityGroupId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String securityGroupId) { - checkNotNull(securityGroupId); - return deleteWithResponse(uri("/os-security-groups/%s", securityGroupId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String securityGroupId) { + checkNotNull(securityGroupId); + return deleteWithResponse(uri("/os-security-groups/%s", securityGroupId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public SecGroupExtension create(String name, String description) { - checkNotNull(name); - return post(NovaSecGroupExtension.class, uri("/os-security-groups")) - .entity(NovaSecGroupExtension.create(name, description)) - .execute(); - } + /** + * {@inheritDoc} + */ + @Override + public SecGroupExtension create(String name, String description) { + checkNotNull(name); + return post(NovaSecGroupExtension.class, uri("/os-security-groups")) + .entity(NovaSecGroupExtension.create(name, description)) + .execute(); + } - /** - * {@inheritDoc} - */ - @Override - public SecGroupExtension update(String securityGroupId, String name, String description) { - checkNotNull(securityGroupId); - checkNotNull(name); - return put(NovaSecGroupExtension.class, uri("/os-security-groups/%s", securityGroupId)) - .entity(NovaSecGroupExtension.create(name, description)) - .execute(); - } + /** + * {@inheritDoc} + */ + @Override + public SecGroupExtension update(String securityGroupId, String name, String description) { + checkNotNull(securityGroupId); + checkNotNull(name); + return put(NovaSecGroupExtension.class, uri("/os-security-groups/%s", securityGroupId)) + .entity(NovaSecGroupExtension.create(name, description)) + .execute(); + } - /** - * {@inheritDoc} - */ - @Override - public Rule createRule(Rule rule) { - checkNotNull(rule); - return post(SecurityGroupRule.class, uri("/os-security-group-rules")).entity(rule).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public Rule createRule(Rule rule) { + checkNotNull(rule); + return post(SecurityGroupRule.class, uri("/os-security-group-rules")).entity(rule).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse deleteRule(String ruleId) { - checkNotNull(ruleId); - return deleteWithResponse(uri("/os-security-group-rules/%s", ruleId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse deleteRule(String ruleId) { + checkNotNull(ruleId); + return deleteWithResponse(uri("/os-security-group-rules/%s", ruleId)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeServiceImpl.java index 5bec6a8f0..bbdb88349 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ComputeServiceImpl.java @@ -1,155 +1,140 @@ package org.openstack4j.openstack.compute.internal; -import java.util.List; - import org.openstack4j.api.Apis; -import org.openstack4j.api.compute.ComputeFloatingIPService; -import org.openstack4j.api.compute.ComputeImageService; -import org.openstack4j.api.compute.ComputeSecurityGroupService; -import org.openstack4j.api.compute.ComputeService; -import org.openstack4j.api.compute.FlavorService; -import org.openstack4j.api.compute.HostAggregateService; -import org.openstack4j.api.compute.HostService; -import org.openstack4j.api.compute.KeypairService; -import org.openstack4j.api.compute.QuotaSetService; -import org.openstack4j.api.compute.ServerGroupService; -import org.openstack4j.api.compute.ServerService; -import org.openstack4j.api.compute.ServerTagService; -import org.openstack4j.api.compute.ext.FloatingIPDNSService; -import org.openstack4j.api.compute.ext.HypervisorService; -import org.openstack4j.api.compute.ext.MigrationService; -import org.openstack4j.api.compute.ext.ServicesService; -import org.openstack4j.api.compute.ext.ZoneService; +import org.openstack4j.api.compute.*; +import org.openstack4j.api.compute.ext.*; import org.openstack4j.model.common.Extension; import org.openstack4j.openstack.common.ExtensionValue.Extensions; +import java.util.List; + /** * Compute (Nova) Operations API implementation - * + * * @author Jeremy Unruh */ public class ComputeServiceImpl extends BaseComputeServices implements ComputeService { - /** - * {@inheritDoc} - */ - @Override - public FlavorService flavors() { - return Apis.get(FlavorService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public ComputeImageService images() { - return Apis.get(ComputeImageService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public ServerService servers() { - return Apis.get(ServerService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public QuotaSetService quotaSets() { - return Apis.get(QuotaSetService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public HostService host() { - return Apis.get(HostService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public List listExtensions() { - return get(Extensions.class, uri("/extensions")).execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public ComputeFloatingIPService floatingIps() { - return Apis.get(ComputeFloatingIPService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public ComputeSecurityGroupService securityGroups() { - return Apis.get(ComputeSecurityGroupService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public KeypairService keypairs() { - return Apis.get(KeypairService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public HypervisorService hypervisors() { - return Apis.get(HypervisorService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public ZoneService zones() { - return Apis.get(ZoneService.class); - } - - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ + @Override + public FlavorService flavors() { + return Apis.get(FlavorService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public ComputeImageService images() { + return Apis.get(ComputeImageService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public ServerService servers() { + return Apis.get(ServerService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public QuotaSetService quotaSets() { + return Apis.get(QuotaSetService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public HostService host() { + return Apis.get(HostService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public List listExtensions() { + return get(Extensions.class, uri("/extensions")).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public ComputeFloatingIPService floatingIps() { + return Apis.get(ComputeFloatingIPService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public ComputeSecurityGroupService securityGroups() { + return Apis.get(ComputeSecurityGroupService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public KeypairService keypairs() { + return Apis.get(KeypairService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public HypervisorService hypervisors() { + return Apis.get(HypervisorService.class); + } + + /** + * {@inheritDoc} + */ + @Override + public ZoneService zones() { + return Apis.get(ZoneService.class); + } + + /** + * {@inheritDoc} + */ @Override public MigrationService migrations() { return Apis.get(MigrationService.class); } - @Override - public ServerGroupService serverGroups() { - return Apis.get(ServerGroupService.class); - } + @Override + public ServerGroupService serverGroups() { + return Apis.get(ServerGroupService.class); + } @Override public FloatingIPDNSService floatingIPDNS() { return Apis.get(FloatingIPDNSService.class); } - @Override - public HostAggregateService hostAggregates() { - - return Apis.get(HostAggregateService.class); - } + @Override + public HostAggregateService hostAggregates() { + + return Apis.get(HostAggregateService.class); + } + + @Override + public ServerTagService serverTags() { + return Apis.get(ServerTagService.class); + } - @Override - public ServerTagService serverTags() { - return Apis.get(ServerTagService.class); - } - @Override public ServicesService services() { return Apis.get(ServicesService.class); } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/FlavorServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/FlavorServiceImpl.java index 961f18a14..7a5aa49e5 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/FlavorServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/FlavorServiceImpl.java @@ -1,11 +1,5 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.openstack4j.api.compute.FlavorService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.Flavor; @@ -17,173 +11,179 @@ import org.openstack4j.openstack.compute.domain.NovaFlavorAccess.FlavorAccesses; import org.openstack4j.openstack.compute.domain.NovaFlavorAccess.RemoveTenantAccess; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Flavor service provides CRUD capabilities for Flavor(s). A flavor is an available hardware configuration/template for a server - * + * * @author Jeremy Unruh, whaon */ public class FlavorServiceImpl extends BaseComputeServices implements FlavorService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return this.list(null); - } - - /** - * {@inheritDoc} - */ - @Override - public List list(boolean detail) { - return this.list(detail, null); - } - - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - return this.list(true, filteringParams); - } - - /** - * {@inheritDoc} - */ - @Override - public List list(boolean detail, Map filteringParams) { - Invocation flavorInvocation = get(Flavors.class, uri("/flavors" + ((detail) ? "/detail" : ""))); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list() { + return this.list(null); + } + + /** + * {@inheritDoc} + */ + @Override + public List list(boolean detail) { + return this.list(detail, null); + } + + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + return this.list(true, filteringParams); + } + + /** + * {@inheritDoc} + */ + @Override + public List list(boolean detail, Map filteringParams) { + Invocation flavorInvocation = get(Flavors.class, uri("/flavors" + ((detail) ? "/detail" : ""))); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - flavorInvocation = flavorInvocation.param(entry.getKey(), entry.getValue()); + flavorInvocation = flavorInvocation.param(entry.getKey(), entry.getValue()); } } - - return flavorInvocation.execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public Flavor get(String flavorId) { - checkNotNull(flavorId); - return get(NovaFlavor.class, uri("/flavors/%s", flavorId)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String flavorId) { - checkNotNull(flavorId); - return deleteWithResponse(uri("/flavors/%s", flavorId)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Flavor create(Flavor flavor) { - checkNotNull(flavor); - return post(NovaFlavor.class, uri("/flavors")) - .entity(flavor) - .execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Flavor create(String name, int ram, int vcpus, int disk, int ephemeral, int swap, float rxtxFactor, boolean isPublic) { - checkNotNull(name); - return create(NovaFlavor.builder().name(name).ram(ram).vcpus(vcpus).disk(disk).swap(swap).ephemeral(ephemeral).rxtxFactor(rxtxFactor).isPublic(isPublic).build()); - } - - /** - * {@inheritDoc} - */ - @Override - public Map listExtraSpecs(String flavorId) { - checkNotNull(flavorId); - ExtraSpecsWrapper wrapper = get(ExtraSpecsWrapper.class, uri("/flavors/%s/os-extra_specs", flavorId)).execute(); - return wrapper != null ? wrapper.getExtraSpecs() : null; - } - - /** - * {@inheritDoc} - */ - @Override - public Map createAndUpdateExtraSpecs(String flavorId, Map spec) { - checkNotNull(flavorId); - checkNotNull(spec); - return post(ExtraSpecsWrapper.class, uri("/flavors/%s/os-extra_specs", flavorId)).entity(ExtraSpecsWrapper.wrap(spec)).execute().getExtraSpecs(); - } - - /** - * {@inheritDoc} - */ - @Override - public void deleteExtraSpecs(String flavorId, String key) { - checkNotNull(flavorId); - checkNotNull(key); - delete(Void.class, uri("/flavors/%s/os-extra_specs/%s", flavorId, key)).execute(); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("rawtypes") - @Override - public String getSpec(String flavorId, String key) { - checkNotNull(flavorId); - checkNotNull(key); - Map extraSpec = get(HashMap.class, uri("/flavors/%s/os-extra_specs/%s", flavorId, key)).execute(); - return extraSpec == null ? null : (String) extraSpec.get(key); - } - - /** - * {@inheritDoc} - */ - @Override - public List listFlavorAccess(String flavorId) { - checkNotNull(flavorId); - return get(FlavorAccesses.class, uri("/flavors/%s/os-flavor-access", flavorId)) - .execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public List addTenantAccess(String flavorId, String tenantId) { - checkNotNull(flavorId); - checkNotNull(tenantId); - - AddTenantAccess addTenantAccess = new AddTenantAccess(); - addTenantAccess.setTenantId(tenantId); - - return post(FlavorAccesses.class, uri("/flavors/%s/action", flavorId)) - .entity(addTenantAccess) - .execute() - .getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public List removeTenantAccess(String flavorId, String tenantId) { - checkNotNull(flavorId); - checkNotNull(tenantId); - - RemoveTenantAccess removeTenantAccess = new RemoveTenantAccess(); - removeTenantAccess.setTenantId(tenantId); - - return post(FlavorAccesses.class, uri("/flavors/%s/action", flavorId)) - .entity(removeTenantAccess) - .execute() - .getList(); - } + + return flavorInvocation.execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public Flavor get(String flavorId) { + checkNotNull(flavorId); + return get(NovaFlavor.class, uri("/flavors/%s", flavorId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String flavorId) { + checkNotNull(flavorId); + return deleteWithResponse(uri("/flavors/%s", flavorId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Flavor create(Flavor flavor) { + checkNotNull(flavor); + return post(NovaFlavor.class, uri("/flavors")) + .entity(flavor) + .execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Flavor create(String name, int ram, int vcpus, int disk, int ephemeral, int swap, float rxtxFactor, boolean isPublic) { + checkNotNull(name); + return create(NovaFlavor.builder().name(name).ram(ram).vcpus(vcpus).disk(disk).swap(swap).ephemeral(ephemeral).rxtxFactor(rxtxFactor).isPublic(isPublic).build()); + } + + /** + * {@inheritDoc} + */ + @Override + public Map listExtraSpecs(String flavorId) { + checkNotNull(flavorId); + ExtraSpecsWrapper wrapper = get(ExtraSpecsWrapper.class, uri("/flavors/%s/os-extra_specs", flavorId)).execute(); + return wrapper != null ? wrapper.getExtraSpecs() : null; + } + + /** + * {@inheritDoc} + */ + @Override + public Map createAndUpdateExtraSpecs(String flavorId, Map spec) { + checkNotNull(flavorId); + checkNotNull(spec); + return post(ExtraSpecsWrapper.class, uri("/flavors/%s/os-extra_specs", flavorId)).entity(ExtraSpecsWrapper.wrap(spec)).execute().getExtraSpecs(); + } + + /** + * {@inheritDoc} + */ + @Override + public void deleteExtraSpecs(String flavorId, String key) { + checkNotNull(flavorId); + checkNotNull(key); + delete(Void.class, uri("/flavors/%s/os-extra_specs/%s", flavorId, key)).execute(); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("rawtypes") + @Override + public String getSpec(String flavorId, String key) { + checkNotNull(flavorId); + checkNotNull(key); + Map extraSpec = get(HashMap.class, uri("/flavors/%s/os-extra_specs/%s", flavorId, key)).execute(); + return extraSpec == null ? null : (String) extraSpec.get(key); + } + + /** + * {@inheritDoc} + */ + @Override + public List listFlavorAccess(String flavorId) { + checkNotNull(flavorId); + return get(FlavorAccesses.class, uri("/flavors/%s/os-flavor-access", flavorId)) + .execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public List addTenantAccess(String flavorId, String tenantId) { + checkNotNull(flavorId); + checkNotNull(tenantId); + + AddTenantAccess addTenantAccess = new AddTenantAccess(); + addTenantAccess.setTenantId(tenantId); + + return post(FlavorAccesses.class, uri("/flavors/%s/action", flavorId)) + .entity(addTenantAccess) + .execute() + .getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public List removeTenantAccess(String flavorId, String tenantId) { + checkNotNull(flavorId); + checkNotNull(tenantId); + + RemoveTenantAccess removeTenantAccess = new RemoveTenantAccess(); + removeTenantAccess.setTenantId(tenantId); + + return post(FlavorAccesses.class, uri("/flavors/%s/action", flavorId)) + .entity(removeTenantAccess) + .execute() + .getList(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/HostAggregateServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/HostAggregateServiceImpl.java index cad15310a..6834bff35 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/HostAggregateServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/HostAggregateServiceImpl.java @@ -1,96 +1,93 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - -import javax.annotation.Nullable; import org.openstack4j.api.compute.HostAggregateService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.HostAggregate; -import org.openstack4j.openstack.compute.domain.AggregateAddHost; -import org.openstack4j.openstack.compute.domain.AggregateRemoveHost; -import org.openstack4j.openstack.compute.domain.HostAggregateMetadata; -import org.openstack4j.openstack.compute.domain.NovaHostAggregate; +import org.openstack4j.openstack.compute.domain.*; import org.openstack4j.openstack.compute.domain.NovaHostAggregate.NovaHostAggregates; -import org.openstack4j.openstack.compute.domain.NovaHostAggregateCreate; -import org.openstack4j.openstack.compute.domain.NovaHostAggregateUpdate; import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; + +import javax.annotation.Nullable; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Host Aggregate Operation API implementation - * @author liujunpeng * + * @author liujunpeng */ public class HostAggregateServiceImpl extends BaseComputeServices implements - HostAggregateService { + HostAggregateService { /** * {@inheritDoc} */ - @Override - public List list() { - Invocation req = get(NovaHostAggregates.class, uri("/os-aggregates")); - return req.execute().getList(); - - } + @Override + public List list() { + Invocation req = get(NovaHostAggregates.class, uri("/os-aggregates")); + return req.execute().getList(); + + } /** * {@inheritDoc} */ - @Override - public List list(Map filteringParams) { - Invocation req = get(NovaHostAggregates.class, uri("/os-aggregates")); - if (filteringParams != null) { + @Override + public List list(Map filteringParams) { + Invocation req = get(NovaHostAggregates.class, uri("/os-aggregates")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } /** * {@inheritDoc} */ - @Override - public NovaHostAggregate get(String aggregateId) { - checkNotNull(aggregateId); - return get(NovaHostAggregate.class,uri("/os-aggregates/%s",aggregateId)).execute(); - } + @Override + public NovaHostAggregate get(String aggregateId) { + checkNotNull(aggregateId); + return get(NovaHostAggregate.class, uri("/os-aggregates/%s", aggregateId)).execute(); + } /** * {@inheritDoc} */ - @Override - public ActionResponse delete(String aggregateId) { - checkNotNull(aggregateId); - return ToActionResponseFunction.INSTANCE.apply( + @Override + public ActionResponse delete(String aggregateId) { + checkNotNull(aggregateId); + return ToActionResponseFunction.INSTANCE.apply( delete(Void.class, uri("/os-aggregates/%s", aggregateId)).executeWithResponse() - ); - } - - /** + ); + } + + /** * {@inheritDoc} */ - @Override - public HostAggregate create(String name,String availabilityZone) { - checkNotNull(name); - checkNotNull(availabilityZone); - // modify by chenyan 2017.02.13 - //return post(NovaHostAggregate.class, uri("/os-aggregates")).entity(NovaHostAggregate.create(name, availabilityZone)).execute(); - return post(NovaHostAggregate.class, uri("/os-aggregates")).entity(new NovaHostAggregateCreate(name, availabilityZone)).execute(); - } - /** + @Override + public HostAggregate create(String name, String availabilityZone) { + checkNotNull(name); + checkNotNull(availabilityZone); + // modify by chenyan 2017.02.13 + //return post(NovaHostAggregate.class, uri("/os-aggregates")).entity(NovaHostAggregate.create(name, availabilityZone)).execute(); + return post(NovaHostAggregate.class, uri("/os-aggregates")).entity(new NovaHostAggregateCreate(name, availabilityZone)).execute(); + } + + /** * {@inheritDoc} */ - @Override - public HostAggregate update(String hostAggregateId, String name, - @Nullable String availabilityZone) { - checkNotNull(hostAggregateId); - checkNotNull(name); - return put(NovaHostAggregate.class, uri("/os-aggregates/%s",hostAggregateId)).entity(new NovaHostAggregateUpdate(name, availabilityZone)).execute(); - } - + @Override + public HostAggregate update(String hostAggregateId, String name, + @Nullable String availabilityZone) { + checkNotNull(hostAggregateId); + checkNotNull(name); + return put(NovaHostAggregate.class, uri("/os-aggregates/%s", hostAggregateId)).entity(new NovaHostAggregateUpdate(name, availabilityZone)).execute(); + } + /** * {@inheritDoc} */ @@ -100,27 +97,27 @@ public HostAggregate setMetadata(String hostAggregateId, Map met checkNotNull(metadata); return post(NovaHostAggregate.class, uri("/os-aggregates/%s/action", hostAggregateId)).entity(new HostAggregateMetadata(metadata)).execute(); } - + /** * {@inheritDoc} */ - @Override - public HostAggregate addHost(String hostAggregateId, String host) { - checkNotNull(hostAggregateId); - checkNotNull(host); - return post(NovaHostAggregate.class, uri("/os-aggregates/%s/action", hostAggregateId)).entity(new AggregateAddHost(host)).execute(); - } - - /** + @Override + public HostAggregate addHost(String hostAggregateId, String host) { + checkNotNull(hostAggregateId); + checkNotNull(host); + return post(NovaHostAggregate.class, uri("/os-aggregates/%s/action", hostAggregateId)).entity(new AggregateAddHost(host)).execute(); + } + + /** * {@inheritDoc} */ - @Override - public HostAggregate removeHost(String hostAggregateId, String host) { - checkNotNull(hostAggregateId); - checkNotNull(host); - - return post(NovaHostAggregate.class, uri("/os-aggregates/%s/action", hostAggregateId)).entity(new AggregateRemoveHost(host)).execute(); - } - - + @Override + public HostAggregate removeHost(String hostAggregateId, String host) { + checkNotNull(hostAggregateId); + checkNotNull(host); + + return post(NovaHostAggregate.class, uri("/os-aggregates/%s/action", hostAggregateId)).entity(new AggregateRemoveHost(host)).execute(); + } + + } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/HostServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/HostServiceImpl.java index aaa5d58ed..4a44897d5 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/HostServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/HostServiceImpl.java @@ -1,56 +1,57 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.compute.HostService; import org.openstack4j.model.compute.HostResource; import org.openstack4j.openstack.compute.domain.NovaHost; import org.openstack4j.openstack.compute.domain.NovaHostResource.NovaHostResources; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * OS Host Service - * - * @author Qin An * + * @author Qin An */ public class HostServiceImpl extends BaseComputeServices implements HostService { @Override - public List hostDescribe(String hostName) { - checkNotNull(hostName); + public List hostDescribe(String hostName) { + checkNotNull(hostName); return get(NovaHost.class, uri("/os-hosts/%s", hostName)).execute().getList(); } - + /** * List all host that the current tenant has access to * {@inheritDoc} + * * @author Wang Ting/王婷 */ - @Override - public List list() { - Invocation req = get(NovaHostResources.class, uri("/os-hosts")); - return req.execute().getList(); - - } + @Override + public List list() { + Invocation req = get(NovaHostResources.class, uri("/os-hosts")); + return req.execute().getList(); + + } /** - * Returns list of hosts filtered by parameters. - * @param filteringParams map (name, value) of filtering parameters - * Now supports query by zone name - * {@inheritDoc} + * Returns list of hosts filtered by parameters. + * + * @param filteringParams map (name, value) of filtering parameters + * Now supports query by zone name + * {@inheritDoc} * @author Wang Ting/王婷 */ - @Override - public List list(Map filteringParams) { - Invocation req = get(NovaHostResources.class, uri("/os-hosts")); - if (filteringParams != null) { + @Override + public List list(Map filteringParams) { + Invocation req = get(NovaHostResources.class, uri("/os-hosts")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/KeypairServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/KeypairServiceImpl.java index ff4c13a7e..b253d6653 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/KeypairServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/KeypairServiceImpl.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - -import javax.annotation.Nullable; - import org.openstack4j.api.compute.KeypairService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.Keypair; import org.openstack4j.openstack.compute.domain.NovaKeypair; import org.openstack4j.openstack.compute.domain.NovaKeypair.Keypairs; +import javax.annotation.Nullable; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Keypair Service manages SSH Keys within OpenStack Compute (Nova). * @@ -19,39 +18,39 @@ */ public class KeypairServiceImpl extends BaseComputeServices implements KeypairService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Keypairs.class, uri("/os-keypairs")).execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public Keypair get(String name) { - checkNotNull(name); - return get(NovaKeypair.class, uri("/os-keypairs/%s", name)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String name) { - checkNotNull(name); - return deleteWithResponse(uri("/os-keypairs/%s", name)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Keypair create(String name, @Nullable String publicKey) { - checkNotNull(name); - return post(NovaKeypair.class, uri("/os-keypairs")).entity(NovaKeypair.create(name, publicKey)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Keypairs.class, uri("/os-keypairs")).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public Keypair get(String name) { + checkNotNull(name); + return get(NovaKeypair.class, uri("/os-keypairs/%s", name)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String name) { + checkNotNull(name); + return deleteWithResponse(uri("/os-keypairs/%s", name)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Keypair create(String name, @Nullable String publicKey) { + checkNotNull(name); + return post(NovaKeypair.class, uri("/os-keypairs")).entity(NovaKeypair.create(name, publicKey)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/QuotaSetServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/QuotaSetServiceImpl.java index 037007cf8..4fc75a627 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/QuotaSetServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/QuotaSetServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.compute.QuotaSetService; import org.openstack4j.model.compute.Limits; import org.openstack4j.model.compute.QuotaSet; @@ -17,9 +13,13 @@ import org.openstack4j.openstack.compute.domain.NovaSimpleTenantUsage; import org.openstack4j.openstack.compute.domain.NovaSimpleTenantUsage.NovaSimpleTenantUsages; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * OpenStack Quota-Set API Implementation - * + * * @author Jeremy Unruh */ public class QuotaSetServiceImpl extends BaseComputeServices implements QuotaSetService { @@ -88,34 +88,34 @@ public SimpleTenantUsage getTenantUsage(String tenantId) { checkNotNull(tenantId); return get(NovaSimpleTenantUsage.class, uri("/os-simple-tenant-usage/%s", tenantId)).execute(); } - + /** * {@inheritDoc} */ - @Override - public List listTenantUsages(String startTime, - String endTime) { - checkNotNull(startTime); - checkNotNull(endTime); - return get(NovaSimpleTenantUsages.class, uri("/os-simple-tenant-usage")) - .param("start", startTime) - .param("end", endTime) - .execute().getList(); - } - - /** + @Override + public List listTenantUsages(String startTime, + String endTime) { + checkNotNull(startTime); + checkNotNull(endTime); + return get(NovaSimpleTenantUsages.class, uri("/os-simple-tenant-usage")) + .param("start", startTime) + .param("end", endTime) + .execute().getList(); + } + + /** * {@inheritDoc} */ - @Override - public SimpleTenantUsage getTenantUsage(String tenantId, String startTime, - String endTime) { - checkNotNull(tenantId); - checkNotNull(startTime); - checkNotNull(endTime); + @Override + public SimpleTenantUsage getTenantUsage(String tenantId, String startTime, + String endTime) { + checkNotNull(tenantId); + checkNotNull(startTime); + checkNotNull(endTime); return get(NovaSimpleTenantUsage.class, uri("/os-simple-tenant-usage/%s", tenantId)) - .param("start", startTime) - .param("end", endTime) - .param("detailed", "1") - .execute(); - } + .param("start", startTime) + .param("end", endTime) + .param("detailed", "1") + .execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerGroupServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerGroupServiceImpl.java index 373a9e25b..8bd0a6624 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerGroupServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerGroupServiceImpl.java @@ -1,38 +1,38 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.compute.ServerGroupService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.ServerGroup; import org.openstack4j.openstack.compute.domain.NovaServerGroup; import org.openstack4j.openstack.compute.domain.NovaServerGroup.ServerGroups; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + public class ServerGroupServiceImpl extends BaseComputeServices implements ServerGroupService { - @Override - public List list() { - return get(ServerGroups.class, uri("/os-server-groups")).execute().getList(); - } - - @Override - public ServerGroup get(String id) { - checkNotNull(id); - return get(NovaServerGroup.class, uri("/os-server-groups/%s", id)).execute(); - } - - @Override - public ActionResponse delete(String id) { - checkNotNull(id); - return deleteWithResponse(uri("/os-server-groups/%s", id)).execute(); - } - - @Override - public ServerGroup create(String name, String policy) { - NovaServerGroup nsg = NovaServerGroup.create(name, policy); - return post(NovaServerGroup.class, uri("/os-server-groups")).entity(nsg).execute(); - } + @Override + public List list() { + return get(ServerGroups.class, uri("/os-server-groups")).execute().getList(); + } + + @Override + public ServerGroup get(String id) { + checkNotNull(id); + return get(NovaServerGroup.class, uri("/os-server-groups/%s", id)).execute(); + } + + @Override + public ActionResponse delete(String id) { + checkNotNull(id); + return deleteWithResponse(uri("/os-server-groups/%s", id)).execute(); + } + + @Override + public ServerGroup create(String name, String policy) { + NovaServerGroup nsg = NovaServerGroup.create(name, policy); + return post(NovaServerGroup.class, uri("/os-server-groups")).entity(nsg).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerServiceImpl.java index 9c8a5b1f1..4c332ca8c 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerServiceImpl.java @@ -1,13 +1,5 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.openstack.compute.domain.actions.CreateSnapshotAction.create; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - import org.openstack4j.api.Apis; import org.openstack4j.api.compute.ServerService; import org.openstack4j.api.compute.ext.InstanceActionsService; @@ -16,52 +8,32 @@ import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.core.transport.propagation.PropagateOnStatus; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.compute.Action; -import org.openstack4j.model.compute.RebootType; -import org.openstack4j.model.compute.Server; +import org.openstack4j.model.compute.*; import org.openstack4j.model.compute.Server.Status; -import org.openstack4j.model.compute.ServerCreate; -import org.openstack4j.model.compute.ServerPassword; -import org.openstack4j.model.compute.ServerUpdateOptions; -import org.openstack4j.model.compute.VNCConsole; import org.openstack4j.model.compute.VNCConsole.Type; -import org.openstack4j.model.compute.VolumeAttachment; import org.openstack4j.model.compute.actions.BackupOptions; import org.openstack4j.model.compute.actions.EvacuateOptions; import org.openstack4j.model.compute.actions.LiveMigrateOptions; import org.openstack4j.model.compute.actions.RebuildOptions; import org.openstack4j.model.compute.builder.ServerCreateBuilder; import org.openstack4j.openstack.common.Metadata; -import org.openstack4j.openstack.compute.domain.AdminPass; -import org.openstack4j.openstack.compute.domain.ConsoleOutput; -import org.openstack4j.openstack.compute.domain.ConsoleOutputOptions; -import org.openstack4j.openstack.compute.domain.NovaPassword; -import org.openstack4j.openstack.compute.domain.NovaServer; +import org.openstack4j.openstack.compute.domain.*; import org.openstack4j.openstack.compute.domain.NovaServer.Servers; -import org.openstack4j.openstack.compute.domain.NovaServerCreate; -import org.openstack4j.openstack.compute.domain.NovaServerUpdate; -import org.openstack4j.openstack.compute.domain.NovaVNCConsole; -import org.openstack4j.openstack.compute.domain.NovaVolumeAttachment; -import org.openstack4j.openstack.compute.domain.actions.BackupAction; -import org.openstack4j.openstack.compute.domain.actions.BasicActions; -import org.openstack4j.openstack.compute.domain.actions.BasicActions.ChangePassword; -import org.openstack4j.openstack.compute.domain.actions.BasicActions.ConfirmResize; -import org.openstack4j.openstack.compute.domain.actions.BasicActions.Migrate; -import org.openstack4j.openstack.compute.domain.actions.BasicActions.Reboot; -import org.openstack4j.openstack.compute.domain.actions.BasicActions.Resize; -import org.openstack4j.openstack.compute.domain.actions.BasicActions.RevertResize; -import org.openstack4j.openstack.compute.domain.actions.CreateSnapshotAction; -import org.openstack4j.openstack.compute.domain.actions.EvacuateAction; -import org.openstack4j.openstack.compute.domain.actions.LiveMigrationAction; -import org.openstack4j.openstack.compute.domain.actions.RebuildAction; -import org.openstack4j.openstack.compute.domain.actions.ResetStateAction; -import org.openstack4j.openstack.compute.domain.actions.SecurityGroupActions; -import org.openstack4j.openstack.compute.domain.actions.ServerAction; +import org.openstack4j.openstack.compute.domain.actions.*; +import org.openstack4j.openstack.compute.domain.actions.BasicActions.*; import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; import org.openstack4j.openstack.compute.functions.WrapServerIfApplicableFunction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.openstack.compute.domain.actions.CreateSnapshotAction.create; + /** * Server Operation API implementation * @@ -132,8 +104,8 @@ public Server get(String serverId) { public Server boot(ServerCreate server) { checkNotNull(server); return post(NovaServer.class, uri("/servers")) - .entity(WrapServerIfApplicableFunction.INSTANCE.apply(server)) - .execute(); + .entity(WrapServerIfApplicableFunction.INSTANCE.apply(server)) + .execute(); } /** @@ -151,8 +123,8 @@ public Server bootAndWaitActive(ServerCreate server, int maxWaitTime) { public ActionResponse delete(String serverId) { checkNotNull(serverId); return ToActionResponseFunction.INSTANCE.apply( - delete(Void.class, uri("/servers/%s", serverId)).executeWithResponse() - ); + delete(Void.class, uri("/servers/%s", serverId)).executeWithResponse() + ); } /** @@ -193,8 +165,7 @@ private String invokeCreateSnapshotAction(String serverId, String snapshotName, String id = null; if (response.getStatus() == 202) { String location = response.header("location"); - if (location != null && location.contains("/")) - { + if (location != null && location.contains("/")) { String[] s = location.split("/"); id = s[s.length - 1]; } @@ -280,9 +251,9 @@ public String getConsoleOutput(String serverId, int numLines) { // Build options with the given numLines or default to full output ConsoleOutputOptions consoleOutputOptions; if (numLines <= 0) - consoleOutputOptions = new ConsoleOutputOptions(); + consoleOutputOptions = new ConsoleOutputOptions(); else - consoleOutputOptions = new ConsoleOutputOptions(numLines); + consoleOutputOptions = new ConsoleOutputOptions(numLines); ConsoleOutput c = post(ConsoleOutput.class, uri("/servers/%s/action", serverId)) .entity(consoleOutputOptions).execute(); @@ -299,8 +270,8 @@ public VNCConsole getVNCConsole(String serverId, Type type) { type = Type.NOVNC; return post(NovaVNCConsole.class, uri("/servers/%s/action", serverId)) - .entity(NovaVNCConsole.getConsoleForType(type)) - .execute(); + .entity(NovaVNCConsole.getConsoleForType(type)) + .execute(); } /** @@ -336,8 +307,8 @@ public VolumeAttachment attachVolume(String serverId, String volumeId, String de @Override public ActionResponse detachVolume(String serverId, String attachmentId) { return ToActionResponseFunction.INSTANCE.apply( - delete(Void.class,uri("/servers/%s/os-volume_attachments/%s", serverId, attachmentId)).executeWithResponse() - ); + delete(Void.class, uri("/servers/%s/os-volume_attachments/%s", serverId, attachmentId)).executeWithResponse() + ); } /** @@ -399,7 +370,7 @@ public Server waitForServerStatus(String serverId, Status status, int maxWait, T Server server = null; long duration = 0; long maxTime = maxWaitUnit.toMillis(maxWait); - while ( duration < maxTime ) { + while (duration < maxTime) { server = get(serverId); if (server == null || server.getStatus() == status || server.getStatus() == Status.ERROR) @@ -437,8 +408,8 @@ public ActionResponse deleteMetadataItem(String serverId, String key) { checkNotNull(serverId); checkNotNull(key); return ToActionResponseFunction.INSTANCE.apply( - delete(Void.class, uri("/servers/%s/metadata/%s", serverId, key)).executeWithResponse() - ); + delete(Void.class, uri("/servers/%s/metadata/%s", serverId, key)).executeWithResponse() + ); } private int sleep(int ms) { @@ -475,17 +446,17 @@ public InstanceActionsService instanceActions() { public ServerPassword getPassword(String serverId) { checkNotNull(serverId); return get(NovaPassword.class, uri("/servers/%s/os-server-password", serverId)).execute(); - } - + } + /** * {@inheritDoc} */ @Override public ServerPassword evacuate(String serverId, EvacuateOptions options) { checkNotNull(serverId); - + return post(AdminPass.class, uri("/servers/%s/action", serverId)) - .entity(EvacuateAction.create(options)) - .execute(); + .entity(EvacuateAction.create(options)) + .execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerTagServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerTagServiceImpl.java index f43ebb8b7..48f19d413 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerTagServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServerTagServiceImpl.java @@ -1,7 +1,5 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - import org.openstack4j.api.compute.ServerTagService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.openstack.compute.domain.NovaServerTag; @@ -9,52 +7,54 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static com.google.common.base.Preconditions.checkNotNull; + public class ServerTagServiceImpl extends BaseComputeServices implements ServerTagService { - - private static final Logger LOG = LoggerFactory.getLogger(ServerTagServiceImpl.class); - - @Override - public NovaServerTag list(String serverId) { - checkNotNull(serverId); - return this.get(NovaServerTag.class, this.uri("/servers/%s/tags", serverId)).execute(); - } - - @Override - public NovaServerTag replace(String serverId, NovaServerTag tags) { - checkNotNull(serverId); - checkNotNull(tags); - return this.put(NovaServerTag.class, this.uri("/servers/%s/tags", serverId)).entity(tags).execute(); - } - - @Override - public ActionResponse deleteAll(String serverId) { - checkNotNull(serverId); - return ToActionResponseFunction.INSTANCE.apply( - this.delete(Void.class, this.uri("/servers/%s/tags", serverId)).executeWithResponse()); - } - - @Override - public ActionResponse delete(String serverId, String tag) { - checkNotNull(serverId); - checkNotNull(tag); - return ToActionResponseFunction.INSTANCE.apply( - this.delete(Void.class, this.uri("/servers/%s/tags/%s", serverId, tag)).executeWithResponse()); - } - - @Override - public ActionResponse check(String serverId, String tag) { - checkNotNull(serverId); - checkNotNull(tag); - return ToActionResponseFunction.INSTANCE.apply( - this.get(Void.class, this.uri("/servers/%s/tags/%s", serverId, tag)).executeWithResponse()); - } - - @Override - public ActionResponse addSingle(String serverId, String tag) { - checkNotNull(serverId); - checkNotNull(tag); - return ToActionResponseFunction.INSTANCE.apply( - this.put(ActionResponse.class, this.uri("/servers/%s/tags/%s", serverId, tag)).executeWithResponse()); - } + + private static final Logger LOG = LoggerFactory.getLogger(ServerTagServiceImpl.class); + + @Override + public NovaServerTag list(String serverId) { + checkNotNull(serverId); + return this.get(NovaServerTag.class, this.uri("/servers/%s/tags", serverId)).execute(); + } + + @Override + public NovaServerTag replace(String serverId, NovaServerTag tags) { + checkNotNull(serverId); + checkNotNull(tags); + return this.put(NovaServerTag.class, this.uri("/servers/%s/tags", serverId)).entity(tags).execute(); + } + + @Override + public ActionResponse deleteAll(String serverId) { + checkNotNull(serverId); + return ToActionResponseFunction.INSTANCE.apply( + this.delete(Void.class, this.uri("/servers/%s/tags", serverId)).executeWithResponse()); + } + + @Override + public ActionResponse delete(String serverId, String tag) { + checkNotNull(serverId); + checkNotNull(tag); + return ToActionResponseFunction.INSTANCE.apply( + this.delete(Void.class, this.uri("/servers/%s/tags/%s", serverId, tag)).executeWithResponse()); + } + + @Override + public ActionResponse check(String serverId, String tag) { + checkNotNull(serverId); + checkNotNull(tag); + return ToActionResponseFunction.INSTANCE.apply( + this.get(Void.class, this.uri("/servers/%s/tags/%s", serverId, tag)).executeWithResponse()); + } + + @Override + public ActionResponse addSingle(String serverId, String tag) { + checkNotNull(serverId); + checkNotNull(tag); + return ToActionResponseFunction.INSTANCE.apply( + this.put(ActionResponse.class, this.uri("/servers/%s/tags/%s", serverId, tag)).executeWithResponse()); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServicesServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServicesServiceImpl.java index 48b1e0f0a..037683464 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ServicesServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ServicesServiceImpl.java @@ -1,16 +1,16 @@ package org.openstack4j.openstack.compute.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.compute.ext.ServicesService; import org.openstack4j.model.compute.ext.Service; import org.openstack4j.openstack.compute.domain.ext.ExtService; import org.openstack4j.openstack.compute.domain.ext.ExtService.Services; import org.openstack4j.openstack.manila.domain.actions.ServiceAction; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Compute Services service provides CRUD capabilities for nova service(s). * @@ -25,57 +25,60 @@ public class ServicesServiceImpl extends BaseComputeServices implements Services public List list() { return get(Services.class, uri("/os-services")).execute().getList(); } - + /** - * Returns list of compute services filtered by parameters. - *

Author:Wang Ting/王婷

- * @Title: list - * @param filteringParams - * @return - * @see org.openstack4j.api.compute.ServicesService#list(java.util.Map) - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(Services.class, uri("/os-services")); - if (filteringParams != null) { + * Returns list of compute services filtered by parameters. + *

Author:Wang Ting/王婷

+ * + * @param filteringParams + * @return + * @Title: list + * @see org.openstack4j.api.compute.ServicesService#list(java.util.Map) + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(Services.class, uri("/os-services")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * Enables a compute services. - *

Author:Wang Ting/王婷

- * @Title: enableService - * @param binary - * @param host - * @return - * @see org.openstack4j.api.compute.ServicesService#enableService(java.lang.String, java.lang.String) - */ - @Override - public ExtService enableService(String binary, String host) { - checkNotNull(binary); - checkNotNull(host); + /** + * Enables a compute services. + *

Author:Wang Ting/王婷

+ * + * @param binary + * @param host + * @return + * @Title: enableService + * @see org.openstack4j.api.compute.ServicesService#enableService(java.lang.String, java.lang.String) + */ + @Override + public ExtService enableService(String binary, String host) { + checkNotNull(binary); + checkNotNull(host); - return put(ExtService.class, uri("/os-services/enable")).entity(ServiceAction.enable(binary, host)).execute(); - } + return put(ExtService.class, uri("/os-services/enable")).entity(ServiceAction.enable(binary, host)).execute(); + } - /** - * Disables a compute service. - *

Author:Wang Ting/王婷

- * @Title: disableService - * @param binary - * @param host - * @return - * @see org.openstack4j.api.compute.ServicesService#disableService(java.lang.String, java.lang.String) - */ - @Override - public ExtService disableService(String binary, String host) { - checkNotNull(binary); - checkNotNull(host); + /** + * Disables a compute service. + *

Author:Wang Ting/王婷

+ * + * @param binary + * @param host + * @return + * @Title: disableService + * @see org.openstack4j.api.compute.ServicesService#disableService(java.lang.String, java.lang.String) + */ + @Override + public ExtService disableService(String binary, String host) { + checkNotNull(binary); + checkNotNull(host); - return put(ExtService.class, uri("/os-services/disable")).entity(ServiceAction.disable(binary, host)).execute(); - } + return put(ExtService.class, uri("/os-services/disable")).entity(ServiceAction.disable(binary, host)).execute(); + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSDomainServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSDomainServiceImpl.java index 6c648104b..5cf6af63b 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSDomainServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSDomainServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.compute.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.compute.ext.FloatingIPDNSDomainService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.ext.DomainEntry; @@ -12,9 +8,13 @@ import org.openstack4j.openstack.compute.domain.ext.ExtDomainEntry.DomainEntries; import org.openstack4j.openstack.compute.internal.BaseComputeServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Service that handles domain names for the floating IP DNS Extension - * + * * @author Jeremy Unruh */ public class FloatingIPDNSDomainServiceImpl extends BaseComputeServices implements FloatingIPDNSDomainService { @@ -34,16 +34,16 @@ public ActionResponse delete(String domainName) { public DomainEntry createPublic(String domainName, String project) { checkNotNull(domainName); return put(ExtDomainEntry.class, uri("/os-floating-ip-dns/%s", domainName)) - .entity(new ExtDomainEntry(Scope.PUBLIC, null, project)) - .execute(); + .entity(new ExtDomainEntry(Scope.PUBLIC, null, project)) + .execute(); } @Override public DomainEntry createPrivate(String domainName, String availabilityZone) { checkNotNull(domainName); return put(ExtDomainEntry.class, uri("/os-floating-ip-dns/%s", domainName)) - .entity(new ExtDomainEntry(Scope.PRIVATE, availabilityZone, null)) - .execute(); + .entity(new ExtDomainEntry(Scope.PRIVATE, availabilityZone, null)) + .execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSEntryServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSEntryServiceImpl.java index b952e796a..6da7dd82b 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSEntryServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSEntryServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.compute.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.compute.ext.FloatingIPDNSEntryService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.ext.DNSEntry; @@ -12,9 +8,13 @@ import org.openstack4j.openstack.compute.domain.ext.ExtDNSEntry.DNSEntries; import org.openstack4j.openstack.compute.internal.BaseComputeServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * A Service which handles DNS Entries for the Floating IP DNS Extension - * + * * @author Jeremy Unruh */ public class FloatingIPDNSEntryServiceImpl extends BaseComputeServices implements FloatingIPDNSEntryService { @@ -29,7 +29,7 @@ public List listByIP(String domain, String ip) { public List listByName(String domain, String name) { checkNotNull(domain, "domain"); checkNotNull(name, "name"); - + return get(DNSEntries.class, uri("/os-floating-ip-dns/%s/entries/%s", domain, name)).execute().getList(); } @@ -52,8 +52,8 @@ public DNSEntry modifyIP(String domain, String name, String ip) { checkNotNull(ip, "ip"); return put(ExtDNSEntry.class, uri("/os-floating-ip-dns/%s/entries/%s", domain, name)) - .entity(new ExtDNSEntry(ip, DNSRecordType.A)) - .execute(); + .entity(new ExtDNSEntry(ip, DNSRecordType.A)) + .execute(); } @Override diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSServiceImpl.java index fe0c49c41..faff74a69 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/FloatingIPDNSServiceImpl.java @@ -7,7 +7,7 @@ /** * API Service that manages the 'os-floating-ip-dns' extension - * + * * @author Jeremy Unruh */ public class FloatingIPDNSServiceImpl implements FloatingIPDNSService { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InstanceActionsServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InstanceActionsServiceImpl.java index 847016140..2dade5b10 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InstanceActionsServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InstanceActionsServiceImpl.java @@ -1,18 +1,18 @@ package org.openstack4j.openstack.compute.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.compute.ext.InstanceActionsService; import org.openstack4j.model.compute.InstanceAction; import org.openstack4j.openstack.compute.domain.NovaInstanceAction; import org.openstack4j.openstack.compute.domain.NovaInstanceAction.NovaInstanceActions; import org.openstack4j.openstack.compute.internal.BaseComputeServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * API to list executed instance actions. - * + * * @author Christian Banse */ public class InstanceActionsServiceImpl extends BaseComputeServices implements InstanceActionsService { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InterfaceServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InterfaceServiceImpl.java index c2e5ca4cc..930e90110 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InterfaceServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/InterfaceServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.compute.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.compute.ext.InterfaceService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.compute.InterfaceAttachment; @@ -11,27 +7,31 @@ import org.openstack4j.openstack.compute.domain.NovaInterfaceAttachment.NovaInterfaceAttachments; import org.openstack4j.openstack.compute.internal.BaseComputeServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * API to Create, list, get details for, and delete port interfaces on a Server Instance - * + * * @author Jeremy Unruh */ -public class InterfaceServiceImpl extends BaseComputeServices implements InterfaceService { +public class InterfaceServiceImpl extends BaseComputeServices implements InterfaceService { @Override public InterfaceAttachment create(String serverId, String portId) { checkNotNull(serverId, "serverId"); checkNotNull(portId, "portId"); return post(NovaInterfaceAttachment.class, uri("/servers/%s/os-interface", serverId)) - .entity(new NovaInterfaceAttachment(portId)) - .execute(); + .entity(new NovaInterfaceAttachment(portId)) + .execute(); } @Override public List list(String serverId) { checkNotNull(serverId, "serverId"); - return get(NovaInterfaceAttachments.class , uri("/servers/%s/os-interface", serverId)) - .execute().getList(); + return get(NovaInterfaceAttachments.class, uri("/servers/%s/os-interface", serverId)) + .execute().getList(); } @Override diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/MigrationServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/MigrationServiceImpl.java index 08de6c3e9..a3c447318 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/MigrationServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/MigrationServiceImpl.java @@ -1,16 +1,16 @@ package org.openstack4j.openstack.compute.internal.ext; -import java.util.List; - import org.openstack4j.api.compute.ext.MigrationService; import org.openstack4j.model.compute.ext.Migration; import org.openstack4j.model.compute.ext.MigrationsFilter; import org.openstack4j.openstack.compute.domain.ext.ExtMigration.Migrations; import org.openstack4j.openstack.compute.internal.BaseComputeServices; +import java.util.List; + /** - * API which supports the "os-migrations" extension. - * + * API which supports the "os-migrations" extension. + * * @author Jeremy Unruh */ public class MigrationServiceImpl extends BaseComputeServices implements MigrationService { diff --git a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/ZoneServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/ZoneServiceImpl.java index 26153c825..debb7a673 100644 --- a/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/ZoneServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/compute/internal/ext/ZoneServiceImpl.java @@ -1,12 +1,12 @@ package org.openstack4j.openstack.compute.internal.ext; -import java.util.List; - import org.openstack4j.api.compute.ext.ZoneService; import org.openstack4j.model.compute.ext.AvailabilityZone; import org.openstack4j.openstack.compute.domain.ext.ExtAvailabilityZone.AvailabilityZones; import org.openstack4j.openstack.compute.internal.BaseComputeServices; +import java.util.List; + /** * Service implementation for ZoneService API */ diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/builder/DesignateV2Builders.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/builder/DesignateV2Builders.java index b73b6cfc8..8cd7778fb 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/builder/DesignateV2Builders.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/builder/DesignateV2Builders.java @@ -3,8 +3,8 @@ import org.openstack4j.model.dns.v2.builder.DNSV2Builders; import org.openstack4j.model.dns.v2.builder.RecordsetBuilder; import org.openstack4j.model.dns.v2.builder.ZoneBuilder; -import org.openstack4j.openstack.dns.v2.domain.DesignateZone; import org.openstack4j.openstack.dns.v2.domain.DesignateRecordset; +import org.openstack4j.openstack.dns.v2.domain.DesignateZone; /** * The Designate V2 Builders @@ -16,8 +16,12 @@ private DesignateV2Builders DesignateV2Builders() { } @Override - public ZoneBuilder zone() { return DesignateZone.builder(); } + public ZoneBuilder zone() { + return DesignateZone.builder(); + } @Override - public RecordsetBuilder recordset() { return DesignateRecordset.builder(); } + public RecordsetBuilder recordset() { + return DesignateRecordset.builder(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java index 571b1b43b..10ac8218e 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; - import org.openstack4j.model.dns.v2.Nameserver; import org.openstack4j.model.dns.v2.builder.NameserverBuilder; import org.openstack4j.openstack.common.ListResult; @@ -17,122 +16,122 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class DesignateNameserver implements Nameserver { - private static final long serialVersionUID = 1L; - private String hostname; - private Integer priority; - - /** - * @return the nameserver builder - */ - public static NameserverBuilder builder() { - return new NameserverConcreteBuilder(); - } - - @Override - public NameserverBuilder toBuilder() { - return new NameserverConcreteBuilder(this); - } - - @Override - public String getHostname() { - return hostname; - } - - @Override - public Integer getPriority() { - return priority; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("hostname", hostname) - .add("priority", priority) - .toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return Objects.hashCode(hostname, priority); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - DesignateNameserver that = DesignateNameserver.class.cast(obj); - return Objects.equal(this.hostname, that.hostname) - && Objects.equal(this.priority, that.priority); - } - - public static class NameserverConcreteBuilder implements NameserverBuilder { - - DesignateNameserver model; - - NameserverConcreteBuilder() { - this(new DesignateNameserver()); - } - - NameserverConcreteBuilder(DesignateNameserver model) { - this.model = model; - } - - @Override - public Nameserver build() { - return model; - } - - /** - * {@inheritDoc} - */ - @Override - public NameserverBuilder from(Nameserver in) { - if (in != null) - this.model = (DesignateNameserver) in; - return this; - } - - /** - * @see DesignateNameserver#getHostname() - */ - @Override - public NameserverBuilder hostname(String hostname) { - model.hostname = hostname; - return this; - } - - /** - * @see DesignateNameserver#getPriority() - */ - @Override - public NameserverBuilder priority(Integer priority) { - model.priority = priority; - return this; - } - - } - - public static class Nameservers extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("nameservers") - protected List list; - - @Override - public List value() { - return list; - } - } + private static final long serialVersionUID = 1L; + private String hostname; + private Integer priority; + + /** + * @return the nameserver builder + */ + public static NameserverBuilder builder() { + return new NameserverConcreteBuilder(); + } + + @Override + public NameserverBuilder toBuilder() { + return new NameserverConcreteBuilder(this); + } + + @Override + public String getHostname() { + return hostname; + } + + @Override + public Integer getPriority() { + return priority; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("hostname", hostname) + .add("priority", priority) + .toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return Objects.hashCode(hostname, priority); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null || getClass() != obj.getClass()) + return false; + DesignateNameserver that = DesignateNameserver.class.cast(obj); + return Objects.equal(this.hostname, that.hostname) + && Objects.equal(this.priority, that.priority); + } + + public static class NameserverConcreteBuilder implements NameserverBuilder { + + DesignateNameserver model; + + NameserverConcreteBuilder() { + this(new DesignateNameserver()); + } + + NameserverConcreteBuilder(DesignateNameserver model) { + this.model = model; + } + + @Override + public Nameserver build() { + return model; + } + + /** + * {@inheritDoc} + */ + @Override + public NameserverBuilder from(Nameserver in) { + if (in != null) + this.model = (DesignateNameserver) in; + return this; + } + + /** + * @see DesignateNameserver#getHostname() + */ + @Override + public NameserverBuilder hostname(String hostname) { + model.hostname = hostname; + return this; + } + + /** + * @see DesignateNameserver#getPriority() + */ + @Override + public NameserverBuilder priority(Integer priority) { + model.priority = priority; + return this; + } + + } + + public static class Nameservers extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("nameservers") + protected List list; + + @Override + public List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java index a549f5409..26d9f0010 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java @@ -4,9 +4,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; - -import org.openstack4j.model.dns.v2.Recordset; import org.openstack4j.model.dns.v2.Action; +import org.openstack4j.model.dns.v2.Recordset; import org.openstack4j.model.dns.v2.Status; import org.openstack4j.model.dns.v2.builder.RecordsetBuilder; import org.openstack4j.openstack.common.ListResult; @@ -39,7 +38,7 @@ public class DesignateRecordset implements Recordset { private String createdAt; @JsonProperty("updated_at") private String updatedAt; - private Map links; + private Map links; private List records; /** @@ -143,7 +142,7 @@ public String toString() { .add("action", action) .add("zoneId", zoneId) .add("zoneName", zoneName) - .add("description",description) + .add("description", description) .add("type", type) .add("version", version) .add("createdAt", createdAt) diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java index 26e9b87c3..d74e06693 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; - import org.openstack4j.model.dns.v2.Action; import org.openstack4j.model.dns.v2.Status; import org.openstack4j.model.dns.v2.Zone; @@ -157,7 +156,7 @@ public String toString() { .add("serial", serial) .add("status", status) .add("action", action) - .add("description",description) + .add("description", description) .add("masters", masters) .add("type", type) .add("transferredAt", transferredAt) diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/BaseDNSServices.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/BaseDNSServices.java index 3439ef531..ee00cceb9 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/BaseDNSServices.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/BaseDNSServices.java @@ -6,7 +6,7 @@ public class BaseDNSServices extends BaseOpenStackService { - protected BaseDNSServices() { - super(ServiceType.DNS, EnforceVersionToURL.instance("/v2")); - } + protected BaseDNSServices() { + super(ServiceType.DNS, EnforceVersionToURL.instance("/v2")); + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/DNSServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/DNSServiceImpl.java index 887fa1a51..607bfb66e 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/DNSServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/DNSServiceImpl.java @@ -4,16 +4,10 @@ import org.openstack4j.api.dns.v2.DNSService; import org.openstack4j.api.dns.v2.RecordsetService; import org.openstack4j.api.dns.v2.ZoneService; -import org.openstack4j.model.common.Extension; -import org.openstack4j.openstack.common.ExtensionValue.ExtensionList; -import org.openstack4j.openstack.internal.BaseOpenStackService; - -import java.util.List; /** * DNS/Designate V2 service implementation - * */ public class DNSServiceImpl extends BaseDNSServices implements DNSService { diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/RecordsetServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/RecordsetServiceImpl.java index 426639ec1..e491cde8b 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/RecordsetServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/RecordsetServiceImpl.java @@ -8,8 +8,8 @@ import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_ZONES; import static org.openstack4j.core.transport.ClientConstants.PATH_RECORDSETS; +import static org.openstack4j.core.transport.ClientConstants.PATH_ZONES; public class RecordsetServiceImpl extends BaseDNSServices implements RecordsetService { diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/ZoneServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/ZoneServiceImpl.java index da392ea94..b0b4017c6 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/ZoneServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/internal/ZoneServiceImpl.java @@ -6,13 +6,12 @@ import org.openstack4j.model.dns.v2.Zone; import org.openstack4j.openstack.dns.v2.domain.DesignateNameserver; import org.openstack4j.openstack.dns.v2.domain.DesignateZone; -import org.openstack4j.openstack.internal.BaseOpenStackService; import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_ZONES; import static org.openstack4j.core.transport.ClientConstants.PATH_NAMESERVERS; +import static org.openstack4j.core.transport.ClientConstants.PATH_ZONES; public class ZoneServiceImpl extends BaseDNSServices implements ZoneService { @@ -31,7 +30,7 @@ public ActionResponse delete(String zoneId) { @Override public List listNameservers(String zoneId) { checkNotNull(zoneId); - return get(DesignateNameserver.Nameservers.class, PATH_ZONES, "/",zoneId, PATH_NAMESERVERS).execute().getList(); + return get(DesignateNameserver.Nameservers.class, PATH_ZONES, "/", zoneId, PATH_NAMESERVERS).execute().getList(); } @Override diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicy.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicy.java index 25a6038f5..5324bcff1 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicy.java @@ -1,20 +1,20 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - -import org.openstack4j.model.gbp.ExternalPolicy; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.gbp.ExternalPolicy; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; + /** * Model implementation for External Policy * * @author vinod borole */ @JsonRootName("external_policy") -public class GbpExternalPolicy implements ExternalPolicy{ +public class GbpExternalPolicy implements ExternalPolicy { private static final long serialVersionUID = 1L; private String name; private String description; @@ -42,7 +42,7 @@ public String getTenantId() { */ @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } /** @@ -58,7 +58,7 @@ public String getName() { */ @Override public void setName(String name) { - this.name=name; + this.name = name; } /** @@ -74,7 +74,7 @@ public String getId() { */ @Override public void setId(String id) { - this.id=id; + this.id = id; } /** diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicyCreate.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicyCreate.java index 0673f3799..8a03cad47 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicyCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalPolicyCreate.java @@ -1,22 +1,22 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.gbp.ExternalPolicyCreate; -import org.openstack4j.model.gbp.builder.ExternalPolicyBuilder; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Maps; +import org.openstack4j.model.gbp.ExternalPolicyCreate; +import org.openstack4j.model.gbp.builder.ExternalPolicyBuilder; + +import java.util.List; +import java.util.Map; + /** * Model implementation for External Policy * * @author vinod borole */ @JsonRootName("external_policy") -public class GbpExternalPolicyCreate implements ExternalPolicyCreate{ +public class GbpExternalPolicyCreate implements ExternalPolicyCreate { private static final long serialVersionUID = 1L; private String name; private String description; @@ -24,9 +24,9 @@ public class GbpExternalPolicyCreate implements ExternalPolicyCreate{ private String tenantId; private String id; @JsonProperty("consumed_policy_rule_sets") - private Map consumedPolicyRuleSets; + private Map consumedPolicyRuleSets; @JsonProperty("provided_policy_rule_sets") - private Map providedPolicyRuleSets; + private Map providedPolicyRuleSets; @JsonProperty("external_segments") private List externalSegments; private Boolean shared; @@ -44,7 +44,7 @@ public String getTenantId() { */ @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } /** @@ -60,7 +60,7 @@ public String getName() { */ @Override public void setName(String name) { - this.name=name; + this.name = name; } /** @@ -76,14 +76,14 @@ public String getId() { */ @Override public void setId(String id) { - this.id=id; + this.id = id; } /** * {@inheritDoc} */ @Override - public Map getConsumedPolicyRuleSets() { + public Map getConsumedPolicyRuleSets() { return consumedPolicyRuleSets; } @@ -91,7 +91,7 @@ public Map getConsumedPolicyRuleSets() { * {@inheritDoc} */ @Override - public Map getProvidedPolicyRuleSets() { + public Map getProvidedPolicyRuleSets() { return providedPolicyRuleSets; } @@ -139,16 +139,16 @@ public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("name", name).add("tenantId", tenantId).add("externalSegments", externalSegments).add("id", id).add("description", description).add("shared", shared).add("consumedPolicyRuleSets", consumedPolicyRuleSets).add("providedPolicyRuleSets", providedPolicyRuleSets).toString(); } - public static class ExternalPolicyConcreteBuilder implements ExternalPolicyBuilder{ + public static class ExternalPolicyConcreteBuilder implements ExternalPolicyBuilder { private GbpExternalPolicyCreate extPolicy; - public ExternalPolicyConcreteBuilder(){ + public ExternalPolicyConcreteBuilder() { this(new GbpExternalPolicyCreate()); } public ExternalPolicyConcreteBuilder(GbpExternalPolicyCreate gbpExternalPolicy) { - this.extPolicy=gbpExternalPolicy; + this.extPolicy = gbpExternalPolicy; } @Override @@ -158,49 +158,49 @@ public ExternalPolicyCreate build() { @Override public ExternalPolicyBuilder from(ExternalPolicyCreate in) { - extPolicy = (GbpExternalPolicyCreate)in; + extPolicy = (GbpExternalPolicyCreate) in; return this; } @Override public ExternalPolicyBuilder name(String name) { - extPolicy.name=name; + extPolicy.name = name; return this; } @Override public ExternalPolicyBuilder description(String description) { - this.extPolicy.description=description; + this.extPolicy.description = description; return this; } @Override public ExternalPolicyBuilder isShared(boolean shared) { - this.extPolicy.shared=shared; + this.extPolicy.shared = shared; return this; } @Override public ExternalPolicyBuilder consumedPolicyRuleSets(List policyRuleSet) { - this.extPolicy.consumedPolicyRuleSets=Maps.newHashMap(); - for(String id : policyRuleSet ){ - this.extPolicy.consumedPolicyRuleSets.put(id, ""); - } + this.extPolicy.consumedPolicyRuleSets = Maps.newHashMap(); + for (String id : policyRuleSet) { + this.extPolicy.consumedPolicyRuleSets.put(id, ""); + } return this; } @Override public ExternalPolicyBuilder providedPolicyRuleSets(List policyRuleSet) { - this.extPolicy.providedPolicyRuleSets=Maps.newHashMap(); - for(String id : policyRuleSet ){ + this.extPolicy.providedPolicyRuleSets = Maps.newHashMap(); + for (String id : policyRuleSet) { this.extPolicy.providedPolicyRuleSets.put(id, ""); - } + } return this; } @Override public ExternalPolicyBuilder externalSegments(List externalSegmentIds) { - this.extPolicy.externalSegments=externalSegmentIds; + this.extPolicy.externalSegments = externalSegmentIds; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalRoutes.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalRoutes.java index 9ab8b3f60..08f2e152c 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalRoutes.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalRoutes.java @@ -1,10 +1,10 @@ package org.openstack4j.openstack.gbp.domain; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.ExternalRoutes; import org.openstack4j.model.gbp.builder.ExternalRoutesBuilder; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; /** * Model implementation for External Routes * @@ -20,9 +20,9 @@ public class GbpExternalRoutes implements ExternalRoutes { public GbpExternalRoutes() { } - public GbpExternalRoutes(String destination, String nexthop){ - this.destination=destination; - this.nexthop=nexthop; + public GbpExternalRoutes(String destination, String nexthop) { + this.destination = destination; + this.nexthop = nexthop; } /** @@ -40,13 +40,14 @@ public String getDestination() { public String getNexthop() { return nexthop; } + /** * {@inheritDoc} */ @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("destination", destination).add("nexthop", nexthop).toString(); + .add("destination", destination).add("nexthop", nexthop).toString(); } @Override @@ -54,11 +55,11 @@ public ExternalRoutesBuilder toBuilder() { return new ExternalRoutesConcreteBuilder(this); } - public static class ExternalRoutesConcreteBuilder implements ExternalRoutesBuilder{ + public static class ExternalRoutesConcreteBuilder implements ExternalRoutesBuilder { private GbpExternalRoutes extRoutes; public ExternalRoutesConcreteBuilder(GbpExternalRoutes gbpExternalRoutes) { - this.extRoutes=gbpExternalRoutes; + this.extRoutes = gbpExternalRoutes; } public ExternalRoutesConcreteBuilder() { @@ -72,19 +73,19 @@ public ExternalRoutes build() { @Override public ExternalRoutesBuilder from(ExternalRoutes in) { - extRoutes=(GbpExternalRoutes) in; + extRoutes = (GbpExternalRoutes) in; return this; } @Override public ExternalRoutesBuilder destination(String destination) { - extRoutes.destination=destination; + extRoutes.destination = destination; return this; } @Override public ExternalRoutesBuilder nextHop(String nextHop) { - extRoutes.nexthop=nextHop; + extRoutes.nexthop = nextHop; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalSegment.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalSegment.java index 2d4dcf826..bf131dcd4 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalSegment.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpExternalSegment.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; import org.openstack4j.model.gbp.ExternalRoutes; import org.openstack4j.model.gbp.ExternalSegment; import org.openstack4j.model.gbp.builder.ExternalSegmentBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; +import java.util.List; /** * Model implementation for External Segments @@ -50,7 +49,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -60,7 +59,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -70,13 +69,14 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } @Override public List getExternalPolicies() { return externalPolicies; } + @Override public int getIpVersion() { return ipVersion; @@ -101,6 +101,7 @@ public boolean isShared() { public String getSubnetId() { return subnetId; } + @Override public List getL3Policies() { return l3Policies; @@ -125,6 +126,7 @@ public List getExternalRoutes() { public ExternalSegmentBuilder toBuilder() { return new ExternalSegmentConcreteBuilder(this); } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("id", id).add("name", name).add("desription", description).add("tenantId", tenantId).add("externalPolicies", externalPolicies) @@ -145,16 +147,16 @@ public List value() { } } - public static class ExternalSegmentConcreteBuilder implements ExternalSegmentBuilder{ + public static class ExternalSegmentConcreteBuilder implements ExternalSegmentBuilder { private GbpExternalSegment extSegment; - public ExternalSegmentConcreteBuilder(){ + public ExternalSegmentConcreteBuilder() { this(new GbpExternalSegment()); } public ExternalSegmentConcreteBuilder(GbpExternalSegment gbpExternalSegment) { - this.extSegment=gbpExternalSegment; + this.extSegment = gbpExternalSegment; } @Override @@ -164,64 +166,64 @@ public ExternalSegment build() { @Override public ExternalSegmentBuilder from(ExternalSegment in) { - extSegment = (GbpExternalSegment)in; + extSegment = (GbpExternalSegment) in; return this; } @Override public ExternalSegmentBuilder name(String name) { - extSegment.name=name; + extSegment.name = name; return this; } @Override public ExternalSegmentBuilder description(String description) { - this.extSegment.description=description; + this.extSegment.description = description; return this; } @Override public ExternalSegmentBuilder externalPolicies(List extPolicyIds) { - this.extSegment.externalPolicies=extPolicyIds; + this.extSegment.externalPolicies = extPolicyIds; return this; } @Override public ExternalSegmentBuilder ipVersion(int ipVersion) { - this.extSegment.ipVersion=ipVersion; + this.extSegment.ipVersion = ipVersion; return this; } @Override public ExternalSegmentBuilder cidr(String cidr) { - this.extSegment.cidr=cidr; + this.extSegment.cidr = cidr; return this; } @Override public ExternalSegmentBuilder isShared(boolean shared) { - this.extSegment.shared=shared; + this.extSegment.shared = shared; return this; } @Override public ExternalSegmentBuilder externalRoutes(List extRoutes) { - this.extSegment.externalRoutes = Lists.newArrayList(); - for(ExternalRoutes externalRoute : extRoutes){ - this.extSegment.externalRoutes.add((GbpExternalRoutes) externalRoute); - } - return this; + this.extSegment.externalRoutes = Lists.newArrayList(); + for (ExternalRoutes externalRoute : extRoutes) { + this.extSegment.externalRoutes.add((GbpExternalRoutes) externalRoute); + } + return this; } @Override public ExternalSegmentBuilder subnetId(String subnetId) { - this.extSegment.subnetId=subnetId; + this.extSegment.subnetId = subnetId; return this; } @Override public ExternalSegmentBuilder isPortAddressTranslation(boolean isPortAddressTranslation) { - this.extSegment.portAddressTranslation=isPortAddressTranslation; + this.extSegment.portAddressTranslation = isPortAddressTranslation; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL2Policy.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL2Policy.java index ce0646417..9e03e1acd 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL2Policy.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL2Policy.java @@ -1,14 +1,14 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.L2Policy; import org.openstack4j.model.gbp.builder.L2PolicyBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; + /** * Model implementation for L2 Policy * @@ -38,7 +38,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -48,7 +48,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -58,13 +58,14 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } @Override public L2PolicyBuilder toBuilder() { - return new L2PolicyConcreteBuilder(this) ; + return new L2PolicyConcreteBuilder(this); } + @Override public String getDescription() { return description; @@ -98,7 +99,7 @@ public String toString() { } - public static class L2Policies extends ListResult{ + public static class L2Policies extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("l2_policies") private List l2Policies; @@ -110,12 +111,12 @@ protected List value() { } - public static class L2PolicyConcreteBuilder implements L2PolicyBuilder{ + public static class L2PolicyConcreteBuilder implements L2PolicyBuilder { private GbpL2Policy l2Policy; public L2PolicyConcreteBuilder(GbpL2Policy gbpL2Policy) { - this.l2Policy=gbpL2Policy; + this.l2Policy = gbpL2Policy; } public L2PolicyConcreteBuilder() { @@ -129,43 +130,43 @@ public L2Policy build() { @Override public L2PolicyBuilder from(L2Policy in) { - l2Policy= (GbpL2Policy) in; + l2Policy = (GbpL2Policy) in; return this; } @Override public L2PolicyBuilder name(String name) { - l2Policy.name=name; + l2Policy.name = name; return this; } @Override public L2PolicyBuilder description(String description) { - l2Policy.description=description; + l2Policy.description = description; return this; } @Override public L2PolicyBuilder isShared(boolean shared) { - l2Policy.shared=shared; + l2Policy.shared = shared; return this; } @Override public L2PolicyBuilder networkId(String id) { - l2Policy.id=id; + l2Policy.id = id; return this; } @Override public L2PolicyBuilder l3PolicyId(String id) { - l2Policy.l3PolicyId=id; + l2Policy.l3PolicyId = id; return this; } @Override public L2PolicyBuilder policyTargetGroups(List ids) { - l2Policy.policyTargetGroups=ids; + l2Policy.policyTargetGroups = ids; return this; } } @@ -175,5 +176,4 @@ public static L2PolicyBuilder builder() { } - } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL3Policy.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL3Policy.java index 80c2db0af..17f4882fc 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL3Policy.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpL3Policy.java @@ -1,17 +1,17 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.gbp.L3Policy; -import org.openstack4j.model.gbp.builder.L3PolicyBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Maps; +import org.openstack4j.model.gbp.L3Policy; +import org.openstack4j.model.gbp.builder.L3PolicyBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + /** * Model implementation for L3 Policy * @@ -39,7 +39,6 @@ public class GbpL3Policy implements L3Policy { private String subnetPrefixLength; - @Override public String getTenantId() { return tenantId; @@ -47,7 +46,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -57,7 +56,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -67,8 +66,9 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; @@ -121,7 +121,7 @@ public String toString() { .add("l2Policies", l2Policies).add("routers", routers).add("shared", shared).add("subnetPrefixLength", subnetPrefixLength).toString(); } - public static class L3Policies extends ListResult{ + public static class L3Policies extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("l3_policies") @@ -134,12 +134,12 @@ protected List value() { } - public static class L3PolicyConcreteBuilder implements L3PolicyBuilder{ + public static class L3PolicyConcreteBuilder implements L3PolicyBuilder { private GbpL3Policy l3Policy; public L3PolicyConcreteBuilder(GbpL3Policy gbpL3Policy) { - this.l3Policy=gbpL3Policy; + this.l3Policy = gbpL3Policy; } public L3PolicyConcreteBuilder() { @@ -159,44 +159,44 @@ public L3PolicyBuilder from(L3Policy in) { @Override public L3PolicyBuilder name(String name) { - this.l3Policy.name=name; + this.l3Policy.name = name; return this; } @Override public L3PolicyBuilder description(String description) { - this.l3Policy.description=description; + this.l3Policy.description = description; return this; } @Override public L3PolicyBuilder ipVersion(int ipVersion) { - this.l3Policy.ipVersion=ipVersion; + this.l3Policy.ipVersion = ipVersion; return this; } @Override public L3PolicyBuilder ippool(String ippool) { - this.l3Policy.ipPool=ippool; + this.l3Policy.ipPool = ippool; return this; } @Override public L3PolicyBuilder subnetPrefixLength(String subnetPrefixLength) { - this.l3Policy.subnetPrefixLength=subnetPrefixLength; + this.l3Policy.subnetPrefixLength = subnetPrefixLength; return this; } @Override public L3PolicyBuilder isShared(boolean shared) { - this.l3Policy.shared=shared; + this.l3Policy.shared = shared; return this; } @Override public L3PolicyBuilder externalSegments(List extSegmentIds) { this.l3Policy.externalSegments = Maps.newHashMap(); - for(String extSegId : extSegmentIds){ + for (String extSegId : extSegmentIds) { this.l3Policy.externalSegments.put(extSegId, new ArrayList()); } return this; diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNatPool.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNatPool.java index 1ca3f5abd..88571563e 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNatPool.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNatPool.java @@ -1,15 +1,15 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.IPVersionType; import org.openstack4j.model.gbp.NatPool; import org.openstack4j.model.gbp.builder.NatPoolBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; + /** * Model implementation for nat pool * @@ -40,7 +40,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -50,7 +50,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -60,8 +60,9 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; @@ -104,7 +105,7 @@ public String toString() { .add("subnetId", subnetId).add("shared", shared).toString(); } - public static class NatPools extends ListResult{ + public static class NatPools extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("nat_pools") @@ -117,12 +118,12 @@ protected List value() { } - public static class NatPoolConcreteBuilder implements NatPoolBuilder{ + public static class NatPoolConcreteBuilder implements NatPoolBuilder { private GbpNatPool natPool; public NatPoolConcreteBuilder(GbpNatPool gbpNatPool) { - this.natPool=gbpNatPool; + this.natPool = gbpNatPool; } public NatPoolConcreteBuilder() { @@ -136,43 +137,43 @@ public NatPool build() { @Override public NatPoolBuilder from(NatPool in) { - this.natPool=(GbpNatPool) in; + this.natPool = (GbpNatPool) in; return this; } @Override public NatPoolBuilder name(String name) { - this.natPool.name=name; + this.natPool.name = name; return this; } @Override public NatPoolBuilder description(String description) { - this.natPool.description=description; + this.natPool.description = description; return this; } @Override public NatPoolBuilder ipVersion(IPVersionType ipVersion) { - this.natPool.ipVersion=ipVersion.name(); + this.natPool.ipVersion = ipVersion.name(); return this; } @Override public NatPoolBuilder cidr(String cidr) { - this.natPool.ipPool=cidr; + this.natPool.ipPool = cidr; return this; } @Override public NatPoolBuilder isShared(boolean shared) { - this.natPool.shared=shared; + this.natPool.shared = shared; return this; } @Override public NatPoolBuilder externalSegmentId(String id) { - this.natPool.externalSegmentId=id; + this.natPool.externalSegmentId = id; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServiceParams.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServiceParams.java index d0b45e1b6..c15d1daac 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServiceParams.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServiceParams.java @@ -9,7 +9,7 @@ * Created by sumit gandhi on 7/4/2016. */ -public class GbpNetworkServiceParams implements NetworkServiceParams{ +public class GbpNetworkServiceParams implements NetworkServiceParams { @JsonProperty("type") private NetworkServiceParamType paramType; diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServicePolicy.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServicePolicy.java index b062c7706..9f6e9f8b4 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServicePolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpNetworkServicePolicy.java @@ -41,7 +41,9 @@ public String getId() { } @Override - public void setId(String id) { this.id = id; } + public void setId(String id) { + this.id = id; + } public String getDescription() { return description; @@ -116,31 +118,31 @@ public NetworkServicePolicy build() { @Override public NetworkServicePolicyBuilder from(NetworkServicePolicy in) { - this.networkServicePolicy=(GbpNetworkServicePolicy) in; + this.networkServicePolicy = (GbpNetworkServicePolicy) in; return this; } @Override public NetworkServicePolicyBuilder name(String name) { - this.networkServicePolicy.name=name; + this.networkServicePolicy.name = name; return this; } @Override public NetworkServicePolicyBuilder description(String description) { - this.networkServicePolicy.description=description; + this.networkServicePolicy.description = description; return this; } @Override public NetworkServicePolicyBuilder isShared(boolean shared) { - this.networkServicePolicy.shared=shared; + this.networkServicePolicy.shared = shared; return this; } @Override public NetworkServicePolicyBuilder gbpNetworkServiceParams(List gbpNetworkServiceParamsList) { - this.networkServicePolicy.gbpNetworkServiceParamsList=gbpNetworkServiceParamsList; + this.networkServicePolicy.gbpNetworkServiceParamsList = gbpNetworkServiceParamsList; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyAction.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyAction.java index dc33d6826..c7499ffef 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyAction.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyAction.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.PolicyAction; import org.openstack4j.model.gbp.builder.PolicyActionCreateBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * Model implementation for Policy Action @@ -42,7 +41,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -52,7 +51,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -62,12 +61,14 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; } + @Override public boolean isShared() { return this.shared == null ? false : shared; @@ -88,7 +89,8 @@ public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("id", id).add("name", name).add("desription", description) .add("tenantId", tenantId).add("actionType", actionType).add("actionValue", actionValue).add("shared", shared).toString(); } - public static class PolicyActions extends ListResult{ + + public static class PolicyActions extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("policy_actions") private List policyActions; @@ -100,12 +102,12 @@ protected List value() { } - public static class PolicyActionConcreteBuilder implements PolicyActionCreateBuilder{ + public static class PolicyActionConcreteBuilder implements PolicyActionCreateBuilder { private GbpPolicyAction policyAction; public PolicyActionConcreteBuilder(GbpPolicyAction gbpPolicyAction) { - this.policyAction=gbpPolicyAction; + this.policyAction = gbpPolicyAction; } public PolicyActionConcreteBuilder() { @@ -119,31 +121,31 @@ public PolicyAction build() { @Override public PolicyActionCreateBuilder from(PolicyAction in) { - this.policyAction=(GbpPolicyAction) in; + this.policyAction = (GbpPolicyAction) in; return this; } @Override public PolicyActionCreateBuilder name(String name) { - this.policyAction.name=name; + this.policyAction.name = name; return this; } @Override public PolicyActionCreateBuilder description(String description) { - this.policyAction.description=description; + this.policyAction.description = description; return this; } @Override public PolicyActionCreateBuilder actionType(PolicyActionProtocol actionType) { - this.policyAction.actionType=actionType; + this.policyAction.actionType = actionType; return this; } @Override public PolicyActionCreateBuilder shared(boolean shared) { - this.policyAction.shared=shared; + this.policyAction.shared = shared; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyActionUpdate.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyActionUpdate.java index 5de769be9..42a1b7a4a 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyActionUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyActionUpdate.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.gbp.domain; -import org.openstack4j.model.gbp.PolicyActionUpdate; -import org.openstack4j.model.gbp.builder.PolicyActionUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.gbp.PolicyActionUpdate; +import org.openstack4j.model.gbp.builder.PolicyActionUpdateBuilder; /** * Model implementation for Policy Action @@ -33,22 +32,24 @@ public String getName() { public String getDescription() { return description; } + @Override public boolean isShared() { return this.shared == null ? false : shared; } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("name", name).add("desription", description) - .add("shared", shared).toString(); + .add("shared", shared).toString(); } - public static class PolicyActionUpdateConcreteBuilder implements PolicyActionUpdateBuilder{ + public static class PolicyActionUpdateConcreteBuilder implements PolicyActionUpdateBuilder { private GbpPolicyActionUpdate policyAction; public PolicyActionUpdateConcreteBuilder(GbpPolicyActionUpdate gbpPolicyAction) { - this.policyAction=gbpPolicyAction; + this.policyAction = gbpPolicyAction; } public PolicyActionUpdateConcreteBuilder() { @@ -62,26 +63,26 @@ public PolicyActionUpdate build() { @Override public PolicyActionUpdateBuilder name(String name) { - this.policyAction.name=name; + this.policyAction.name = name; return this; } @Override public PolicyActionUpdateBuilder description(String description) { - this.policyAction.description=description; + this.policyAction.description = description; return this; } @Override public PolicyActionUpdateBuilder shared(boolean shared) { - this.policyAction.shared=shared; + this.policyAction.shared = shared; return this; } @Override public PolicyActionUpdateBuilder from(PolicyActionUpdate in) { - this.policyAction=(GbpPolicyActionUpdate) in; + this.policyAction = (GbpPolicyActionUpdate) in; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifier.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifier.java index 1da8fd60f..5d78eba1c 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifier.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifier.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.Direction; import org.openstack4j.model.gbp.PolicyClassifier; import org.openstack4j.model.gbp.Protocol; import org.openstack4j.model.gbp.builder.PolicyClassifierBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * Model implementation for Policy Classifier @@ -32,7 +31,6 @@ public class GbpPolicyClassifier implements PolicyClassifier { private Boolean shared; - @Override public PolicyClassifierBuilder toBuilder() { return new PolicyClassifierConcreteBuilder(this); @@ -45,7 +43,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -55,7 +53,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -65,8 +63,9 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; @@ -91,16 +90,19 @@ public Protocol getProtocol() { public boolean isShared() { return this.shared == null ? false : shared; } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("id", id).add("name", name).add("desription", description) .add("tenantId", tenantId).add("portRange", portRange).add("protocol", protocol).add("shared", shared).toString(); } - public static class PolicyClassifiers extends ListResult{ + + public static class PolicyClassifiers extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("policy_classifiers") private List policyClassfiers; + @Override protected List value() { return policyClassfiers; @@ -108,11 +110,12 @@ protected List value() { } - public static class PolicyClassifierConcreteBuilder implements PolicyClassifierBuilder{ + public static class PolicyClassifierConcreteBuilder implements PolicyClassifierBuilder { private GbpPolicyClassifier policyClassfier; + public PolicyClassifierConcreteBuilder(GbpPolicyClassifier gbpPolicyClassifier) { - this.policyClassfier=gbpPolicyClassifier; + this.policyClassfier = gbpPolicyClassifier; } public PolicyClassifierConcreteBuilder() { @@ -126,61 +129,61 @@ public PolicyClassifier build() { @Override public PolicyClassifierBuilder from(PolicyClassifier in) { - this.policyClassfier=(GbpPolicyClassifier) in; + this.policyClassfier = (GbpPolicyClassifier) in; return this; } @Override public PolicyClassifierBuilder name(String name) { - this.policyClassfier.name=name; + this.policyClassfier.name = name; return this; } @Override public PolicyClassifierBuilder description(String description) { - this.policyClassfier.description=description; + this.policyClassfier.description = description; return this; } @Override public PolicyClassifierBuilder portRangeMin(int min) { - String range=""; - if(this.policyClassfier.portRange!=null && !this.policyClassfier.portRange.isEmpty()) - range=min+":"+this.policyClassfier.portRange; + String range = ""; + if (this.policyClassfier.portRange != null && !this.policyClassfier.portRange.isEmpty()) + range = min + ":" + this.policyClassfier.portRange; else - range=""+min; + range = "" + min; - this.policyClassfier.portRange=range; + this.policyClassfier.portRange = range; return this; } @Override public PolicyClassifierBuilder portRangeMax(int max) { - String range=""; - if(this.policyClassfier.portRange!=null && !this.policyClassfier.portRange.isEmpty()) - range=this.policyClassfier.portRange+":"+max; + String range = ""; + if (this.policyClassfier.portRange != null && !this.policyClassfier.portRange.isEmpty()) + range = this.policyClassfier.portRange + ":" + max; else - range=""+max; + range = "" + max; - this.policyClassfier.portRange=range; + this.policyClassfier.portRange = range; return this; } @Override public PolicyClassifierBuilder direction(Direction direction) { - this.policyClassfier.direction=direction.value(); + this.policyClassfier.direction = direction.value(); return this; } @Override public PolicyClassifierBuilder protocol(Protocol protocol) { - this.policyClassfier.protocol=protocol.value(); + this.policyClassfier.protocol = protocol.value(); return this; } @Override public PolicyClassifierBuilder shared(boolean shared) { - this.policyClassfier.shared=shared; + this.policyClassfier.shared = shared; return this; } @@ -188,7 +191,7 @@ public PolicyClassifierBuilder shared(boolean shared) { public static PolicyClassifierBuilder builder() { - return new PolicyClassifierConcreteBuilder() ; + return new PolicyClassifierConcreteBuilder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifierUpdate.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifierUpdate.java index 1a9e08cb7..5f11366fa 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifierUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyClassifierUpdate.java @@ -1,15 +1,15 @@ package org.openstack4j.openstack.gbp.domain; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.gbp.Direction; import org.openstack4j.model.gbp.PolicyClassifierUpdate; import org.openstack4j.model.gbp.Protocol; import org.openstack4j.model.gbp.builder.PolicyClassifierUpdateBuilder; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; /** * Model implementation for Policy Classifier Update - * + * * @author vinod borole */ @JsonRootName("policy_classifier") @@ -23,7 +23,7 @@ public class GbpPolicyClassifierUpdate implements PolicyClassifierUpdate { private Protocol protocol; private Boolean shared; private String name; - + @Override public String getDescription() { return description; @@ -60,7 +60,7 @@ public boolean isShared() { public Protocol getProtocol() { return protocol; } - + public void setProtocol(Protocol protocol) { this.protocol = protocol; } @@ -79,9 +79,9 @@ public PolicyClassifierUpdateBuilder toBuilder() { } public static PolicyClassifierUpdateBuilder builder() { - return new PolicyClassifierUpdateConcreteBuilder() ; + return new PolicyClassifierUpdateConcreteBuilder(); } - + public String getName() { return name; } @@ -90,75 +90,83 @@ public void setName(String name) { this.name = name; } - public static class PolicyClassifierUpdateConcreteBuilder implements PolicyClassifierUpdateBuilder{ + public static class PolicyClassifierUpdateConcreteBuilder implements PolicyClassifierUpdateBuilder { private GbpPolicyClassifierUpdate policyClassfierUpdate; + @Override public PolicyClassifierUpdate build() { return policyClassfierUpdate; } + public PolicyClassifierUpdateConcreteBuilder(GbpPolicyClassifierUpdate gbpPolicyClassifierUpdate) { - this.policyClassfierUpdate=gbpPolicyClassifierUpdate; + this.policyClassfierUpdate = gbpPolicyClassifierUpdate; } - + public PolicyClassifierUpdateConcreteBuilder() { this(new GbpPolicyClassifierUpdate()); } + @Override public PolicyClassifierUpdateBuilder from(PolicyClassifierUpdate in) { - this.policyClassfierUpdate=(GbpPolicyClassifierUpdate) in; + this.policyClassfierUpdate = (GbpPolicyClassifierUpdate) in; return this; } + @Override public PolicyClassifierUpdateBuilder name(String name) { - this.policyClassfierUpdate.name=name; + this.policyClassfierUpdate.name = name; return this; } + @Override public PolicyClassifierUpdateBuilder description(String description) { - this.policyClassfierUpdate.description=description; + this.policyClassfierUpdate.description = description; return this; } + @Override public PolicyClassifierUpdateBuilder shared(boolean shared) { - this.policyClassfierUpdate.shared=shared; + this.policyClassfierUpdate.shared = shared; return this; } + @Override public PolicyClassifierUpdateBuilder portRangeMin(int min) { - String range=""; - if(this.policyClassfierUpdate.portRange!=null && !this.policyClassfierUpdate.portRange.isEmpty()) - range=min+":"+this.policyClassfierUpdate.portRange; + String range = ""; + if (this.policyClassfierUpdate.portRange != null && !this.policyClassfierUpdate.portRange.isEmpty()) + range = min + ":" + this.policyClassfierUpdate.portRange; else - range=""+min; - - this.policyClassfierUpdate.portRange=range; - return this; + range = "" + min; + + this.policyClassfierUpdate.portRange = range; + return this; } - + @Override public PolicyClassifierUpdateBuilder portRangeMax(int max) { - String range=""; - if(this.policyClassfierUpdate.portRange!=null && !this.policyClassfierUpdate.portRange.isEmpty()) - range=this.policyClassfierUpdate.portRange+":"+max; + String range = ""; + if (this.policyClassfierUpdate.portRange != null && !this.policyClassfierUpdate.portRange.isEmpty()) + range = this.policyClassfierUpdate.portRange + ":" + max; else - range=""+max; - - this.policyClassfierUpdate.portRange=range; - return this; + range = "" + max; + + this.policyClassfierUpdate.portRange = range; + return this; } - + @Override public PolicyClassifierUpdateBuilder direction(Direction direction) { - this.policyClassfierUpdate.direction=direction; + this.policyClassfierUpdate.direction = direction; return this; } + @Override public PolicyClassifierUpdateBuilder protocol(Protocol protocol) { - this.policyClassfierUpdate.protocol=protocol; + this.policyClassfierUpdate.protocol = protocol; return this; } - - + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRule.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRule.java index a1d3d5dd9..16b5b1742 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRule.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRule.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.PolicyRule; import org.openstack4j.model.gbp.builder.PolicyRuleBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * Model implementation for Policy rule @@ -36,6 +35,7 @@ public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("id", id).add("name", name).add("desription", description) .add("tenantId", tenantId).add("policyClassifierId", policyClassifierId).add("policyActions", policyActions).add("shared", shared).add("enabled", enabled).toString(); } + @Override public String getTenantId() { return tenantId; @@ -43,7 +43,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -53,7 +53,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -63,16 +63,19 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; } + @Override public String getPolicyClassifierId() { return policyClassifierId; } + @Override public List getPolicyActions() { return policyActions; @@ -93,11 +96,12 @@ public PolicyRuleBuilder toBuilder() { return new PolicyRuleConcreteBuilder(this); } - public static class PolicyRules extends ListResult{ + public static class PolicyRules extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("policy_rules") private List policyRules; + @Override protected List value() { return policyRules; @@ -105,12 +109,12 @@ protected List value() { } - public static class PolicyRuleConcreteBuilder implements PolicyRuleBuilder{ + public static class PolicyRuleConcreteBuilder implements PolicyRuleBuilder { private GbpPolicyRule policyRule; public PolicyRuleConcreteBuilder(GbpPolicyRule gbpPolicyRule) { - this.policyRule=gbpPolicyRule; + this.policyRule = gbpPolicyRule; } public PolicyRuleConcreteBuilder() { @@ -124,37 +128,37 @@ public PolicyRule build() { @Override public PolicyRuleBuilder from(PolicyRule in) { - this.policyRule=(GbpPolicyRule) in; + this.policyRule = (GbpPolicyRule) in; return this; } @Override public PolicyRuleBuilder name(String name) { - this.policyRule.name=name; + this.policyRule.name = name; return this; } @Override public PolicyRuleBuilder description(String description) { - this.policyRule.description=description; + this.policyRule.description = description; return this; } @Override public PolicyRuleBuilder shared(boolean shared) { - this.policyRule.shared=shared; + this.policyRule.shared = shared; return this; } @Override public PolicyRuleBuilder classifier(String classifierId) { - this.policyRule.policyClassifierId=classifierId; + this.policyRule.policyClassifierId = classifierId; return this; } @Override public PolicyRuleBuilder actions(List actionIds) { - this.policyRule.policyActions=actionIds; + this.policyRule.policyActions = actionIds; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRuleSet.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRuleSet.java index c12fab0fd..46f02ed3f 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRuleSet.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyRuleSet.java @@ -1,14 +1,14 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.PolicyRuleSet; import org.openstack4j.model.gbp.builder.PolicyRuleSetBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; + /** * Model implementation for Policy rule set * @@ -38,7 +38,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -48,7 +48,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -58,8 +58,9 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; @@ -79,6 +80,7 @@ public String getParentId() { public List getChildPolicyRuleSets() { return childPolicyRuleSets; } + @Override public List getPolicyRules() { return policyRules; @@ -88,29 +90,32 @@ public List getPolicyRules() { public PolicyRuleSetBuilder toBuilder() { return new PolicyRuleSetConcreteBuilder(this); } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("id", id).add("name", name).add("desription", description) .add("tenantId", tenantId).add("parentId", parentId).add("childPolicyRuleSets", childPolicyRuleSets).add("shared", shared).add("policyRules", policyRules).toString(); } - public static class PolicyRuleSets extends ListResult{ + public static class PolicyRuleSets extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("policy_rule_sets") private List policyRuleSets; + @Override protected List value() { return policyRuleSets; } } - public static class PolicyRuleSetConcreteBuilder implements PolicyRuleSetBuilder{ + + public static class PolicyRuleSetConcreteBuilder implements PolicyRuleSetBuilder { private GbpPolicyRuleSet policyRuleSet; public PolicyRuleSetConcreteBuilder(GbpPolicyRuleSet gbpPolicyRuleSet) { - this.policyRuleSet=gbpPolicyRuleSet; + this.policyRuleSet = gbpPolicyRuleSet; } public PolicyRuleSetConcreteBuilder() { @@ -124,35 +129,36 @@ public PolicyRuleSet build() { @Override public PolicyRuleSetBuilder from(PolicyRuleSet in) { - this.policyRuleSet=(GbpPolicyRuleSet) in; + this.policyRuleSet = (GbpPolicyRuleSet) in; return this; } @Override public PolicyRuleSetBuilder name(String name) { - this.policyRuleSet.name=name; + this.policyRuleSet.name = name; return this; } @Override public PolicyRuleSetBuilder description(String description) { - this.policyRuleSet.description=description; + this.policyRuleSet.description = description; return this; } @Override public PolicyRuleSetBuilder shared(boolean shared) { - this.policyRuleSet.shared=shared; + this.policyRuleSet.shared = shared; return this; } @Override public PolicyRuleSetBuilder rules(List ruleIds) { - this.policyRuleSet.policyRules=ruleIds; + this.policyRuleSet.policyRules = ruleIds; return this; } } + public static PolicyRuleSetBuilder builder() { return new PolicyRuleSetConcreteBuilder(); } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTarget.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTarget.java index 4221c3eb0..5efd8a2f4 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTarget.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTarget.java @@ -1,14 +1,14 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.gbp.PolicyTarget; import org.openstack4j.model.gbp.builder.PolicyTargetBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; + /** * Model implementation for Policy Target * @@ -38,7 +38,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -48,7 +48,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -58,8 +58,9 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; @@ -84,17 +85,19 @@ public String getPortId() { public PolicyTargetBuilder toBuilder() { return new PolicyTargetConcreteBuilder(this); } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("id", id).add("name", name).add("desription", description) .add("tenantId", tenantId).add("clusterId", clusterId).add("policyTargetGroupId", policyTargetGroupId).add("portId", portId).toString(); } - public static class PolicyTargets extends ListResult{ + public static class PolicyTargets extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("policy_targets") private List policyTargets; + @Override protected List value() { return policyTargets; @@ -102,11 +105,12 @@ protected List value() { } - public static class PolicyTargetConcreteBuilder implements PolicyTargetBuilder{ + public static class PolicyTargetConcreteBuilder implements PolicyTargetBuilder { private GbpPolicyTarget policyTarget; + public PolicyTargetConcreteBuilder(GbpPolicyTarget gbpPolicyTarget) { - this.policyTarget=gbpPolicyTarget; + this.policyTarget = gbpPolicyTarget; } public PolicyTargetConcreteBuilder() { @@ -120,37 +124,37 @@ public PolicyTarget build() { @Override public PolicyTargetBuilder from(PolicyTarget in) { - policyTarget=(GbpPolicyTarget) in; + policyTarget = (GbpPolicyTarget) in; return this; } @Override public PolicyTargetBuilder portId(String portId) { - policyTarget.portId=portId; + policyTarget.portId = portId; return this; } @Override public PolicyTargetBuilder policyTargetGroupId(String policyTargetGroupId) { - policyTarget.policyTargetGroupId=policyTargetGroupId; + policyTarget.policyTargetGroupId = policyTargetGroupId; return this; } @Override public PolicyTargetBuilder clusterId(String clusterId) { - policyTarget.clusterId=clusterId; + policyTarget.clusterId = clusterId; return this; } @Override public PolicyTargetBuilder description(String description) { - policyTarget.description=description; + policyTarget.description = description; return this; } @Override public PolicyTargetBuilder name(String name) { - policyTarget.name=name; + policyTarget.name = name; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroup.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroup.java index fd36a8bce..f8c362802 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroup.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; - -import org.openstack4j.model.gbp.PolicyTargetGroup; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.gbp.PolicyTargetGroup; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * Model implementation for Policy target group @@ -47,7 +46,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -57,7 +56,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -67,12 +66,14 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; } + @Override public List getConsumedPolicyRuleSets() { return consumedPolicyRuleSets; @@ -122,8 +123,7 @@ public String toString() { } - - public static class PolicyTargetGroups extends ListResult{ + public static class PolicyTargetGroups extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("policy_target_groups") @@ -136,5 +136,4 @@ public List value() { } - } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroupCreate.java b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroupCreate.java index 5d307a294..d4654024f 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroupCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/domain/GbpPolicyTargetGroupCreate.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.gbp.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.gbp.PolicyTargetGroupCreate; -import org.openstack4j.model.gbp.builder.PolicyTargetGroupBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Maps; +import org.openstack4j.model.gbp.PolicyTargetGroupCreate; +import org.openstack4j.model.gbp.builder.PolicyTargetGroupBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; /** * Model implementation for Policy target group create @@ -27,9 +26,9 @@ public class GbpPolicyTargetGroupCreate implements PolicyTargetGroupCreate { private String id; private String description; @JsonProperty("consumed_policy_rule_sets") - private Map consumedPolicyRuleSets; + private Map consumedPolicyRuleSets; @JsonProperty("provided_policy_rule_sets") - private Map providedPolicyRuleSets; + private Map providedPolicyRuleSets; @JsonProperty("l2_policy_id") private String l2PolicyId; @JsonProperty("network_service_policy_id") @@ -41,6 +40,7 @@ public class GbpPolicyTargetGroupCreate implements PolicyTargetGroupCreate { private Boolean shared; @JsonProperty("subnets") private List subnets; + @Override public PolicyTargetGroupBuilder toBuilder() { return new PolicyTargetConcreteGroupBuilder(this); @@ -53,7 +53,7 @@ public String getTenantId() { @Override public void setTenantId(String tenantId) { - this.tenantId=tenantId; + this.tenantId = tenantId; } @Override @@ -63,7 +63,7 @@ public String getName() { @Override public void setName(String name) { - this.name=name; + this.name = name; } @Override @@ -73,19 +73,21 @@ public String getId() { @Override public void setId(String id) { - this.id=id; + this.id = id; } + @Override public String getDescription() { return description; } + @Override - public Map getConsumedPolicyRuleSets() { + public Map getConsumedPolicyRuleSets() { return consumedPolicyRuleSets; } @Override - public Map getProvidedPolicyRuleSets() { + public Map getProvidedPolicyRuleSets() { return providedPolicyRuleSets; } @@ -128,8 +130,7 @@ public String toString() { } - - public static class PolicyTargetGroups extends ListResult{ + public static class PolicyTargetGroups extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("policy_target_groups") @@ -141,11 +142,11 @@ public List value() { } } - public static class PolicyTargetConcreteGroupBuilder implements PolicyTargetGroupBuilder{ + public static class PolicyTargetConcreteGroupBuilder implements PolicyTargetGroupBuilder { private GbpPolicyTargetGroupCreate policyTargetGroup; public PolicyTargetConcreteGroupBuilder(GbpPolicyTargetGroupCreate gbpPolicyTargetGroup) { - this.policyTargetGroup=gbpPolicyTargetGroup; + this.policyTargetGroup = gbpPolicyTargetGroup; } public PolicyTargetConcreteGroupBuilder() { @@ -159,67 +160,67 @@ public PolicyTargetGroupCreate build() { @Override public PolicyTargetGroupBuilder from(PolicyTargetGroupCreate in) { - policyTargetGroup=(GbpPolicyTargetGroupCreate) in; + policyTargetGroup = (GbpPolicyTargetGroupCreate) in; return this; } @Override public PolicyTargetGroupBuilder name(String name) { - policyTargetGroup.name=name; + policyTargetGroup.name = name; return this; } @Override public PolicyTargetGroupBuilder description(String description) { - this.policyTargetGroup.description=description; + this.policyTargetGroup.description = description; return this; } @Override public PolicyTargetGroupBuilder isShared(boolean shared) { - this.policyTargetGroup.shared=shared; + this.policyTargetGroup.shared = shared; return this; } @Override public PolicyTargetGroupBuilder consumedPolicyRuleSets(List policyRuleSet) { - this.policyTargetGroup.consumedPolicyRuleSets=Maps.newHashMap(); - for(String id : policyRuleSet ){ - this.policyTargetGroup.consumedPolicyRuleSets.put(id, ""); + this.policyTargetGroup.consumedPolicyRuleSets = Maps.newHashMap(); + for (String id : policyRuleSet) { + this.policyTargetGroup.consumedPolicyRuleSets.put(id, ""); } return this; } @Override public PolicyTargetGroupBuilder providedPolicyRuleSets(List policyRuleSet) { - this.policyTargetGroup.providedPolicyRuleSets=Maps.newHashMap(); - for(String id : policyRuleSet ){ - this.policyTargetGroup.providedPolicyRuleSets.put(id, ""); + this.policyTargetGroup.providedPolicyRuleSets = Maps.newHashMap(); + for (String id : policyRuleSet) { + this.policyTargetGroup.providedPolicyRuleSets.put(id, ""); } return this; } @Override public PolicyTargetGroupBuilder policyTargets(List policyTargets) { - this.policyTargetGroup.policyTargets=policyTargets; + this.policyTargetGroup.policyTargets = policyTargets; return this; } @Override public PolicyTargetGroupBuilder networkServicePolicyId(String id) { - this.policyTargetGroup.networkServicePolicyId=id; + this.policyTargetGroup.networkServicePolicyId = id; return this; } @Override public PolicyTargetGroupBuilder l2Policy(String id) { - this.policyTargetGroup.l2PolicyId=id; + this.policyTargetGroup.l2PolicyId = id; return this; } @Override public PolicyTargetGroupBuilder serviceManagement(boolean serviceManagement) { - this.policyTargetGroup.serviceManagement=serviceManagement; + this.policyTargetGroup.serviceManagement = serviceManagement; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalPolicyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalPolicyServiceImpl.java index db2465802..4bd60520b 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalPolicyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalPolicyServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.ExternalPolicyService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.ExternalPolicy; @@ -12,9 +7,15 @@ import org.openstack4j.openstack.gbp.domain.GbpExternalPolicy; import org.openstack4j.openstack.gbp.domain.GbpExternalPolicy.ExternalPolicies; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * External Policy API Implementation - * + * * @author vinod borole */ public class ExternalPolicyServiceImpl extends BaseNetworkingServices implements ExternalPolicyService { @@ -22,11 +23,11 @@ public class ExternalPolicyServiceImpl extends BaseNetworkingServices implements /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(ExternalPolicies.class, uri("/grouppolicy/external_policies")).execute().getList(); } - + /** * {@inheritDoc} */ @@ -34,7 +35,7 @@ public List list() { public List list(Map filteringParams) { Invocation externalPolicyInvocation = buildInvocation(filteringParams); return externalPolicyInvocation.execute().getList(); - } + } private Invocation buildInvocation(Map filteringParams) { Invocation externalPolicyInvocation = get(ExternalPolicies.class, "/grouppolicy/external_policies"); @@ -61,23 +62,23 @@ public ExternalPolicy get(String id) { /** * {@inheritDoc} */ - @Override + @Override public ActionResponse delete(String id) { checkNotNull(id); return deleteWithResponse(uri("/grouppolicy/external_policies/%s", id)).execute(); } - /** - * {@inheritDoc} - */ - @Override + /** + * {@inheritDoc} + */ + @Override public ExternalPolicy create(ExternalPolicyCreate externalPolicy) { - return post(GbpExternalPolicy.class, uri("/grouppolicy/external_policies")).entity(externalPolicy).execute(); + return post(GbpExternalPolicy.class, uri("/grouppolicy/external_policies")).entity(externalPolicy).execute(); } - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ @Override public ExternalPolicy update(String externalPolicyId, ExternalPolicyCreate externalPolicy) { checkNotNull(externalPolicyId); @@ -85,6 +86,5 @@ public ExternalPolicy update(String externalPolicyId, ExternalPolicyCreate exter return put(GbpExternalPolicy.class, uri("/grouppolicy/external_policies/%s", externalPolicyId)).entity(externalPolicy).execute(); } - } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalSegmentServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalSegmentServiceImpl.java index ce9b0c03b..1421a2bf2 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalSegmentServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ExternalSegmentServiceImpl.java @@ -1,19 +1,20 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.ExternalSegmentService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.ExternalSegment; import org.openstack4j.openstack.gbp.domain.GbpExternalSegment; import org.openstack4j.openstack.gbp.domain.GbpExternalSegment.ExternalSegments; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * External Segment API Implementation - * + * * @author vinod borole */ public class ExternalSegmentServiceImpl extends BaseNetworkingServices implements ExternalSegmentService { @@ -21,7 +22,7 @@ public class ExternalSegmentServiceImpl extends BaseNetworkingServices implement /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(ExternalSegments.class, uri("/grouppolicy/external_segments")).execute().getList(); } @@ -29,16 +30,17 @@ public List list() { /** * {@inheritDoc} */ - @Override + @Override public List list(Map filteringParams) { Invocation externalSegmentInvocation = buildInvocation(filteringParams); return externalSegmentInvocation.execute().getList(); } + private Invocation buildInvocation(Map filteringParams) { Invocation externalSegmentInvocation = get(ExternalSegments.class, "/grouppolicy/external_segments"); if (filteringParams == null) { return externalSegmentInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { externalSegmentInvocation = externalSegmentInvocation.param(entry.getKey(), entry.getValue()); @@ -46,6 +48,7 @@ private Invocation buildInvocation(Map filteri } return externalSegmentInvocation; } + /** * {@inheritDoc} */ @@ -75,7 +78,7 @@ public ExternalSegment create(ExternalSegment externalSegment) { /** * {@inheritDoc} */ - @Override + @Override public ExternalSegment update(String externalSegmentId, ExternalSegment externalSegment) { checkNotNull(externalSegmentId); checkNotNull(externalSegment); diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/GbpServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/GbpServiceImpl.java index b7be7cdef..f70638d86 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/GbpServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/GbpServiceImpl.java @@ -1,25 +1,12 @@ package org.openstack4j.openstack.gbp.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.gbp.ExternalPolicyService; -import org.openstack4j.api.gbp.ExternalSegmentService; -import org.openstack4j.api.gbp.GbpService; -import org.openstack4j.api.gbp.GroupService; -import org.openstack4j.api.gbp.L2policyService; -import org.openstack4j.api.gbp.L3policyService; -import org.openstack4j.api.gbp.NatPoolService; -import org.openstack4j.api.gbp.NetworkPolicyService; -import org.openstack4j.api.gbp.PolicyActionService; -import org.openstack4j.api.gbp.PolicyClassifierService; -import org.openstack4j.api.gbp.PolicyRuleService; -import org.openstack4j.api.gbp.PolicyRuleSetService; -import org.openstack4j.api.gbp.PolicyTargetService; -import org.openstack4j.api.gbp.ServiceProfileService; -import org.openstack4j.api.gbp.ServicechainService; +import org.openstack4j.api.gbp.*; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + /** * GBP services - * + * * @author vinod borole */ public class GbpServiceImpl extends BaseNetworkingServices implements GbpService { @@ -44,7 +31,7 @@ public ExternalSegmentService externalSegment() { * {@inheritDoc} */ @Override - public GroupService group() { + public GroupService group() { return Apis.get(GroupService.class); } @@ -91,17 +78,19 @@ public PolicyActionService policyAction() { /** * {@inheritDoc} */ - @Override + @Override public PolicyRuleService policyRule() { return Apis.get(PolicyRuleService.class); } - /** - * {@inheritDoc} - */ + + /** + * {@inheritDoc} + */ @Override public PolicyRuleSetService policyRuleSet() { return Apis.get(PolicyRuleSetService.class); } + /** * {@inheritDoc} */ @@ -129,7 +118,7 @@ public ServicechainService servicechain() { /** * {@inheritDoc} */ - @Override + @Override public ServiceProfileService serviceProfile() { return Apis.get(ServiceProfileService.class); } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/GroupServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/GroupServiceImpl.java index bcc2afc29..3250fa765 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/GroupServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/GroupServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.GroupService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyTargetGroup; @@ -12,9 +7,15 @@ import org.openstack4j.openstack.gbp.domain.GbpPolicyTargetGroup; import org.openstack4j.openstack.gbp.domain.GbpPolicyTargetGroup.PolicyTargetGroups; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Policy target group API Implementation - * + * * @author vinod borole */ public class GroupServiceImpl extends BaseNetworkingServices implements GroupService { @@ -22,7 +23,7 @@ public class GroupServiceImpl extends BaseNetworkingServices implements GroupSer /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(PolicyTargetGroups.class, uri("/grouppolicy/policy_target_groups")).execute().getList(); } @@ -35,11 +36,12 @@ public List list(Map filteringParam Invocation policyTargetGroupInvocation = buildInvocation(filteringParams); return policyTargetGroupInvocation.execute().getList(); } + private Invocation buildInvocation(Map filteringParams) { Invocation policyTargetGroupInvocation = get(PolicyTargetGroups.class, "/grouppolicy/policy_target_groups"); - if (filteringParams == null) { + if (filteringParams == null) { return policyTargetGroupInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { policyTargetGroupInvocation = policyTargetGroupInvocation.param(entry.getKey(), entry.getValue()); @@ -47,6 +49,7 @@ private Invocation buildInvocation(Map filte } return policyTargetGroupInvocation; } + /** * {@inheritDoc} */ @@ -59,15 +62,15 @@ public PolicyTargetGroup get(String id) { /** * {@inheritDoc} */ - @Override + @Override public ActionResponse delete(String id) { checkNotNull(id); return deleteWithResponse(uri("/grouppolicy/policy_target_groups/%s", id)).execute(); } - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ @Override public PolicyTargetGroup create(PolicyTargetGroupCreate policyTargetGroup) { return post(GbpPolicyTargetGroup.class, uri("/grouppolicy/policy_target_groups")).entity(policyTargetGroup).execute(); @@ -84,5 +87,4 @@ public PolicyTargetGroup update(String policyTargetGroupId, PolicyTargetGroupCre } - } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/L2policyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/L2policyServiceImpl.java index c5bd8e1ca..2a5de890a 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/L2policyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/L2policyServiceImpl.java @@ -1,19 +1,20 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.L2policyService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.L2Policy; import org.openstack4j.openstack.gbp.domain.GbpL2Policy; import org.openstack4j.openstack.gbp.domain.GbpL2Policy.L2Policies; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * L2 Policy API Implementation - * + * * @author vinod borole */ public class L2policyServiceImpl extends BaseNetworkingServices implements L2policyService { @@ -21,7 +22,7 @@ public class L2policyServiceImpl extends BaseNetworkingServices implements L2pol /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(L2Policies.class, uri("/grouppolicy/l2_policies")).execute().getList(); } @@ -34,11 +35,12 @@ public List list(Map filteringParams) { Invocation l2PoliciesInvocation = buildInvocation(filteringParams); return l2PoliciesInvocation.execute().getList(); } + private Invocation buildInvocation(Map filteringParams) { Invocation l2PoliciesInvocation = get(L2Policies.class, "/grouppolicy/l2_policies"); - if (filteringParams == null) { + if (filteringParams == null) { return l2PoliciesInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { l2PoliciesInvocation = l2PoliciesInvocation.param(entry.getKey(), entry.getValue()); @@ -68,15 +70,15 @@ public ActionResponse delete(String id) { /** * {@inheritDoc} */ - @Override + @Override public L2Policy create(L2Policy l2Policy) { return post(GbpL2Policy.class, uri("/grouppolicy/l2_policies")).entity(l2Policy).execute(); } - /** - * {@inheritDoc} - */ - @Override + /** + * {@inheritDoc} + */ + @Override public L2Policy update(String l2PolicyId, L2Policy l2Policy) { checkNotNull(l2PolicyId); checkNotNull(l2Policy); diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/L3policyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/L3policyServiceImpl.java index c827ac75c..9b1295e22 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/L3policyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/L3policyServiceImpl.java @@ -1,19 +1,20 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.L3policyService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.L3Policy; import org.openstack4j.openstack.gbp.domain.GbpL3Policy; import org.openstack4j.openstack.gbp.domain.GbpL3Policy.L3Policies; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * L3 Policy API Implementation - * + * * @author vinod borole */ public class L3policyServiceImpl extends BaseNetworkingServices implements L3policyService { @@ -21,7 +22,7 @@ public class L3policyServiceImpl extends BaseNetworkingServices implements L3pol /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(L3Policies.class, uri("/grouppolicy/l3_policies")).execute().getList(); } @@ -34,11 +35,12 @@ public List list(Map filteringParams) { Invocation l3PoliciesInvocation = buildInvocation(filteringParams); return l3PoliciesInvocation.execute().getList(); } + private Invocation buildInvocation(Map filteringParams) { Invocation l3PoliciesInvocation = get(L3Policies.class, "/grouppolicy/l3_policies"); - if (filteringParams == null) { + if (filteringParams == null) { return l3PoliciesInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { l3PoliciesInvocation = l3PoliciesInvocation.param(entry.getKey(), entry.getValue()); diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/NatPoolServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/NatPoolServiceImpl.java index 56512818f..e0c2b8015 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/NatPoolServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/NatPoolServiceImpl.java @@ -1,19 +1,20 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.NatPoolService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.NatPool; import org.openstack4j.openstack.gbp.domain.GbpNatPool; import org.openstack4j.openstack.gbp.domain.GbpNatPool.NatPools; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Nat Pool API Implementation - * + * * @author vinod borole */ public class NatPoolServiceImpl extends BaseNetworkingServices implements NatPoolService { @@ -21,7 +22,7 @@ public class NatPoolServiceImpl extends BaseNetworkingServices implements NatPoo /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(NatPools.class, uri("/grouppolicy/nat_pools")).execute().getList(); } @@ -34,12 +35,12 @@ public List list(Map filteringParams) { Invocation natpoolInvocation = buildInvocation(filteringParams); return natpoolInvocation.execute().getList(); } - + private Invocation buildInvocation(Map filteringParams) { Invocation natpoolInvocation = get(NatPools.class, "/grouppolicy/nat_pools"); - if (filteringParams == null) { + if (filteringParams == null) { return natpoolInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { natpoolInvocation = natpoolInvocation.param(entry.getKey(), entry.getValue()); diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/NetworkPolicyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/NetworkPolicyServiceImpl.java index e148c45fd..03482d1ab 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/NetworkPolicyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/NetworkPolicyServiceImpl.java @@ -14,7 +14,7 @@ /** * Network service policy API Implementation - * + * * @author sumit gandhi */ public class NetworkPolicyServiceImpl extends BaseNetworkingServices implements NetworkPolicyService { @@ -80,7 +80,7 @@ public ActionResponse delete(String id) { * {@inheritDoc} */ @Override - public NetworkServicePolicy update(String gbpServicePolicyId , NetworkServicePolicy gbpServicePolicy) { + public NetworkServicePolicy update(String gbpServicePolicyId, NetworkServicePolicy gbpServicePolicy) { checkNotNull(gbpServicePolicy); checkNotNull(gbpServicePolicyId); return put(GbpNetworkServicePolicy.class, uri("/grouppolicy/network_service_policies/%s", gbpServicePolicyId)). diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyActionServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyActionServiceImpl.java index 357716ec1..8081b859a 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyActionServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyActionServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.PolicyActionService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyAction; @@ -12,9 +7,15 @@ import org.openstack4j.openstack.gbp.domain.GbpPolicyAction; import org.openstack4j.openstack.gbp.domain.GbpPolicyAction.PolicyActions; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Policy Action API Implementation - * + * * @author vinod borole */ public class PolicyActionServiceImpl extends BaseNetworkingServices implements PolicyActionService { @@ -22,7 +23,7 @@ public class PolicyActionServiceImpl extends BaseNetworkingServices implements P /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(PolicyActions.class, uri("/grouppolicy/policy_actions")).execute().getList(); } @@ -35,12 +36,12 @@ public List list(Map filteringParams) { Invocation policyactionInvocation = buildInvocation(filteringParams); return policyactionInvocation.execute().getList(); } - + private Invocation buildInvocation(Map filteringParams) { Invocation policyactionInvocation = get(PolicyActions.class, "/grouppolicy/policy_actions"); - if (filteringParams == null) { + if (filteringParams == null) { return policyactionInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { policyactionInvocation = policyactionInvocation.param(entry.getKey(), entry.getValue()); diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyClassifierServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyClassifierServiceImpl.java index 20a30cd1e..5c105da6a 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyClassifierServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyClassifierServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.PolicyClassifierService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyClassifier; @@ -12,9 +7,15 @@ import org.openstack4j.openstack.gbp.domain.GbpPolicyClassifier; import org.openstack4j.openstack.gbp.domain.GbpPolicyClassifier.PolicyClassifiers; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Policy Classifier API Implementation - * + * * @author vinod borole */ public class PolicyClassifierServiceImpl extends BaseNetworkingServices implements PolicyClassifierService { @@ -22,7 +23,7 @@ public class PolicyClassifierServiceImpl extends BaseNetworkingServices implemen /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(PolicyClassifiers.class, uri("/grouppolicy/policy_classifiers")).execute().getList(); } @@ -35,12 +36,12 @@ public List list(Map filteringParams Invocation policyclassifierInvocation = buildInvocation(filteringParams); return policyclassifierInvocation.execute().getList(); } - + private Invocation buildInvocation(Map filteringParams) { Invocation policyclassifierInvocation = get(PolicyClassifiers.class, "/grouppolicy/policy_classifiers"); - if (filteringParams == null) { + if (filteringParams == null) { return policyclassifierInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { policyclassifierInvocation = policyclassifierInvocation.param(entry.getKey(), entry.getValue()); diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleServiceImpl.java index 3063680ce..402e535fd 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleServiceImpl.java @@ -1,19 +1,20 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.PolicyRuleService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyRule; import org.openstack4j.openstack.gbp.domain.GbpPolicyRule; import org.openstack4j.openstack.gbp.domain.GbpPolicyRule.PolicyRules; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Policy Rule API Implementation - * + * * @author vinod borole */ public class PolicyRuleServiceImpl extends BaseNetworkingServices implements PolicyRuleService { @@ -21,7 +22,7 @@ public class PolicyRuleServiceImpl extends BaseNetworkingServices implements Pol /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(PolicyRules.class, uri("/grouppolicy/policy_rules")).execute().getList(); } @@ -34,12 +35,12 @@ public List list(Map filteringParams) { Invocation policyruleInvocation = buildInvocation(filteringParams); return policyruleInvocation.execute().getList(); } - + private Invocation buildInvocation(Map filteringParams) { Invocation policyruleInvocation = get(PolicyRules.class, "/grouppolicy/policy_rules"); - if (filteringParams == null) { + if (filteringParams == null) { return policyruleInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { policyruleInvocation = policyruleInvocation.param(entry.getKey(), entry.getValue()); @@ -47,7 +48,7 @@ private Invocation buildInvocation(Map filteringPar } return policyruleInvocation; } - + /** * {@inheritDoc} */ diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleSetServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleSetServiceImpl.java index f2fd52907..0b09effe4 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleSetServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyRuleSetServiceImpl.java @@ -1,19 +1,20 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.PolicyRuleSetService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyRuleSet; import org.openstack4j.openstack.gbp.domain.GbpPolicyRuleSet; import org.openstack4j.openstack.gbp.domain.GbpPolicyRuleSet.PolicyRuleSets; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Policy Rule set API Implementation - * + * * @author vinod borole */ public class PolicyRuleSetServiceImpl extends BaseNetworkingServices implements PolicyRuleSetService { @@ -21,7 +22,7 @@ public class PolicyRuleSetServiceImpl extends BaseNetworkingServices implements /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(PolicyRuleSets.class, uri("/grouppolicy/policy_rule_sets")).execute().getList(); } @@ -29,17 +30,17 @@ public List list() { /** * {@inheritDoc} */ - @Override + @Override public List list(Map filteringParams) { Invocation policyrulesetsInvocation = buildInvocation(filteringParams); return policyrulesetsInvocation.execute().getList(); } - + private Invocation buildInvocation(Map filteringParams) { Invocation policyrulesetsInvocation = get(PolicyRuleSets.class, "/grouppolicy/policy_rule_sets"); - if (filteringParams == null) { + if (filteringParams == null) { return policyrulesetsInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { policyrulesetsInvocation = policyrulesetsInvocation.param(entry.getKey(), entry.getValue()); @@ -69,15 +70,15 @@ public ActionResponse delete(String id) { /** * {@inheritDoc} */ - @Override + @Override public PolicyRuleSet create(PolicyRuleSet policyRuleSet) { return post(GbpPolicyRuleSet.class, uri("/grouppolicy/policy_rule_sets")).entity(policyRuleSet).execute(); } - /** - * {@inheritDoc} - */ - @Override + /** + * {@inheritDoc} + */ + @Override public PolicyRuleSet update(String policyRuleSetId, PolicyRuleSet policyRuleSet) { checkNotNull(policyRuleSetId); checkNotNull(policyRuleSet); diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyTargetServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyTargetServiceImpl.java index 116e41500..a87da0fbe 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyTargetServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/PolicyTargetServiceImpl.java @@ -1,19 +1,20 @@ package org.openstack4j.openstack.gbp.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.gbp.PolicyTargetService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.gbp.PolicyTarget; import org.openstack4j.openstack.gbp.domain.GbpPolicyTarget; import org.openstack4j.openstack.gbp.domain.GbpPolicyTarget.PolicyTargets; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Policy target API Implementation - * + * * @author vinod borole */ public class PolicyTargetServiceImpl extends BaseNetworkingServices implements PolicyTargetService { @@ -21,7 +22,7 @@ public class PolicyTargetServiceImpl extends BaseNetworkingServices implements P /** * {@inheritDoc} */ - @Override + @Override public List list() { return get(PolicyTargets.class, uri("/grouppolicy/policy_targets")).execute().getList(); } @@ -34,12 +35,12 @@ public List list(Map filteringParams) { Invocation policytargetsInvocation = buildInvocation(filteringParams); return policytargetsInvocation.execute().getList(); } - + private Invocation buildInvocation(Map filteringParams) { Invocation policytargetsInvocation = get(PolicyTargets.class, "/grouppolicy/policy_targets"); - if (filteringParams == null) { + if (filteringParams == null) { return policytargetsInvocation; - } + } if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { policytargetsInvocation = policytargetsInvocation.param(entry.getKey(), entry.getValue()); @@ -77,11 +78,11 @@ public PolicyTarget create(PolicyTarget policyTarget) { /** * {@inheritDoc} */ - @Override + @Override public PolicyTarget update(String policyTargetId, PolicyTarget policyTarget) { checkNotNull(policyTargetId); checkNotNull(policyTarget); return put(GbpPolicyTarget.class, uri("/grouppolicy/policy_targets/%s", policyTargetId)).entity(policyTarget).execute(); - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServiceProfileServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServiceProfileServiceImpl.java index 9db884f35..9c88ef4d9 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServiceProfileServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServiceProfileServiceImpl.java @@ -2,9 +2,10 @@ import org.openstack4j.api.gbp.ServiceProfileService; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + /** * Service profile API Implementation - * + * * @author vinod borole */ public class ServiceProfileServiceImpl extends BaseNetworkingServices implements ServiceProfileService { diff --git a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServicechainServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServicechainServiceImpl.java index 610890245..52212f59d 100644 --- a/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServicechainServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/gbp/internal/ServicechainServiceImpl.java @@ -2,9 +2,10 @@ import org.openstack4j.api.gbp.ServicechainService; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + /** * Service chain API Implementation - * + * * @author vinod borole */ public class ServicechainServiceImpl extends BaseNetworkingServices implements ServicechainService { diff --git a/core/src/main/java/org/openstack4j/openstack/heat/builder/HeatBuilders.java b/core/src/main/java/org/openstack4j/openstack/heat/builder/HeatBuilders.java index 6d85e68eb..cf97d328e 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/builder/HeatBuilders.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/builder/HeatBuilders.java @@ -1,16 +1,7 @@ package org.openstack4j.openstack.heat.builder; -import org.openstack4j.model.heat.builder.OrchestrationBuilders; -import org.openstack4j.model.heat.builder.ResourceHealthBuilder; -import org.openstack4j.model.heat.builder.SoftwareConfigBuilder; -import org.openstack4j.model.heat.builder.StackCreateBuilder; -import org.openstack4j.model.heat.builder.StackUpdateBuilder; -import org.openstack4j.model.heat.builder.TemplateBuilder; -import org.openstack4j.openstack.heat.domain.HeatResourceHealth; -import org.openstack4j.openstack.heat.domain.HeatSoftwareConfig; -import org.openstack4j.openstack.heat.domain.HeatStackCreate; -import org.openstack4j.openstack.heat.domain.HeatStackUpdate; -import org.openstack4j.openstack.heat.domain.HeatTemplate; +import org.openstack4j.model.heat.builder.*; +import org.openstack4j.openstack.heat.domain.*; /** * The Orchestration V3 Builders diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatAdoptStackData.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatAdoptStackData.java index 3f9fcaee0..8da5c99c9 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatAdoptStackData.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatAdoptStackData.java @@ -3,13 +3,14 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; -import java.util.Map; import org.openstack4j.model.heat.AdoptStackData; +import java.util.Map; + /** * This class contains all elements required for the creation of adopt_stack_data element. It is used for stack adoption and as a return value for stack abandoning. * It uses Jackson annotation for (de)serialization into JSON. - * + * * @author Ales Kemr */ @JsonIgnoreProperties(ignoreUnknown = true) @@ -18,19 +19,19 @@ public class HeatAdoptStackData implements AdoptStackData { @JsonProperty("action") private String action; - + @JsonProperty("id") private String id; - + @JsonProperty("name") private String name; - + @JsonProperty("status") private String status; - + @JsonProperty("template") - private Map template; - + private Map template; + @JsonProperty("resources") private Map> resources; @@ -38,7 +39,7 @@ public class HeatAdoptStackData implements AdoptStackData { public String getAction() { return action; } - + @Override public String getId() { return id; @@ -55,7 +56,7 @@ public String getStatus() { } @Override - public Map getTemplate() { + public Map getTemplate() { return template; } @@ -110,7 +111,7 @@ public HeatAdoptStackDataBuilder status(String status) { return this; } - public HeatAdoptStackDataBuilder template(Map template) { + public HeatAdoptStackDataBuilder template(Map template) { this.model.template = template; return this; } @@ -125,5 +126,5 @@ public HeatAdoptStackData build() { } } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatEvent.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatEvent.java index f196ac7de..93e5565b2 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatEvent.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatEvent.java @@ -1,114 +1,110 @@ package org.openstack4j.openstack.heat.domain; -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.common.Link; import org.openstack4j.model.heat.Event; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.Date; +import java.util.List; /** * This is a model of a heatevent. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author Octopus Zhang - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("event") public class HeatEvent implements Event { - private static final long serialVersionUID = 1L; - - private String id; - private List links; - @JsonProperty("event_time") - private Date time; - @JsonProperty("resource_status_reason") - private String reason; - @JsonProperty("resource_name") - private String resourceName; - @JsonProperty("logical_resource_id") - private String localReourceId; - @JsonProperty("resource_status") - private String resourceStatus; - @JsonProperty("physical_resource_id") - private String physicalResourceId; - @JsonProperty("resource_type") - private String resourceType; - @JsonProperty("resource_properties") - private Object resourceProperties; - - @Override - public String getId() { - return id; - } - - @Override - public String getResourceName() { - return resourceName; - } - - @Override - public Date getTime() { - return time; - } - - @Override - public String getLocalReourceId() { - return localReourceId; - } - - @Override - public String getReason() { - return reason; - } - - @Override - public String getResourceStatus() { - return resourceStatus; - } - - @Override - public String getPhysicalResourceId() { - return physicalResourceId; - } - - @Override - public List getLinks() { - return links; - } - - @Override - public String getResourceType() { - return resourceType; - } - - @Override - public Object getResourceProperties() { - return resourceProperties; - } - - - - /** - * An inner class for representing lists of Heat Resource - * - * @author Octopus Zhang - * - */ - public static class Events extends ListResult { - private static final long serialVersionUID = 1L; - - @JsonProperty("events") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = 1L; + + private String id; + private List links; + @JsonProperty("event_time") + private Date time; + @JsonProperty("resource_status_reason") + private String reason; + @JsonProperty("resource_name") + private String resourceName; + @JsonProperty("logical_resource_id") + private String localReourceId; + @JsonProperty("resource_status") + private String resourceStatus; + @JsonProperty("physical_resource_id") + private String physicalResourceId; + @JsonProperty("resource_type") + private String resourceType; + @JsonProperty("resource_properties") + private Object resourceProperties; + + @Override + public String getId() { + return id; + } + + @Override + public String getResourceName() { + return resourceName; + } + + @Override + public Date getTime() { + return time; + } + + @Override + public String getLocalReourceId() { + return localReourceId; + } + + @Override + public String getReason() { + return reason; + } + + @Override + public String getResourceStatus() { + return resourceStatus; + } + + @Override + public String getPhysicalResourceId() { + return physicalResourceId; + } + + @Override + public List getLinks() { + return links; + } + + @Override + public String getResourceType() { + return resourceType; + } + + @Override + public Object getResourceProperties() { + return resourceProperties; + } + + + /** + * An inner class for representing lists of Heat Resource + * + * @author Octopus Zhang + */ + public static class Events extends ListResult { + private static final long serialVersionUID = 1L; + + @JsonProperty("events") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResource.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResource.java index 2989a796b..fee016f40 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResource.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResource.java @@ -1,102 +1,99 @@ package org.openstack4j.openstack.heat.domain; -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.common.Link; import org.openstack4j.model.heat.Resource; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Date; +import java.util.List; /** * This is a model of a HeatResource. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author Octopus Zhang - * */ public class HeatResource implements Resource { -private static final long serialVersionUID = 1L; - - private List links; - @JsonProperty("updated_time") - private Date time; - @JsonProperty("resource_type") - private String type; - @JsonProperty("resource_status_reason") - private String reason; - @JsonProperty("resource_name") - private String resourceName; - @JsonProperty("logical_resource_id") - private String localReourceId; - @JsonProperty("resource_status") - private String resourceStatus; - @JsonProperty("physical_resource_id") - private String physicalResourceId; - @JsonProperty("required_by") - private List requiredBy; - - @Override - public List getLinks() { - return links; - } - - @Override - public Date getTime() { - return time; - } - - @Override - public String getType() { - return type; - } - - @Override - public String getReason() { - return reason; - } - - @Override - public String getResourceName() { - return resourceName; - } - - @Override - public String getLocalReourceId() { - return localReourceId; - } - - @Override - public String getResourceStatus() { - return resourceStatus; - } - - @Override - public String getPhysicalResourceId() { - return physicalResourceId; - } - - @Override - public List getRequiredBy() { - return requiredBy; - } - - /** - * An inner class for representing lists of Heat Resource - * - * @author Octopus Zhang - * - */ - public static class Resources extends ListResult { - private static final long serialVersionUID = 1L; - - @JsonProperty("resources") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = 1L; + + private List links; + @JsonProperty("updated_time") + private Date time; + @JsonProperty("resource_type") + private String type; + @JsonProperty("resource_status_reason") + private String reason; + @JsonProperty("resource_name") + private String resourceName; + @JsonProperty("logical_resource_id") + private String localReourceId; + @JsonProperty("resource_status") + private String resourceStatus; + @JsonProperty("physical_resource_id") + private String physicalResourceId; + @JsonProperty("required_by") + private List requiredBy; + + @Override + public List getLinks() { + return links; + } + + @Override + public Date getTime() { + return time; + } + + @Override + public String getType() { + return type; + } + + @Override + public String getReason() { + return reason; + } + + @Override + public String getResourceName() { + return resourceName; + } + + @Override + public String getLocalReourceId() { + return localReourceId; + } + + @Override + public String getResourceStatus() { + return resourceStatus; + } + + @Override + public String getPhysicalResourceId() { + return physicalResourceId; + } + + @Override + public List getRequiredBy() { + return requiredBy; + } + + /** + * An inner class for representing lists of Heat Resource + * + * @author Octopus Zhang + */ + public static class Resources extends ListResult { + private static final long serialVersionUID = 1L; + + @JsonProperty("resources") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResourceHealth.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResourceHealth.java index 62ced70c2..2f1351ea4 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResourceHealth.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatResourceHealth.java @@ -27,7 +27,6 @@ * (de)serialization into JSON format * * @author Dan Maas - * */ public class HeatResourceHealth implements ResourceHealth { @@ -75,7 +74,7 @@ public void setResourceStatusReason(String resourceStatusReason) { } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("markUnhealthy", markUnhealthy) .add("resourceStatusReason", resourceStatusReason) @@ -87,7 +86,6 @@ public String toString(){ * {@link StackCreate} object. * * @author Matthias Reisser - * */ public static class HeatResourceHealthBuilder implements ResourceHealthBuilder { @@ -119,7 +117,7 @@ public ResourceHealth build() { @Override public ResourceHealthBuilder from(ResourceHealth in) { - model = (HeatResourceHealth)in; + model = (HeatResourceHealth) in; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatSoftwareConfig.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatSoftwareConfig.java index b64cffeaa..8f7bc0e32 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatSoftwareConfig.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatSoftwareConfig.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.heat.domain; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.heat.SoftwareConfig; -import org.openstack4j.model.heat.builder.SoftwareConfigBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; +import org.openstack4j.model.heat.SoftwareConfig; +import org.openstack4j.model.heat.builder.SoftwareConfigBuilder; + +import java.util.Collections; +import java.util.List; +import java.util.Map; /** * Model implementation for Software Config @@ -81,10 +80,10 @@ public SoftwareConfigBuilder toBuilder() { public String toString() { return MoreObjects.toStringHelper(SoftwareConfig.class).omitNullValues() - .add("id", id).add("name", name).add("group", group).addValue("\n") - .add("inputs", inputs).addValue("\n").add("outputs", outputs) - .addValue("\n").add("config", config).add("options", options) - .toString(); + .add("id", id).add("name", name).add("group", group).addValue("\n") + .add("inputs", inputs).addValue("\n").add("outputs", outputs) + .addValue("\n").add("config", config).add("options", options) + .toString(); } public static class SCInput implements Input { @@ -98,7 +97,8 @@ public static class SCInput implements Input { @JsonProperty("type") String type; - public SCInput() { } + public SCInput() { + } public SCInput(String name, String type, String description, String defaultValue) { this.name = name; @@ -129,9 +129,9 @@ public String getType() { public String toString() { return MoreObjects.toStringHelper(Input.class).omitNullValues() - .add("name", name).add("type", type) - .add("description", description).add("default", defaultValue) - .toString(); + .add("name", name).add("type", type) + .add("description", description).add("default", defaultValue) + .toString(); } } @@ -146,7 +146,8 @@ public static class SCOutput implements Output { @JsonProperty("type") String type; - public SCOutput() { } + public SCOutput() { + } public SCOutput(String name, String type, String description, boolean errorOutput) { this.name = name; @@ -177,9 +178,9 @@ public boolean isErrorOutput() { public String toString() { return MoreObjects.toStringHelper(Output.class).omitNullValues() - .add("name", name).add("type", type) - .add("description", description).add("errorOutput", errorOutput) - .toString(); + .add("name", name).add("type", type) + .add("description", description).add("errorOutput", errorOutput) + .toString(); } } @@ -202,7 +203,7 @@ public SoftwareConfig build() { @Override public SoftwareConfigBuilder from(SoftwareConfig in) { - return new Builder((HeatSoftwareConfig)in); + return new Builder((HeatSoftwareConfig) in); } @Override diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStack.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStack.java index 9d3834b4a..391cb8f82 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStack.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStack.java @@ -13,132 +13,130 @@ /** * This is a model of a heatstack. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author Matthias Reisser - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("stack") public class HeatStack implements Stack { - private static final long serialVersionUID = 2151261616427716429L; - - @JsonProperty("id") - private String id; - @JsonProperty("stack_name") - private String name; - @JsonProperty("stack_status") - private String status; - @JsonProperty("stack_status_reason") - private String stackStatusReason; - @JsonProperty("description") - private String description; - @JsonProperty("template_description") - private String templateDescription; - @JsonProperty("timeout_mins") - private Long timeoutMins; - @JsonProperty("outputs") - private List> outputs; - @JsonProperty("parameters") - private Map parameters; - @JsonProperty("creation_time") - private String creationTime; - @JsonProperty("links") - private List links; - @JsonProperty("updated_time") - private String updatedTime; - @JsonProperty("tags") - private List tags; - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - - return name; - } - - @Override - public String getStatus() { - return status; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public String getTemplateDescription() { - return templateDescription; - } - - @Override - public Long getTimeoutMins() { - return timeoutMins; - } - - @Override - public List> getOutputs() { - return outputs; - } - - @Override - public Map getParameters() { - return parameters; - } - - @Override - public String getCreationTime() { - return creationTime; - } - - @Override - public List getLinks() { - return links; - } - - @Override - public String getUpdatedTime() { - return updatedTime; - } - - @Override - public List getTags() { - return tags; - } - - @Override - public String getStackStatusReason() { - return stackStatusReason; - } - - @Override - public String toString() { - return "HeatStack [id=" + id + ", name=" + name + ", status=" + status - + ", description=" + description + ", templateDescription=" - + templateDescription + ", timeoutMins=" + timeoutMins - + ", outputs=" + outputs + ", parameters=" + parameters - + ", creationTime=" + creationTime + ", links=" + links - + ", updatedTime=" + updatedTime + ", tags=" + tags + "]"; - } - - /** - * An inner class for representing lists of HeatStacks - * - * @author Matthias Reisser - * - */ - public static class Stacks extends ListResult { - private static final long serialVersionUID = 600661296207420793L; - - @JsonProperty("stacks") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = 2151261616427716429L; + + @JsonProperty("id") + private String id; + @JsonProperty("stack_name") + private String name; + @JsonProperty("stack_status") + private String status; + @JsonProperty("stack_status_reason") + private String stackStatusReason; + @JsonProperty("description") + private String description; + @JsonProperty("template_description") + private String templateDescription; + @JsonProperty("timeout_mins") + private Long timeoutMins; + @JsonProperty("outputs") + private List> outputs; + @JsonProperty("parameters") + private Map parameters; + @JsonProperty("creation_time") + private String creationTime; + @JsonProperty("links") + private List links; + @JsonProperty("updated_time") + private String updatedTime; + @JsonProperty("tags") + private List tags; + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + + return name; + } + + @Override + public String getStatus() { + return status; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public String getTemplateDescription() { + return templateDescription; + } + + @Override + public Long getTimeoutMins() { + return timeoutMins; + } + + @Override + public List> getOutputs() { + return outputs; + } + + @Override + public Map getParameters() { + return parameters; + } + + @Override + public String getCreationTime() { + return creationTime; + } + + @Override + public List getLinks() { + return links; + } + + @Override + public String getUpdatedTime() { + return updatedTime; + } + + @Override + public List getTags() { + return tags; + } + + @Override + public String getStackStatusReason() { + return stackStatusReason; + } + + @Override + public String toString() { + return "HeatStack [id=" + id + ", name=" + name + ", status=" + status + + ", description=" + description + ", templateDescription=" + + templateDescription + ", timeoutMins=" + timeoutMins + + ", outputs=" + outputs + ", parameters=" + parameters + + ", creationTime=" + creationTime + ", links=" + links + + ", updatedTime=" + updatedTime + ", tags=" + tags + "]"; + } + + /** + * An inner class for representing lists of HeatStacks + * + * @author Matthias Reisser + */ + public static class Stacks extends ListResult { + private static final long serialVersionUID = 600661296207420793L; + + @JsonProperty("stacks") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackAdopt.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackAdopt.java index 3b8edbfc1..85fbed5a1 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackAdopt.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackAdopt.java @@ -3,16 +3,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import org.openstack4j.model.ModelEntity; +import org.openstack4j.model.heat.AdoptStackData; + import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.heat.AdoptStackData; /** * This class contains all elements required for the adoption of a HeatStack. It * uses Jackson annotation for (de)serialization into JSON - * + * * @author Ales Kemr */ public class HeatStackAdopt implements ModelEntity { @@ -55,7 +56,7 @@ public String getAdoptStackData() { public String getTemplate() { return template; } - + public static HeatStackAdoptBuilder builder() { return new HeatStackAdoptBuilder(); } @@ -71,7 +72,7 @@ public HeatStackAdoptBuilder(HeatStackAdopt model) { public HeatStackAdoptBuilder() { this.model = new HeatStackAdopt(); } - + public HeatStackAdoptBuilder name(String name) { this.model.name = name; return this; @@ -101,7 +102,7 @@ public HeatStackAdoptBuilder adoptStackData(AdoptStackData adoptStackData) { throw new RuntimeException(ex); } } - + public HeatStackAdoptBuilder template(String template) { this.model.template = template; return this; @@ -111,6 +112,6 @@ public HeatStackAdopt build() { return model; } } - - + + } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackCreate.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackCreate.java index a27b66f22..1434a0118 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackCreate.java @@ -16,154 +16,151 @@ * uses Jackson annotation for (de)serialization into JSON * * @author Matthias Reisser - * */ public class HeatStackCreate implements StackCreate { - private static final long serialVersionUID = -8775995682456485275L; + private static final long serialVersionUID = -8775995682456485275L; private static final Logger LOG = LoggerFactory.getLogger(HeatStackCreate.class); - @JsonProperty("disableRollback") - private boolean disableRollback; - @JsonProperty("stack_name") - private String name; - @JsonProperty("template") - private String template; - @JsonProperty("template_url") - private String templateURL; - @JsonProperty("parameters") - private Map parameters; - @JsonProperty("timeout_mins") - private Long timeoutMins; - @JsonProperty("environment") - private String environment; - @JsonProperty("files") - private Map files = new HashMap(); - @JsonProperty("tags") - private String tags; - - /** - * Returnes a {@link HeatStackCreateConcreteBuilder} for configuration and - * creation of a {@link HeatStackCreate} object. - * - * @return a {@link HeatStackCreateConcreteBuilder} - */ - public static HeatStackCreateConcreteBuilder build() { - return new HeatStackCreateConcreteBuilder(); - } - - @Override - public StackCreateBuilder toBuilder() { - return new HeatStackCreateConcreteBuilder(this); - } - - @Override - public String getName() { - return name; - } - - @Override - public Map getParameters() { - return parameters; - } - - @Override - public boolean getDisableRollback() { - return disableRollback; - } - - @Override - public String getTemplate() { - return template; - } - - public String getTempateURL() { - return templateURL; - } - - public String getEnvironment(){ - return environment; - } - - public Map getFiles() { - return files; - } - - public String getTags() { - return tags; - } - - /** - * A Builder to create a HeatStack. Use {@link #build()} to receive the - * {@link StackCreate} object. - * - * @author Matthias Reisser - * - */ - public static class HeatStackCreateConcreteBuilder implements - StackCreateBuilder { - - private HeatStackCreate model; - - /** - * Constructor to create a {@link HeatStackCreateConcreteBuilder} object - * with a new, empty {@link HeatStackCreate} object. - */ - public HeatStackCreateConcreteBuilder() { - this(new HeatStackCreate()); - } - - /** - * Constructor for manipulation of an existing {@link HeatStackCreate} - * object. - * - * @param model - * the {@link HeatStackCreate} object which is to be - * modified. - */ - public HeatStackCreateConcreteBuilder(HeatStackCreate model) { - this.model = model; - } - - @Override - public StackCreate build() { - return model; - } - - @Override - public StackCreateBuilder from(StackCreate in) { - model = (HeatStackCreate) in; - return this; - } - - @Override - public StackCreateBuilder name(String name) { - model.name = name; - return this; - } - - @Override - public StackCreateBuilder parameters(Map parameters) { - model.parameters = parameters; - return this; - } - - @Override - public StackCreateBuilder timeoutMins(Long timeoutMins) { - model.timeoutMins = timeoutMins; - return this; - } - - @Override - public StackCreateBuilder disableRollback(boolean disableRollback) { - model.disableRollback = disableRollback; - return this; - } + @JsonProperty("disableRollback") + private boolean disableRollback; + @JsonProperty("stack_name") + private String name; + @JsonProperty("template") + private String template; + @JsonProperty("template_url") + private String templateURL; + @JsonProperty("parameters") + private Map parameters; + @JsonProperty("timeout_mins") + private Long timeoutMins; + @JsonProperty("environment") + private String environment; + @JsonProperty("files") + private Map files = new HashMap(); + @JsonProperty("tags") + private String tags; + + /** + * Returnes a {@link HeatStackCreateConcreteBuilder} for configuration and + * creation of a {@link HeatStackCreate} object. + * + * @return a {@link HeatStackCreateConcreteBuilder} + */ + public static HeatStackCreateConcreteBuilder build() { + return new HeatStackCreateConcreteBuilder(); + } + + @Override + public StackCreateBuilder toBuilder() { + return new HeatStackCreateConcreteBuilder(this); + } + + @Override + public String getName() { + return name; + } + + @Override + public Map getParameters() { + return parameters; + } + + @Override + public boolean getDisableRollback() { + return disableRollback; + } + + @Override + public String getTemplate() { + return template; + } + + public String getTempateURL() { + return templateURL; + } + + public String getEnvironment() { + return environment; + } + + public Map getFiles() { + return files; + } + + public String getTags() { + return tags; + } + + /** + * A Builder to create a HeatStack. Use {@link #build()} to receive the + * {@link StackCreate} object. + * + * @author Matthias Reisser + */ + public static class HeatStackCreateConcreteBuilder implements + StackCreateBuilder { + + private HeatStackCreate model; + + /** + * Constructor to create a {@link HeatStackCreateConcreteBuilder} object + * with a new, empty {@link HeatStackCreate} object. + */ + public HeatStackCreateConcreteBuilder() { + this(new HeatStackCreate()); + } + + /** + * Constructor for manipulation of an existing {@link HeatStackCreate} + * object. + * + * @param model the {@link HeatStackCreate} object which is to be + * modified. + */ + public HeatStackCreateConcreteBuilder(HeatStackCreate model) { + this.model = model; + } + + @Override + public StackCreate build() { + return model; + } + + @Override + public StackCreateBuilder from(StackCreate in) { + model = (HeatStackCreate) in; + return this; + } + + @Override + public StackCreateBuilder name(String name) { + model.name = name; + return this; + } + + @Override + public StackCreateBuilder parameters(Map parameters) { + model.parameters = parameters; + return this; + } + + @Override + public StackCreateBuilder timeoutMins(Long timeoutMins) { + model.timeoutMins = timeoutMins; + return this; + } + + @Override + public StackCreateBuilder disableRollback(boolean disableRollback) { + model.disableRollback = disableRollback; + return this; + } @Override public StackCreateBuilder template(String template) { - model.template = template; - return this; + model.template = template; + return this; } @Override @@ -180,12 +177,12 @@ public StackCreateBuilder templateFromFile(String tplFile) { @Override public StackCreateBuilder templateURL(String templateURL) { - model.templateURL = templateURL; - return this; + model.templateURL = templateURL; + return this; } @Override - public StackCreateBuilder environment(String environment){ + public StackCreateBuilder environment(String environment) { model.environment = environment; return this; } @@ -203,17 +200,17 @@ public StackCreateBuilder environmentFromFile(String envFile) { } @Override - public StackCreateBuilder files(Map files) { - model.files = files; - return this; - } - - @Override - public StackCreateBuilder tags(String tags) { - model.tags = tags; - return this; - } - - } + public StackCreateBuilder files(Map files) { + model.files = files; + return this; + } + + @Override + public StackCreateBuilder tags(String tags) { + model.tags = tags; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackUpdate.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackUpdate.java index 898a79564..9dfc2ce80 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatStackUpdate.java @@ -9,7 +9,6 @@ import org.slf4j.LoggerFactory; import java.util.HashMap; -import java.util.List; import java.util.Map; /** @@ -55,7 +54,7 @@ public String getTempateURL() { return templateURL; } - public String getEnvironment(){ + public String getEnvironment() { return environment; } @@ -132,13 +131,13 @@ public StackUpdateBuilder timeoutMins(Long timeoutMins) { } @Override - public StackUpdateBuilder environment(String environment){ + public StackUpdateBuilder environment(String environment) { model.environment = environment; return this; } @Override - public StackUpdateBuilder environmentFromFile(String envFile){ + public StackUpdateBuilder environmentFromFile(String envFile) { try { Environment env = new Environment(envFile); model.environment = env.getEnvContent(); diff --git a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatTemplate.java b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatTemplate.java index f24d93c55..ccb923d8d 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatTemplate.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/domain/HeatTemplate.java @@ -1,18 +1,16 @@ package org.openstack4j.openstack.heat.domain; -import org.openstack4j.model.heat.Template; -import org.openstack4j.model.heat.builder.TemplateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRawValue; +import org.openstack4j.model.heat.Template; +import org.openstack4j.model.heat.builder.TemplateBuilder; /** * This class represents a HeatTemplate. It uses jackson for (de)serialization * of contents. - * + * * @author Matthias Reisser - * */ @JsonIgnoreProperties(ignoreUnknown = true) public class HeatTemplate implements Template { @@ -40,7 +38,7 @@ public String getTemplateURL() { /** * returns a {@link HeatTemplateConcreteBuilder} for configuration and * creation of a {@link HeatTemplate} - * + * * @return a {@link HeatTemplateConcreteBuilder} */ public static HeatTemplateConcreteBuilder build() { @@ -55,9 +53,8 @@ public TemplateBuilder toBuilder() { /** * builder class for configuration and creation of {@link HeatTemplate} * objects. Use {@link #build()} to create the {@link HeatTemplate} object. - * + * * @author Matthias Reisser - * */ public static class HeatTemplateConcreteBuilder implements TemplateBuilder { HeatTemplate model; @@ -73,9 +70,8 @@ public HeatTemplateConcreteBuilder() { /** * Constructor to create a {@link HeatTemplateConcreteBuilder} object * for an existing {@link HeatTemplate} object. - * - * @param template - * existing {@link HeatTemplate} object. + * + * @param template existing {@link HeatTemplate} object. */ public HeatTemplateConcreteBuilder(HeatTemplate template) { this.model = template; diff --git a/core/src/main/java/org/openstack4j/openstack/heat/internal/BaseHeatServices.java b/core/src/main/java/org/openstack4j/openstack/heat/internal/BaseHeatServices.java index c6ce4c640..fa19b1671 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/internal/BaseHeatServices.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/internal/BaseHeatServices.java @@ -6,14 +6,13 @@ /** * This class is extended by every Heat Service. It is necessary to determine * the correct endpoint (url) for heat calls. - * + * * @author Matthias Reisser - * */ public class BaseHeatServices extends BaseOpenStackService { - protected BaseHeatServices() { - super(ServiceType.ORCHESTRATION); - } + protected BaseHeatServices() { + super(ServiceType.ORCHESTRATION); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/internal/EventsServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/heat/internal/EventsServiceImpl.java index aa64ef707..056bca442 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/internal/EventsServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/internal/EventsServiceImpl.java @@ -1,46 +1,45 @@ package org.openstack4j.openstack.heat.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.heat.EventsService; import org.openstack4j.model.heat.Event; import org.openstack4j.openstack.heat.domain.HeatEvent; import org.openstack4j.openstack.heat.domain.HeatEvent.Events; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * This class implements some methods for manipulation of {@link HeatEvent} objects. The * non-exhaustive list of methods is oriented along * http://developer.openstack.org/api-ref-orchestration-v1.html#stacks - * + * * @author Octopus Zhang - * */ public class EventsServiceImpl extends BaseHeatServices implements EventsService { - @Override - public List list(String stackName, String stackId) { - checkNotNull(stackId); - checkNotNull(stackName); - return get(Events.class, uri("/stacks/%s/%s/events", stackName, stackId)).execute().getList(); - } + @Override + public List list(String stackName, String stackId) { + checkNotNull(stackId); + checkNotNull(stackName); + return get(Events.class, uri("/stacks/%s/%s/events", stackName, stackId)).execute().getList(); + } - @Override - public List list(String stackName, String stackId, String resourceName) { - checkNotNull(stackId); + @Override + public List list(String stackName, String stackId, String resourceName) { + checkNotNull(stackId); checkNotNull(stackName); checkNotNull(resourceName); - return get(Events.class, uri("/stacks/%s/%s/resources/%s/events", stackName, stackId ,resourceName)).execute().getList(); - } + return get(Events.class, uri("/stacks/%s/%s/resources/%s/events", stackName, stackId, resourceName)).execute().getList(); + } - @Override - public Event show(String stackName, String stackId, String resourceName, String eventId) { - checkNotNull(stackId); + @Override + public Event show(String stackName, String stackId, String resourceName, String eventId) { + checkNotNull(stackId); checkNotNull(stackName); checkNotNull(resourceName); checkNotNull(eventId); - return get(HeatEvent.class, uri("/stacks/%s/%s/resources/%s/events/%s", stackName, stackId, resourceName, eventId)).execute(); - } + return get(HeatEvent.class, uri("/stacks/%s/%s/resources/%s/events/%s", stackName, stackId, resourceName, eventId)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/internal/HeatServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/heat/internal/HeatServiceImpl.java index 9d9cafea9..10df6c497 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/internal/HeatServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/internal/HeatServiceImpl.java @@ -2,44 +2,39 @@ import org.openstack4j.api.Apis; -import org.openstack4j.api.heat.EventsService; -import org.openstack4j.api.heat.HeatService; -import org.openstack4j.api.heat.ResourcesService; -import org.openstack4j.api.heat.SoftwareConfigService; -import org.openstack4j.api.heat.StackService; -import org.openstack4j.api.heat.TemplateService; +import org.openstack4j.api.heat.*; /** * This class contains getters for all implementation of the available Heat services - * + * * @author Matthias Reisser */ public class HeatServiceImpl extends BaseHeatServices implements HeatService { - @Override - public StackService stacks() { - return Apis.get(StackService.class); - } + @Override + public StackService stacks() { + return Apis.get(StackService.class); + } - @Override - public TemplateService templates() { - return Apis.get(TemplateService.class); - } + @Override + public TemplateService templates() { + return Apis.get(TemplateService.class); + } - @Override - public EventsService events() { - return Apis.get(EventsService.class); - } + @Override + public EventsService events() { + return Apis.get(EventsService.class); + } - @Override - public ResourcesService resources() { - return Apis.get(ResourcesService.class); - } + @Override + public ResourcesService resources() { + return Apis.get(ResourcesService.class); + } @Override public SoftwareConfigService softwareConfig() { return Apis.get(SoftwareConfigService.class); } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/internal/ResourcesServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/heat/internal/ResourcesServiceImpl.java index 258712525..91cc05703 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/internal/ResourcesServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/internal/ResourcesServiceImpl.java @@ -1,8 +1,7 @@ package org.openstack4j.openstack.heat.internal; -import com.google.common.net.*; import org.openstack4j.api.heat.ResourcesService; -import org.openstack4j.model.common.*; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.heat.Resource; import org.openstack4j.model.heat.ResourceHealth; import org.openstack4j.openstack.heat.domain.HeatResource; @@ -18,62 +17,61 @@ * This class implements some methods for manipulation of {@link HeatResource} objects. The * non-exhaustive list of methods is oriented along * http://developer.openstack.org/api-ref-orchestration-v1.html - * + * * @author Octopus Zhang - * */ public class ResourcesServiceImpl extends BaseHeatServices implements ResourcesService { - @Override - public List list(String stackName, String stackId) { - checkNotNull(stackName); + @Override + public List list(String stackName, String stackId) { + checkNotNull(stackName); checkNotNull(stackId); - return get(Resources.class, uri("/stacks/%s/%s/resources", stackName, stackId)).execute().getList(); - } - - @Override - public List list(String stackNameOrId) { - return list(stackNameOrId, 1); - } + return get(Resources.class, uri("/stacks/%s/%s/resources", stackName, stackId)).execute().getList(); + } - @Override - public List list(String stackNameOrId, int depth) { - checkNotNull(stackNameOrId); - return get(HeatResource.Resources.class, uri("/stacks/%s/resources", stackNameOrId)) - .param("nested_depth", depth).execute().getList(); - } - - @Override - public Resource show(String stackName, String stackId, String resourceName) { - checkNotNull(stackName); + @Override + public List list(String stackNameOrId) { + return list(stackNameOrId, 1); + } + + @Override + public List list(String stackNameOrId, int depth) { + checkNotNull(stackNameOrId); + return get(HeatResource.Resources.class, uri("/stacks/%s/resources", stackNameOrId)) + .param("nested_depth", depth).execute().getList(); + } + + @Override + public Resource show(String stackName, String stackId, String resourceName) { + checkNotNull(stackName); checkNotNull(stackId); checkNotNull(resourceName); - return get(HeatResource.class, uri("/stacks/%s/%s/resources/%s", stackName, stackId, resourceName)).execute(); - } + return get(HeatResource.class, uri("/stacks/%s/%s/resources/%s", stackName, stackId, resourceName)).execute(); + } - @SuppressWarnings("unchecked") - @Override - public Map getMetadata(String stackName, String stackId, String resourceName) { - checkNotNull(stackName); - checkNotNull(stackId); - checkNotNull(resourceName); - return get(HashMap.class, uri("/stacks/%s/%s/resources/%s/metadata", stackName, stackId, resourceName)).execute(); - } + @SuppressWarnings("unchecked") + @Override + public Map getMetadata(String stackName, String stackId, String resourceName) { + checkNotNull(stackName); + checkNotNull(stackId); + checkNotNull(resourceName); + return get(HashMap.class, uri("/stacks/%s/%s/resources/%s/metadata", stackName, stackId, resourceName)).execute(); + } - @Override - public ActionResponse signal(String stackName, String stackId, String resourceName) { - checkNotNull(stackName); - checkNotNull(stackId); - checkNotNull(resourceName); - return postWithResponse(uri("/stacks/%s/%s/resources/%s/signal", stackName, stackId, resourceName)).execute(); - } + @Override + public ActionResponse signal(String stackName, String stackId, String resourceName) { + checkNotNull(stackName); + checkNotNull(stackId); + checkNotNull(resourceName); + return postWithResponse(uri("/stacks/%s/%s/resources/%s/signal", stackName, stackId, resourceName)).execute(); + } - @Override - public ActionResponse markUnhealthy(String stackName, String stackId, String resourceName, ResourceHealth resourceHealth) { - checkNotNull(stackName); - checkNotNull(stackId); - return patchWithResponse(uri("/stacks/%s/%s/resources/%s", stackName, stackId, resourceName)) - .entity(resourceHealth) - .execute(); - } + @Override + public ActionResponse markUnhealthy(String stackName, String stackId, String resourceName, ResourceHealth resourceHealth) { + checkNotNull(stackName); + checkNotNull(stackId); + return patchWithResponse(uri("/stacks/%s/%s/resources/%s", stackName, stackId, resourceName)) + .entity(resourceHealth) + .execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/internal/SoftwareConfigServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/heat/internal/SoftwareConfigServiceImpl.java index 5cf7fbeab..b46f4390e 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/internal/SoftwareConfigServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/internal/SoftwareConfigServiceImpl.java @@ -1,21 +1,21 @@ package org.openstack4j.openstack.heat.internal; -import static com.google.common.base.Preconditions.checkNotNull; - import org.openstack4j.api.heat.SoftwareConfigService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.heat.SoftwareConfig; import org.openstack4j.openstack.heat.domain.HeatSoftwareConfig; +import static com.google.common.base.Preconditions.checkNotNull; + /** * Software Configuration Service for HEAT Orchestration - * + * * @author Jeremy Unruh */ public class SoftwareConfigServiceImpl extends BaseHeatServices implements SoftwareConfigService { private static final String BASE_URI = "/software_configs"; - + /** * {@inheritDoc} */ @@ -31,7 +31,7 @@ public SoftwareConfig create(SoftwareConfig sc) { @Override public SoftwareConfig show(String configId) { checkNotNull(configId); - return get(HeatSoftwareConfig.class, uri(BASE_URI+"/%s", configId)).execute(); + return get(HeatSoftwareConfig.class, uri(BASE_URI + "/%s", configId)).execute(); } /** @@ -40,7 +40,7 @@ public SoftwareConfig show(String configId) { @Override public ActionResponse delete(String configId) { checkNotNull(configId); - return deleteWithResponse(uri(BASE_URI+"/%s", configId)).execute(); + return deleteWithResponse(uri(BASE_URI + "/%s", configId)).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/internal/StackServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/heat/internal/StackServiceImpl.java index fb8de911a..32fba8f19 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/internal/StackServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/internal/StackServiceImpl.java @@ -10,8 +10,8 @@ import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; import org.openstack4j.openstack.heat.domain.HeatAdoptStackData; import org.openstack4j.openstack.heat.domain.HeatStack; -import org.openstack4j.openstack.heat.domain.HeatStackAdopt; import org.openstack4j.openstack.heat.domain.HeatStack.Stacks; +import org.openstack4j.openstack.heat.domain.HeatStackAdopt; import java.util.List; import java.util.Map; @@ -22,9 +22,8 @@ * This class implements all methods for manipulation of {@link HeatStack} objects. The * non-exhaustive list of methods is oriented along * http://developer.openstack.org/api-ref-orchestration-v1.html#stacks - * + * * @author Matthias Reisser - * */ public class StackServiceImpl extends BaseHeatServices implements StackService { @@ -36,8 +35,8 @@ public Stack create(StackCreate newStack) { @Override public Stack create(String name, String template, - Map parameters, boolean disableRollback, - Long timeoutMins) { + Map parameters, boolean disableRollback, + Long timeoutMins) { checkNotNull(name); checkNotNull(template); checkNotNull(parameters); @@ -93,7 +92,7 @@ public Stack getStackByName(String stackName) { checkNotNull(stackName); return get(HeatStack.class, uri("/stacks/%s", stackName)).execute(); } - + @Override public AdoptStackData abandon(String stackName, String stackId) { checkNotNull(stackId); @@ -114,5 +113,5 @@ public Stack adopt(AdoptStackData adoptStackData, Map parameters .timeoutMins(timeoutMins) .build(); return post(HeatStack.class, uri("/stacks")).entity(heatStackAdopt).execute(); - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/internal/TemplateServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/heat/internal/TemplateServiceImpl.java index 673887ca5..ad575f11f 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/internal/TemplateServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/internal/TemplateServiceImpl.java @@ -1,23 +1,21 @@ package org.openstack4j.openstack.heat.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Map; - import org.openstack4j.api.Builders; import org.openstack4j.api.heat.TemplateService; import org.openstack4j.model.heat.Template; import org.openstack4j.model.heat.TemplateResponse; import org.openstack4j.openstack.heat.domain.HeatTemplate; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * This class implements all methods for manipulation of {@link HeatTemplate} * objects. The non-exhaustive list of methods is oriented along * http://developer.openstack.org/api-ref-orchestration-v1.html#stack-templates - * - * + * * @author Matthias Reisser - * */ public class TemplateServiceImpl extends BaseHeatServices implements TemplateService { @@ -63,27 +61,27 @@ public String getTemplateAsString(String stackName, String stackId) { checkNotNull(stackId); return get(String.class, uri("/stacks/%s/%s/template", stackName, stackId)).execute(); } - + /** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override - public Map getTemplateAsMap(String stackName, String stackId) { + public Map getTemplateAsMap(String stackName, String stackId) { checkNotNull(stackName); checkNotNull(stackId); return get(Map.class, uri("/stacks/%s/%s/template", stackName, stackId)).execute(); } - + /** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override - public Map getTemplateAsMap(String stackNameOrId) { + public Map getTemplateAsMap(String stackNameOrId) { checkNotNull(stackNameOrId); return get(Map.class, uri("/stacks/%s/template", stackNameOrId)).execute(); } - - + + } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java b/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java index 2942c8805..5b3192253 100755 --- a/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java @@ -19,7 +19,7 @@ public class Environment { private Map files = new HashMap(); private URL baseUrl; - public Environment(URL environmentRes) throws JsonParseException, IOException, URISyntaxException{ + public Environment(URL environmentRes) throws JsonParseException, IOException, URISyntaxException { setEnvContent(Resources.toString(environmentRes, Charsets.UTF_8)); setBaseUrl(TemplateUtils.baseUrl(environmentRes.toString())); getFileContent(); @@ -27,13 +27,13 @@ public Environment(URL environmentRes) throws JsonParseException, IOException, U public Environment(String environmentLoc) throws JsonParseException, MalformedURLException, - UnsupportedEncodingException, IOException, URISyntaxException { + UnsupportedEncodingException, IOException, URISyntaxException { this(TemplateUtils.normaliseFilePathToUrl(environmentLoc)); } @SuppressWarnings("unchecked") - private Map getResourceRegistry(){ + private Map getResourceRegistry() { Yaml yaml = new Yaml(); Map content = (Map) yaml.load(getEnvContent()); return (Map) content.get("resource_registry"); @@ -45,22 +45,22 @@ private Map getResourceRegistry(){ private void getFileContent() throws JsonParseException, MalformedURLException, UnsupportedEncodingException, IOException, URISyntaxException { Map rr = getResourceRegistry(); - if (rr == null ) return; - if(rr.get("base_url") != null ) setBaseUrl(new URL(rr.get("base_url"))); - for(String resourceType: rr.keySet()) { - if(resourceType.equals("base_url")) + if (rr == null) return; + if (rr.get("base_url") != null) setBaseUrl(new URL(rr.get("base_url"))); + for (String resourceType : rr.keySet()) { + if (resourceType.equals("base_url")) continue; - - if("OS::Heat::None".equals(rr.get(resourceType))) - continue; - + + if ("OS::Heat::None".equals(rr.get(resourceType))) + continue; + URL tplUrl = new URL(baseUrl, rr.get(resourceType)); Template tpl = new Template(tplUrl); files.put(rr.get(resourceType), tpl.getTplContent()); Map fileFromTemplate = tpl.getFiles(); - for(String file : fileFromTemplate.keySet()) { - if(! files.containsKey(file)) { + for (String file : fileFromTemplate.keySet()) { + if (!files.containsKey(file)) { files.put(file, fileFromTemplate.get(file)); } } diff --git a/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java b/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java index 26ffd12dc..dafb836a8 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java @@ -28,7 +28,7 @@ public class Template { private final static String GET_FILE = "get_file"; - public Template(URL templateRes) throws JsonParseException, IOException{ + public Template(URL templateRes) throws JsonParseException, IOException { setTplContent(Resources.toString(templateRes, Charsets.UTF_8)); baseUrl = TemplateUtils.baseUrl(templateRes.toString()); getFileContents(); @@ -36,7 +36,7 @@ public Template(URL templateRes) throws JsonParseException, IOException{ public Template(String templateLoc) throws JsonParseException, MalformedURLException, - UnsupportedEncodingException, IOException, URISyntaxException { + UnsupportedEncodingException, IOException, URISyntaxException { this(TemplateUtils.normaliseFilePathToUrl(templateLoc)); } @@ -56,25 +56,25 @@ private void getFileContents() { } } - private void resolveTemplateType(Map map) throws MalformedURLException, IOException { - for(Object key : map.keySet()) { + private void resolveTemplateType(Map map) throws MalformedURLException, IOException { + for (Object key : map.keySet()) { // Ignore if the key is not string. Actually not happening - if(!(key instanceof String)) { + if (!(key instanceof String)) { continue; } String skey = (String) key; Object value = map.get(skey); - if(value instanceof String) { + if (value instanceof String) { String valueInString = (String) value; //Processing the nested template - if(isTemplate(skey, valueInString)) { + if (isTemplate(skey, valueInString)) { try { final String templateName = valueInString; - final URL fullTemplateName = TemplateUtils.normaliseFilePathToUrl(baseUrl.toString(), templateName); + final URL fullTemplateName = TemplateUtils.normaliseFilePathToUrl(baseUrl.toString(), templateName); - if(! files.containsKey(templateName)) { + if (!files.containsKey(templateName)) { final Template tpl = new Template(fullTemplateName); files.put(templateName, tpl.getTplContent()); files.putAll(tpl.getFiles()); @@ -85,8 +85,8 @@ private void resolveTemplateType(Map map) throws MalformedURLException, IOE } } - if (value instanceof Map){ - resolveTemplateType((Map)value); + if (value instanceof Map) { + resolveTemplateType((Map) value); } else if (value instanceof List) { for (Object item : (List) value) { if (item instanceof Map) { @@ -97,25 +97,25 @@ private void resolveTemplateType(Map map) throws MalformedURLException, IOE } } - private void resolveTemplateGetFiles(Map map) throws IOException { - for(Object key : map.keySet()){ + private void resolveTemplateGetFiles(Map map) throws IOException { + for (Object key : map.keySet()) { // Ignore if the key is not string. Actually not happening - if(!(key instanceof String)) { + if (!(key instanceof String)) { continue; } String skey = (String) key; Object value = map.get(skey); - if(isGetFile(skey)) { + if (isGetFile(skey)) { //if key="get_file", the value is the filename - addToFiles((String)value); + addToFiles((String) value); continue; } Object subMap = map.get(skey); - if (subMap instanceof Map){ - resolveTemplateGetFiles((Map)subMap); + if (subMap instanceof Map) { + resolveTemplateGetFiles((Map) subMap); } else if (subMap instanceof List) { for (Object item : (List) subMap) { if (item instanceof Map) { @@ -127,12 +127,12 @@ private void resolveTemplateGetFiles(Map map) throws IOException { } private void addToFiles(String filename) throws IOException { - if(! files.containsKey(filename)) { - if (filename.startsWith("/")){ - files.put(filename, TemplateUtils.readToString(filename)); - } else { - files.put(filename, TemplateUtils.readToString(baseUrl + filename)); - } + if (!files.containsKey(filename)) { + if (filename.startsWith("/")) { + files.put(filename, TemplateUtils.readToString(filename)); + } else { + files.put(filename, TemplateUtils.readToString(baseUrl + filename)); + } } } @@ -141,7 +141,7 @@ private boolean isGetFile(String tag) { } private boolean isTemplate(String key, String value) { - if (! key.equals("type")) { + if (!key.equals("type")) { return false; } if (value.endsWith(".yaml") || value.endsWith(".template")) { diff --git a/core/src/main/java/org/openstack4j/openstack/heat/utils/TemplateUtils.java b/core/src/main/java/org/openstack4j/openstack/heat/utils/TemplateUtils.java index d6557f2fa..e683f8c95 100755 --- a/core/src/main/java/org/openstack4j/openstack/heat/utils/TemplateUtils.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/utils/TemplateUtils.java @@ -1,6 +1,7 @@ package org.openstack4j.openstack.heat.utils; -import static org.openstack4j.core.transport.ClientConstants.URI_SEP; +import com.google.common.base.Charsets; +import com.google.common.io.Resources; import java.io.File; import java.io.IOException; @@ -9,37 +10,36 @@ import java.net.URISyntaxException; import java.net.URL; -import com.google.common.base.Charsets; -import com.google.common.io.Resources; +import static org.openstack4j.core.transport.ClientConstants.URI_SEP; public class TemplateUtils { public static String readToString(String filename) throws IOException { return Resources.toString(new URL(filename), Charsets.UTF_8); } - + public static String readToString(URL url) throws IOException { return Resources.toString(url, Charsets.UTF_8); } - + public static URL baseUrl(String url) throws MalformedURLException { - String baseUrl = url.substring(0, url.lastIndexOf(URI_SEP) + 1); - if(! baseUrl.endsWith(URI_SEP)) { + String baseUrl = url.substring(0, url.lastIndexOf(URI_SEP) + 1); + if (!baseUrl.endsWith(URI_SEP)) { baseUrl += URI_SEP; } return new URL(baseUrl); } - - public static URL normaliseFilePathToUrl(String path) + + public static URL normaliseFilePathToUrl(String path) throws MalformedURLException, URISyntaxException { - if(path.startsWith("file:") - || path.startsWith("http:") + if (path.startsWith("file:") + || path.startsWith("http:") || path.startsWith("https:")) { return new URI(path).toURL(); } else { return new File(path).toURI().toURL(); } - + } public static URL normaliseFilePathToUrl(String baseUrl, String templateName) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/functions/ServiceFunctions.java b/core/src/main/java/org/openstack4j/openstack/identity/functions/ServiceFunctions.java index 9c9dd5a70..329110401 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/functions/ServiceFunctions.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/functions/ServiceFunctions.java @@ -1,21 +1,21 @@ package org.openstack4j.openstack.identity.functions; +import com.google.common.base.Function; + import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.google.common.base.Function; - /** * Functions to help resolve specific Services and Versions - * + * * @author Jeremy Unruh */ public final class ServiceFunctions { private static final Pattern VERSION_PATTERN = Pattern.compile("(.*)v(\\d+)"); - + /** - * Takes a Service Type or Service Name and strips off any version (if applicable) and returns the + * Takes a Service Type or Service Name and strips off any version (if applicable) and returns the * common name. For example: {@code nova21} would be returned as {@code nova}. */ public static final Function TYPE_WITHOUT_VERSION = new Function() { @@ -37,7 +37,7 @@ public Integer apply(String serviceType) { return matchForVersion(serviceType, true); } }; - + @SuppressWarnings("unchecked") private static T matchForVersion(String service, boolean returnVersion) { Matcher m = VERSION_PATTERN.matcher(service); @@ -52,5 +52,5 @@ private static T matchForVersion(String service, boolean returnVersion) { } return (T) service; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java b/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java index 3d60389f7..135c19997 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java @@ -1,36 +1,36 @@ package org.openstack4j.openstack.identity.internal; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Map; -import java.util.SortedSet; -import java.util.concurrent.ConcurrentHashMap; import com.google.common.base.Optional; import com.google.common.collect.SortedSetMultimap; - import org.openstack4j.api.exceptions.RegionEndpointNotFoundException; import org.openstack4j.api.identity.EndpointURLResolver; import org.openstack4j.api.types.Facing; import org.openstack4j.api.types.ServiceType; -import org.openstack4j.model.identity.v3.Token; +import org.openstack4j.model.identity.URLResolverParams; import org.openstack4j.model.identity.v2.Access; import org.openstack4j.model.identity.v2.Endpoint; -import org.openstack4j.model.identity.URLResolverParams; +import org.openstack4j.model.identity.v3.Token; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Map; +import java.util.SortedSet; +import java.util.concurrent.ConcurrentHashMap; + /** * Resolves an Endpoint URL based on the Service Type and Facing perspective * * @author Jeremy Unruh */ public class DefaultEndpointURLResolver implements EndpointURLResolver { - + private static final Logger LOG = LoggerFactory.getLogger(DefaultEndpointURLResolver.class); private static final Map CACHE = new ConcurrentHashMap(); private static boolean LEGACY_EP_HANDLING = Boolean.getBoolean(LEGACY_EP_RESOLVING_PROP); private String publicHostIP; - + @Override public String findURLV2(URLResolverParams p) { if (p.type == null) { @@ -100,13 +100,13 @@ private String resolveV2(URLResolverParams p) { return getEndpointURL(p.access, ep); switch (p.perspective) { - case ADMIN: - return ep.getAdminURL().toString(); - case INTERNAL: - return ep.getInternalURL().toString(); - case PUBLIC: - default: - return ep.getPublicURL().toString(); + case ADMIN: + return ep.getAdminURL().toString(); + case INTERNAL: + return ep.getInternalURL().toString(); + case PUBLIC: + default: + return ep.getPublicURL().toString(); } } } else { @@ -168,7 +168,7 @@ private boolean matches(org.openstack4j.model.identity.v3.Endpoint endpoint, URL /** * Gets the endpoint url. * - * @param access the current access data source + * @param access the current access data source * @param endpoint the endpoint * @return the endpoint url */ diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Auth.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Auth.java index db47177b1..c36f7105e 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Auth.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Auth.java @@ -4,32 +4,35 @@ public abstract class Auth implements org.openstack4j.openstack.common.Auth { - private static final long serialVersionUID = 1L; - - private String tenantId; - private String tenantName; - @JsonIgnore - private transient Type type; - - protected Auth(Type type) { - this.type = type; - } - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getTenantName() { - return tenantName; - } - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - @JsonIgnore - public Type getType() { - return type; - } + private static final long serialVersionUID = 1L; + + private String tenantId; + private String tenantName; + @JsonIgnore + private transient Type type; + + protected Auth(Type type) { + this.type = type; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + @JsonIgnore + public Type getType() { + return type; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Credentials.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Credentials.java index 59e9a1bb1..7d62060bd 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Credentials.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/Credentials.java @@ -1,24 +1,23 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.io.Serializable; - -import org.openstack4j.model.identity.AuthStore; -import org.openstack4j.model.identity.AuthVersion; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.identity.AuthStore; +import org.openstack4j.model.identity.AuthVersion; + +import java.io.Serializable; @JsonRootName("auth") public class Credentials extends Auth implements AuthStore { private static final long serialVersionUID = 1L; - @JsonProperty(value="passwordCredentials") + @JsonProperty(value = "passwordCredentials") private PasswordCredentials passwordCreds = new PasswordCredentials(); - public Credentials() { + public Credentials() { super(Type.CREDENTIALS); } @@ -64,9 +63,9 @@ public String getName() { private static final class PasswordCredentials implements Serializable { - private static final long serialVersionUID = 1L; - - @JsonProperty + private static final long serialVersionUID = 1L; + + @JsonProperty String username; @JsonProperty String password; diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneAccess.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneAccess.java index d736b314c..4424b190c 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneAccess.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneAccess.java @@ -1,308 +1,306 @@ package org.openstack4j.openstack.identity.v2.domain; -import static org.openstack4j.openstack.identity.functions.ServiceFunctions.TYPE_WITHOUT_VERSION; -import static org.openstack4j.openstack.identity.functions.ServiceFunctions.VERSION_FROM_TYPE; - -import java.io.Serializable; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import com.google.common.collect.SortedSetMultimap; +import com.google.common.collect.TreeMultimap; import org.openstack4j.api.types.ServiceType; import org.openstack4j.model.common.Link; -import org.openstack4j.model.identity.v2.Access; import org.openstack4j.model.identity.AuthStore; import org.openstack4j.model.identity.AuthVersion; +import org.openstack4j.model.identity.v2.Access; import org.openstack4j.model.identity.v2.Endpoint; import org.openstack4j.model.identity.v2.Role; import org.openstack4j.model.identity.v2.TokenV2; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.SortedSetMultimap; -import com.google.common.collect.TreeMultimap; +import java.io.Serializable; +import java.util.List; + +import static org.openstack4j.openstack.identity.functions.ServiceFunctions.TYPE_WITHOUT_VERSION; +import static org.openstack4j.openstack.identity.functions.ServiceFunctions.VERSION_FROM_TYPE; @JsonRootName("access") public class KeystoneAccess implements Access { - private static final long serialVersionUID = 1L; - private static final String CACHE_FMT = "%s:%s"; - private KeystoneToken token; - private List serviceCatalog; - private AccessUser user; - private String endpoint; - private AuthStore credentials; - private TokenAuth tokenAuth; - @JsonIgnore - private volatile SortedSetMultimap aggregatedCatalog; - - /** - * @return the token - */ - public TokenV2 getToken() { - return token; - } - - /** - * @return the serviceCatalog - */ - public List getServiceCatalog() { - return serviceCatalog; - } - - /** - * A Lazy loading Aggregated Service Catalog Mapping. The key is a stripped version service type or name with a collection - * of Services sorted by version - * - * @return sorted aggregate service catalog - */ - @Override - @JsonIgnore - public SortedSetMultimap getAggregatedCatalog() { - if (aggregatedCatalog == null) { - synchronized(this) { - if (aggregatedCatalog == null) { - aggregatedCatalog = TreeMultimap.create(); - for (AccessService sc : serviceCatalog) { - String nameKey = TYPE_WITHOUT_VERSION.apply(sc.getName()); - String typeKey = TYPE_WITHOUT_VERSION.apply(sc.getType()); - aggregatedCatalog.put(nameKey, sc); + private static final long serialVersionUID = 1L; + private static final String CACHE_FMT = "%s:%s"; + private KeystoneToken token; + private List serviceCatalog; + private AccessUser user; + private String endpoint; + private AuthStore credentials; + private TokenAuth tokenAuth; + @JsonIgnore + private volatile SortedSetMultimap aggregatedCatalog; + + /** + * @return the token + */ + public TokenV2 getToken() { + return token; + } + + /** + * @return the serviceCatalog + */ + public List getServiceCatalog() { + return serviceCatalog; + } + + /** + * A Lazy loading Aggregated Service Catalog Mapping. The key is a stripped version service type or name with a collection + * of Services sorted by version + * + * @return sorted aggregate service catalog + */ + @Override + @JsonIgnore + public SortedSetMultimap getAggregatedCatalog() { + if (aggregatedCatalog == null) { + synchronized (this) { + if (aggregatedCatalog == null) { + aggregatedCatalog = TreeMultimap.create(); + for (AccessService sc : serviceCatalog) { + String nameKey = TYPE_WITHOUT_VERSION.apply(sc.getName()); + String typeKey = TYPE_WITHOUT_VERSION.apply(sc.getType()); + aggregatedCatalog.put(nameKey, sc); aggregatedCatalog.put(typeKey, sc); - } - } - } - } - return aggregatedCatalog; - } - - /** - * @return the user - */ - public UserDetails getUser() { - return user; - } - - public String getEndpoint() { - return endpoint; - } - - /** - * ONLY used for unit tests - * @param endpoint - */ - public void setEndpoint(String endpoint) { - this.endpoint = endpoint; - } - - public AuthStore getCredentials() { - return credentials; - } - - public TokenAuth getTokenAuth() { - return tokenAuth; - } - - public boolean isCredentialType() { - return credentials != null; - } - - public KeystoneAccess applyContext(String endpoint, AuthStore credentials) { - this.credentials = credentials; - this.endpoint = endpoint; - return this; - } - - public KeystoneAccess applyContext(String endpoint, TokenAuth token) { + } + } + } + } + return aggregatedCatalog; + } + + /** + * @return the user + */ + public UserDetails getUser() { + return user; + } + + public String getEndpoint() { + return endpoint; + } + + /** + * ONLY used for unit tests + * + * @param endpoint + */ + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public AuthStore getCredentials() { + return credentials; + } + + public TokenAuth getTokenAuth() { + return tokenAuth; + } + + public boolean isCredentialType() { + return credentials != null; + } + + public KeystoneAccess applyContext(String endpoint, AuthStore credentials) { + this.credentials = credentials; + this.endpoint = endpoint; + return this; + } + + public KeystoneAccess applyContext(String endpoint, TokenAuth token) { this.endpoint = endpoint; return this; } - /** - * {@inheritDoc} - */ - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("token", token).add("serviceCatalog", serviceCatalog).add("user", user) - .toString(); - } - - @JsonIgnoreProperties(ignoreUnknown=true) - public static final class AccessUser implements UserDetails, Serializable { - - private static final long serialVersionUID = 1L; - - private String id; - private String name; - private String username; - private List roles; - private Boolean enabled; - - @JsonProperty("roles_links") - private List rolesLinks; - - public String getId() { - return id; - } - - public String getName() { - return name; - } - - public String getUsername() { - return username; - } - - public List getRoles() { - return roles; - } - - public List getRolesLinks() { - return rolesLinks; - } - - public boolean isEnabled() { - return (enabled != null && enabled); - } - - /** - * {@inheritDoc} - */ - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("username", username).add("enabled", enabled) - .add("roles", roles).add("rolesLinks", rolesLinks) - .toString(); - } - - @JsonIgnoreProperties(ignoreUnknown=true) - public static final class AccessRole extends KeystoneRole - { - private static final long serialVersionUID = 1L; - - /** - * {@inheritDoc} - */ - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", getId()).add("name", getName()).add("tenantId", getTenantId()) - .toString(); - } - } - } - - public static class AccessUsers extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("users") - private List list; - - public List value() { - return list; - } - } - - - public static final class AccessService implements Service, Comparable, Serializable - { - private static final long serialVersionUID = 1L; - - private String type; - private String name; - private List endpoints; - private ServiceType serviceType; + /** + * {@inheritDoc} + */ + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("token", token).add("serviceCatalog", serviceCatalog).add("user", user) + .toString(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class AccessUser implements UserDetails, Serializable { + + private static final long serialVersionUID = 1L; + + private String id; + private String name; + private String username; + private List roles; + private Boolean enabled; + + @JsonProperty("roles_links") + private List rolesLinks; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getUsername() { + return username; + } + + public List getRoles() { + return roles; + } + + public List getRolesLinks() { + return rolesLinks; + } + + public boolean isEnabled() { + return (enabled != null && enabled); + } + + /** + * {@inheritDoc} + */ + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("username", username).add("enabled", enabled) + .add("roles", roles).add("rolesLinks", rolesLinks) + .toString(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class AccessRole extends KeystoneRole { + private static final long serialVersionUID = 1L; + + /** + * {@inheritDoc} + */ + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", getId()).add("name", getName()).add("tenantId", getTenantId()) + .toString(); + } + } + } + + public static class AccessUsers extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("users") + private List list; + + public List value() { + return list; + } + } + + + public static final class AccessService implements Service, Comparable, Serializable { + private static final long serialVersionUID = 1L; + + private String type; + private String name; + private List endpoints; + private ServiceType serviceType; @JsonIgnore private Integer version; - @JsonProperty("endpoints_links") - private List endpointsLinks; - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - @JsonIgnore - public ServiceType getServiceType() { - if (serviceType == null) - serviceType = ServiceType.forName(name); - if (serviceType == ServiceType.UNKNOWN) - serviceType = ServiceType.forName(type); - return serviceType; - } - - /** - * @return the endpoints - */ - public List getEndpoints() { - return endpoints; - } - - /** - * @return the endpointsLinks - */ - public List getEndpointsLinks() { - return endpointsLinks; - } - - @JsonIgnore - public Integer getVersion() { - if (version == null) { + @JsonProperty("endpoints_links") + private List endpointsLinks; + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + @JsonIgnore + public ServiceType getServiceType() { + if (serviceType == null) + serviceType = ServiceType.forName(name); + if (serviceType == ServiceType.UNKNOWN) + serviceType = ServiceType.forName(type); + return serviceType; + } + + /** + * @return the endpoints + */ + public List getEndpoints() { + return endpoints; + } + + /** + * @return the endpointsLinks + */ + public List getEndpointsLinks() { + return endpointsLinks; + } + + @JsonIgnore + public Integer getVersion() { + if (version == null) { version = VERSION_FROM_TYPE.apply(type); } - return version; - } - - /** - * {@inheritDoc} - */ - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("type", type).add("version", getVersion()).add("endpoints", endpoints).addValue("\n") - .toString(); - } + return version; + } + + /** + * {@inheritDoc} + */ + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", name).add("type", type).add("version", getVersion()).add("endpoints", endpoints).addValue("\n") + .toString(); + } @Override public int compareTo(AccessService o) { return getVersion().compareTo(o.getVersion()); } - } - - @JsonIgnore - @Override - public AuthVersion getVersion() { - return AuthVersion.V2; - } - - @SuppressWarnings("unchecked") - @JsonIgnore - @Override - public T unwrap() { - return (T) this; - } - - @JsonIgnore + } + + @JsonIgnore + @Override + public AuthVersion getVersion() { + return AuthVersion.V2; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + @Override + public T unwrap() { + return (T) this; + } + + @JsonIgnore @Override public String getCacheIdentifier() { - String uniq = null; - if (token.getTenant() != null) - uniq = token.getTenant().getId(); - else if (user != null) - uniq = user.getId(); - else - uniq = ""; - return String.format(CACHE_FMT, endpoint, uniq); + String uniq = null; + if (token.getTenant() != null) + uniq = token.getTenant().getId(); + else if (user != null) + uniq = user.getId(); + else + uniq = ""; + return String.format(CACHE_FMT, endpoint, uniq); } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneCreateRole.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneCreateRole.java index e88d2b9d0..75217f869 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneCreateRole.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneCreateRole.java @@ -1,27 +1,26 @@ package org.openstack4j.openstack.identity.v2.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; @JsonRootName("role") public class KeystoneCreateRole implements ModelEntity { - - private static final long serialVersionUID = 1L; - private String name; - public KeystoneCreateRole() { - } - - public KeystoneCreateRole(String name) { - this.name = name; - } - - public String getName() { - return name; - } + private static final long serialVersionUID = 1L; + private String name; + + public KeystoneCreateRole() { + } + + public KeystoneCreateRole(String name) { + this.name = name; + } + + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java index da1d38ccd..55c416d18 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java @@ -1,267 +1,265 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.net.URI; -import java.util.List; - -import org.openstack4j.model.identity.v2.builder.EndpointBuilder; -import org.openstack4j.model.identity.v2.Endpoint; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.model.identity.v2.Endpoint; +import org.openstack4j.model.identity.v2.builder.EndpointBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.net.URI; +import java.util.List; /** * Endpoint Model is used to describe a network address which is described by URL's and other service * information depending on the context it was retrieved in. * * @author Jeremy Unruh - * * @see { - private static final long serialVersionUID = 1L; - - @JsonProperty("endpoints") - private List endpoints; - - public List value() { - return endpoints; - } - } - - public static class EndPointConcreteBuilder implements EndpointBuilder { - - protected KeystoneEndpoint model; - - protected EndPointConcreteBuilder() { - this(new KeystoneEndpoint()); - } - - EndPointConcreteBuilder(KeystoneEndpoint model) { - this.model = model; - } - - /** - * @see KeystoneEndpoint#getRegion() - */ - public EndpointBuilder region(String region) { - model.region = region; - return this; - } - - /** - * @see KeystoneEndpoint#getPublicURL() - */ - public EndpointBuilder publicURL(URI publicURL) { - model.publicURL = publicURL; - return this; - } - - /** - * @see KeystoneEndpoint#getInternalURL() - */ - public EndpointBuilder internalURL(URI internalURL) { - model.internalURL = internalURL; - return this; - } - - /** - * @see KeystoneEndpoint#getTenantId() - */ - public EndpointBuilder tenantId(String tenantId) { - model.tenantId = tenantId; - return this; - } - - /** - * @see KeystoneEndpoint#getType() - */ - public EndpointBuilder type(String type) { - model.type = type; - return this; - } - - /** - * @see KeystoneEndpoint#getId() - */ - public EndpointBuilder id(String id) { - model.id = id; - return this; - } - - /** - * @see KeystoneEndpoint#getName() - */ - public EndpointBuilder name(String name) { - model.name = name; - return this; - } - - /** - * @see KeystoneEndpoint#getAdminURL() - */ - public EndpointBuilder adminURL(URI adminURL) { - model.adminURL = adminURL; - return this; - } - - /** - * @see KeystoneEndpoint#getVersionInfo() - */ - public EndpointBuilder versionInfo(URI versionInfo) { - model.versionInfo = versionInfo; - return this; - } - - /** - * @see KeystoneEndpoint#getVersionList() - */ - public EndpointBuilder versionList(URI versionList) { - model.versionList = versionList; - return this; - } - - @Override - public KeystoneEndpoint build() { - return model; - } - - @Override - public EndpointBuilder from(Endpoint in) { - this.model = (KeystoneEndpoint)in; - return this; - } - } + private static final long serialVersionUID = 1L; + + private String type; + private String id; + private String name; + private String region; + private URI publicURL; + private URI internalURL; + private URI adminURL; + private String tenantId; + private String versionId; + private URI versionInfo; + private URI versionList; + + public static EndpointBuilder builder() { + return new EndPointConcreteBuilder(); + } + + @Override + public EndpointBuilder toBuilder() { + return new EndPointConcreteBuilder(this); + } + + public String getType() { + return type; + } + + /** + * @return the id for this endpoint (null if a new endpoint is being created) + */ + public String getId() { + return id; + } + + /** + * @return the name of this endpoint, or null when the endpoint is part of the Access ServiceCatalog + */ + public String getName() { + return name; + } + + /** + * @return the admin URL for this endpoint, or null when the endpoint is part of the Access ServiceCatalog + */ + public URI getAdminURL() { + return adminURL; + } + + /** + * @return the public URL for this endpoint + */ + public URI getPublicURL() { + return publicURL; + } + + /** + * @return the internal URL for this endpoint + */ + public URI getInternalURL() { + return internalURL; + } + + /** + * @return the region of the endpoint or null + */ + public String getRegion() { + return region; + } + + /** + * @return the tenant identifier for this endpoint or null + */ + public String getTenantId() { + return tenantId; + } + + /** + * @return the version id or null + */ + public String getVersionId() { + return versionId; + } + + /** + * @return the version information when endpoint is listed as part of Access Service Catalog, otherwise null + */ + public URI getVersionInfo() { + return versionInfo; + } + + /** + * @return the version list when endpoint is listed as part of Access Service Catalog, otherwise null + */ + public URI getVersionList() { + return versionList; + } + + @Override + public int hashCode() { + return Objects.hashCode(id, versionId, region, publicURL, internalURL, adminURL, versionInfo, versionList, + tenantId, type); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null || getClass() != obj.getClass()) + return false; + KeystoneEndpoint that = KeystoneEndpoint.class.cast(obj); + return Objects.equal(this.id, that.id) && Objects.equal(this.versionId, that.versionId) + && Objects.equal(this.region, that.region) && Objects.equal(this.publicURL, that.publicURL) + && Objects.equal(this.internalURL, that.internalURL) && Objects.equal(this.adminURL, that.adminURL) + && Objects.equal(this.versionInfo, that.versionInfo) && Objects.equal(this.versionList, that.versionList) + && Objects.equal(this.tenantId, that.tenantId) && Objects.equal(this.type, that.type); + } + + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("type", type) + .add("region", region).add("publicURL", publicURL) + .add("internalURL", internalURL).add("adminURL", adminURL) + .add("versionId", versionId).add("versionInfo", versionInfo).add("versionList", versionList) + .toString(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static class Endpoints extends ListResult { + private static final long serialVersionUID = 1L; + + @JsonProperty("endpoints") + private List endpoints; + + public List value() { + return endpoints; + } + } + + public static class EndPointConcreteBuilder implements EndpointBuilder { + + protected KeystoneEndpoint model; + + protected EndPointConcreteBuilder() { + this(new KeystoneEndpoint()); + } + + EndPointConcreteBuilder(KeystoneEndpoint model) { + this.model = model; + } + + /** + * @see KeystoneEndpoint#getRegion() + */ + public EndpointBuilder region(String region) { + model.region = region; + return this; + } + + /** + * @see KeystoneEndpoint#getPublicURL() + */ + public EndpointBuilder publicURL(URI publicURL) { + model.publicURL = publicURL; + return this; + } + + /** + * @see KeystoneEndpoint#getInternalURL() + */ + public EndpointBuilder internalURL(URI internalURL) { + model.internalURL = internalURL; + return this; + } + + /** + * @see KeystoneEndpoint#getTenantId() + */ + public EndpointBuilder tenantId(String tenantId) { + model.tenantId = tenantId; + return this; + } + + /** + * @see KeystoneEndpoint#getType() + */ + public EndpointBuilder type(String type) { + model.type = type; + return this; + } + + /** + * @see KeystoneEndpoint#getId() + */ + public EndpointBuilder id(String id) { + model.id = id; + return this; + } + + /** + * @see KeystoneEndpoint#getName() + */ + public EndpointBuilder name(String name) { + model.name = name; + return this; + } + + /** + * @see KeystoneEndpoint#getAdminURL() + */ + public EndpointBuilder adminURL(URI adminURL) { + model.adminURL = adminURL; + return this; + } + + /** + * @see KeystoneEndpoint#getVersionInfo() + */ + public EndpointBuilder versionInfo(URI versionInfo) { + model.versionInfo = versionInfo; + return this; + } + + /** + * @see KeystoneEndpoint#getVersionList() + */ + public EndpointBuilder versionList(URI versionList) { + model.versionList = versionList; + return this; + } + + @Override + public KeystoneEndpoint build() { + return model; + } + + @Override + public EndpointBuilder from(Endpoint in) { + this.model = (KeystoneEndpoint) in; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneRole.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneRole.java index 8312ad32f..695bc19a4 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneRole.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneRole.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.util.List; - -import org.openstack4j.core.transport.internal.OSBadBooleanDeserializer; -import org.openstack4j.model.identity.v2.builder.RoleBuilder; -import org.openstack4j.model.identity.v2.Role; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.common.base.MoreObjects; +import org.openstack4j.core.transport.internal.OSBadBooleanDeserializer; +import org.openstack4j.model.identity.v2.Role; +import org.openstack4j.model.identity.v2.builder.RoleBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * A User based Role - see {@link Role} @@ -20,137 +19,136 @@ @JsonRootName("role") public class KeystoneRole implements Role { - private static final long serialVersionUID = 1L; - private String id; - private String name; - private String description; - @JsonDeserialize(using=OSBadBooleanDeserializer.class) - private Boolean enabled = true; - private String tenantId; - private String serviceId; - - public static RoleBuilder builder() { - return new RoleConcreteBuilder(); - } - - @Override - public RoleBuilder toBuilder() { - return new RoleConcreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - public boolean isEnabled() { - return (enabled != null && enabled); - } - - /** - * {@inheritDoc} - */ - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - public String getServiceId() { - return serviceId; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("description", description) - .add("enabled", enabled).add("tenantId", tenantId).add("serviceId", serviceId) - .toString(); - } - - - - public static class Roles extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("roles") - private List list; - - @Override - protected List value() { - return list; - } - - - } - - public static class RoleConcreteBuilder implements RoleBuilder { - - private KeystoneRole model; - - RoleConcreteBuilder() { - this(new KeystoneRole()); - } - - RoleConcreteBuilder(KeystoneRole model) { - this.model = model; - } - - public RoleBuilder id(String id) { - model.id = id; - return this; - } - - public RoleBuilder tenantId(String tenantId) { - model.tenantId = tenantId; - return this; - } - - public RoleBuilder name(String name) { - model.name = name; - return this; - } - - public RoleBuilder description(String description) { - model.description = description; - return this; - } - - public RoleBuilder enabled(boolean enabled) { - model.enabled = enabled; - return this; - } - - @Override - public Role build() { - return model; - } - - @Override - public RoleBuilder from(Role in) { - model = (KeystoneRole)in; - return this; - } - - } + private static final long serialVersionUID = 1L; + private String id; + private String name; + private String description; + @JsonDeserialize(using = OSBadBooleanDeserializer.class) + private Boolean enabled = true; + private String tenantId; + private String serviceId; + + public static RoleBuilder builder() { + return new RoleConcreteBuilder(); + } + + @Override + public RoleBuilder toBuilder() { + return new RoleConcreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + public boolean isEnabled() { + return (enabled != null && enabled); + } + + /** + * {@inheritDoc} + */ + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + public String getServiceId() { + return serviceId; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("description", description) + .add("enabled", enabled).add("tenantId", tenantId).add("serviceId", serviceId) + .toString(); + } + + + public static class Roles extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("roles") + private List list; + + @Override + protected List value() { + return list; + } + + + } + + public static class RoleConcreteBuilder implements RoleBuilder { + + private KeystoneRole model; + + RoleConcreteBuilder() { + this(new KeystoneRole()); + } + + RoleConcreteBuilder(KeystoneRole model) { + this.model = model; + } + + public RoleBuilder id(String id) { + model.id = id; + return this; + } + + public RoleBuilder tenantId(String tenantId) { + model.tenantId = tenantId; + return this; + } + + public RoleBuilder name(String name) { + model.name = name; + return this; + } + + public RoleBuilder description(String description) { + model.description = description; + return this; + } + + public RoleBuilder enabled(boolean enabled) { + model.enabled = enabled; + return this; + } + + @Override + public Role build() { + return model; + } + + @Override + public RoleBuilder from(Role in) { + model = (KeystoneRole) in; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneService.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneService.java index 4d55fff7b..3c977e3b5 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneService.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneService.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.util.List; - -import org.openstack4j.model.identity.v2.builder.ServiceBuilder; -import org.openstack4j.model.identity.v2.Service; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.identity.v2.Service; +import org.openstack4j.model.identity.v2.builder.ServiceBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * OpenStack service, such as Compute (Nova), Object Storage (Swift), or Image Service (Glance). @@ -19,96 +18,96 @@ @JsonRootName("OS-KSADM:service") public class KeystoneService implements Service { - private static final long serialVersionUID = 1L; - - String id; - String type; - String name; - String description; - - public static ServiceBuilder builder() { - return new ServiceConcreteBuilder(); - } - - @Override - public ServiceBuilder toBuilder() { - return new ServiceConcreteBuilder(this); - } - - public String getId() { - return id; - } - - public String getType() { - return type; - } - - public String getName() { - return name; - } - - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("type", type).add("description", description) - .toString(); - } - - public static class Services extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("OS-KSADM:services") - private List list; - - public List value() { - return list; - } - } - - public static class ServiceConcreteBuilder implements ServiceBuilder { - - private KeystoneService model; - - ServiceConcreteBuilder() { - this(new KeystoneService()); - } - - ServiceConcreteBuilder(KeystoneService model) { - this.model = model; - } - - public ServiceBuilder name(String name) { - model.name = name; - return this; - } - - public ServiceBuilder type(String type) { - model.type = type; - return this; - } - - public ServiceBuilder description(String description) { - model.description = description; - return this; - } - - @Override - public Service build() { - return model; - } - - @Override - public ServiceBuilder from(Service in) { - model = (KeystoneService)in; - return this; - } - - } + private static final long serialVersionUID = 1L; + + String id; + String type; + String name; + String description; + + public static ServiceBuilder builder() { + return new ServiceConcreteBuilder(); + } + + @Override + public ServiceBuilder toBuilder() { + return new ServiceConcreteBuilder(this); + } + + public String getId() { + return id; + } + + public String getType() { + return type; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("type", type).add("description", description) + .toString(); + } + + public static class Services extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("OS-KSADM:services") + private List list; + + public List value() { + return list; + } + } + + public static class ServiceConcreteBuilder implements ServiceBuilder { + + private KeystoneService model; + + ServiceConcreteBuilder() { + this(new KeystoneService()); + } + + ServiceConcreteBuilder(KeystoneService model) { + this.model = model; + } + + public ServiceBuilder name(String name) { + model.name = name; + return this; + } + + public ServiceBuilder type(String type) { + model.type = type; + return this; + } + + public ServiceBuilder description(String description) { + model.description = description; + return this; + } + + @Override + public Service build() { + return model; + } + + @Override + public ServiceBuilder from(Service in) { + model = (KeystoneService) in; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java index d61916810..859d0fc50 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java @@ -1,211 +1,209 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.List; - -import org.openstack4j.model.identity.v2.builder.ServiceEndpointBuilder; -import org.openstack4j.model.identity.v2.Service; -import org.openstack4j.model.identity.v2.ServiceEndpoint; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; - +import org.openstack4j.model.identity.v2.Service; +import org.openstack4j.model.identity.v2.ServiceEndpoint; +import org.openstack4j.model.identity.v2.builder.ServiceEndpointBuilder; import org.openstack4j.openstack.common.ListResult; import org.slf4j.LoggerFactory; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; + /** * OpenStack ServiceEndpoint is an endpoint which is mapped to a {@link Service} * * @author Jeremy Unruh */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("endpoint") public class KeystoneServiceEndpoint implements ServiceEndpoint { - private static final long serialVersionUID = 1L; - - @JsonProperty("id") - private String id; - @JsonProperty("region") - private String region; - @JsonProperty("service_id") - private String serviceId; - @JsonProperty("publicurl") - private URI publicURL; - @JsonProperty("adminurl") - private URI adminURL; - @JsonProperty("internalurl") - private URI internalURL; - - public static ServiceEndpointBuilder builder() { - return new ServiceConcreteEndpointBuilder(); - } - - @Override - public ServiceEndpointBuilder toBuilder() { - return new ServiceConcreteEndpointBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getRegion() { - return region; - } - - /** - * {@inheritDoc} - */ - @Override - public String getServiceId() { - return serviceId; - } - - /** - * {@inheritDoc} - */ - @Override - public URI getPublicURL() { - return publicURL; - } - - /** - * {@inheritDoc} - */ - @Override - public URI getAdminURL() { - return adminURL; - } - - /** - * {@inheritDoc} - */ - @Override - public URI getInternalURL() { - return internalURL; - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return Objects.hashCode(id, region, publicURL, internalURL, adminURL, serviceId); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - KeystoneServiceEndpoint that = KeystoneServiceEndpoint.class.cast(obj); - return Objects.equal(this.id, that.id) - && Objects.equal(this.publicURL, that.publicURL) && Objects.equal(this.region, that.region) - && Objects.equal(this.internalURL, that.internalURL) && Objects.equal(this.adminURL, that.adminURL) - && Objects.equal(this.serviceId, that.serviceId); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("region", region).add("publicURL", publicURL) - .add("internalURL", internalURL).add("adminURL", adminURL) - .add("serviceId", serviceId) - .toString(); - } - - public static class ServiceEndpoints extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("endpoints") - List endpoints; - - public List value() { - return endpoints; - } - } - - public static class ServiceConcreteEndpointBuilder implements ServiceEndpointBuilder { - - private KeystoneServiceEndpoint model; - - ServiceConcreteEndpointBuilder() { - this(new KeystoneServiceEndpoint()); - } - - ServiceConcreteEndpointBuilder(KeystoneServiceEndpoint model) { - this.model = model; - } - - public ServiceEndpointBuilder region(String region) { - model.region = region; - return this; - } - - public ServiceEndpointBuilder serviceId(String serviceId) { - model.serviceId = serviceId; - return this; - } - - public ServiceEndpointBuilder publicURL(String publicURL) { - model.publicURL = uri(publicURL); - return this; - } - - public ServiceEndpointBuilder adminURL(String adminURL) { - model.adminURL = uri(adminURL); - return this; - } - - public ServiceEndpointBuilder internalURL(String internalURL) { - model.internalURL = uri(internalURL); - return this; - } - - private URI uri(String url) { - if (url == null) return null; - - try { - return new URI(url); - } - catch (URISyntaxException e) { - LoggerFactory.getLogger(ServiceConcreteEndpointBuilder.class).error(e.getMessage(), e); - } - return null; - } - - @Override - public ServiceEndpoint build() { - return model; - } - - @Override - public ServiceEndpointBuilder from(ServiceEndpoint in) { - model = (KeystoneServiceEndpoint)in; - return this; - } - - } + private static final long serialVersionUID = 1L; + + @JsonProperty("id") + private String id; + @JsonProperty("region") + private String region; + @JsonProperty("service_id") + private String serviceId; + @JsonProperty("publicurl") + private URI publicURL; + @JsonProperty("adminurl") + private URI adminURL; + @JsonProperty("internalurl") + private URI internalURL; + + public static ServiceEndpointBuilder builder() { + return new ServiceConcreteEndpointBuilder(); + } + + @Override + public ServiceEndpointBuilder toBuilder() { + return new ServiceConcreteEndpointBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getRegion() { + return region; + } + + /** + * {@inheritDoc} + */ + @Override + public String getServiceId() { + return serviceId; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getPublicURL() { + return publicURL; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getAdminURL() { + return adminURL; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getInternalURL() { + return internalURL; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return Objects.hashCode(id, region, publicURL, internalURL, adminURL, serviceId); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null || getClass() != obj.getClass()) + return false; + KeystoneServiceEndpoint that = KeystoneServiceEndpoint.class.cast(obj); + return Objects.equal(this.id, that.id) + && Objects.equal(this.publicURL, that.publicURL) && Objects.equal(this.region, that.region) + && Objects.equal(this.internalURL, that.internalURL) && Objects.equal(this.adminURL, that.adminURL) + && Objects.equal(this.serviceId, that.serviceId); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("region", region).add("publicURL", publicURL) + .add("internalURL", internalURL).add("adminURL", adminURL) + .add("serviceId", serviceId) + .toString(); + } + + public static class ServiceEndpoints extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("endpoints") + List endpoints; + + public List value() { + return endpoints; + } + } + + public static class ServiceConcreteEndpointBuilder implements ServiceEndpointBuilder { + + private KeystoneServiceEndpoint model; + + ServiceConcreteEndpointBuilder() { + this(new KeystoneServiceEndpoint()); + } + + ServiceConcreteEndpointBuilder(KeystoneServiceEndpoint model) { + this.model = model; + } + + public ServiceEndpointBuilder region(String region) { + model.region = region; + return this; + } + + public ServiceEndpointBuilder serviceId(String serviceId) { + model.serviceId = serviceId; + return this; + } + + public ServiceEndpointBuilder publicURL(String publicURL) { + model.publicURL = uri(publicURL); + return this; + } + + public ServiceEndpointBuilder adminURL(String adminURL) { + model.adminURL = uri(adminURL); + return this; + } + + public ServiceEndpointBuilder internalURL(String internalURL) { + model.internalURL = uri(internalURL); + return this; + } + + private URI uri(String url) { + if (url == null) return null; + + try { + return new URI(url); + } catch (URISyntaxException e) { + LoggerFactory.getLogger(ServiceConcreteEndpointBuilder.class).error(e.getMessage(), e); + } + return null; + } + + @Override + public ServiceEndpoint build() { + return model; + } + + @Override + public ServiceEndpointBuilder from(ServiceEndpoint in) { + model = (KeystoneServiceEndpoint) in; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java index 192db71f2..ece60ed6f 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java @@ -1,244 +1,241 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.util.List; - -import org.openstack4j.api.Apis; -import org.openstack4j.model.identity.v2.builder.TenantBuilder; -import org.openstack4j.model.identity.v2.Tenant; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.api.Apis; +import org.openstack4j.model.identity.v2.Tenant; +import org.openstack4j.model.identity.v2.builder.TenantBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * Tenant Model class use to group/isolate resources and/or identity objects * * @author Jeremy Unruh - * * @see { - - private static final long serialVersionUID = 1L; - @JsonProperty("tenants") - protected List list; - - public List value() { - return list; - } - } - - /** - * Used for backwards compatibility in fetching a Tenant By Name. Older deployments return a single object - * or null whereas newer deployments return an [] containing a single element - */ - public static class BackwardsCompatTenants extends Tenants { + private static final long serialVersionUID = 1L; + private String id; + private String name; + private String description; + private Boolean enabled = true; + + /** + * @return the Tenant builder + */ + public static TenantBuilder builder() { + return new TenantConcreteBuilder(); + } + + @Override + public TenantBuilder toBuilder() { + return new TenantConcreteBuilder(this); + } + + /** + * By providing an ID it is assumed this object will be mapped to an existing Tenant + * + * @return the id of the tenant + */ + public String getId() { + return id; + } + + /** + * @return the name of the tenant + */ + public String getName() { + return name; + } + + + /** + * @return the description of the tenant + */ + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + return (enabled != null && enabled); + } + + /** + * Sets the enabled. + * + * @param enabled the new enabled + */ + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /** + * {@inheritDoc} + */ + @Override + public void delete() { + if (id != null) + Apis.getIdentityV2Services().tenants().delete(getId()); + } + + /** + * {@inheritDoc} + */ + @Override + public void update() { + if (id != null) + Apis.getIdentityV2Services().tenants().update(this); + } + + /** + * {@inheritDoc} + */ + @Override + public void addUser(String userId, String roleId) { + Apis.getIdentityV2Services().roles().addUserRole(id, userId, roleId); + } + + /** + * {@inheritDoc} + */ + @Override + public void removeUser(String userId, String roleId) { + Apis.getIdentityV2Services().roles().removeUserRole(id, userId, roleId); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return Objects.hashCode(id, name, description); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null || getClass() != obj.getClass()) return false; + KeystoneTenant that = KeystoneTenant.class.cast(obj); + return Objects.equal(this.id, that.id) + && Objects.equal(this.name, that.name) + && Objects.equal(this.description, that.description); + } + + /** + * {@inheritDoc} + */ + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("description", description) + .add("enabled", enabled) + .toString(); + } + + public static class TenantConcreteBuilder implements TenantBuilder { + + KeystoneTenant model; + + TenantConcreteBuilder() { + this(new KeystoneTenant()); + } + + TenantConcreteBuilder(KeystoneTenant model) { + this.model = model; + } + + /** + * @see KeystoneTenant#getName() + */ + public TenantBuilder name(String name) { + model.name = name; + return this; + } + + /** + * @see KeystoneTenant#getDescription() + */ + public TenantBuilder description(String desc) { + model.description = desc; + return this; + } + + /** + * @see KeystoneTenant#getId() + */ + public TenantBuilder id(String id) { + model.id = id; + return this; + } + + /** + * @see KeystoneTenant#getEnabled() + */ + public TenantBuilder enabled(boolean enabled) { + model.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Tenant build() { + return model; + } + + /** + * {@inheritDoc} + */ + @Override + public TenantBuilder from(Tenant in) { + if (in != null) + this.model = (KeystoneTenant) in; + return this; + } + } + + public static class Tenants extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("tenants") + protected List list; + + public List value() { + return list; + } + } + + /** + * Used for backwards compatibility in fetching a Tenant By Name. Older deployments return a single object + * or null whereas newer deployments return an [] containing a single element + */ + public static class BackwardsCompatTenants extends Tenants { private static final long serialVersionUID = 1L; @JsonProperty("tenant") private KeystoneTenant tenant; - public KeystoneTenant getOneOrNull() - { - if (tenant != null) - return tenant; + public KeystoneTenant getOneOrNull() { + if (tenant != null) + return tenant; - return (list != null && list.size() > 0) ? list.get(0) : null; - } - } + return (list != null && list.size() > 0) ? list.get(0) : null; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenantUser.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenantUser.java index d080323bb..295dc19d0 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenantUser.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenantUser.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.identity.v2.TenantUser; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; /** * A User from a Tenant perspective implemenation @@ -45,8 +44,8 @@ public boolean isEnabled() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id).add("name", name).add("email", email).add("enabled", enabled) - .toString(); + .add("id", id).add("name", name).add("email", email).add("enabled", enabled) + .toString(); } public static class TenantUsers extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneToken.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneToken.java index 2ef2ad21f..6a17078c7 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneToken.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneToken.java @@ -1,51 +1,50 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.util.Date; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.identity.AuthVersion; import org.openstack4j.model.identity.v2.Tenant; import org.openstack4j.model.identity.v2.TokenV2; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.Date; public final class KeystoneToken implements TokenV2 { - private static final long serialVersionUID = 1L; - - private String id; - private Date expires; - private KeystoneTenant tenant; - - @JsonProperty("issued_at") - private Date created; - - public String getId() { - return id; - } - - public Date getExpires() { - return expires; - } - - public Tenant getTenant() { - return tenant; - } - - /** - * {@inheritDoc} - */ - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("created", created).add("expires", expires).add("tenant", tenant) - .toString(); - } - - @JsonIgnore - @Override - public AuthVersion getVersion() { - return AuthVersion.V2; - } + private static final long serialVersionUID = 1L; + + private String id; + private Date expires; + private KeystoneTenant tenant; + + @JsonProperty("issued_at") + private Date created; + + public String getId() { + return id; + } + + public Date getExpires() { + return expires; + } + + public Tenant getTenant() { + return tenant; + } + + /** + * {@inheritDoc} + */ + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("created", created).add("expires", expires).add("tenant", tenant) + .toString(); + } + + @JsonIgnore + @Override + public AuthVersion getVersion() { + return AuthVersion.V2; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneUser.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneUser.java index a07430823..7c6b30345 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneUser.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneUser.java @@ -1,163 +1,162 @@ package org.openstack4j.openstack.identity.v2.domain; -import java.util.List; - -import org.openstack4j.model.identity.v2.builder.UserBuilder; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.identity.v2.Role; import org.openstack4j.model.identity.v2.Tenant; import org.openstack4j.model.identity.v2.User; +import org.openstack4j.model.identity.v2.builder.UserBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("user") -public class KeystoneUser implements User -{ - private static final long serialVersionUID = 1L; - private String id; - private String username; - @JsonProperty("password") - private String password; - private String tenantId; - private String name; - private String email; - @JsonProperty("enabled") - private Boolean enabled; - @JsonProperty("OS-ROLE:roles") - private List roles; - - public static UserBuilder builder() { - return new UserConcreteBuilder(); - } - - @Override - public UserBuilder toBuilder() { - return new UserConcreteBuilder(this); - } - - public String getId() { - return id; - } - - public String getUsername() { - return username; - } - - public String getPassword() { - return password; - } - - public String getTenantId() { - return tenantId; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - public Boolean isEnabled() { - return enabled; - } - - public List getRoles() { - return roles; - } - - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name) - .add("id", id) - .add("username", username) - .add("password", password) - .add("tenantId", tenantId) - .add("email", email) - .add("enabled", enabled) - .add("roles", roles) - .toString(); - } - - public static class Users extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("users") - private List list; - - public List value() { - return list; - } - } - - public static class UserConcreteBuilder implements UserBuilder { - - private KeystoneUser model; - - UserConcreteBuilder() { - this(new KeystoneUser()); - } - - UserConcreteBuilder(KeystoneUser model) { - this.model = model; - } - - public UserBuilder name(String name) { - model.name = name; - return this; - } - - /** - * ID should only ever be set if the user already exists and this is used for update based actions - * @param id the user id - * @return this for method chaining - */ - public UserBuilder id(String id) { - model.id = id; - return this; - } - - public UserBuilder password(String password) { - model.password = password; - return this; - } - - public UserBuilder email(String email) { - model.email = email; - return this; - } - - public UserBuilder enabled(boolean enabled) { - model.enabled = enabled; - return this; - } - - public UserBuilder tenantId(String tenantId) { - model.tenantId = tenantId; - return this; - } - - public UserBuilder tenant(Tenant tenant) { - if (tenant != null && tenant.getId() != null) - model.tenantId = tenant.getId(); - return this; - } - - @Override - public User build() { - return model; - } - - @Override - public UserBuilder from(User in) { - model = (KeystoneUser) in; - return this; - } - - } +public class KeystoneUser implements User { + private static final long serialVersionUID = 1L; + private String id; + private String username; + @JsonProperty("password") + private String password; + private String tenantId; + private String name; + private String email; + @JsonProperty("enabled") + private Boolean enabled; + @JsonProperty("OS-ROLE:roles") + private List roles; + + public static UserBuilder builder() { + return new UserConcreteBuilder(); + } + + @Override + public UserBuilder toBuilder() { + return new UserConcreteBuilder(this); + } + + public String getId() { + return id; + } + + public String getUsername() { + return username; + } + + public String getPassword() { + return password; + } + + public String getTenantId() { + return tenantId; + } + + public String getName() { + return name; + } + + public String getEmail() { + return email; + } + + public Boolean isEnabled() { + return enabled; + } + + public List getRoles() { + return roles; + } + + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", name) + .add("id", id) + .add("username", username) + .add("password", password) + .add("tenantId", tenantId) + .add("email", email) + .add("enabled", enabled) + .add("roles", roles) + .toString(); + } + + public static class Users extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("users") + private List list; + + public List value() { + return list; + } + } + + public static class UserConcreteBuilder implements UserBuilder { + + private KeystoneUser model; + + UserConcreteBuilder() { + this(new KeystoneUser()); + } + + UserConcreteBuilder(KeystoneUser model) { + this.model = model; + } + + public UserBuilder name(String name) { + model.name = name; + return this; + } + + /** + * ID should only ever be set if the user already exists and this is used for update based actions + * + * @param id the user id + * @return this for method chaining + */ + public UserBuilder id(String id) { + model.id = id; + return this; + } + + public UserBuilder password(String password) { + model.password = password; + return this; + } + + public UserBuilder email(String email) { + model.email = email; + return this; + } + + public UserBuilder enabled(boolean enabled) { + model.enabled = enabled; + return this; + } + + public UserBuilder tenantId(String tenantId) { + model.tenantId = tenantId; + return this; + } + + public UserBuilder tenant(Tenant tenant) { + if (tenant != null && tenant.getId() != null) + model.tenantId = tenant.getId(); + return this; + } + + @Override + public User build() { + return model; + } + + @Override + public UserBuilder from(User in) { + model = (KeystoneUser) in; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/RaxApiKeyCredentials.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/RaxApiKeyCredentials.java index 3d54c3e0f..ea0d86718 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/RaxApiKeyCredentials.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/RaxApiKeyCredentials.java @@ -1,11 +1,10 @@ package org.openstack4j.openstack.identity.v2.domain; -import org.openstack4j.model.identity.AuthStore; -import org.openstack4j.model.identity.AuthVersion; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.identity.AuthStore; +import org.openstack4j.model.identity.AuthVersion; @JsonRootName("auth") public class RaxApiKeyCredentials extends Auth implements AuthStore { @@ -27,15 +26,15 @@ public RaxApiKeyCredentials(String username, String apiKey) { @Override @JsonIgnore - public String getTenantId() { + public String getTenantId() { return super.getTenantId(); - } + } @Override @JsonIgnore - public String getTenantName() { + public String getTenantName() { return super.getTenantName(); - } + } @JsonIgnore public String getUsername() { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/TokenAuth.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/TokenAuth.java index b4f206427..97732d213 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/TokenAuth.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/TokenAuth.java @@ -5,33 +5,33 @@ /** * Represents a Token class used for V2 token authentication - * + * * @author Jeremy Unruh */ @JsonRootName("auth") public class TokenAuth extends Auth { private static final long serialVersionUID = 1L; - + @JsonProperty private Token token; - + public TokenAuth(String tokenId, String tenantName, String tenantId) { super(Type.TOKEN); this.token = new Token(tokenId); setTenantName(tenantName); setTenantId(tenantId); } - + protected static class Token { @JsonProperty protected String id; - + protected Token(String id) { this.id = id; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/functions/ServiceToServiceType.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/functions/ServiceToServiceType.java index 1892a619a..a1da262d9 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/functions/ServiceToServiceType.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/functions/ServiceToServiceType.java @@ -1,23 +1,22 @@ package org.openstack4j.openstack.identity.v2.functions; +import com.google.common.base.Function; import org.openstack4j.api.types.ServiceType; import org.openstack4j.model.identity.v2.Access.Service; -import com.google.common.base.Function; - /** * A Function which takes a ServiceCatalog -> Service and returns the corresponding common ServiceType - * + * * @author Jeremy Unruh */ public class ServiceToServiceType implements Function { - /** - * {@inheritDoc} - */ - @Override - public ServiceType apply(Service input) { - return input.getServiceType(); - } + /** + * {@inheritDoc} + */ + @Override + public ServiceType apply(Service input) { + return input.getServiceType(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/IdentityServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/IdentityServiceImpl.java index 4a6c7f3ce..6812730a4 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/IdentityServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/IdentityServiceImpl.java @@ -1,11 +1,7 @@ package org.openstack4j.openstack.identity.v2.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.identity.v2.IdentityService; -import org.openstack4j.api.identity.v2.RoleService; -import org.openstack4j.api.identity.v2.ServiceManagerService; -import org.openstack4j.api.identity.v2.TenantService; -import org.openstack4j.api.identity.v2.UserService; +import org.openstack4j.api.identity.v2.*; import org.openstack4j.model.common.Extension; import org.openstack4j.model.identity.v2.Endpoint; import org.openstack4j.openstack.common.ExtensionValue.ExtensionList; @@ -19,34 +15,34 @@ public class IdentityServiceImpl extends BaseOpenStackService implements IdentityService { - @Override - public TenantService tenants() { - return Apis.get(TenantService.class); - } - - @Override - public UserService users() { - return Apis.get(UserService.class); - } - - @Override - public List listExtensions() { - return get(ExtensionList.class, PATH_EXTENSIONS).execute().getList(); - } - - @Override - public RoleService roles() { - return Apis.get(RoleService.class); - } - - @Override - public ServiceManagerService services() { - return Apis.get(ServiceManagerService.class); - } - - @Override - public List listTokenEndpoints() { - return get(Endpoints.class, uri("/tokens/%s/endpoints", OSClientSession.OSClientSessionV2.getCurrent().getTokenId())).execute().getList(); - } - + @Override + public TenantService tenants() { + return Apis.get(TenantService.class); + } + + @Override + public UserService users() { + return Apis.get(UserService.class); + } + + @Override + public List listExtensions() { + return get(ExtensionList.class, PATH_EXTENSIONS).execute().getList(); + } + + @Override + public RoleService roles() { + return Apis.get(RoleService.class); + } + + @Override + public ServiceManagerService services() { + return Apis.get(ServiceManagerService.class); + } + + @Override + public List listTokenEndpoints() { + return get(Endpoints.class, uri("/tokens/%s/endpoints", OSClientSession.OSClientSessionV2.getCurrent().getTokenId())).execute().getList(); + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/RoleServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/RoleServiceImpl.java index 76f1216b3..8785d8fba 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/RoleServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/RoleServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.identity.v2.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.identity.v2.RoleService; import org.openstack4j.core.transport.HttpMethod; import org.openstack4j.model.common.ActionResponse; @@ -13,130 +9,133 @@ import org.openstack4j.openstack.identity.v2.domain.KeystoneRole.Roles; import org.openstack4j.openstack.internal.BaseOpenStackService; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Identity Role based Operations Implementation - * + * * @author Jeremy Unruh */ public class RoleServiceImpl extends BaseOpenStackService implements RoleService { - /** - * {@inheritDoc} - */ - @Override - public ActionResponse addUserRole(String userId, String roleId) { - return addUserRole(null, userId, roleId); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse addUserRole(String tenantId, String userId, String roleId) { - return addRemoveRoles(HttpMethod.PUT, tenantId, userId, roleId); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse removeUserRole(String userId, String roleId) { - return removeUserRole(null, userId, roleId); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse removeUserRole(String tenantId, String userId, String roleId) { - return addRemoveRoles(HttpMethod.DELETE, tenantId, userId, roleId); - } - - /** - * Adds the remove roles. - * - * @param method the method - * @param tenantId the tenant id - * @param userId the user id - * @param roleId the role id - * @param the action response - */ - private ActionResponse addRemoveRoles(HttpMethod method, String tenantId, String userId, String roleId) { - checkNotNull(userId); - checkNotNull(roleId); - String uri = (tenantId != null) ? uri("/tenants/%s/users/%s/roles/OS-KSADM/%s", tenantId, userId, roleId) : uri("/users/%s/roles/OS-KSADM/%s", userId, roleId); - return request(method, ActionResponse.class, uri).execute(); - } - - - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Roles.class, uri("/OS-KSADM/roles")).execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public List listRolesForUser(String userId) { - return listRolesForUser(userId, null); - } - - /** - * {@inheritDoc} - */ - @Override - public List listRolesForUser(String userId, String tenantId) { - checkNotNull(userId); - String uri = (tenantId != null) ? uri("/tenants/%s/users/%s/roles", tenantId, userId) : uri("/users/%s/roles", userId); - return get(Roles.class, uri).execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String roleId) { - checkNotNull(roleId); - return deleteWithResponse(uri("/OS-KSADM/roles/%s", roleId)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Role get(String roleId) { - checkNotNull(roleId); - return get(KeystoneRole.class, uri("/OS-KSADM/roles/%s", roleId)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Role create(String name) { - checkNotNull(name); - return post(KeystoneRole.class, uri("/OS-KSADM/roles")).entity(new KeystoneCreateRole(name)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Role getByName(String name) { - // Due to a bug in OpenStack Rest Service (not returning documented query) we will manually match on the list until it's resolved. Since the contract of the - // API is against the interface we can change this anytime - checkNotNull(name); - List roles = list(); - for (Role r : roles) - { - if (name.equalsIgnoreCase(r.getName())) - return r; - } - return null; - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse addUserRole(String userId, String roleId) { + return addUserRole(null, userId, roleId); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse addUserRole(String tenantId, String userId, String roleId) { + return addRemoveRoles(HttpMethod.PUT, tenantId, userId, roleId); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse removeUserRole(String userId, String roleId) { + return removeUserRole(null, userId, roleId); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse removeUserRole(String tenantId, String userId, String roleId) { + return addRemoveRoles(HttpMethod.DELETE, tenantId, userId, roleId); + } + + /** + * Adds the remove roles. + * + * @param method the method + * @param tenantId the tenant id + * @param userId the user id + * @param roleId the role id + * @param the action response + */ + private ActionResponse addRemoveRoles(HttpMethod method, String tenantId, String userId, String roleId) { + checkNotNull(userId); + checkNotNull(roleId); + String uri = (tenantId != null) ? uri("/tenants/%s/users/%s/roles/OS-KSADM/%s", tenantId, userId, roleId) : uri("/users/%s/roles/OS-KSADM/%s", userId, roleId); + return request(method, ActionResponse.class, uri).execute(); + } + + + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Roles.class, uri("/OS-KSADM/roles")).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public List listRolesForUser(String userId) { + return listRolesForUser(userId, null); + } + + /** + * {@inheritDoc} + */ + @Override + public List listRolesForUser(String userId, String tenantId) { + checkNotNull(userId); + String uri = (tenantId != null) ? uri("/tenants/%s/users/%s/roles", tenantId, userId) : uri("/users/%s/roles", userId); + return get(Roles.class, uri).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String roleId) { + checkNotNull(roleId); + return deleteWithResponse(uri("/OS-KSADM/roles/%s", roleId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Role get(String roleId) { + checkNotNull(roleId); + return get(KeystoneRole.class, uri("/OS-KSADM/roles/%s", roleId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Role create(String name) { + checkNotNull(name); + return post(KeystoneRole.class, uri("/OS-KSADM/roles")).entity(new KeystoneCreateRole(name)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Role getByName(String name) { + // Due to a bug in OpenStack Rest Service (not returning documented query) we will manually match on the list until it's resolved. Since the contract of the + // API is against the interface we can change this anytime + checkNotNull(name); + List roles = list(); + for (Role r : roles) { + if (name.equalsIgnoreCase(r.getName())) + return r; + } + return null; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/ServiceManagerServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/ServiceManagerServiceImpl.java index 76b394910..2b37a9ede 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/ServiceManagerServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/ServiceManagerServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.identity.v2.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.identity.v2.ServiceManagerService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v2.Service; @@ -14,83 +10,87 @@ import org.openstack4j.openstack.identity.v2.domain.KeystoneServiceEndpoint.ServiceEndpoints; import org.openstack4j.openstack.internal.BaseOpenStackService; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Manages OpenStack service(s), such as Compute (Nova), Object Storage (Swift), or Image Service (Glance). - * + * * @author Jeremy Unruh */ public class ServiceManagerServiceImpl extends BaseOpenStackService implements ServiceManagerService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Services.class, uri("/OS-KSADM/services")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Services.class, uri("/OS-KSADM/services")).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public Service get(String serviceId) { + checkNotNull(serviceId); + return get(KeystoneService.class, uri("/OS-KSADM/services/%s", serviceId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public Service get(String serviceId) { - checkNotNull(serviceId); - return get(KeystoneService.class, uri("/OS-KSADM/services/%s", serviceId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public Service create(String name, String type, String description) { + checkNotNull(name); + checkNotNull(type); + checkNotNull(description); + return post(KeystoneService.class, uri("/OS-KSADM/services")) + .entity(KeystoneService.builder().name(name).type(type).description(description).build()) + .execute(); + } - /** - * {@inheritDoc} - */ - @Override - public Service create(String name, String type, String description) { - checkNotNull(name); - checkNotNull(type); - checkNotNull(description); - return post(KeystoneService.class, uri("/OS-KSADM/services")) - .entity(KeystoneService.builder().name(name).type(type).description(description).build()) - .execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String serviceId) { + checkNotNull(serviceId); + return deleteWithResponse(uri("/OS-KSADM/services/%s", serviceId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String serviceId) { - checkNotNull(serviceId); - return deleteWithResponse(uri("/OS-KSADM/services/%s", serviceId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public List listEndpoints() { + return get(ServiceEndpoints.class, uri("/endpoints")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List listEndpoints() { - return get(ServiceEndpoints.class, uri("/endpoints")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public ServiceEndpoint createEndpoint(String region, String serviceId, String publicURL, String adminURL, String internalURL) { + checkNotNull(region); + checkNotNull(serviceId); + checkNotNull(publicURL); + checkNotNull(adminURL); + checkNotNull(internalURL); - /** - * {@inheritDoc} - */ - @Override - public ServiceEndpoint createEndpoint(String region, String serviceId, String publicURL, String adminURL, String internalURL) { - checkNotNull(region); - checkNotNull(serviceId); - checkNotNull(publicURL); - checkNotNull(adminURL); - checkNotNull(internalURL); - - return post(KeystoneServiceEndpoint.class, uri("/endpoints")) - .entity(KeystoneServiceEndpoint.builder().region(region).serviceId(serviceId).publicURL(publicURL).adminURL(adminURL).internalURL(internalURL).build()) - .execute(); - } + return post(KeystoneServiceEndpoint.class, uri("/endpoints")) + .entity(KeystoneServiceEndpoint.builder().region(region).serviceId(serviceId).publicURL(publicURL).adminURL(adminURL).internalURL(internalURL).build()) + .execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse deleteEndpoint(String endpointId) { - checkNotNull(endpointId); - return deleteWithResponse(uri("/endpoints/%s", endpointId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse deleteEndpoint(String endpointId) { + checkNotNull(endpointId); + return deleteWithResponse(uri("/endpoints/%s", endpointId)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/TenantServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/TenantServiceImpl.java index 7054903d2..418ecb570 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/TenantServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/TenantServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.identity.v2.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_TENANTS; - -import java.util.List; - import org.openstack4j.api.identity.v2.TenantService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v2.Tenant; @@ -15,43 +10,48 @@ import org.openstack4j.openstack.identity.v2.domain.KeystoneTenantUser.TenantUsers; import org.openstack4j.openstack.internal.BaseOpenStackService; -public class TenantServiceImpl extends BaseOpenStackService implements TenantService { - - - @Override - public List list() { - return get(Tenants.class, PATH_TENANTS).execute().getList(); - } - - @Override - public Tenant get(String tenantId) { - checkNotNull(tenantId); - return get(KeystoneTenant.class, PATH_TENANTS, "/", tenantId).execute(); - } - - @Override - public Tenant getByName(String tenantName) { - checkNotNull(tenantName); - return get(BackwardsCompatTenants.class, PATH_TENANTS).param("name", tenantName).execute().getOneOrNull(); - } - - @Override - public Tenant create(Tenant tenant) { - checkNotNull(tenant); - return post(KeystoneTenant.class, PATH_TENANTS).entity(tenant).execute(); - } - - @Override - public ActionResponse delete(String tenantId) { - checkNotNull(tenantId); - return deleteWithResponse(PATH_TENANTS, "/", tenantId).execute(); - } - - @Override - public Tenant update(Tenant tenant) { - checkNotNull(tenant); - return post(KeystoneTenant.class, uri("/tenants/%s", tenant.getId())).entity(tenant).execute(); - } +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_TENANTS; + +public class TenantServiceImpl extends BaseOpenStackService implements TenantService { + + + @Override + public List list() { + return get(Tenants.class, PATH_TENANTS).execute().getList(); + } + + @Override + public Tenant get(String tenantId) { + checkNotNull(tenantId); + return get(KeystoneTenant.class, PATH_TENANTS, "/", tenantId).execute(); + } + + @Override + public Tenant getByName(String tenantName) { + checkNotNull(tenantName); + return get(BackwardsCompatTenants.class, PATH_TENANTS).param("name", tenantName).execute().getOneOrNull(); + } + + @Override + public Tenant create(Tenant tenant) { + checkNotNull(tenant); + return post(KeystoneTenant.class, PATH_TENANTS).entity(tenant).execute(); + } + + @Override + public ActionResponse delete(String tenantId) { + checkNotNull(tenantId); + return deleteWithResponse(PATH_TENANTS, "/", tenantId).execute(); + } + + @Override + public Tenant update(Tenant tenant) { + checkNotNull(tenant); + return post(KeystoneTenant.class, uri("/tenants/%s", tenant.getId())).entity(tenant).execute(); + } @Override public List listUsers(String tenantId) { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/UserServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/UserServiceImpl.java index dd64e3861..13a59b7f0 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/UserServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/internal/UserServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.identity.v2.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.Apis; import org.openstack4j.api.identity.v2.UserService; import org.openstack4j.model.common.ActionResponse; @@ -13,94 +9,98 @@ import org.openstack4j.openstack.identity.v2.domain.KeystoneUser.Users; import org.openstack4j.openstack.internal.BaseOpenStackService; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Identity User based Operations - * + * * @author Jeremy Unruh */ public class UserServiceImpl extends BaseOpenStackService implements UserService { - - @Override - public List list() { - return get(Users.class, uri("/users")).execute().getList(); - } - - @Override - public User get(String userId) { - checkNotNull(userId); - return get(KeystoneUser.class, uri("/users/%s", userId)).execute(); - } - - @Override - public List listTenantUsers(String tenantId) { - checkNotNull(tenantId); - return get(Users.class, uri("/tenants/%s/users", tenantId)).execute().getList(); - } - - @Override - public User create(String tenantId, String name, String password, String email, boolean enabled) { - checkNotNull(name); - checkNotNull(password); - return create(KeystoneUser.builder().name(name).tenantId(tenantId).email(email).password(password).enabled(enabled).build()); - } - - @Override - public User create(User user) { - checkNotNull(user); - return post(KeystoneUser.class, uri("/users")).entity(user).execute(); - } - - @Override - public ActionResponse delete(String userId) { - checkNotNull(userId); - return deleteWithResponse(uri("/users/%s", userId)).execute(); - } - - @Override - public User enableUser(String userId, boolean enabled) { - checkNotNull(userId); - return put(KeystoneUser.class, uri("/users/%s/OS-KSADM/enabled", userId)).entity(KeystoneUser.builder().enabled(enabled).build()).execute(); - } - - @Override - public User update(User user) { - checkNotNull(user); - return put(KeystoneUser.class, uri("/users/%s", user.getId())).entity(user).execute(); - } - - @Override - public ActionResponse changePassword(String userId, String password) { - checkNotNull(userId); - checkNotNull(password); - return put(ActionResponse.class, uri("/users/%s/OS-KSADM/password", userId)).entity(KeystoneUser.builder().id(userId).password(password).build()).execute(); - } - - @Override - public List listRoles(String userId) { - checkNotNull(userId); - return Apis.getIdentityV2Services().roles().listRolesForUser(userId); - } - - @Override - public List listRoles(User user) { - checkNotNull(user); - return listRoles(user.getId()); - } - - @Override - public List listRolesOnTenant(String userId, String tenantId) { - return Apis.getIdentityV2Services().roles().listRolesForUser(userId, tenantId); - } - - @Override - public List listRolesOnCurrentTenant(User user) { - checkNotNull(user); - return Apis.getIdentityV2Services().roles().listRolesForUser(user.getId(), user.getTenantId()); - } - - @Override - public User getByName(String userName) { - checkNotNull(userName); - return get(KeystoneUser.class, "/users").param("name", userName).execute(); - } + + @Override + public List list() { + return get(Users.class, uri("/users")).execute().getList(); + } + + @Override + public User get(String userId) { + checkNotNull(userId); + return get(KeystoneUser.class, uri("/users/%s", userId)).execute(); + } + + @Override + public List listTenantUsers(String tenantId) { + checkNotNull(tenantId); + return get(Users.class, uri("/tenants/%s/users", tenantId)).execute().getList(); + } + + @Override + public User create(String tenantId, String name, String password, String email, boolean enabled) { + checkNotNull(name); + checkNotNull(password); + return create(KeystoneUser.builder().name(name).tenantId(tenantId).email(email).password(password).enabled(enabled).build()); + } + + @Override + public User create(User user) { + checkNotNull(user); + return post(KeystoneUser.class, uri("/users")).entity(user).execute(); + } + + @Override + public ActionResponse delete(String userId) { + checkNotNull(userId); + return deleteWithResponse(uri("/users/%s", userId)).execute(); + } + + @Override + public User enableUser(String userId, boolean enabled) { + checkNotNull(userId); + return put(KeystoneUser.class, uri("/users/%s/OS-KSADM/enabled", userId)).entity(KeystoneUser.builder().enabled(enabled).build()).execute(); + } + + @Override + public User update(User user) { + checkNotNull(user); + return put(KeystoneUser.class, uri("/users/%s", user.getId())).entity(user).execute(); + } + + @Override + public ActionResponse changePassword(String userId, String password) { + checkNotNull(userId); + checkNotNull(password); + return put(ActionResponse.class, uri("/users/%s/OS-KSADM/password", userId)).entity(KeystoneUser.builder().id(userId).password(password).build()).execute(); + } + + @Override + public List listRoles(String userId) { + checkNotNull(userId); + return Apis.getIdentityV2Services().roles().listRolesForUser(userId); + } + + @Override + public List listRoles(User user) { + checkNotNull(user); + return listRoles(user.getId()); + } + + @Override + public List listRolesOnTenant(String userId, String tenantId) { + return Apis.getIdentityV2Services().roles().listRolesForUser(userId, tenantId); + } + + @Override + public List listRolesOnCurrentTenant(User user) { + checkNotNull(user); + return Apis.getIdentityV2Services().roles().listRolesForUser(user.getId(), user.getTenantId()); + } + + @Override + public User getByName(String userName) { + checkNotNull(userName); + return get(KeystoneUser.class, "/users").param("name", userName).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Auth.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Auth.java index 79946aa17..862d87bdc 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Auth.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Auth.java @@ -2,7 +2,7 @@ /** * an v3 auth object - * + * * @see API reference */ public abstract class Auth implements org.openstack4j.openstack.common.Auth { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Credentials.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Credentials.java index ed04b0fe4..bd892c6be 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Credentials.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/Credentials.java @@ -1,11 +1,10 @@ package org.openstack4j.openstack.identity.v3.domain; -import org.openstack4j.model.identity.AuthStore; -import org.openstack4j.model.identity.AuthVersion; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.identity.AuthStore; +import org.openstack4j.model.identity.AuthVersion; @JsonRootName("auth") public class Credentials extends Auth implements AuthStore { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneAuth.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneAuth.java index 222874801..bc0adc4e9 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneAuth.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneAuth.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.identity.v3.domain; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.io.Serializable; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.collect.Lists; import org.openstack4j.model.common.Identifier; import org.openstack4j.model.identity.AuthStore; import org.openstack4j.model.identity.AuthVersion; @@ -13,16 +12,13 @@ import org.openstack4j.openstack.common.BasicResourceEntity; import org.openstack4j.openstack.common.IdResourceEntity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.collect.Lists; +import java.io.Serializable; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; /** - * * Represents an v3 Auth object. - * - * */ @JsonRootName("auth") public class KeystoneAuth implements Authentication, AuthStore { @@ -33,9 +29,9 @@ public class KeystoneAuth implements Authentication, AuthStore { private AuthScope scope; @JsonIgnore private transient Type type; - + public KeystoneAuth() { - super(); + super(); } public KeystoneAuth(String tokenId) { @@ -59,7 +55,7 @@ public KeystoneAuth(String user, String password, Identifier domain, AuthScope s this.type = Type.CREDENTIALS; } - public KeystoneAuth(AuthScope scope, Type type){ + public KeystoneAuth(AuthScope scope, Type type) { this.scope = scope; this.type = type; } @@ -108,9 +104,9 @@ public String getName() { public static final class AuthIdentity implements Identity, Serializable { - private static final long serialVersionUID = 1L; - - private AuthPassword password; + private static final long serialVersionUID = 1L; + + private AuthPassword password; private AuthToken token; private List methods = Lists.newArrayList(); @@ -149,9 +145,9 @@ public List getMethods() { public static final class AuthToken implements Token, Serializable { - private static final long serialVersionUID = 1L; - - @JsonProperty + private static final long serialVersionUID = 1L; + + @JsonProperty private String id; AuthToken() { @@ -169,9 +165,9 @@ public String getId() { public static final class AuthPassword implements Password, Serializable { - private static final long serialVersionUID = 1L; - - private AuthUser user; + private static final long serialVersionUID = 1L; + + private AuthUser user; public AuthPassword() { } @@ -204,8 +200,7 @@ public AuthUser(String username, String password, Identifier domainIdentifier) { else domain.setName(domainIdentifier.getId()); setName(username); - } - else + } else setId(username); } @@ -230,9 +225,9 @@ public static final class AuthDomain extends BasicResourceEntity implements Doma public static final class AuthScope implements Scope, Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("project") + @JsonProperty("project") private ScopeProject project; @JsonProperty("domain") @@ -310,8 +305,7 @@ public static ScopeProject create(Identifier project, Identifier domain) { scope.domain = new AuthDomain(domain); if (project.isTypeID()) { scope.id = project.getId(); - } - else { + } else { scope.name = project.getId(); } return scope; diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneCredential.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneCredential.java index cf4acc587..fa0d37f8a 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneCredential.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneCredential.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.identity.v3.Credential; -import org.openstack4j.model.identity.v3.builder.CredentialBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.model.identity.v3.Credential; +import org.openstack4j.model.identity.v3.builder.CredentialBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; @JsonRootName("credential") @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneDomain.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneDomain.java index fa46433e3..18de999b1 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneDomain.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneDomain.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.identity.v3.Domain; -import org.openstack4j.model.identity.v3.builder.DomainBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.model.identity.v3.Domain; +import org.openstack4j.model.identity.v3.builder.DomainBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; @JsonRootName("domain") @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java index f7cbafd75..f6e407636 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java @@ -1,23 +1,21 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.net.URL; -import java.util.List; -import java.util.Map; - -import org.openstack4j.api.types.Facing; -import org.openstack4j.model.identity.v3.Endpoint; -import org.openstack4j.model.identity.v3.builder.EndpointBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.api.types.Facing; +import org.openstack4j.model.identity.v3.Endpoint; +import org.openstack4j.model.identity.v3.builder.EndpointBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.net.URL; +import java.util.List; +import java.util.Map; /** * Keystone V3 endpoint model class - * */ @JsonRootName("endpoint") @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java index c4b579d18..a5a3034ef 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.identity.v3.Group; -import org.openstack4j.model.identity.v3.builder.GroupBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.model.identity.v3.Group; +import org.openstack4j.model.identity.v3.builder.GroupBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; /** * group model class for identity/v3 diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java index 95df4eb4e..a7b1542b3 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.identity.v3.Policy; -import org.openstack4j.model.identity.v3.builder.PolicyBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.model.identity.v3.Policy; +import org.openstack4j.model.identity.v3.builder.PolicyBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; @JsonRootName("policy") @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java index 47c36422c..4d41ed815 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java @@ -1,23 +1,17 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.*; +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import org.openstack4j.model.identity.v3.Domain; import org.openstack4j.model.identity.v3.Project; import org.openstack4j.model.identity.v3.builder.ProjectBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.base.Objects; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; /** * Project model class for identity/v3 @@ -26,7 +20,7 @@ */ @JsonRootName("project") /** If we don't explicitly set extra as an ignore property, it will methods with @JsonAnyGetter/Setter will not work **/ -@JsonIgnoreProperties(value = "extra" , ignoreUnknown = true) +@JsonIgnoreProperties(value = "extra", ignoreUnknown = true) public class KeystoneProject implements Project { private static final long serialVersionUID = 1L; @@ -176,24 +170,23 @@ public void setExtra(String key, String value) { } /** - * @return the tags - */ - public List getTags() { - return tags; - } - - /** - * @param tags the tags to set - */ - public void setTags(List tags) { - this.tags = tags; - } - - /** + * @return the tags + */ + public List getTags() { + return tags; + } + + /** + * @param tags the tags to set + */ + public void setTags(List tags) { + this.tags = tags; + } + + /** * set project enabled * - * @param enabled - * the new enabled status + * @param enabled the new enabled status */ public void setEnabled(Boolean enabled) { this.enabled = enabled; @@ -346,16 +339,16 @@ public ProjectBuilder setExtra(String key, String value) { model.extra.put(key, value); return this; } - + /** * @see KeystoneProject#setTags(List) */ - @Override - public ProjectBuilder setTags(List tags) { - model.setTags(tags); - return this; - } + @Override + public ProjectBuilder setTags(List tags) { + model.setTags(tags); + return this; + } /** * @see KeystoneProject#isEnabled() diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java index 8e8c149cd..154761988 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java @@ -1,23 +1,22 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; - -import org.openstack4j.model.identity.v3.Region; -import org.openstack4j.model.identity.v3.builder.RegionBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.model.identity.v3.Region; +import org.openstack4j.model.identity.v3.builder.RegionBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * Region model class for identity v3 * * @see API - * reference + * "http://developer.openstack.org/api-ref-identity-v3.html#regions-v3">API + * reference */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("region") diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRole.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRole.java index 9c1670461..ce5db332c 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRole.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRole.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.identity.v3.Role; -import org.openstack4j.model.identity.v3.builder.RoleBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.identity.v3.Role; +import org.openstack4j.model.identity.v3.builder.RoleBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; /** * v3 role implementation diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRoleAssignment.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRoleAssignment.java index 8a6335c4b..bdf95010d 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRoleAssignment.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRoleAssignment.java @@ -2,11 +2,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; -import org.openstack4j.model.identity.v3.Role; import org.openstack4j.model.identity.v3.RoleAssignment; -import org.openstack4j.model.identity.v3.builder.RoleBuilder; import org.openstack4j.openstack.common.ListResult; import java.util.List; diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneService.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneService.java index f00a9f272..52bdbe60d 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneService.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneService.java @@ -1,21 +1,19 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.identity.v3.Endpoint; import org.openstack4j.model.identity.v3.Service; import org.openstack4j.model.identity.v3.builder.ServiceBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; +import java.util.Map; /** * V3 OpenStack service - * */ @JsonRootName("service") @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneToken.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneToken.java index 0ea755be9..c6949a83c 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneToken.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneToken.java @@ -1,15 +1,5 @@ package org.openstack4j.openstack.identity.v3.domain; -import static org.openstack4j.openstack.identity.functions.ServiceFunctions.TYPE_WITHOUT_VERSION; - -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.identity.AuthStore; -import org.openstack4j.model.identity.AuthVersion; -import org.openstack4j.model.identity.v3.Service; -import org.openstack4j.model.identity.v3.Token; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,6 +7,15 @@ import com.google.common.base.MoreObjects; import com.google.common.collect.SortedSetMultimap; import com.google.common.collect.TreeMultimap; +import org.openstack4j.model.identity.AuthStore; +import org.openstack4j.model.identity.AuthVersion; +import org.openstack4j.model.identity.v3.Service; +import org.openstack4j.model.identity.v3.Token; + +import java.util.Date; +import java.util.List; + +import static org.openstack4j.openstack.identity.functions.ServiceFunctions.TYPE_WITHOUT_VERSION; @JsonRootName("token") @JsonIgnoreProperties(ignoreUnknown = true) @@ -169,7 +168,7 @@ public KeystoneToken applyContext(String endpoint, AuthStore credentials) { @JsonIgnore public SortedSetMultimap getAggregatedCatalog() { if (aggregatedCatalog == null) { - synchronized(this) { + synchronized (this) { if (aggregatedCatalog == null) { aggregatedCatalog = TreeMultimap.create(); for (Service sc : catalog) { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java index 7ccaab850..e1fb79cc7 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java @@ -1,18 +1,17 @@ package org.openstack4j.openstack.identity.v3.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.identity.v3.Domain; -import org.openstack4j.model.identity.v3.User; -import org.openstack4j.model.identity.v3.builder.UserBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; +import org.openstack4j.model.identity.v3.Domain; +import org.openstack4j.model.identity.v3.User; +import org.openstack4j.model.identity.v3.builder.UserBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; /** * User model class for identity/v3 @@ -158,23 +157,23 @@ public String toString() { } /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - KeystoneUser that = KeystoneUser.class.cast(obj); - return Objects.equal(this.name, that.name) - && Objects.equal(this.id, that.id) - && Objects.equal(this.email, that.email) - && Objects.equal(this.password, that.password) - && Objects.equal(this.description, that.description) - && Objects.equal(this.domainId, that.domainId) - && Objects.equal(this.links, that.domainId) - && Objects.equal(this.enabled, that.enabled) - && Objects.equal(this.defaultProjectId, that.defaultProjectId); - } + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null || getClass() != obj.getClass()) return false; + KeystoneUser that = KeystoneUser.class.cast(obj); + return Objects.equal(this.name, that.name) + && Objects.equal(this.id, that.id) + && Objects.equal(this.email, that.email) + && Objects.equal(this.password, that.password) + && Objects.equal(this.description, that.description) + && Objects.equal(this.domainId, that.domainId) + && Objects.equal(this.links, that.domainId) + && Objects.equal(this.enabled, that.enabled) + && Objects.equal(this.defaultProjectId, that.defaultProjectId); + } public static class Users extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/functions/ServiceToServiceType.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/functions/ServiceToServiceType.java index 87f7d6d5b..8349a270e 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/functions/ServiceToServiceType.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/functions/ServiceToServiceType.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.identity.v3.functions; +import com.google.common.base.Function; import org.openstack4j.api.types.ServiceType; import org.openstack4j.model.identity.v3.Service; -import com.google.common.base.Function; - /** * A Function which takes a ServiceCatalog -> Service and returns the corresponding common ServiceType * @@ -12,15 +11,15 @@ */ public class ServiceToServiceType implements Function { - /** - * {@inheritDoc} - */ - @Override - public ServiceType apply(Service input) { - ServiceType serviceType = ServiceType.forName(input.getType()); - if (serviceType == ServiceType.UNKNOWN) - serviceType = ServiceType.forName(input.getName()); - return serviceType; - } + /** + * {@inheritDoc} + */ + @Override + public ServiceType apply(Service input) { + ServiceType serviceType = ServiceType.forName(input.getType()); + if (serviceType == ServiceType.UNKNOWN) + serviceType = ServiceType.forName(input.getName()); + return serviceType; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/BaseIdentityServices.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/BaseIdentityServices.java index c44f53265..0dbd643df 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/BaseIdentityServices.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/BaseIdentityServices.java @@ -11,8 +11,8 @@ */ public class BaseIdentityServices extends BaseOpenStackService { - protected BaseIdentityServices() { - super(ServiceType.IDENTITY, EnforceVersionToURL.instance("/v3")); - } + protected BaseIdentityServices() { + super(ServiceType.IDENTITY, EnforceVersionToURL.instance("/v3")); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/CredentialServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/CredentialServiceImpl.java index 3c6d5367f..5b0a2012e 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/CredentialServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/CredentialServiceImpl.java @@ -1,16 +1,16 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_CREDENTIALS; - -import java.util.List; - import org.openstack4j.api.identity.v3.CredentialService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Credential; import org.openstack4j.openstack.identity.v3.domain.KeystoneCredential; import org.openstack4j.openstack.identity.v3.domain.KeystoneCredential.Credentials; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_CREDENTIALS; + public class CredentialServiceImpl extends BaseIdentityServices implements CredentialService { @Override diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/DomainServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/DomainServiceImpl.java index 39491a154..2b9fca7de 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/DomainServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/DomainServiceImpl.java @@ -1,16 +1,16 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_DOMAINS; - -import java.util.List; - import org.openstack4j.api.identity.v3.DomainService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Domain; import org.openstack4j.openstack.identity.v3.domain.KeystoneDomain; import org.openstack4j.openstack.identity.v3.domain.KeystoneDomain.Domains; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_DOMAINS; + public class DomainServiceImpl extends BaseIdentityServices implements DomainService { @Override diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/GroupServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/GroupServiceImpl.java index 524e49a36..50134ab66 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/GroupServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/GroupServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_GROUPS; - -import java.util.List; - import org.openstack4j.api.identity.v3.GroupService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Group; @@ -15,6 +10,11 @@ import org.openstack4j.openstack.identity.v3.domain.KeystoneRole.Roles; import org.openstack4j.openstack.identity.v3.domain.KeystoneUser.Users; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_GROUPS; + public class GroupServiceImpl extends BaseIdentityServices implements GroupService { @Override diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/IdentityServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/IdentityServiceImpl.java index d12584090..d1d5024e0 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/IdentityServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/IdentityServiceImpl.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.identity.v3.internal; -import static org.openstack4j.core.transport.ClientConstants.PATH_EXTENSIONS; - -import java.util.List; - import org.openstack4j.api.Apis; import org.openstack4j.api.identity.v3.*; import org.openstack4j.model.common.Extension; import org.openstack4j.openstack.common.ExtensionValue.ExtensionList; +import java.util.List; + +import static org.openstack4j.core.transport.ClientConstants.PATH_EXTENSIONS; + /** * Identity V3 service implementation - * */ public class IdentityServiceImpl extends BaseIdentityServices implements IdentityService { @@ -64,7 +63,7 @@ public RegionService regions() { public TokenService tokens() { return Apis.get(TokenService.class); } - + @Override public List listExtensions() { return get(ExtensionList.class, PATH_EXTENSIONS).execute().getList(); diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/PolicyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/PolicyServiceImpl.java index 9c6cfacca..f618d4589 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/PolicyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/PolicyServiceImpl.java @@ -1,16 +1,16 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_POLICIES; - -import java.util.List; - import org.openstack4j.api.identity.v3.PolicyService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Policy; import org.openstack4j.openstack.identity.v3.domain.KeystonePolicy; import org.openstack4j.openstack.identity.v3.domain.KeystonePolicy.Policies; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_POLICIES; + public class PolicyServiceImpl extends BaseIdentityServices implements PolicyService { @Override diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ProjectServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ProjectServiceImpl.java index 9ee8ba2a9..2caabd2f8 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ProjectServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ProjectServiceImpl.java @@ -1,23 +1,23 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_PROJECTS; - -import java.util.List; - import org.openstack4j.api.identity.v3.ProjectService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Project; import org.openstack4j.openstack.identity.v3.domain.KeystoneProject; import org.openstack4j.openstack.identity.v3.domain.KeystoneProject.Projects; -public class ProjectServiceImpl extends BaseIdentityServices implements ProjectService { +import java.util.List; - @Override - public Project create(Project project) { - checkNotNull(project); - return post(KeystoneProject.class, PATH_PROJECTS).entity(project).execute(); - } +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_PROJECTS; + +public class ProjectServiceImpl extends BaseIdentityServices implements ProjectService { + + @Override + public Project create(Project project) { + checkNotNull(project); + return post(KeystoneProject.class, PATH_PROJECTS).entity(project).execute(); + } @Override public Project create(String domainId, String name, String description, boolean enabled) { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RegionServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RegionServiceImpl.java index 650fd411e..f71e85c76 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RegionServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RegionServiceImpl.java @@ -1,19 +1,18 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_REGIONS; - -import java.util.List; - import org.openstack4j.api.identity.v3.RegionService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Region; import org.openstack4j.openstack.identity.v3.domain.KeystoneRegion; import org.openstack4j.openstack.identity.v3.domain.KeystoneRegion.Regions; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_REGIONS; + /** * Implementation of v3 region service - * */ public class RegionServiceImpl extends BaseIdentityServices implements RegionService { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RoleServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RoleServiceImpl.java index 1b652afc6..18eed3571 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RoleServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/RoleServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_ROLES; - -import java.util.List; - import org.openstack4j.api.identity.v3.RoleService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Role; @@ -13,9 +8,13 @@ import org.openstack4j.openstack.identity.v3.domain.KeystoneRole.Roles; import org.openstack4j.openstack.identity.v3.domain.KeystoneRoleAssignment.RoleAssignments; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_ROLES; + /** * Identity Role based Operations Implementation - * */ public class RoleServiceImpl extends BaseIdentityServices implements RoleService { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ServiceEndpointServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ServiceEndpointServiceImpl.java index cb01367b0..e0627b580 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ServiceEndpointServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/ServiceEndpointServiceImpl.java @@ -1,12 +1,5 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_ENDPOINTS; -import static org.openstack4j.core.transport.ClientConstants.PATH_SERVICES; - -import java.net.URL; -import java.util.List; - import org.openstack4j.api.identity.v3.ServiceEndpointService; import org.openstack4j.api.types.Facing; import org.openstack4j.model.common.ActionResponse; @@ -16,10 +9,16 @@ import org.openstack4j.openstack.identity.v3.domain.KeystoneEndpoint.Endpoints; import org.openstack4j.openstack.identity.v3.domain.KeystoneService; import org.openstack4j.openstack.identity.v3.domain.KeystoneService.Services; + +import java.net.URL; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_ENDPOINTS; +import static org.openstack4j.core.transport.ClientConstants.PATH_SERVICES; + /** - * * implementation of v3 service manager service - * */ public class ServiceEndpointServiceImpl extends BaseIdentityServices implements ServiceEndpointService { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/TokenServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/TokenServiceImpl.java index 6fd02b9a5..fac1cdb4e 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/TokenServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/TokenServiceImpl.java @@ -1,10 +1,6 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.*; - import org.openstack4j.api.identity.v3.TokenService; - import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.identity.v3.Domain; import org.openstack4j.model.identity.v3.Project; @@ -17,6 +13,9 @@ import java.util.List; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.*; + public class TokenServiceImpl extends BaseIdentityServices implements TokenService { @Override diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/UserServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/UserServiceImpl.java index ef8b2f113..8f452d28d 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/UserServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/internal/UserServiceImpl.java @@ -1,20 +1,8 @@ package org.openstack4j.openstack.identity.v3.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.PATH_DOMAINS; -import static org.openstack4j.core.transport.ClientConstants.PATH_USERS; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.openstack4j.api.identity.v3.UserService; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.identity.v3.Domain; -import org.openstack4j.model.identity.v3.Group; -import org.openstack4j.model.identity.v3.Project; -import org.openstack4j.model.identity.v3.Role; -import org.openstack4j.model.identity.v3.User; +import org.openstack4j.model.identity.v3.*; import org.openstack4j.openstack.common.MapEntity; import org.openstack4j.openstack.identity.v3.domain.KeystoneDomain; import org.openstack4j.openstack.identity.v3.domain.KeystoneGroup.Groups; @@ -23,9 +11,16 @@ import org.openstack4j.openstack.identity.v3.domain.KeystoneUser; import org.openstack4j.openstack.identity.v3.domain.KeystoneUser.Users; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.PATH_DOMAINS; +import static org.openstack4j.core.transport.ClientConstants.PATH_USERS; + /** * implementation of v3 user service - * */ public class UserServiceImpl extends BaseIdentityServices implements UserService { @@ -53,7 +48,7 @@ public List getByName(String userName) { @Override public User getByName(String userName, String domainId) { checkNotNull(userName); - checkNotNull(domainId); + checkNotNull(domainId); return get(Users.class, uri(PATH_USERS)).param("name", userName).param("domain_id", domainId).execute().first(); } @@ -150,20 +145,20 @@ public List listDomainUserRoles(String userId, String domainId) checkNotNull(domainId); return get(Roles.class, uri("domains/%s/users/%s/roles", domainId, userId)).execute().getList(); } - + /** * {@inheritDoc} */ @Override - public ActionResponse changePassword(String userId,String originalPassword,String password) { + public ActionResponse changePassword(String userId, String originalPassword, String password) { checkNotNull(userId); checkNotNull(originalPassword); checkNotNull(password); - Map passwordMap = new HashMap(); + Map passwordMap = new HashMap(); passwordMap.put("original_password", originalPassword); passwordMap.put("password", password); - MapEntity mapEntity = MapEntity.create("user", passwordMap); - return post(ActionResponse.class, uri("/users/%s/password",userId)).entity(mapEntity).execute(); + MapEntity mapEntity = MapEntity.create("user", passwordMap); + return post(ActionResponse.class, uri("/users/%s/password", userId)).entity(mapEntity).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImage.java b/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImage.java index 5ea1ad93f..5039305c1 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImage.java +++ b/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImage.java @@ -1,11 +1,10 @@ package org.openstack4j.openstack.image.domain; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import javax.annotation.Nullable; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Maps; import org.openstack4j.model.common.builder.BasicResourceBuilder; import org.openstack4j.model.image.ContainerFormat; import org.openstack4j.model.image.DiskFormat; @@ -14,11 +13,10 @@ import org.openstack4j.model.image.builder.ImageBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Maps; +import javax.annotation.Nullable; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * A Glance v1.1 Image model implementation @@ -29,232 +27,232 @@ @JsonRootName("image") public class GlanceImage implements Image { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private String id; - private String name; - private String location; + private String id; + private String name; + private String location; - @JsonProperty("disk_format") - private DiskFormat diskFormat; + @JsonProperty("disk_format") + private DiskFormat diskFormat; - @JsonProperty("container_format") - private ContainerFormat containerFormat; - private Long size; - private String checksum; - private String owner; + @JsonProperty("container_format") + private ContainerFormat containerFormat; + private Long size; + private String checksum; + private String owner; - @JsonProperty("created_at") - private Date createdAt; + @JsonProperty("created_at") + private Date createdAt; - @JsonProperty("updated_at") - private Date updatedAt; + @JsonProperty("updated_at") + private Date updatedAt; - @JsonProperty("deleted_at") - private Date deletedAt; + @JsonProperty("deleted_at") + private Date deletedAt; - private Status status; + private Status status; - @JsonProperty("is_public") - private boolean isPublic; + @JsonProperty("is_public") + private boolean isPublic; - @JsonProperty("min_ram") - private Long minRam; + @JsonProperty("min_ram") + private Long minRam; - @JsonProperty("min_disk") - private Long minDisk; + @JsonProperty("min_disk") + private Long minDisk; - @JsonProperty("deleted") - private boolean isDeleted; + @JsonProperty("deleted") + private boolean isDeleted; - @JsonProperty("protected") - private boolean isProtected; + @JsonProperty("protected") + private boolean isProtected; @JsonProperty("copy_from") private String copyFrom; - private Map properties; - - private transient StoreType storeType; - - public static ImageBuilder builder() { - return new ImageConcreteBuilder(); - } - - @Override - public ImageBuilder toBuilder() { - return new ImageConcreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public void setId(String id) { - this.id = id; - } - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) { - this.name = name; - } - - /** - * {@inheritDoc} - */ - @Override - public ContainerFormat getContainerFormat() { - return (containerFormat != null) ? containerFormat : ContainerFormat.UNRECOGNIZED; - } - - /** - * {@inheritDoc} - */ - @Override - public DiskFormat getDiskFormat() { - return (diskFormat != null) ? diskFormat : DiskFormat.UNRECOGNIZED; - } - - /** - * {@inheritDoc} - */ - @Override - public Long getSize() { - return size; - } - - /** - * {@inheritDoc} - */ - @Override - public String getChecksum() { - return checksum; - } - - /** - * {@inheritDoc} - */ - @Override - public long getMinDisk() { - return (minDisk == null) ? 0L : minDisk; - } - - /** - * {@inheritDoc} - */ - @Override - public long getMinRam() { - return (minRam == null) ? 0L : minRam; - } - - /** - * {@inheritDoc} - */ - @Override - public String getLocation() { - return location; - } - - /** - * {@inheritDoc} - */ - @Override - @Nullable - public String getOwner() { - return owner; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreatedAt() { - return createdAt; - } - - /** - * {@inheritDoc} - */ - @Override - @Nullable - public Date getDeletedAt() { - return deletedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isPublic() { - return isPublic; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isDeleted() { - return isDeleted; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isProtected() { - return isProtected; - } - - /** - * {@inheritDoc} - */ - @Override - public StoreType getStoreType() { - return storeType; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getProperties() { - return properties; - } + private Map properties; + + private transient StoreType storeType; + + public static ImageBuilder builder() { + return new ImageConcreteBuilder(); + } + + @Override + public ImageBuilder toBuilder() { + return new ImageConcreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public void setId(String id) { + this.id = id; + } + + /** + * {@inheritDoc} + */ + @Override + public void setName(String name) { + this.name = name; + } + + /** + * {@inheritDoc} + */ + @Override + public ContainerFormat getContainerFormat() { + return (containerFormat != null) ? containerFormat : ContainerFormat.UNRECOGNIZED; + } + + /** + * {@inheritDoc} + */ + @Override + public DiskFormat getDiskFormat() { + return (diskFormat != null) ? diskFormat : DiskFormat.UNRECOGNIZED; + } + + /** + * {@inheritDoc} + */ + @Override + public Long getSize() { + return size; + } + + /** + * {@inheritDoc} + */ + @Override + public String getChecksum() { + return checksum; + } + + /** + * {@inheritDoc} + */ + @Override + public long getMinDisk() { + return (minDisk == null) ? 0L : minDisk; + } + + /** + * {@inheritDoc} + */ + @Override + public long getMinRam() { + return (minRam == null) ? 0L : minRam; + } + + /** + * {@inheritDoc} + */ + @Override + public String getLocation() { + return location; + } + + /** + * {@inheritDoc} + */ + @Override + @Nullable + public String getOwner() { + return owner; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedAt() { + return createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + @Nullable + public Date getDeletedAt() { + return deletedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Status getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isPublic() { + return isPublic; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isDeleted() { + return isDeleted; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isProtected() { + return isProtected; + } + + /** + * {@inheritDoc} + */ + @Override + public StoreType getStoreType() { + return storeType; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getProperties() { + return properties; + } @Override public String getCopyFrom() { @@ -263,54 +261,54 @@ public String getCopyFrom() { /* Business Domain Method Chains for Conversion */ - public GlanceImage isProtected(Boolean isProtected) { - if (isProtected != null) - this.isProtected = isProtected; - return this; - } - - public GlanceImage isDeleted(Boolean isDeleted) { - if (isDeleted != null) - this.isDeleted = isDeleted; - return this; - } - - public GlanceImage status(Status status) { - this.status = status; - return this; - } - - public GlanceImage createdAt(Date createdAt) { - this.createdAt = createdAt; - return this; - } - - public GlanceImage updatedAt(Date updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - public GlanceImage deletedAt(Date deletedAt) { - this.deletedAt = deletedAt; - return this; - } - - public GlanceImage size(Long size) { - this.size = size; - return this; - } - - public GlanceImage location(String location) { - this.location = location; - return this; - } - - public GlanceImage properties(Map properties) { - this.properties = properties; - return this; - } - - /** + public GlanceImage isProtected(Boolean isProtected) { + if (isProtected != null) + this.isProtected = isProtected; + return this; + } + + public GlanceImage isDeleted(Boolean isDeleted) { + if (isDeleted != null) + this.isDeleted = isDeleted; + return this; + } + + public GlanceImage status(Status status) { + this.status = status; + return this; + } + + public GlanceImage createdAt(Date createdAt) { + this.createdAt = createdAt; + return this; + } + + public GlanceImage updatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public GlanceImage deletedAt(Date deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + public GlanceImage size(Long size) { + this.size = size; + return this; + } + + public GlanceImage location(String location) { + this.location = location; + return this; + } + + public GlanceImage properties(Map properties) { + this.properties = properties; + return this; + } + + /** * {@inheritDoc} */ @JsonIgnore @@ -320,130 +318,129 @@ public boolean isSnapshot() { } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("status", status).add("location", location).add("diskFormat", diskFormat) - .add("containerFormat", containerFormat).add("size", size).add("owner", owner).add("minRam", minRam).add("minDisk", minDisk) - .add("created", createdAt).add("updated", updatedAt).add("deleted", deletedAt).add("isPublic", isPublic) - .add("isProtected", isProtected).add("isDeleted", isDeleted).add("propterties", properties).addValue("\n") - .toString(); - } - - public static class Images extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("images") - private List images; - - @Override - protected List value() { - return images; - } - } - - public static class ImageConcreteBuilder extends BasicResourceBuilder implements ImageBuilder { - - private GlanceImage m; - - ImageConcreteBuilder() { - this(new GlanceImage()); - } - - ImageConcreteBuilder(GlanceImage m) { - this.m = m; - } - - @Override - public ImageBuilder diskFormat(DiskFormat diskFormat) { - m.diskFormat = diskFormat; - return this; - } - - @Override - public ImageBuilder containerFormat(ContainerFormat containerFormat) { - m.containerFormat = containerFormat; - return this; - } - - @Override - public ImageBuilder size(Long size) { - m.size = size; - return this; - } - - @Override - public ImageBuilder checksum(String checksum) { - m.checksum = checksum; - return this; - } - - @Override - public ImageBuilder minDisk(Long minDisk) { - m.minDisk = minDisk; - return this; - } - - @Override - public ImageBuilder minRam(Long minRam) { - m.minRam = minRam; - return this; - } - - @Override - public ImageBuilder owner(String owner) { - m.owner = owner; - return this; - } - - @Override - public ImageBuilder isPublic(Boolean isPublic) { - if (isPublic != null) - m.isPublic = isPublic; - return this; - } - - @Override - public ImageBuilder properties(Map properties) { - m.properties = properties; - return this; - } - - @Override - protected Image reference() { - return m; - } - - @Override - public Image build() { - return m; - } - - @Override - public ImageBuilder from(Image in) { - this.m = (GlanceImage) in; - return this; - } - - @Override - public ImageBuilder property(String key, String value) { - if (key != null && value != null) - { - if (m.properties == null) - m.properties = Maps.newHashMap(); - m.properties.put(key, value); - } - return this; - } - - @Override - public ImageBuilder storeType(StoreType storeType) { - m.storeType = storeType; - return this; - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("status", status).add("location", location).add("diskFormat", diskFormat) + .add("containerFormat", containerFormat).add("size", size).add("owner", owner).add("minRam", minRam).add("minDisk", minDisk) + .add("created", createdAt).add("updated", updatedAt).add("deleted", deletedAt).add("isPublic", isPublic) + .add("isProtected", isProtected).add("isDeleted", isDeleted).add("propterties", properties).addValue("\n") + .toString(); + } + + public static class Images extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("images") + private List images; + + @Override + protected List value() { + return images; + } + } + + public static class ImageConcreteBuilder extends BasicResourceBuilder implements ImageBuilder { + + private GlanceImage m; + + ImageConcreteBuilder() { + this(new GlanceImage()); + } + + ImageConcreteBuilder(GlanceImage m) { + this.m = m; + } + + @Override + public ImageBuilder diskFormat(DiskFormat diskFormat) { + m.diskFormat = diskFormat; + return this; + } + + @Override + public ImageBuilder containerFormat(ContainerFormat containerFormat) { + m.containerFormat = containerFormat; + return this; + } + + @Override + public ImageBuilder size(Long size) { + m.size = size; + return this; + } + + @Override + public ImageBuilder checksum(String checksum) { + m.checksum = checksum; + return this; + } + + @Override + public ImageBuilder minDisk(Long minDisk) { + m.minDisk = minDisk; + return this; + } + + @Override + public ImageBuilder minRam(Long minRam) { + m.minRam = minRam; + return this; + } + + @Override + public ImageBuilder owner(String owner) { + m.owner = owner; + return this; + } + + @Override + public ImageBuilder isPublic(Boolean isPublic) { + if (isPublic != null) + m.isPublic = isPublic; + return this; + } + + @Override + public ImageBuilder properties(Map properties) { + m.properties = properties; + return this; + } + + @Override + protected Image reference() { + return m; + } + + @Override + public Image build() { + return m; + } + + @Override + public ImageBuilder from(Image in) { + this.m = (GlanceImage) in; + return this; + } + + @Override + public ImageBuilder property(String key, String value) { + if (key != null && value != null) { + if (m.properties == null) + m.properties = Maps.newHashMap(); + m.properties.put(key, value); + } + return this; + } + + @Override + public ImageBuilder storeType(StoreType storeType) { + m.storeType = storeType; + return this; + } @Override public ImageBuilder copyFrom(String copyFrom) { diff --git a/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImageMember.java b/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImageMember.java index 7e6524d3e..26213b1bc 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImageMember.java +++ b/core/src/main/java/org/openstack4j/openstack/image/domain/GlanceImageMember.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.image.domain; -import java.util.List; - -import org.openstack4j.model.image.ImageMember; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.image.ImageMember; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * Represents a system tenant who has access to another tenants Image @@ -17,55 +16,56 @@ @JsonRootName("member") public class GlanceImageMember implements ImageMember { - private static final long serialVersionUID = 1L; - - @JsonProperty("member_id") - private String memberId; - @JsonProperty("can_share") - private boolean canShare; - - public GlanceImageMember() { } - - public GlanceImageMember(String memberId, boolean canShare) { - this.memberId = memberId; - this.canShare = canShare; - } - - /** - * {@inheritDoc} - */ - @Override - public String getMemberId() { - return memberId; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isCanShare() { - return canShare; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("memberId", memberId).add("canShare", canShare).toString(); - } - - public static class Members extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("members") - private List members; - - @Override - protected List value() { - return members; - } - } + private static final long serialVersionUID = 1L; + + @JsonProperty("member_id") + private String memberId; + @JsonProperty("can_share") + private boolean canShare; + + public GlanceImageMember() { + } + + public GlanceImageMember(String memberId, boolean canShare) { + this.memberId = memberId; + this.canShare = canShare; + } + + /** + * {@inheritDoc} + */ + @Override + public String getMemberId() { + return memberId; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isCanShare() { + return canShare; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("memberId", memberId).add("canShare", canShare).toString(); + } + + public static class Members extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("members") + private List members; + + @Override + protected List value() { + return members; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/image/domain/ImageHeader.java b/core/src/main/java/org/openstack4j/openstack/image/domain/ImageHeader.java index 6a6c4a1b3..6cb09c090 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/domain/ImageHeader.java +++ b/core/src/main/java/org/openstack4j/openstack/image/domain/ImageHeader.java @@ -2,26 +2,26 @@ /** * Used to decode and encode header values into corresponding image mutators - * + * * @author Jeremy Unruh */ public enum ImageHeader { - ID, NAME, CHECKSUM, MIN_DISK, MIN_RAM, IS_PUBLIC, PROTECTED, CREATED_AT, UPDATED_AT, DELETED_AT,COPY_FROM, - OWNER, LOCATION, STATUS, DISK_FORMAT, CONTAINER_FORMAT, SIZE, SIZE_MIN, SIZE_MAX, STORE, PROPERTY, DELETED; + ID, NAME, CHECKSUM, MIN_DISK, MIN_RAM, IS_PUBLIC, PROTECTED, CREATED_AT, UPDATED_AT, DELETED_AT, COPY_FROM, + OWNER, LOCATION, STATUS, DISK_FORMAT, CONTAINER_FORMAT, SIZE, SIZE_MIN, SIZE_MAX, STORE, PROPERTY, DELETED; - public static final String HEADER_PREFIX = "X-Image-Meta-"; - public static final String GLANCE_HEADER_PREFIX = "x-glance-api-"; + public static final String HEADER_PREFIX = "X-Image-Meta-"; + public static final String GLANCE_HEADER_PREFIX = "x-glance-api-"; - public String asParam() { - return name().toLowerCase(); - } + public String asParam() { + return name().toLowerCase(); + } - public String asHeader() { - return HEADER_PREFIX + name().charAt(0) + name().substring(1).toLowerCase(); - } + public String asHeader() { + return HEADER_PREFIX + name().charAt(0) + name().substring(1).toLowerCase(); + } - public String asGlanceHeader() { + public String asGlanceHeader() { return GLANCE_HEADER_PREFIX + name().charAt(0) + name().substring(1).toLowerCase(); - } + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageForUpdateToHeaders.java b/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageForUpdateToHeaders.java index 25cc073cd..4a3796f05 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageForUpdateToHeaders.java +++ b/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageForUpdateToHeaders.java @@ -1,43 +1,28 @@ package org.openstack4j.openstack.image.domain.functions; -import static org.openstack4j.openstack.image.domain.ImageHeader.CHECKSUM; -import static org.openstack4j.openstack.image.domain.ImageHeader.CONTAINER_FORMAT; -import static org.openstack4j.openstack.image.domain.ImageHeader.COPY_FROM; -import static org.openstack4j.openstack.image.domain.ImageHeader.DISK_FORMAT; -import static org.openstack4j.openstack.image.domain.ImageHeader.IS_PUBLIC; -import static org.openstack4j.openstack.image.domain.ImageHeader.MIN_DISK; -import static org.openstack4j.openstack.image.domain.ImageHeader.MIN_RAM; -import static org.openstack4j.openstack.image.domain.ImageHeader.NAME; -import static org.openstack4j.openstack.image.domain.ImageHeader.OWNER; -import static org.openstack4j.openstack.image.domain.ImageHeader.PROPERTY; -import static org.openstack4j.openstack.image.domain.ImageHeader.PROTECTED; -import static org.openstack4j.openstack.image.domain.ImageHeader.SIZE; -import static org.openstack4j.openstack.image.domain.ImageHeader.STORE; -import static org.openstack4j.openstack.image.domain.ImageHeader.ID; - -import java.util.Map; - -import javax.annotation.Nullable; - +import com.google.common.base.Function; +import com.google.common.collect.Maps; import org.openstack4j.model.image.ContainerFormat; import org.openstack4j.model.image.DiskFormat; import org.openstack4j.model.image.Image; import org.openstack4j.openstack.image.domain.ImageHeader; -import com.google.common.base.Function; -import com.google.common.collect.Maps; +import javax.annotation.Nullable; +import java.util.Map; + +import static org.openstack4j.openstack.image.domain.ImageHeader.*; /** * A function which takes an Image and applies the values to headers. The function only applies values that are supported for Update based * calls - * + * * @author Jeremy Unruh */ -public class ImageForUpdateToHeaders implements Function> -{ +public class ImageForUpdateToHeaders implements Function> { private static final ImageForUpdateToHeaders instance = new ImageForUpdateToHeaders(); - private ImageForUpdateToHeaders() { } + private ImageForUpdateToHeaders() { + } public static ImageForUpdateToHeaders instance() { return instance; @@ -71,7 +56,7 @@ public Map apply(@Nullable Image from) { if (from.getProperties() != null) { for (String k : from.getProperties().keySet()) { - headers.put(PROPERTY.asHeader()+"-"+k, from.getProperties().get(k)); + headers.put(PROPERTY.asHeader() + "-" + k, from.getProperties().get(k)); } } return headers; @@ -84,10 +69,9 @@ private void addIfNotNull(Map headers, ImageHeader header, Objec private void addIfNotNull(Map headers, ImageHeader header, Object value, boolean asHeader) { if (value == null) return; - if(asHeader) { + if (asHeader) { headers.put(header.asHeader(), value); - } - else { + } else { headers.put(header.asGlanceHeader(), value); } } diff --git a/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageFromHeadersFunction.java b/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageFromHeadersFunction.java index 064032fac..1d6fb09b2 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageFromHeadersFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/image/domain/functions/ImageFromHeadersFunction.java @@ -1,30 +1,7 @@ package org.openstack4j.openstack.image.domain.functions; -import static org.openstack4j.openstack.image.domain.ImageHeader.CHECKSUM; -import static org.openstack4j.openstack.image.domain.ImageHeader.CONTAINER_FORMAT; -import static org.openstack4j.openstack.image.domain.ImageHeader.CREATED_AT; -import static org.openstack4j.openstack.image.domain.ImageHeader.DELETED; -import static org.openstack4j.openstack.image.domain.ImageHeader.DELETED_AT; -import static org.openstack4j.openstack.image.domain.ImageHeader.DISK_FORMAT; -import static org.openstack4j.openstack.image.domain.ImageHeader.ID; -import static org.openstack4j.openstack.image.domain.ImageHeader.IS_PUBLIC; -import static org.openstack4j.openstack.image.domain.ImageHeader.MIN_DISK; -import static org.openstack4j.openstack.image.domain.ImageHeader.MIN_RAM; -import static org.openstack4j.openstack.image.domain.ImageHeader.NAME; -import static org.openstack4j.openstack.image.domain.ImageHeader.OWNER; -import static org.openstack4j.openstack.image.domain.ImageHeader.PROPERTY; -import static org.openstack4j.openstack.image.domain.ImageHeader.PROTECTED; -import static org.openstack4j.openstack.image.domain.ImageHeader.SIZE; -import static org.openstack4j.openstack.image.domain.ImageHeader.STATUS; -import static org.openstack4j.openstack.image.domain.ImageHeader.UPDATED_AT; -import static org.openstack4j.openstack.internal.Parser.asBoolean; -import static org.openstack4j.openstack.internal.Parser.asDate; -import static org.openstack4j.openstack.internal.Parser.asLong; - -import java.util.Map; - -import javax.annotation.Nullable; - +import com.google.common.base.Function; +import com.google.common.collect.Maps; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.model.image.ContainerFormat; import org.openstack4j.model.image.DiskFormat; @@ -33,63 +10,66 @@ import org.openstack4j.model.image.builder.ImageBuilder; import org.openstack4j.openstack.image.domain.GlanceImage; -import com.google.common.base.Function; -import com.google.common.collect.Maps; +import javax.annotation.Nullable; +import java.util.Map; + +import static org.openstack4j.openstack.image.domain.ImageHeader.*; +import static org.openstack4j.openstack.internal.Parser.*; /** * When retrieving a specific image the Glance API returns headers in the response. This function is responsible for parsing the headers into * an Image. - * + * * @author Jeremy Unruh */ public class ImageFromHeadersFunction implements Function { - private static final ImageFromHeadersFunction instance = new ImageFromHeadersFunction(); - - public static ImageFromHeadersFunction instance() { - return instance; - } - - private ImageFromHeadersFunction() { } - - @Override - @Nullable - public Image apply(HttpResponse from) { - - ImageBuilder builder = GlanceImage.builder() - .id(from.header(ID.asHeader())) - .name(from.header(NAME.asHeader())) - .checksum(from.header(CHECKSUM.asHeader())) - .minDisk(asLong(from.header(MIN_DISK.asHeader()))) - .minRam(asLong(from.header(MIN_RAM.asHeader()))) - .isPublic(asBoolean(from.header(IS_PUBLIC.asHeader()))) - .owner(from.header(OWNER.asHeader())) - .containerFormat(ContainerFormat.value(from.header(CONTAINER_FORMAT.asHeader()))) - .diskFormat(DiskFormat.value(from.header(DISK_FORMAT.asHeader()))); - - - GlanceImage image = (GlanceImage) builder.build(); - image.location(from.header("Location")) - .isDeleted(asBoolean(from.header(DELETED.asHeader()))) - .isProtected(asBoolean(from.header(PROTECTED.asHeader()))) - .createdAt(asDate(from.header(CREATED_AT.asHeader()))) - .updatedAt(asDate(from.header(UPDATED_AT.asHeader()))) - .deletedAt(asDate(from.header(DELETED_AT.asHeader()))) - .size(asLong(from.header(SIZE.asHeader()))) - .status(Status.value(from.header(STATUS.asHeader()))); - - Map properties = null; - String property = PROPERTY.asHeader()+"-"; - for (String k : from.headers().keySet()) { - if (k.indexOf(property) > -1) - { - if (properties == null) - properties = Maps.newHashMap(); - properties.put(k.substring(property.length()).toLowerCase(), from.headers().get(k)); - } - } - image.properties(properties); - - return image; - } + private static final ImageFromHeadersFunction instance = new ImageFromHeadersFunction(); + + public static ImageFromHeadersFunction instance() { + return instance; + } + + private ImageFromHeadersFunction() { + } + + @Override + @Nullable + public Image apply(HttpResponse from) { + + ImageBuilder builder = GlanceImage.builder() + .id(from.header(ID.asHeader())) + .name(from.header(NAME.asHeader())) + .checksum(from.header(CHECKSUM.asHeader())) + .minDisk(asLong(from.header(MIN_DISK.asHeader()))) + .minRam(asLong(from.header(MIN_RAM.asHeader()))) + .isPublic(asBoolean(from.header(IS_PUBLIC.asHeader()))) + .owner(from.header(OWNER.asHeader())) + .containerFormat(ContainerFormat.value(from.header(CONTAINER_FORMAT.asHeader()))) + .diskFormat(DiskFormat.value(from.header(DISK_FORMAT.asHeader()))); + + + GlanceImage image = (GlanceImage) builder.build(); + image.location(from.header("Location")) + .isDeleted(asBoolean(from.header(DELETED.asHeader()))) + .isProtected(asBoolean(from.header(PROTECTED.asHeader()))) + .createdAt(asDate(from.header(CREATED_AT.asHeader()))) + .updatedAt(asDate(from.header(UPDATED_AT.asHeader()))) + .deletedAt(asDate(from.header(DELETED_AT.asHeader()))) + .size(asLong(from.header(SIZE.asHeader()))) + .status(Status.value(from.header(STATUS.asHeader()))); + + Map properties = null; + String property = PROPERTY.asHeader() + "-"; + for (String k : from.headers().keySet()) { + if (k.indexOf(property) > -1) { + if (properties == null) + properties = Maps.newHashMap(); + properties.put(k.substring(property.length()).toLowerCase(), from.headers().get(k)); + } + } + image.properties(properties); + + return image; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/image/internal/BaseImageServices.java b/core/src/main/java/org/openstack4j/openstack/image/internal/BaseImageServices.java index da56235e3..04edf34bf 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/internal/BaseImageServices.java +++ b/core/src/main/java/org/openstack4j/openstack/image/internal/BaseImageServices.java @@ -6,12 +6,12 @@ /** * Base Image Operations Implementation is responsible for insuring the proper endpoint is used for all extending operation APIs - * + * * @author Jeremy Unruh */ public class BaseImageServices extends BaseOpenStackService { - protected BaseImageServices() { - super(ServiceType.IMAGE, EnforceVersionToURL.instance("/v1", true)); - } + protected BaseImageServices() { + super(ServiceType.IMAGE, EnforceVersionToURL.instance("/v1", true)); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/image/internal/ImageServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/image/internal/ImageServiceImpl.java index 183b639b8..8c4fcb8ed 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/internal/ImageServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/image/internal/ImageServiceImpl.java @@ -32,7 +32,7 @@ /** * OpenStack (Glance) Image based Operations - * + * * @author Jeremy Unruh */ public class ImageServiceImpl extends BaseImageServices implements ImageService { @@ -47,8 +47,7 @@ public List listChachedImages() { try { return get(CachedImages.class, uri("/cached_images")) .execute(ExecutionOptions.create(PropagateOnStatus.on(404))).getList(); - } - catch (ResponseException e) { + } catch (ResponseException e) { return null; } } @@ -70,31 +69,31 @@ public List list(Map filteringParams) { Invocation imageInvocation = buildInvocation(filteringParams); return imageInvocation.execute().getList(); } - + public List listAll(Map filteringParams) { Invocation imageInvocation = buildInvocation(filteringParams); - + int limit = DEFAULT_PAGE_SIZE; - if(filteringParams != null && filteringParams.containsKey("limit")) { + if (filteringParams != null && filteringParams.containsKey("limit")) { limit = Integer.parseInt(filteringParams.get("limit")); } - + List totalList = imageInvocation.execute().getList(); List currList = totalList; while (currList.size() == limit) { - + imageInvocation.updateParam("marker", currList.get(limit - 1).getId()); currList = imageInvocation.execute().getList(); totalList.addAll(currList); - } - + } + return totalList; } public List listAll() { return listAll(null); } - + private Invocation buildInvocation(Map filteringParams) { Invocation imageInvocation = get(Images.class, "/images/detail"); if (filteringParams == null) { @@ -109,7 +108,6 @@ private Invocation buildInvocation(Map filteringParams) } /** - * * {@inheritDoc} */ @Override diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java index 510394024..816eb6e7f 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java @@ -1,11 +1,12 @@ package org.openstack4j.openstack.image.v2.domain; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; - +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import org.openstack4j.model.common.builder.BasicResourceBuilder; import org.openstack4j.model.image.v2.ContainerFormat; import org.openstack4j.model.image.v2.DiskFormat; @@ -14,13 +15,7 @@ import org.openstack4j.openstack.common.ListResult; import org.openstack4j.openstack.common.Metadata; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; +import java.util.*; /** * A glance v2.0-2.3 image model implementation @@ -30,7 +25,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class GlanceImage implements Image { - private static final Set RESERVED_KEYS = Sets.newHashSet(Arrays.asList(new String[] { + private static final Set RESERVED_KEYS = Sets.newHashSet(Arrays.asList(new String[]{ "id", "name", "tags", @@ -57,7 +52,7 @@ public class GlanceImage implements Image { "os_version", "os_distro", "ramdisk_id", - "virtual_size" })); + "virtual_size"})); private static final long serialVersionUID = 1L; @@ -441,14 +436,14 @@ protected List value() { } } - @JsonInclude(JsonInclude.Include.NON_NULL) - public static class Location { - @JsonProperty("url") - private String url; + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Location { + @JsonProperty("url") + private String url; - @JsonProperty("metadata") - private Metadata metadat; - } + @JsonProperty("metadata") + private Metadata metadat; + } public static class ImageConcreteBuilder extends BasicResourceBuilder implements ImageBuilder { private GlanceImage m; diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImageUpdate.java b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImageUpdate.java index 08e5f6994..af6c64fee 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImageUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImageUpdate.java @@ -12,6 +12,7 @@ /** * Implementation of updating a glance image + * * @author emjburns */ public class GlanceImageUpdate implements ImageUpdate { @@ -22,8 +23,8 @@ public GlanceImageUpdate() { } public GlanceImageUpdate(JsonNode value) { - if (value.isArray()){ - for(Iterator iterator = value.iterator(); iterator.hasNext();) { + if (value.isArray()) { + for (Iterator iterator = value.iterator(); iterator.hasNext(); ) { JsonNode next = iterator.next(); iterator.remove(); PatchOperation p = new PatchOperation( diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceMember.java b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceMember.java index 3d685cf4b..30762ff06 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceMember.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceMember.java @@ -12,6 +12,7 @@ /** * Implementation of Glance V2 member + * * @author emjburns */ @JsonIgnoreProperties(ignoreUnknown = true) @@ -42,6 +43,7 @@ public GlanceMember() { /** * Constructor used in createMember + * * @param memberId */ public GlanceMember(String memberId) { @@ -50,6 +52,7 @@ public GlanceMember(String memberId) { /** * Constructor used in updateMember + * * @param status */ public GlanceMember(MemberStatus status) { diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceTask.java b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceTask.java index 13124410c..093f4ca56 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceTask.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceTask.java @@ -1,18 +1,18 @@ package org.openstack4j.openstack.image.v2.domain; -import java.util.Date; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.image.v2.Task; import org.openstack4j.model.image.v2.builder.TaskBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * A Glance v2 task model implementation + * * @author emjburns */ public class GlanceTask implements Task { diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/PatchOperation.java b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/PatchOperation.java index 960ff21ed..14df9b97a 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/PatchOperation.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/PatchOperation.java @@ -8,6 +8,7 @@ /** * Representation of a json patch operation for an openstack image update + * * @author emjburns */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -19,8 +20,7 @@ public enum OperationType { UNKNOWN; @JsonCreator - public static OperationType value(String v) - { + public static OperationType value(String v) { if (v == null) return UNKNOWN; try { return valueOf(v.toUpperCase()); @@ -39,7 +39,8 @@ public String value() { private String path; private Object value; - public PatchOperation() {} + public PatchOperation() { + } public PatchOperation(OperationType op, String path, Object value) { this.op = op; diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/internal/ImageServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/image/v2/internal/ImageServiceImpl.java index 988f372a5..892deed0b 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/internal/ImageServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/internal/ImageServiceImpl.java @@ -23,22 +23,16 @@ import org.openstack4j.openstack.image.v2.domain.GlanceMember; import javax.annotation.Nullable; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; import java.util.List; import java.util.Map; import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_IMAGE_V2_PATCH; -import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_OCTECT_STREAM; -import static org.openstack4j.core.transport.ClientConstants.HEADER_ACCEPT; -import static org.openstack4j.core.transport.ClientConstants.HEADER_CONTENT_TYPE; +import static org.openstack4j.core.transport.ClientConstants.*; /** * Implementation of Glance V2 Image Service + * * @author emjburns */ public class ImageServiceImpl extends BaseImageServices implements ImageService { @@ -57,17 +51,16 @@ public List list() { public List list(Map filteringParams) { return get(GlanceImage.Images.class, uri("/images")).params(filteringParams).execute().getList(); } - + /** * {@inheritDoc} */ @Override public List listCachedImages() { - try { + try { return get(CachedImages.class, uri("/cached_images")) .execute(ExecutionOptions.create(PropagateOnStatus.on(404))).getList(); - } - catch (ResponseException e) { + } catch (ResponseException e) { return null; } } @@ -113,7 +106,7 @@ public Image update(Image image) { GlanceImageUpdate giu = new GlanceImageUpdate(jsonDiff); return update(image.getId(), giu); - }catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); return null; } @@ -135,7 +128,7 @@ public Image update(String imageId, ImageUpdate imageUpdate) { @Override public ActionResponse delete(String imageId) { checkNotNull(imageId); - return deleteWithResponse(uri("/images/%s", imageId)).param("format","json").execute(); + return deleteWithResponse(uri("/images/%s", imageId)).param("format", "json").execute(); } /** @@ -144,7 +137,7 @@ public ActionResponse delete(String imageId) { @Override public ActionResponse deactivate(String imageId) { checkNotNull(imageId); - return post(ActionResponse.class, uri("/images/%s/actions/deactivate",imageId)).execute(); + return post(ActionResponse.class, uri("/images/%s/actions/deactivate", imageId)).execute(); } /** @@ -153,7 +146,7 @@ public ActionResponse deactivate(String imageId) { @Override public ActionResponse reactivate(String imageId) { checkNotNull(imageId); - return post(ActionResponse.class, uri("/images/%s/actions/reactivate",imageId)).execute(); + return post(ActionResponse.class, uri("/images/%s/actions/reactivate", imageId)).execute(); } /** @@ -163,7 +156,7 @@ public ActionResponse reactivate(String imageId) { public ActionResponse upload(String imageId, Payload payload, @Nullable Image image) { checkNotNull(imageId); checkNotNull(payload); - return put(ActionResponse.class, uri("/images/%s/file",imageId)).header(HEADER_CONTENT_TYPE,CONTENT_TYPE_OCTECT_STREAM).entity(payload).execute(); + return put(ActionResponse.class, uri("/images/%s/file", imageId)).header(HEADER_CONTENT_TYPE, CONTENT_TYPE_OCTECT_STREAM).entity(payload).execute(); } /** @@ -182,14 +175,14 @@ public ActionResponse download(String imageId, File filename) { outputStream = new FileOutputStream(filename); byte[] buffer = new byte[1024]; int bytesRead; - while((bytesRead = inputStream.read(buffer)) !=-1){ + while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead); } inputStream.close(); outputStream.flush(); outputStream.close(); return ActionResponse.actionSuccess(); - }catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return ActionResponse.actionFailed("Failed to write to file " + e.getMessage(), 400); } @@ -258,7 +251,7 @@ public Member getMember(String imageId, String memberId) { public Member createMember(String imageId, String memberId) { checkNotNull(imageId); checkNotNull(memberId); - return post(Member.class, uri("/images/%s/members",imageId)).entity(new GlanceMember(memberId)).execute(); + return post(Member.class, uri("/images/%s/members", imageId)).entity(new GlanceMember(memberId)).execute(); } /** @@ -278,8 +271,9 @@ public Member updateMember(String imageId, String memberId, Member.MemberStatus public ActionResponse deleteMember(String imageId, String memberId) { checkNotNull(imageId); checkNotNull(memberId); - return deleteWithResponse(uri("/images/%s/members/%s",imageId, memberId)).execute(); + return deleteWithResponse(uri("/images/%s/members/%s", imageId, memberId)).execute(); } + /** * {@inheritDoc} */ diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/internal/TaskServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/image/v2/internal/TaskServiceImpl.java index ecc79a3fe..c09907c02 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/internal/TaskServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/internal/TaskServiceImpl.java @@ -9,6 +9,7 @@ /** * Glance V2 task service implementation + * * @author emjburns */ public class TaskServiceImpl extends BaseImageServices implements TaskService { @@ -34,7 +35,7 @@ public List list(Map filteringParams) { */ @Override public Task get(String taskId) { - return get(GlanceTask.class, uri("/tasks/%s",taskId)).execute(); + return get(GlanceTask.class, uri("/tasks/%s", taskId)).execute(); } /** diff --git a/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java b/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java index cb91e1174..782536bb3 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java @@ -1,23 +1,12 @@ package org.openstack4j.openstack.internal; -import static org.openstack4j.core.transport.ClientConstants.HEADER_USER_AGENT; -import static org.openstack4j.core.transport.ClientConstants.USER_AGENT; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.SortedSet; - +import com.google.common.base.Function; +import com.google.common.base.Joiner; import org.openstack4j.api.client.CloudProvider; import org.openstack4j.api.exceptions.OS4JException; import org.openstack4j.api.types.ServiceType; -import org.openstack4j.core.transport.ClientConstants; -import org.openstack4j.core.transport.ExecutionOptions; -import org.openstack4j.core.transport.HttpMethod; -import org.openstack4j.core.transport.HttpRequest; +import org.openstack4j.core.transport.*; import org.openstack4j.core.transport.HttpRequest.RequestBuilder; -import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.core.transport.internal.HttpExecutor; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.ActionResponse; @@ -26,19 +15,21 @@ import org.openstack4j.model.identity.v2.Access; import org.openstack4j.model.identity.v3.Service; -import com.google.common.base.Function; -import com.google.common.base.Joiner; +import java.util.*; + +import static org.openstack4j.core.transport.ClientConstants.HEADER_USER_AGENT; +import static org.openstack4j.core.transport.ClientConstants.USER_AGENT; public class BaseOpenStackService { ServiceType serviceType = ServiceType.IDENTITY; Function endpointFunc; - + private static ThreadLocal reqIdContainer = new ThreadLocal(); - + public String getXOpenstackRequestId() { - return reqIdContainer.get(); + return reqIdContainer.get(); } protected BaseOpenStackService() { @@ -113,9 +104,9 @@ private Invocation builder(Class returnType, String path, HttpMethod m RequestBuilder req = HttpRequest.builder(returnType).endpointTokenProvider(ses).config(ses.getConfig()) .method(method).path(path); Map headers = ses.getHeaders(); - if (headers != null && headers.size() > 0){ + if (headers != null && headers.size() > 0) { return new Invocation(req, serviceType, endpointFunc).headers(headers); - }else{ + } else { return new Invocation(req, serviceType, endpointFunc); } } @@ -211,31 +202,31 @@ public R execute(ExecutionOptions options) { header(HEADER_USER_AGENT, USER_AGENT); HttpRequest request = req.build(); HttpResponse res = HttpExecutor.create().execute(request); - + reqIdContainer.remove(); - + String reqId = null; - if(res.headers().containsKey(ClientConstants.X_COMPUTE_REQUEST_ID)) { - reqId = res.header(ClientConstants.X_COMPUTE_REQUEST_ID); + if (res.headers().containsKey(ClientConstants.X_COMPUTE_REQUEST_ID)) { + reqId = res.header(ClientConstants.X_COMPUTE_REQUEST_ID); } else { - reqId = res.header(ClientConstants.X_OPENSTACK_REQUEST_ID); + reqId = res.header(ClientConstants.X_OPENSTACK_REQUEST_ID); } - + reqIdContainer.set(reqId); return res.getEntity(request.getReturnType(), options); } public HttpResponse executeWithResponse() { - HttpResponse res = HttpExecutor.create().execute(req.build()); - reqIdContainer.remove(); - + HttpResponse res = HttpExecutor.create().execute(req.build()); + reqIdContainer.remove(); + String reqId = null; - if(res.headers().containsKey(ClientConstants.X_COMPUTE_REQUEST_ID)) { - reqId = res.header(ClientConstants.X_COMPUTE_REQUEST_ID); + if (res.headers().containsKey(ClientConstants.X_COMPUTE_REQUEST_ID)) { + reqId = res.header(ClientConstants.X_COMPUTE_REQUEST_ID); } else { - reqId = res.header(ClientConstants.X_OPENSTACK_REQUEST_ID); + reqId = res.header(ClientConstants.X_OPENSTACK_REQUEST_ID); } - + reqIdContainer.set(reqId); return res; } diff --git a/core/src/main/java/org/openstack4j/openstack/internal/MicroVersion.java b/core/src/main/java/org/openstack4j/openstack/internal/MicroVersion.java index 6ae876a1e..f9653f331 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/MicroVersion.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/MicroVersion.java @@ -1,6 +1,5 @@ package org.openstack4j.openstack.internal; -import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java b/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java index b6dcb8c1e..5b510e343 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java @@ -1,7 +1,5 @@ package org.openstack4j.openstack.internal; -import static org.openstack4j.core.transport.HttpExceptionHandler.mapException; - import org.openstack4j.api.OSClient; import org.openstack4j.api.OSClient.OSClientV2; import org.openstack4j.api.OSClient.OSClientV3; @@ -29,6 +27,8 @@ import java.util.HashMap; import java.util.Map; +import static org.openstack4j.core.transport.HttpExceptionHandler.mapException; + /** * Responsible for authenticating and re-authenticating sessions for V2 and V3 * of the Identity API @@ -42,15 +42,15 @@ public class OSAuthenticator { * Invokes authentication to obtain a valid V3 Token, throws an * UnsupportedOperationException for an V2 attempt. * - * @param auth the authentication credentials - * @param endpoint the identity endpoint + * @param auth the authentication credentials + * @param endpoint the identity endpoint * @param perspective the network facing perspective - * @param config the client configuration + * @param config the client configuration * @return the OSClient */ @SuppressWarnings("rawtypes") public static OSClient invoke(AuthStore auth, String endpoint, Facing perspective, Config config, - CloudProvider provider) { + CloudProvider provider) { SessionInfo info = new SessionInfo(endpoint, perspective, false, provider); if (auth.getVersion().equals(AuthVersion.V2)) { return authenticateV2((org.openstack4j.openstack.identity.v2.domain.Auth) auth, info, config); @@ -60,32 +60,32 @@ public static OSClient invoke(AuthStore auth, String endpoint, Facing perspectiv /** * Invokes V3 authentication via an existing token - * - * @param auth the token authentication - * @param endpoint the identity endpoint + * + * @param auth the token authentication + * @param endpoint the identity endpoint * @param perspective the network facing perspective - * @param config the client configuration + * @param config the client configuration * @return the OSClient */ @SuppressWarnings("rawtypes") public static OSClient invoke(KeystoneAuth auth, String endpoint, Facing perspective, Config config, - CloudProvider provider) { + CloudProvider provider) { SessionInfo info = new SessionInfo(endpoint, perspective, false, provider); return authenticateV3(auth, info, config); } /** * Invokes V2 authentication via an existing token - * - * @param auth the token authentication - * @param endpoint the identity endpoint + * + * @param auth the token authentication + * @param endpoint the identity endpoint * @param perspective the network facing perspective - * @param config the client configuration + * @param config the client configuration * @return the OSClient */ @SuppressWarnings("rawtypes") public static OSClient invoke(org.openstack4j.openstack.identity.v2.domain.TokenAuth auth, String endpoint, - Facing perspective, Config config, CloudProvider provider) { + Facing perspective, Config config, CloudProvider provider) { SessionInfo info = new SessionInfo(endpoint, perspective, false, provider); return authenticateV2(auth, info, config); } @@ -101,24 +101,24 @@ public static void reAuthenticate() { OSClientSession session = OSClientSession.getCurrent(); switch (session.getAuthVersion()) { - case V2: - KeystoneAccess access = ((OSClientSessionV2) session).getAccess().unwrap(); - SessionInfo info = new SessionInfo(access.getEndpoint(), session.getPerspective(), true, - session.getProvider()); - Auth auth = (Auth) ((access.isCredentialType()) ? access.getCredentials() : access.getTokenAuth()); - authenticateV2((org.openstack4j.openstack.identity.v2.domain.Auth) auth, info, session.getConfig()); - break; - case V3: - default: - Token token = ((OSClientSessionV3) session).getToken(); - info = new SessionInfo(token.getEndpoint(), session.getPerspective(), true, session.getProvider()); - authenticateV3((KeystoneAuth) token.getCredentials(), info, session.getConfig()); - break; + case V2: + KeystoneAccess access = ((OSClientSessionV2) session).getAccess().unwrap(); + SessionInfo info = new SessionInfo(access.getEndpoint(), session.getPerspective(), true, + session.getProvider()); + Auth auth = (Auth) ((access.isCredentialType()) ? access.getCredentials() : access.getTokenAuth()); + authenticateV2((org.openstack4j.openstack.identity.v2.domain.Auth) auth, info, session.getConfig()); + break; + case V3: + default: + Token token = ((OSClientSessionV3) session).getToken(); + info = new SessionInfo(token.getEndpoint(), session.getPerspective(), true, session.getProvider()); + authenticateV3((KeystoneAuth) token.getCredentials(), info, session.getConfig()); + break; } } private static OSClientV2 authenticateV2(org.openstack4j.openstack.identity.v2.domain.Auth auth, SessionInfo info, - Config config) { + Config config) { HttpRequest request = HttpRequest.builder(KeystoneAccess.class) .header(ClientConstants.HEADER_OS4J_AUTH, TOKEN_INDICATOR).endpoint(info.endpoint) .method(HttpMethod.POST).path("/tokens").config(config).entity(auth).build(); @@ -151,24 +151,24 @@ private static OSClientV2 authenticateV2(org.openstack4j.openstack.identity.v2.d } private static OSClientV3 authenticateV3(KeystoneAuth auth, SessionInfo info, Config config) { - if (auth.getType().equals(Type.TOKENLESS)){ + if (auth.getType().equals(Type.TOKENLESS)) { Map headers = new HashMap(); Authentication.Scope.Project project = auth.getScope().getProject(); - if (project != null){ + if (project != null) { if (!isEmpty(project.getId())) headers.put(ClientConstants.HEADER_X_PROJECT_ID, project.getId()); if (!isEmpty(project.getName())) headers.put(ClientConstants.HEADER_X_PROJECT_NAME, project.getName()); Authentication.Scope.Domain domain = project.getDomain(); - if (domain != null){ + if (domain != null) { if (!isEmpty(domain.getId())) headers.put(ClientConstants.HEADER_X_PROJECT_DOMAIN_ID, domain.getId()); if (!isEmpty(domain.getName())) headers.put(ClientConstants.HEADER_X_PROJECT_DOMAIN_NAME, domain.getName()); } - }else{ + } else { Authentication.Scope.Domain domain = auth.getScope().getDomain(); - if (domain != null){ + if (domain != null) { if (!isEmpty(domain.getId())) headers.put(ClientConstants.HEADER_X_DOMAIN_ID, domain.getId()); if (!isEmpty(domain.getName())) @@ -203,25 +203,25 @@ private static OSClientV3 authenticateV3(KeystoneAuth auth, SessionInfo info, Co token = token.applyContext(info.endpoint, new TokenAuth(token.getId(), auth.getScope().getProject().getName(), auth.getScope().getProject().getId())); - } else if (token.getDomain() != null ) { + } else if (token.getDomain() != null) { token = token.applyContext(info.endpoint, new TokenAuth(token.getId(), auth.getScope().getDomain().getName(), auth.getScope().getDomain().getId())); } else { - token = token.applyContext(info.endpoint, new TokenAuth(token.getId(),null,null)); + token = token.applyContext(info.endpoint, new TokenAuth(token.getId(), null, null)); } } String reqId = response.header(ClientConstants.X_OPENSTACK_REQUEST_ID); if (!info.reLinkToExistingSession) { - OSClientSessionV3 v3 = OSClientSessionV3.createSession(token, info.perspective, info.provider, config); - v3.reqId = reqId; + OSClientSessionV3 v3 = OSClientSessionV3.createSession(token, info.perspective, info.provider, config); + v3.reqId = reqId; return v3; } OSClientSessionV3 current = (OSClientSessionV3) OSClientSessionV3.getCurrent(); current.token = token; - + current.reqId = reqId; return current; } @@ -240,7 +240,7 @@ private static class SessionInfo { } } - private static boolean isEmpty(String str){ + private static boolean isEmpty(String str) { if (str != null && str.length() > 0) return false; return true; diff --git a/core/src/main/java/org/openstack4j/openstack/internal/OSClientSession.java b/core/src/main/java/org/openstack4j/openstack/internal/OSClientSession.java index 6da513ebc..820862122 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/OSClientSession.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/OSClientSession.java @@ -56,8 +56,8 @@ * @author Jeremy Unruh */ public abstract class OSClientSession> implements EndpointTokenProvider { - - private static final Logger LOG = LoggerFactory.getLogger(OSClientSession.class); + + private static final Logger LOG = LoggerFactory.getLogger(OSClientSession.class); @SuppressWarnings("rawtypes") private static final ThreadLocal sessions = new ThreadLocal(); @@ -145,7 +145,7 @@ public OctaviaService octavia() { public ArtifactService artifact() { return Apis.getArtifactServices(); } - + /** * {@inheritDoc} */ @@ -203,7 +203,7 @@ public AppCatalogService murano() { * {@inheritDoc} */ public MagnumService magnum() { - return Apis.getMagnumService(); + return Apis.getMagnumService(); } /** @@ -244,7 +244,9 @@ public BarbicanService barbican() { /** * {@inheritDoc} */ - public DNSService dns() {return Apis.getDNSService(); } + public DNSService dns() { + return Apis.getDNSService(); + } /** * {@inheritDoc} @@ -267,7 +269,7 @@ public T headers(Map headers) { return (T) this; } - public Map getHeaders(){ + public Map getHeaders() { return this.headers; } @@ -351,17 +353,21 @@ public boolean supportsShare() { /** * {@inheritDoc} */ - public boolean supportsTrove() { return getSupportedServices().contains(ServiceType.DATABASE); } + public boolean supportsTrove() { + return getSupportedServices().contains(ServiceType.DATABASE); + } /** * {@inheritDoc} */ - public boolean supportsDNS() { return getSupportedServices().contains(ServiceType.DNS); } + public boolean supportsDNS() { + return getSupportedServices().contains(ServiceType.DNS); + } public Set getSupportedServices() { return null; } - + public AuthVersion getAuthVersion() { return null; } @@ -374,13 +380,12 @@ public GbpService gbp() { } /** - * * @return */ - public TroveService trove(){ + public TroveService trove() { return Apis.getTroveServices(); } - + public static class OSClientSessionV2 extends OSClientSession implements OSClientV2 { Access access; @@ -416,7 +421,7 @@ public Access getAccess() { public String getEndpoint() { return access.getEndpoint(); } - + @Override public AuthVersion getAuthVersion() { return AuthVersion.V2; @@ -439,9 +444,9 @@ private String addNATIfApplicable(String url) { */ @Override public String getEndpoint(ServiceType service) { - - final EndpointURLResolver eUrlResolver = (config != null && config.getEndpointURLResolver() != null) ? config.getEndpointURLResolver() : fallbackEndpointUrlResolver; - + + final EndpointURLResolver eUrlResolver = (config != null && config.getEndpointURLResolver() != null) ? config.getEndpointURLResolver() : fallbackEndpointUrlResolver; + return addNATIfApplicable(eUrlResolver.findURLV2(URLResolverParams .create(access, service) .resolver(config != null ? config.getV2Resolver() : null) @@ -475,7 +480,7 @@ public Set getSupportedServices() { public static class OSClientSessionV3 extends OSClientSession implements OSClientV3 { Token token; - + protected String reqId; private OSClientSessionV3(Token token, String endpoint, Facing perspective, CloudProvider provider, Config config) { @@ -499,9 +504,9 @@ public static OSClientSessionV3 createSession(Token token) { public static OSClientSessionV3 createSession(Token token, Facing perspective, CloudProvider provider, Config config) { return new OSClientSessionV3(token, token.getEndpoint(), perspective, provider, config); } - + public String getXOpenstackRequestId() { - return reqId; + return reqId; } @Override @@ -516,7 +521,7 @@ public Token getToken() { public String getEndpoint() { return token.getEndpoint(); } - + @Override public AuthVersion getAuthVersion() { return AuthVersion.V3; @@ -539,9 +544,9 @@ private String addNATIfApplicable(String url) { */ @Override public String getEndpoint(ServiceType service) { - - final EndpointURLResolver eUrlResolver = (config != null && config.getEndpointURLResolver() != null) ? config.getEndpointURLResolver() : fallbackEndpointUrlResolver; - + + final EndpointURLResolver eUrlResolver = (config != null && config.getEndpointURLResolver() != null) ? config.getEndpointURLResolver() : fallbackEndpointUrlResolver; + return addNATIfApplicable(eUrlResolver.findURLV3(URLResolverParams .create(token, service) .resolver(config != null ? config.getResolver() : null) @@ -584,5 +589,4 @@ public TelemetryService telemetry() { } - } diff --git a/core/src/main/java/org/openstack4j/openstack/internal/Parser.java b/core/src/main/java/org/openstack4j/openstack/internal/Parser.java index 2dd9a8d18..d6b232106 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/Parser.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/Parser.java @@ -17,6 +17,7 @@ /** * Provides common parser routines when dealing with Headers or other non-json payloads + * * @author Jeremy Unruh * @author Qin An - Added parser function for Neutron Agent List */ @@ -36,6 +37,7 @@ public final class Parser { /** * Takes a String Numeric and returns null or the Long value + * * @param number the number in string form * @return the Long or null */ @@ -45,7 +47,8 @@ public static Long asLong(String number) { /** * Takes a String Numeric and returns null or the Long value - * @param number the number in string form + * + * @param number the number in string form * @param defaultValue the default value if number is null * @return the Long or null */ @@ -56,6 +59,7 @@ public static Long asLong(String number, Long defaultValue) { /** * Takes a String Boolean and returns null or as Boolean value + * * @param bool the boolean in String form * @return the Boolean or null */ @@ -66,6 +70,7 @@ public static Boolean asBoolean(String bool) { /** * Takes a String Date and decodes it into a date. Returns null if the date is null + * * @param date the date in String form * @return Date or null */ @@ -73,39 +78,38 @@ public static Date asDate(String date) { try { if (date != null) return StdDateFormat.instance.parse(date); - } - catch (ParseException e) { + } catch (ParseException e) { LoggerFactory.getLogger(Parser.class).error(e.getMessage(), e); } return null; } - + /** * Parse a string with format "yyyy-MM-dd HH:mm:ss" into a Date * The string format is used in Neutron Agent-List - * + * * @param date - string to be parsed * @return Date */ public static Date parseSimpleDate(String date) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { - if (date != null) { - return format.parse(date); - } + if (date != null) { + return format.parse(date); + } } catch (ParseException e) { - LoggerFactory.getLogger(Parser.class).error(e.getMessage(), e); + LoggerFactory.getLogger(Parser.class).error(e.getMessage(), e); } return null; - } + } /** * Takes a Date and returns it's equivalent in RFC 1123 + * * @param date the date to format * @return the formatted date string */ - public static String toRFC1123(Date date) - { + public static String toRFC1123(Date date) { if (DF == null) { DF = new SimpleDateFormat(PATTERN_RFC1123, Locale.US); DF.setTimeZone(TimeZone.getTimeZone("GMT")); diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBay.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBay.java index cf0bebb6b..152b36a11 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBay.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBay.java @@ -1,279 +1,277 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Bay; import org.openstack4j.model.magnum.BayBuilder; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumBay implements Bay { - private static final long serialVersionUID = 1L; - @JsonProperty("status") - private String status; - @JsonProperty("uuid") - private String uuid; - @JsonProperty("links") - private List links; - @JsonProperty("stack_id") - private String stackId; - @JsonProperty("created_at") - private String createdAt; - @JsonProperty("api_address") - private String apiAddress; - @JsonProperty("discovery_url") - private String discoveryUrl; - @JsonProperty("updated_at") - private String updatedAt; - @JsonProperty("master_count") - private Integer masterCount; - @JsonProperty("coe_version") - private String coeVersion; - @JsonProperty("baymodel_id") - private String baymodelId; - @JsonProperty("master_addresses") - private List masterAddresses; - @JsonProperty("node_count") - private Integer nodeCount; - @JsonProperty("node_addresses") - private List nodeAddresses; - @JsonProperty("status_reason") - private String statusReason; - @JsonProperty("bay_create_timeout") - private String bayCreateTimeout; - @JsonProperty("name") - private String name; - - public static BayBuilder builder() { - return new BayConcreteBuilder(); - } - - @Override - public BayBuilder toBuilder() { - return new BayConcreteBuilder(this); - } - - public String getStatus() { - return status; - } - - public String getUuid() { - return uuid; - } - - public List getLinks() { - return links; - } - - public String getStackId() { - return stackId; - } - - public String getCreatedAt() { - return createdAt; - } - - public String getApiAddress() { - return apiAddress; - } - - public String getDiscoveryUrl() { - return discoveryUrl; - } - - public String getUpdatedAt() { - return updatedAt; - } - - public Integer getMasterCount() { - return masterCount; - } - - public String getCoeVersion() { - return coeVersion; - } - - public String getBaymodelId() { - return baymodelId; - } - - public List getMasterAddresses() { - return masterAddresses; - } - - public Integer getNodeCount() { - return nodeCount; - } - - public List getNodeAddresses() { - return nodeAddresses; - } - - public String getStatusReason() { - return statusReason; - } - - public String getBayCreateTimeout() { - return bayCreateTimeout; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues().add("status", status).add("uuid", uuid).add("links", links) - .add("stackId", stackId).add("createdAt", createdAt).add("apiAddress", apiAddress) - .add("discoveryUrl", discoveryUrl).add("updatedAt", updatedAt).add("masterCount", masterCount) - .add("coeVersion", coeVersion).add("baymodelId", baymodelId).add("masterAddresses", masterAddresses) - .add("nodeCount", nodeCount).add("nodeAddresses", nodeAddresses).add("statusReason", statusReason) - .add("bayCreateTimeout", bayCreateTimeout).add("name", name).toString(); - } - - /** - * Concrete builder containing MagnumBay as model - * - */ - public static class BayConcreteBuilder implements BayBuilder { - MagnumBay model; - - public BayConcreteBuilder() { - this(new MagnumBay()); - } - - public BayConcreteBuilder(MagnumBay model) { - this.model = model; - } - - @Override - public Bay build() { - return model; - } - - @Override - public BayBuilder from(Bay in) { - if (in != null) - this.model = (MagnumBay) in; - return this; - } - - @Override - public BayBuilder status(String status) { - model.status = status; - return this; - } - - @Override - public BayBuilder uuid(String uuid) { - model.uuid = uuid; - return this; - } - - @Override - public BayBuilder links(List links) { - model.links = links; - return this; - } - - @Override - public BayBuilder stackId(String stackId) { - model.stackId = stackId; - return this; - } - - @Override - public BayBuilder createdAt(String createdAt) { - model.createdAt = createdAt; - return this; - } - - @Override - public BayBuilder apiAddress(String apiAddress) { - model.apiAddress = apiAddress; - return this; - } - - @Override - public BayBuilder discoveryUrl(String discoveryUrl) { - model.discoveryUrl = discoveryUrl; - return this; - } - - @Override - public BayBuilder updatedAt(String updatedAt) { - model.updatedAt = updatedAt; - return this; - } - - @Override - public BayBuilder masterCount(Integer masterCount) { - model.masterCount = masterCount; - return this; - } - - @Override - public BayBuilder coeVersion(String coeVersion) { - model.coeVersion = coeVersion; - return this; - } - - @Override - public BayBuilder baymodelId(String baymodelId) { - model.baymodelId = baymodelId; - return this; - } - - @Override - public BayBuilder masterAddresses(List masterAddresses) { - model.masterAddresses = masterAddresses; - return this; - } - - @Override - public BayBuilder nodeCount(Integer nodeCount) { - model.nodeCount = nodeCount; - return this; - } - - @Override - public BayBuilder nodeAddresses(List nodeAddresses) { - model.nodeAddresses = nodeAddresses; - return this; - } - - @Override - public BayBuilder statusReason(String statusReason) { - model.statusReason = statusReason; - return this; - } - - @Override - public BayBuilder bayCreateTimeout(String bayCreateTimeout) { - model.bayCreateTimeout = bayCreateTimeout; - return this; - } - - @Override - public BayBuilder name(String name) { - model.name = name; - return this; - } - - public static class Bays extends ListResult { - private static final long serialVersionUID = 1L; - @JsonProperty("bays") - private List list; - - @Override - public List value() { - return list; - } - } - } + private static final long serialVersionUID = 1L; + @JsonProperty("status") + private String status; + @JsonProperty("uuid") + private String uuid; + @JsonProperty("links") + private List links; + @JsonProperty("stack_id") + private String stackId; + @JsonProperty("created_at") + private String createdAt; + @JsonProperty("api_address") + private String apiAddress; + @JsonProperty("discovery_url") + private String discoveryUrl; + @JsonProperty("updated_at") + private String updatedAt; + @JsonProperty("master_count") + private Integer masterCount; + @JsonProperty("coe_version") + private String coeVersion; + @JsonProperty("baymodel_id") + private String baymodelId; + @JsonProperty("master_addresses") + private List masterAddresses; + @JsonProperty("node_count") + private Integer nodeCount; + @JsonProperty("node_addresses") + private List nodeAddresses; + @JsonProperty("status_reason") + private String statusReason; + @JsonProperty("bay_create_timeout") + private String bayCreateTimeout; + @JsonProperty("name") + private String name; + + public static BayBuilder builder() { + return new BayConcreteBuilder(); + } + + @Override + public BayBuilder toBuilder() { + return new BayConcreteBuilder(this); + } + + public String getStatus() { + return status; + } + + public String getUuid() { + return uuid; + } + + public List getLinks() { + return links; + } + + public String getStackId() { + return stackId; + } + + public String getCreatedAt() { + return createdAt; + } + + public String getApiAddress() { + return apiAddress; + } + + public String getDiscoveryUrl() { + return discoveryUrl; + } + + public String getUpdatedAt() { + return updatedAt; + } + + public Integer getMasterCount() { + return masterCount; + } + + public String getCoeVersion() { + return coeVersion; + } + + public String getBaymodelId() { + return baymodelId; + } + + public List getMasterAddresses() { + return masterAddresses; + } + + public Integer getNodeCount() { + return nodeCount; + } + + public List getNodeAddresses() { + return nodeAddresses; + } + + public String getStatusReason() { + return statusReason; + } + + public String getBayCreateTimeout() { + return bayCreateTimeout; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("status", status).add("uuid", uuid).add("links", links) + .add("stackId", stackId).add("createdAt", createdAt).add("apiAddress", apiAddress) + .add("discoveryUrl", discoveryUrl).add("updatedAt", updatedAt).add("masterCount", masterCount) + .add("coeVersion", coeVersion).add("baymodelId", baymodelId).add("masterAddresses", masterAddresses) + .add("nodeCount", nodeCount).add("nodeAddresses", nodeAddresses).add("statusReason", statusReason) + .add("bayCreateTimeout", bayCreateTimeout).add("name", name).toString(); + } + + /** + * Concrete builder containing MagnumBay as model + */ + public static class BayConcreteBuilder implements BayBuilder { + MagnumBay model; + + public BayConcreteBuilder() { + this(new MagnumBay()); + } + + public BayConcreteBuilder(MagnumBay model) { + this.model = model; + } + + @Override + public Bay build() { + return model; + } + + @Override + public BayBuilder from(Bay in) { + if (in != null) + this.model = (MagnumBay) in; + return this; + } + + @Override + public BayBuilder status(String status) { + model.status = status; + return this; + } + + @Override + public BayBuilder uuid(String uuid) { + model.uuid = uuid; + return this; + } + + @Override + public BayBuilder links(List links) { + model.links = links; + return this; + } + + @Override + public BayBuilder stackId(String stackId) { + model.stackId = stackId; + return this; + } + + @Override + public BayBuilder createdAt(String createdAt) { + model.createdAt = createdAt; + return this; + } + + @Override + public BayBuilder apiAddress(String apiAddress) { + model.apiAddress = apiAddress; + return this; + } + + @Override + public BayBuilder discoveryUrl(String discoveryUrl) { + model.discoveryUrl = discoveryUrl; + return this; + } + + @Override + public BayBuilder updatedAt(String updatedAt) { + model.updatedAt = updatedAt; + return this; + } + + @Override + public BayBuilder masterCount(Integer masterCount) { + model.masterCount = masterCount; + return this; + } + + @Override + public BayBuilder coeVersion(String coeVersion) { + model.coeVersion = coeVersion; + return this; + } + + @Override + public BayBuilder baymodelId(String baymodelId) { + model.baymodelId = baymodelId; + return this; + } + + @Override + public BayBuilder masterAddresses(List masterAddresses) { + model.masterAddresses = masterAddresses; + return this; + } + + @Override + public BayBuilder nodeCount(Integer nodeCount) { + model.nodeCount = nodeCount; + return this; + } + + @Override + public BayBuilder nodeAddresses(List nodeAddresses) { + model.nodeAddresses = nodeAddresses; + return this; + } + + @Override + public BayBuilder statusReason(String statusReason) { + model.statusReason = statusReason; + return this; + } + + @Override + public BayBuilder bayCreateTimeout(String bayCreateTimeout) { + model.bayCreateTimeout = bayCreateTimeout; + return this; + } + + @Override + public BayBuilder name(String name) { + model.name = name; + return this; + } + + public static class Bays extends ListResult { + private static final long serialVersionUID = 1L; + @JsonProperty("bays") + private List list; + + @Override + public List value() { + return list; + } + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBaymodel.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBaymodel.java index 461b5e3fb..8a828777e 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBaymodel.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumBaymodel.java @@ -1,20 +1,18 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Baymodel; import org.openstack4j.model.magnum.BaymodelBuilder; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) -public class MagnumBaymodel implements Baymodel{ +public class MagnumBaymodel implements Baymodel { /** * */ @@ -90,6 +88,7 @@ public class MagnumBaymodel implements Baymodel{ public static BaymodelBuilder builder() { return new BaymodelConcreteBuilder(); } + @Override public BaymodelBuilder toBuilder() { @@ -99,90 +98,119 @@ public BaymodelBuilder toBuilder() { public String getInsecureRegistry() { return insecureRegistry; } + public List getLinks() { return links; } + public String getHttpProxy() { return httpProxy; } + public String getUpdatedAt() { return updatedAt; } + public Boolean isFloatingIpEnabled() { return floatingIpEnabled; } + public String getFixedSubnet() { return fixedSubnet; } + public String getMasterFlavorId() { return masterFlavorId; } + public String getUuid() { return uuid; } + public String getNoProxy() { return noProxy; } + public String getHttpsProxy() { return httpsProxy; } + public Boolean isTlsDisabled() { return tlsDisabled; } + public String getKeypairId() { return keypairId; } + public Boolean isPublicBaymodel() { return publicBaymodel; } + public String getDockerVolumeSize() { return dockerVolumeSize; } + public String getServerType() { return serverType; } + public String getExternalNetworkId() { return externalNetworkId; } + public String getClusterDistro() { return clusterDistro; } + public String getImageId() { return imageId; } + public String getVolumeDriver() { return volumeDriver; } + public Boolean isRegistryEnabled() { return registryEnabled; } + public String getDockerStorageDriver() { return dockerStorageDriver; } + public String getApiserverPort() { return apiserverPort; } + public String getName() { return name; } + public String getCreatedAt() { return createdAt; } + public String getNetworkDriver() { return networkDriver; } + public String getFixedNetwork() { return fixedNetwork; } + public String getCoe() { return coe; } + public String getFlavorId() { return flavorId; } + public Boolean isMasterLbEnabled() { return masterLbEnabled; } + public String getDnsNameserver() { return dnsNameserver; } @@ -225,9 +253,8 @@ public String toString() { /** * Concrete builder containing MagnumBaymodel as model - * */ - public static class BaymodelConcreteBuilder implements BaymodelBuilder{ + public static class BaymodelConcreteBuilder implements BaymodelBuilder { MagnumBaymodel model; @@ -246,8 +273,8 @@ public Baymodel build() { @Override public BaymodelBuilder from(Baymodel in) { - if(in != null) - this.model = (MagnumBaymodel)in; + if (in != null) + this.model = (MagnumBaymodel) in; return this; } @@ -435,8 +462,6 @@ public BaymodelBuilder dnsNameserver(String dnsNameserver) { /** * list of baymodels - * - * */ public static class Baymodels extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCarequest.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCarequest.java index 721381894..5fd3f9e70 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCarequest.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCarequest.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Carequest; import org.openstack4j.model.magnum.CarequestBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumCarequest implements Carequest { @@ -42,7 +41,6 @@ public String toString() { /** * Concrete builder containing MagnumCarequest as model - * */ public static class CarequestConcreteBuilder implements CarequestBuilder { MagnumCarequest model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCertificate.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCertificate.java index aa3164e74..8013b8595 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCertificate.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCertificate.java @@ -1,16 +1,14 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Certificate; import org.openstack4j.model.magnum.CertificateBuilder; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumCertificate implements Certificate { @@ -51,7 +49,6 @@ public String toString() { /** * Concrete builder containing MagnumCertificate as model - * */ public static class CertificateConcreteBuilder implements CertificateBuilder { MagnumCertificate model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCluster.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCluster.java index 85d872196..f8769fafe 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCluster.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumCluster.java @@ -1,16 +1,14 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Cluster; import org.openstack4j.model.magnum.ClusterBuilder; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumCluster implements Cluster { @@ -102,7 +100,6 @@ public String toString() { /** * Concrete builder containing MagnumCluster as model - * */ public static class ClusterConcreteBuilder implements ClusterBuilder { MagnumCluster model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumClustertemplate.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumClustertemplate.java index 2e51e1b0c..ac5795738 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumClustertemplate.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumClustertemplate.java @@ -1,18 +1,16 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Clustertemplate; import org.openstack4j.model.magnum.ClustertemplateBuilder; import org.openstack4j.model.magnum.Label; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumClustertemplate implements Clustertemplate { @@ -238,7 +236,6 @@ public String toString() { /** * Concrete builder containing MagnumClustertemplate as model - * */ public static class ClustertemplateConcreteBuilder implements ClustertemplateBuilder { MagnumClustertemplate model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumContainer.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumContainer.java index 885519dfb..8426afa5f 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumContainer.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumContainer.java @@ -1,16 +1,14 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Container; import org.openstack4j.model.magnum.ContainerBuilder; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumContainer implements Container { @@ -88,7 +86,6 @@ public String toString() { /** * Concrete builder containing MagnumContainer as model - * */ public static class ContainerConcreteBuilder implements ContainerBuilder { MagnumContainer model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumEnvironment.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumEnvironment.java index 09b63afdf..8edb35e9d 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumEnvironment.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumEnvironment.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.magnum; -import org.openstack4j.model.magnum.Environment; -import org.openstack4j.model.magnum.EnvironmentBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.magnum.Environment; +import org.openstack4j.model.magnum.EnvironmentBuilder; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumEnvironment implements Environment { @@ -41,7 +40,6 @@ public String toString() { /** * Concrete builder containing MagnumEnvironment as model - * */ public static class EnvironmentConcreteBuilder implements EnvironmentBuilder { MagnumEnvironment model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumLabel.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumLabel.java index 6624e43de..2eb865eca 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumLabel.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumLabel.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.magnum; -import org.openstack4j.model.magnum.Label; -import org.openstack4j.model.magnum.LabelBuilder; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.magnum.Label; +import org.openstack4j.model.magnum.LabelBuilder; public class MagnumLabel implements Label { private static final long serialVersionUID = 1L; @@ -31,7 +30,6 @@ public String toString() { /** * Concrete builder containing MagnumLabel as model - * */ public static class LabelConcreteBuilder implements LabelBuilder { MagnumLabel model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumMservice.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumMservice.java index 5860b5e6a..8f6bc99a3 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumMservice.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumMservice.java @@ -1,191 +1,189 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - -import org.openstack4j.model.magnum.Mservice; -import org.openstack4j.model.magnum.MserviceBuilder; -import org.openstack4j.openstack.common.ListResult; - - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.magnum.Mservice; +import org.openstack4j.model.magnum.MserviceBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; @JsonRootName("mservice") @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumMservice implements Mservice { - /** - * - */ - private static final long serialVersionUID = 1L; - @JsonProperty - private String id; - private String binary; - @JsonProperty("created_at") - private String createdAt; - private String state; - @JsonProperty("report_count") - private int reportCount; - @JsonProperty("updated_at") - private String updatedAt; - private String host; - @JsonProperty("disabled_reason") - private String disabledReason; - - - /** - * Magnum service builder - * - * @return the Magnum Service builder - */ - public static MserviceBuilder builder() { - return new MserviceConcreteBuilder(); - } - - @Override - public MserviceBuilder toBuilder() { - return new MserviceConcreteBuilder(this); - } - - /** + /** + * + */ + private static final long serialVersionUID = 1L; + @JsonProperty + private String id; + private String binary; + @JsonProperty("created_at") + private String createdAt; + private String state; + @JsonProperty("report_count") + private int reportCount; + @JsonProperty("updated_at") + private String updatedAt; + private String host; + @JsonProperty("disabled_reason") + private String disabledReason; + + + /** + * Magnum service builder + * + * @return the Magnum Service builder + */ + public static MserviceBuilder builder() { + return new MserviceConcreteBuilder(); + } + + @Override + public MserviceBuilder toBuilder() { + return new MserviceConcreteBuilder(this); + } + + /** * {@inheritDoc} */ - @Override - public String getId() { - return id; - } - - /** - * Set the id - * - * @param id - */ - public void setId(String id) { - this.id = id; - } - - /** + @Override + public String getId() { + return id; + } + + /** + * Set the id + * + * @param id + */ + public void setId(String id) { + this.id = id; + } + + /** * {@inheritDoc} */ - @Override - public String getBinary() { - return binary; - } - - /** - * Set the binary - * - * @param binary - */ - public void setBinary(String binary) { - this.binary = binary; - } - - /** + @Override + public String getBinary() { + return binary; + } + + /** + * Set the binary + * + * @param binary + */ + public void setBinary(String binary) { + this.binary = binary; + } + + /** * {@inheritDoc} */ - @Override - public String getCreatedAt() { - return createdAt; - } - - /** - * Set the creation date - * - * @param createdAt - */ - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - /** + @Override + public String getCreatedAt() { + return createdAt; + } + + /** + * Set the creation date + * + * @param createdAt + */ + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + /** * {@inheritDoc} */ - @Override - public String getState() { - return state; - } - - /** - * Set the state - * - * @param state - */ - public void setState(String state) { - this.state = state; - } - - /** + @Override + public String getState() { + return state; + } + + /** + * Set the state + * + * @param state + */ + public void setState(String state) { + this.state = state; + } + + /** * {@inheritDoc} */ - @Override - public int getReportCount() { - return reportCount; - } - - /** - * Set the report count - * - * @param reportCount - */ - public void setReportCount(int reportCount) { - this.reportCount = reportCount; - } - - /** + @Override + public int getReportCount() { + return reportCount; + } + + /** + * Set the report count + * + * @param reportCount + */ + public void setReportCount(int reportCount) { + this.reportCount = reportCount; + } + + /** * {@inheritDoc} */ - @Override - public String getUpdatedAt() { - return updatedAt; - } - - /** - * Set the updated time - * - * @param updatedAt - */ - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - /** + @Override + public String getUpdatedAt() { + return updatedAt; + } + + /** + * Set the updated time + * + * @param updatedAt + */ + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + /** * {@inheritDoc} */ - @Override - public String getHost() { - return host; - } - - /** - * Set the hostname - * - * @param host - */ - public void setHost(String host) { - this.host = host; - } - - /** + @Override + public String getHost() { + return host; + } + + /** + * Set the hostname + * + * @param host + */ + public void setHost(String host) { + this.host = host; + } + + /** * {@inheritDoc} */ - @Override - public String getDisabledReason() { - return disabledReason; - } - - - /** - * Set the disabled reason - * - * @param disabledReason - */ - public void setDisabledReason(String disabledReason) { - this.disabledReason = disabledReason; - } - - @Override + @Override + public String getDisabledReason() { + return disabledReason; + } + + + /** + * Set the disabled reason + * + * @param disabledReason + */ + public void setDisabledReason(String disabledReason) { + this.disabledReason = disabledReason; + } + + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() .add("id", id) @@ -199,97 +197,95 @@ public String toString() { .toString(); } - /** - * Concrete builder containing MagnumMservice as model - * - */ - public static class MserviceConcreteBuilder implements MserviceBuilder { - MagnumMservice model; - - public MserviceConcreteBuilder() { - this(new MagnumMservice()); - } - - MserviceConcreteBuilder(MagnumMservice model) { - this.model = model; - } - - @Override - public Mservice build() { - return model; - } - - @Override - public MserviceBuilder from(Mservice in) { - if (in != null) - this.model = (MagnumMservice) in; - return this; - } - - @Override - public MserviceBuilder id(String id) { - model.id = id; - return this; - } - - @Override - public MserviceBuilder binary(String binary) { - model.binary = binary; - return this; - } - - @Override - public MserviceBuilder createdAt(String createdAt) { - model.createdAt = createdAt; - return this; - } - - @Override - public MserviceBuilder state(String state) { - model.state = state; - return this; - } - - @Override - public MserviceBuilder reportCount(int reportCount) { - model.reportCount = reportCount; - return this; - } - - @Override - public MserviceBuilder updatedAt(String updatedAt) { - model.updatedAt = updatedAt; - return this; - } - - @Override - public MserviceBuilder host(String host) { - model.host = host; - return this; - } - - @Override - public MserviceBuilder disabledReason(String disabledReason) { - model.disabledReason = disabledReason; - return this; - } - - } - - /** - * List of Magnum Services - * - */ - public static class Mservices extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("mservices") - protected List list; - - @Override - protected List value() { - return list; - } - - } + /** + * Concrete builder containing MagnumMservice as model + */ + public static class MserviceConcreteBuilder implements MserviceBuilder { + MagnumMservice model; + + public MserviceConcreteBuilder() { + this(new MagnumMservice()); + } + + MserviceConcreteBuilder(MagnumMservice model) { + this.model = model; + } + + @Override + public Mservice build() { + return model; + } + + @Override + public MserviceBuilder from(Mservice in) { + if (in != null) + this.model = (MagnumMservice) in; + return this; + } + + @Override + public MserviceBuilder id(String id) { + model.id = id; + return this; + } + + @Override + public MserviceBuilder binary(String binary) { + model.binary = binary; + return this; + } + + @Override + public MserviceBuilder createdAt(String createdAt) { + model.createdAt = createdAt; + return this; + } + + @Override + public MserviceBuilder state(String state) { + model.state = state; + return this; + } + + @Override + public MserviceBuilder reportCount(int reportCount) { + model.reportCount = reportCount; + return this; + } + + @Override + public MserviceBuilder updatedAt(String updatedAt) { + model.updatedAt = updatedAt; + return this; + } + + @Override + public MserviceBuilder host(String host) { + model.host = host; + return this; + } + + @Override + public MserviceBuilder disabledReason(String disabledReason) { + model.disabledReason = disabledReason; + return this; + } + + } + + /** + * List of Magnum Services + */ + public static class Mservices extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("mservices") + protected List list; + + @Override + protected List value() { + return list; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumPod.java b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumPod.java index 15a871618..913619317 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/MagnumPod.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/MagnumPod.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.magnum; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.magnum.Label; import org.openstack4j.model.magnum.Pod; import org.openstack4j.model.magnum.PodBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class MagnumPod implements Pod { @@ -81,7 +80,6 @@ public String toString() { /** * Concrete builder containing MagnumPod as model - * */ public static class PodConcreteBuilder implements PodBuilder { MagnumPod model; diff --git a/core/src/main/java/org/openstack4j/openstack/magnum/internal/MagnumServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/magnum/internal/MagnumServiceImpl.java index f49656fa0..f2756ce09 100644 --- a/core/src/main/java/org/openstack4j/openstack/magnum/internal/MagnumServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/magnum/internal/MagnumServiceImpl.java @@ -1,48 +1,30 @@ package org.openstack4j.openstack.magnum.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.*; - - -import org.openstack4j.api.types.ServiceType; - - -import java.util.List; - import org.openstack4j.api.magnum.MagnumService; +import org.openstack4j.api.types.ServiceType; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.magnum.Bay; -import org.openstack4j.model.magnum.Baymodel; -import org.openstack4j.model.magnum.Carequest; -import org.openstack4j.model.magnum.Certificate; -import org.openstack4j.model.magnum.Cluster; -import org.openstack4j.model.magnum.Clustertemplate; -import org.openstack4j.model.magnum.Container; -import org.openstack4j.model.magnum.Mservice; -import org.openstack4j.model.magnum.Pod; +import org.openstack4j.model.magnum.*; import org.openstack4j.openstack.internal.BaseOpenStackService; -import org.openstack4j.openstack.magnum.MagnumBay; +import org.openstack4j.openstack.magnum.*; import org.openstack4j.openstack.magnum.MagnumBay.BayConcreteBuilder.Bays; -import org.openstack4j.openstack.magnum.MagnumBaymodel; import org.openstack4j.openstack.magnum.MagnumBaymodel.Baymodels; -import org.openstack4j.openstack.magnum.MagnumCertificate; -import org.openstack4j.openstack.magnum.MagnumCluster; import org.openstack4j.openstack.magnum.MagnumCluster.Clusters; -import org.openstack4j.openstack.magnum.MagnumClustertemplate; import org.openstack4j.openstack.magnum.MagnumClustertemplate.Clustertemplates; -import org.openstack4j.openstack.magnum.MagnumContainer; import org.openstack4j.openstack.magnum.MagnumContainer.Containers; import org.openstack4j.openstack.magnum.MagnumMservice.Mservices; -import org.openstack4j.openstack.magnum.MagnumPod; import org.openstack4j.openstack.magnum.MagnumPod.Pods; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.*; + /** * OpenStack Container Infrastructure Management service (Magnum) APIs - * - * @author Sohan Sangwan * + * @author Sohan Sangwan */ public class MagnumServiceImpl extends BaseOpenStackService implements MagnumService { @@ -76,12 +58,12 @@ public Baymodel showBaymodel(String id) { checkNotNull(id); return get(MagnumBaymodel.class, MAGNUM_BAYMODELS, "/", id).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Baymodel updateBaymodel(String id, String operations) { - checkNotNull(id); + checkNotNull(id); checkNotNull(operations); - return patch(MagnumBaymodel.class, MAGNUM_BAYMODELS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); + return patch(MagnumBaymodel.class, MAGNUM_BAYMODELS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); } @Override @@ -100,18 +82,18 @@ public ActionResponse deleteBay(String id) { checkNotNull(id); return deleteWithResponse(MAGNUM_BAYS, "/", id).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Bay showBay(String id) { checkNotNull(id); return get(MagnumBay.class, MAGNUM_BAYS, "/", id).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Bay updateBay(String id, String operations) { - checkNotNull(id); + checkNotNull(id); checkNotNull(operations); - return patch(MagnumBay.class, MAGNUM_BAYS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); + return patch(MagnumBay.class, MAGNUM_BAYS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); } //Containers @@ -119,28 +101,28 @@ public Bay updateBay(String id, String operations) { public List listContainers() { return get(Containers.class, uri(MAGNUM_CONTAINERS)).serviceType(ServiceType.MAGNUM).execute().getList(); } - + @Override public Container createContainer(Container container) { checkNotNull(container); return post(MagnumContainer.class, MAGNUM_CONTAINERS).serviceType(ServiceType.MAGNUM).entity(container).execute(); } - + @Override public ActionResponse deleteContainer(String uuid) { checkNotNull(uuid); return deleteWithResponse(MAGNUM_CONTAINERS, "/", uuid).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public String execCmdInContainer(String id, String cmd) { checkNotNull(id); checkNotNull(cmd); ///v1/containers/%s/execute?command=ls return put(String.class, uri("%s/execute?command=%s", MAGNUM_CONTAINERS, id, cmd)).serviceType(ServiceType.MAGNUM).execute(); - + } - + @Override public String getContainerLogs(String id) { checkNotNull(id); @@ -152,43 +134,43 @@ public Container pauseContainer(String id) { checkNotNull(id); return put(MagnumContainer.class, uri("%s/%s/pause", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Container unpauseContainer(String id) { checkNotNull(id); return put(MagnumContainer.class, uri("%s/%s/unpause", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Container rebootContainer(String id) { checkNotNull(id); - return put(MagnumContainer.class, uri("%s/%s/reboot", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); + return put(MagnumContainer.class, uri("%s/%s/reboot", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Container startContainer(String id) { checkNotNull(id); - return put(MagnumContainer.class, uri("%s/%s/start", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); + return put(MagnumContainer.class, uri("%s/%s/start", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Container stopContainer(String id) { checkNotNull(id); - return put(MagnumContainer.class, uri("%s/%s/stop", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); + return put(MagnumContainer.class, uri("%s/%s/stop", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Container showContainer(String id) { checkNotNull(id); return get(MagnumContainer.class, uri("%s/%s", MAGNUM_CONTAINERS, id)).serviceType(ServiceType.MAGNUM).execute(); } - + @Override public Container updateContainer(String id, String operations) { - checkNotNull(id); + checkNotNull(id); checkNotNull(operations); - return patch(MagnumContainer.class, MAGNUM_CONTAINERS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); - + return patch(MagnumContainer.class, MAGNUM_CONTAINERS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); + } @Override @@ -200,7 +182,7 @@ public Certificate getCertificate(String uuid) { @Override public Certificate signCertificate(Carequest ca) { checkNotNull(ca); - return post(MagnumCertificate.class, MAGNUM_CERTIFICATES).serviceType(ServiceType.MAGNUM).entity(ca).execute(); + return post(MagnumCertificate.class, MAGNUM_CERTIFICATES).serviceType(ServiceType.MAGNUM).entity(ca).execute(); } @Override @@ -208,13 +190,13 @@ public ActionResponse rotateCertificate(String uuid) { checkNotNull(uuid); return patch(ActionResponse.class, uri("%s/%s", MAGNUM_CERTIFICATES, uuid)).serviceType(ServiceType.MAGNUM).execute(); } - + //Clusters @Override public Cluster createCluster(Cluster cluster) { checkNotNull(cluster); - return post(MagnumCluster.class, MAGNUM_CLUSTERS).serviceType(ServiceType.MAGNUM).entity(cluster).execute(); + return post(MagnumCluster.class, MAGNUM_CLUSTERS).serviceType(ServiceType.MAGNUM).entity(cluster).execute(); } @Override @@ -236,17 +218,17 @@ public ActionResponse deleteCluster(String id) { @Override public Cluster updateCluster(String id, String operations) { - checkNotNull(id); + checkNotNull(id); checkNotNull(operations); - return patch(MagnumCluster.class, MAGNUM_CLUSTERS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); + return patch(MagnumCluster.class, MAGNUM_CLUSTERS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); } - + //Cluster template APIs @Override public Clustertemplate createClustertemplate(Clustertemplate template) { checkNotNull(template); - return post(MagnumClustertemplate.class, MAGNUM_CLUSTERTEMPLATES).serviceType(ServiceType.MAGNUM).entity(template).execute(); + return post(MagnumClustertemplate.class, MAGNUM_CLUSTERTEMPLATES).serviceType(ServiceType.MAGNUM).entity(template).execute(); } @Override @@ -262,9 +244,9 @@ public ActionResponse deleteClustertemplate(String id) { @Override public Clustertemplate updateClustertemplate(String id, String operations) { - checkNotNull(id); + checkNotNull(id); checkNotNull(operations); - return patch(MagnumClustertemplate.class, MAGNUM_CLUSTERTEMPLATES, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); + return patch(MagnumClustertemplate.class, MAGNUM_CLUSTERTEMPLATES, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); } @Override @@ -277,34 +259,33 @@ public List listPods(String bayUuid) { @Override public Pod createPod(Pod pod) { checkNotNull(pod); - return post(MagnumPod.class, MAGNUM_PODS).serviceType(ServiceType.MAGNUM).entity(pod).execute(); + return post(MagnumPod.class, MAGNUM_PODS).serviceType(ServiceType.MAGNUM).entity(pod).execute(); } @Override public ActionResponse deletePod(String bayUuid, String id) { checkNotNull(bayUuid); checkNotNull(id); - + // Url: '/v1/pods/%s/?bay_ident=%s' - return deleteWithResponse( uri("%s/%s/?bay_ident=%s", MAGNUM_PODS, id, bayUuid)).serviceType(ServiceType.MAGNUM).execute(); + return deleteWithResponse(uri("%s/%s/?bay_ident=%s", MAGNUM_PODS, id, bayUuid)).serviceType(ServiceType.MAGNUM).execute(); } @Override public Pod showPod(String bayUuid, String id) { - checkNotNull(bayUuid); + checkNotNull(bayUuid); checkNotNull(id); - + // Url: '/v1/pods/%s/?bay_ident=%s' - return get(MagnumPod.class, uri("%s/?bay_ident=%s", MAGNUM_PODS, bayUuid)).serviceType(ServiceType.MAGNUM).execute(); + return get(MagnumPod.class, uri("%s/?bay_ident=%s", MAGNUM_PODS, bayUuid)).serviceType(ServiceType.MAGNUM).execute(); } @Override public Pod updatePod(String bayUuid, String id, String operations) { - checkNotNull(id); + checkNotNull(id); checkNotNull(operations); - return patch(MagnumPod.class, MAGNUM_PODS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); + return patch(MagnumPod.class, MAGNUM_PODS, "/", id).serviceType(ServiceType.MAGNUM).json(operations).execute(); } - } diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaQuotaSetUpdate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaQuotaSetUpdate.java index ecb841657..299ef3872 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaQuotaSetUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaQuotaSetUpdate.java @@ -21,7 +21,8 @@ public class ManilaQuotaSetUpdate implements ModelEntity { private Integer shareNetworks; private Boolean force; - private ManilaQuotaSetUpdate() {} + private ManilaQuotaSetUpdate() { + } /** * Creates a quota set update from options. diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaSecurityServiceUpdate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaSecurityServiceUpdate.java index cda63c64b..a01c4310e 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaSecurityServiceUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaSecurityServiceUpdate.java @@ -25,7 +25,8 @@ public class ManilaSecurityServiceUpdate implements ModelEntity { private String domain; private String server; - private ManilaSecurityServiceUpdate() {} + private ManilaSecurityServiceUpdate() { + } /** * Creates a security service from options. diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareCreate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareCreate.java index f47f55a04..3b76fdeb6 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareCreate.java @@ -17,7 +17,7 @@ @JsonRootName("share") public class ManilaShareCreate implements ShareCreate { private static final long serialVersionUID = 1L; - + @JsonProperty("share_proto") private Share.Protocol shareProto; private Integer size; @@ -34,7 +34,7 @@ public class ManilaShareCreate implements ShareCreate { @JsonProperty("snapshot_id") private String snapshotId; @JsonProperty("is_public") - private Boolean isPublic ; + private Boolean isPublic; private Map metadata; @JsonProperty("share_network_id") private String shareNetworkId; @@ -154,16 +154,16 @@ public String getConsistencyGroupId() { public String getAvailabilityZone() { return availabilityZone; } - + public static ShareCreateBuilder builder() { return new ShareCreateConcreteBuilder(); } - + @Override public ShareCreateBuilder toBuilder() { return new ShareCreateConcreteBuilder(this); } - + public static class ShareCreateConcreteBuilder implements ShareCreateBuilder { ManilaShareCreate shareCreate; diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareManage.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareManage.java index 7875bd343..bcae861e7 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareManage.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareManage.java @@ -71,7 +71,7 @@ public static ShareManageBuilder builder() { public ShareManageBuilder toBuilder() { return new ShareManageConcreteBuilder(this); } - + public static class ShareManageConcreteBuilder implements ShareManageBuilder { ManilaShareManage shareManage; diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkCreate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkCreate.java index 66658daab..afcdabd69 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkCreate.java @@ -21,7 +21,8 @@ public class ManilaShareNetworkCreate implements ShareNetworkCreate { private String name; private String description; - private ManilaShareNetworkCreate() {} + private ManilaShareNetworkCreate() { + } /** * {@inheritDoc} @@ -66,6 +67,7 @@ public String getDescription() { public static ShareNetworkCreateBuilder builder() { return new ShareNetworkCreateConcreteBuilder(); } + @Override public ShareNetworkCreateBuilder toBuilder() { return new ShareNetworkCreateConcreteBuilder(this); diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkUpdate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkUpdate.java index 1ddac89ab..49ea03532 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareNetworkUpdate.java @@ -16,7 +16,8 @@ public class ManilaShareNetworkUpdate implements ModelEntity { private String name; private String description; - private ManilaShareNetworkUpdate() {} + private ManilaShareNetworkUpdate() { + } /** * Creates a share network from options. diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotCreate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotCreate.java index b07e1cf2f..d543b6a9f 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotCreate.java @@ -73,11 +73,12 @@ public String getDisplayDescription() { public static ShareSnapshotCreateBuilder builder() { return new ShareSnapshotCreateConcreteBuilder(); } + @Override public ShareSnapshotCreateBuilder toBuilder() { return new ShareSnapshotCreateConcreteBuilder(this); } - + public static class ShareSnapshotCreateConcreteBuilder implements ShareSnapshotCreateBuilder { ManilaShareSnapshotCreate shareSnapshotCreate; diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotUpdate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotUpdate.java index 0c73a6ce2..d38e05952 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareSnapshotUpdate.java @@ -19,7 +19,8 @@ public class ManilaShareSnapshotUpdate implements ModelEntity { @JsonProperty("display_description") private String displayDescription; - private ManilaShareSnapshotUpdate() {} + private ManilaShareSnapshotUpdate() { + } public static ManilaShareSnapshotUpdate fromOptions(ShareSnapshotUpdateOptions options) { ManilaShareSnapshotUpdate shareSnapshotUpdate = new ManilaShareSnapshotUpdate(); diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareTypeCreate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareTypeCreate.java index a6f87828c..4d099482c 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareTypeCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareTypeCreate.java @@ -21,7 +21,7 @@ public class ManilaShareTypeCreate implements ShareTypeCreate { @JsonProperty("os-share-type-access:is_public") Boolean osShareTypeAccessIsPublic; String name; - + @Override public ExtraSpecs getExtraSpecs() { return extraSpecs; @@ -45,14 +45,14 @@ public static ShareTypeCreateBuilder builder() { public ShareTypeCreateBuilder toBuilder() { return new ShareTypeCreateConcreteBuilder(this); } - + public static class ShareTypeCreateConcreteBuilder implements ShareTypeCreateBuilder { ManilaShareTypeCreate shareTypeCreate; - + public ShareTypeCreateConcreteBuilder() { this(new ManilaShareTypeCreate()); } - + public ShareTypeCreateConcreteBuilder(ManilaShareTypeCreate shareTypeCreate) { this.shareTypeCreate = shareTypeCreate; } @@ -62,7 +62,7 @@ public ShareTypeCreateBuilder addExtraSpec(String key, String value) { if (shareTypeCreate.extraSpecs == null) shareTypeCreate.extraSpecs = ExtraSpecs.toExtraSpecs( Maps.newHashMap()); - + shareTypeCreate.extraSpecs.put(key, value); return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareUpdate.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareUpdate.java index a8d65b31e..8ecf35ac0 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/ManilaShareUpdate.java @@ -21,7 +21,8 @@ public class ManilaShareUpdate implements ModelEntity { @JsonProperty("is_public") private Boolean isPublic; - private ManilaShareUpdate() {} + private ManilaShareUpdate() { + } public static ManilaShareUpdate fromOptions(ShareUpdateOptions options) { ManilaShareUpdate shareUpdate = new ManilaShareUpdate(); diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/SecurityServiceAction.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/SecurityServiceAction.java index 91486a2a5..9a186be31 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/SecurityServiceAction.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/SecurityServiceAction.java @@ -9,7 +9,7 @@ * * @author Daniel Gonzalez Nothnagel */ -public class SecurityServiceAction implements ModelEntity { +public class SecurityServiceAction implements ModelEntity { private static final long serialVersionUID = 1L; @JsonProperty("security_service_id") diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareAction.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareAction.java index a7bbc6a96..c1cab0c0c 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareAction.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareAction.java @@ -7,4 +7,5 @@ * * @author Daniel Gonzalez Nothnagel */ -public interface ShareAction extends ModelEntity {} +public interface ShareAction extends ModelEntity { +} diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareActions.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareActions.java index 138ee4700..558c73827 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareActions.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareActions.java @@ -11,14 +11,17 @@ */ public final class ShareActions { @JsonRootName("os-access_list") - public static class ListAccessRulesAction implements ShareAction {} + public static class ListAccessRulesAction implements ShareAction { + } @JsonRootName("os-force_delete") - public static class ForceDeleteAction implements ShareAction {} + public static class ForceDeleteAction implements ShareAction { + } public static GrantAccessAction grantAccess(AccessOptions options) { return new GrantAccessAction(options.getAccessLevel(), options.getAccessType(), options.getAccessTo()); } + public static RevokeAccessAction revokeAccess(String accessId) { return new RevokeAccessAction(accessId); } diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareInstanceActions.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareInstanceActions.java index 94955c444..0d6fb301d 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareInstanceActions.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareInstanceActions.java @@ -24,7 +24,8 @@ public ShareInstance.Status getStatus() { } @JsonRootName("os-force_delete") - public static class ForceDeleteAction implements ModelEntity {} + public static class ForceDeleteAction implements ModelEntity { + } public static ResetStateAction resetState(ShareInstance.Status status) { return new ResetStateAction(status); diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotAction.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotAction.java index 8fc874dd2..b8b61463f 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotAction.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotAction.java @@ -7,4 +7,5 @@ * * @author Daniel Gonzalez Nothnagel */ -public interface ShareSnapshotAction extends ModelEntity {} +public interface ShareSnapshotAction extends ModelEntity { +} diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotActions.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotActions.java index 4a03cbf48..78d7f19d4 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotActions.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareSnapshotActions.java @@ -23,7 +23,8 @@ public ShareSnapshot.Status getStatus() { } @JsonRootName("os-force_delete") - public static class ForceDeleteAction implements ShareSnapshotAction {} + public static class ForceDeleteAction implements ShareSnapshotAction { + } public static ResetStateAction resetState(ShareSnapshot.Status status) { return new ResetStateAction(status); diff --git a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareTypeAction.java b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareTypeAction.java index babad39b3..d02f00776 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareTypeAction.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/domain/actions/ShareTypeAction.java @@ -7,4 +7,5 @@ * * @author Daniel Gonzalez Nothnagel */ -public interface ShareTypeAction extends ModelEntity {} +public interface ShareTypeAction extends ModelEntity { +} diff --git a/core/src/main/java/org/openstack4j/openstack/manila/internal/SchedulerStatsServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/manila/internal/SchedulerStatsServiceImpl.java index 89521119c..c49fdf3a8 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/internal/SchedulerStatsServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/internal/SchedulerStatsServiceImpl.java @@ -18,7 +18,7 @@ public List poolsDetail() { } private List list(boolean detail) { - return get(ManilaBackendStoragePool.BackendStoragePools.class, uri("/scheduler-stats/pools" + (detail ? "/detail" : ""))) + return get(ManilaBackendStoragePool.BackendStoragePools.class, uri("/scheduler-stats/pools" + (detail ? "/detail" : ""))) .execute() .getList(); } diff --git a/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareServiceImpl.java index 81cfbd7e9..1c81835f0 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareServiceImpl.java @@ -2,8 +2,8 @@ import org.openstack4j.api.Apis; import org.openstack4j.api.manila.*; -import org.openstack4j.model.common.Extension; import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.common.Extension; import org.openstack4j.model.manila.*; import org.openstack4j.openstack.common.ExtensionValue; import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; diff --git a/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareSnapshotServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareSnapshotServiceImpl.java index 01e7aa1cb..07183e6e7 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareSnapshotServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareSnapshotServiceImpl.java @@ -35,7 +35,7 @@ public List listDetails() { } private List list(boolean detail) { - return get(ManilaShareSnapshot.ShareSnapshots.class, uri("/snapshots" + (detail ? "/detail" : ""))) + return get(ManilaShareSnapshot.ShareSnapshots.class, uri("/snapshots" + (detail ? "/detail" : ""))) .execute() .getList(); } @@ -81,7 +81,7 @@ public ActionResponse forceDelete(String snapshotId) { * Invoke the action on the given snapshot. * * @param snapshotId the snapshot ID - * @param action the action to invoke + * @param action the action to invoke * @return the action response of the server */ private ActionResponse invokeAction(String snapshotId, ShareSnapshotAction action) { diff --git a/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareTypeServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareTypeServiceImpl.java index 0eca4fde0..4be56539b 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareTypeServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/internal/ShareTypeServiceImpl.java @@ -135,7 +135,7 @@ public ActionResponse removeShareTypeAccess(String shareTypeId, String projectId * Invoke the action on the given share type. * * @param shareTypeId the share type ID - * @param action the action to invoke + * @param action the action to invoke * @return the action response of the server */ private ActionResponse invokeAction(String shareTypeId, ShareTypeAction action) { diff --git a/core/src/main/java/org/openstack4j/openstack/manila/internal/SharesServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/manila/internal/SharesServiceImpl.java index b09922d29..432e3d0d1 100644 --- a/core/src/main/java/org/openstack4j/openstack/manila/internal/SharesServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/manila/internal/SharesServiceImpl.java @@ -51,7 +51,7 @@ public List listDetails() { } private List list(boolean detail) { - return get(ManilaShare.Shares.class, uri("/shares" + (detail ? "/detail" : ""))) + return get(ManilaShare.Shares.class, uri("/shares" + (detail ? "/detail" : ""))) .execute() .getList(); } @@ -217,9 +217,9 @@ public ActionResponse shrink(String shareId, int newSize) { * Invoke the action on teh given share and unserialize the response body into the given return type. * * @param returnType the return type to unserialize to - * @param shareId the share ID - * @param action the action to invoke - * @param The type of the return type + * @param shareId the share ID + * @param action the action to invoke + * @param The type of the return type * @return the unserialized response body of the server */ private R invokeAction(Class returnType, String shareId, ShareAction action) { @@ -232,7 +232,7 @@ private R invokeAction(Class returnType, String shareId, ShareAction acti * Invoke the action on the given share. * * @param shareId the share ID - * @param action the action to invoke + * @param action the action to invoke * @return the action response of the server */ private ActionResponse invokeAction(String shareId, ShareAction action) { diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/builder/MuranoBuilders.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/builder/MuranoBuilders.java index 811c1741c..03e9137b5 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/builder/MuranoBuilders.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/builder/MuranoBuilders.java @@ -1,7 +1,7 @@ package org.openstack4j.openstack.murano.v1.builder; -import org.openstack4j.model.murano.v1.builder.EnvironmentBuilder; import org.openstack4j.model.murano.v1.builder.AppCatalogBuilders; +import org.openstack4j.model.murano.v1.builder.EnvironmentBuilder; import org.openstack4j.openstack.murano.v1.domain.MuranoEnvironment; /** diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoActionInfo.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoActionInfo.java index ec100e6b0..b7373b582 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoActionInfo.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoActionInfo.java @@ -1,7 +1,6 @@ package org.openstack4j.openstack.murano.v1.domain; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; import org.openstack4j.model.murano.v1.domain.ActionInfo; /** diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoApplication.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoApplication.java index 54c143b64..746e3665b 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoApplication.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoApplication.java @@ -1,6 +1,9 @@ package org.openstack4j.openstack.murano.v1.domain; -import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIdentityInfo; +import com.fasterxml.jackson.annotation.JsonIdentityReference; +import com.fasterxml.jackson.annotation.ObjectIdGenerators; import com.fasterxml.jackson.databind.ObjectMapper; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.murano.v1.domain.Application; @@ -16,23 +19,23 @@ * This is needed to serialize only property "data" without key "data" itself. * I.e. get output: * { - * "instance": { - * ... - * }, - * "name": "MyApp", - * ... + * "instance": { + * ... + * }, + * "name": "MyApp", + * ... * } - * + *

* instead of: - * + *

* { - * "data": { - * "instance": { - * ... - * }, - * "name": "MyApp", - * ... - * } + * "data": { + * "instance": { + * ... + * }, + * "name": "MyApp", + * ... + * } * } */ @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "data") @@ -100,16 +103,16 @@ public MuranoServiceInfo getService() { * It wrappers an ArrayList class to serialize without * the list key itself: * [ - * {"key": "value"}, - * {"key": "value2"} + * {"key": "value"}, + * {"key": "value2"} * ] - * + *

* instead of: * { - * "list_key": [ - * {"key": "value"}, - * {"key": "value2"} - * ] + * "list_key": [ + * {"key": "value"}, + * {"key": "value2"} + * ] * } */ public static class ApplicationList extends ArrayList implements ModelEntity { diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoDeployment.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoDeployment.java index dff429d31..b2433e150 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoDeployment.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoDeployment.java @@ -43,6 +43,7 @@ public class MuranoDeployment implements Deployment { @JsonProperty private MuranoDeploymentResult result; + /** * {@inheritDoc} */ diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoEnvironment.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoEnvironment.java index 5d6620438..fd3843c93 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoEnvironment.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoEnvironment.java @@ -3,10 +3,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import org.openstack4j.model.murano.v1.builder.EnvironmentBuilder; -import org.openstack4j.model.murano.v1.domain.Application; import org.openstack4j.model.murano.v1.domain.Environment; import org.openstack4j.openstack.common.ListResult; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; import java.util.List; @@ -130,7 +128,7 @@ public static EnvironmentBuilder builder() { return new MuranoEnvironmentConcreteBuilder(); } - public static class MuranoEnvironmentConcreteBuilder implements EnvironmentBuilder{ + public static class MuranoEnvironmentConcreteBuilder implements EnvironmentBuilder { private MuranoEnvironment model; diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoServiceInfo.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoServiceInfo.java index 435cc58f0..975950199 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoServiceInfo.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/domain/MuranoServiceInfo.java @@ -1,6 +1,8 @@ package org.openstack4j.openstack.murano.v1.domain; -import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; import org.openstack4j.model.murano.v1.domain.ServiceInfo; @@ -11,7 +13,7 @@ /** * @author Nikolay Mahotkin. */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class MuranoServiceInfo implements ServiceInfo { private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/BaseMuranoServices.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/BaseMuranoServices.java index c203a482a..d641c8eb1 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/BaseMuranoServices.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/BaseMuranoServices.java @@ -9,7 +9,6 @@ * the correct endpoint (url) for murano calls. * * @author Nikolay Makhotkin - * */ class BaseMuranoServices extends BaseOpenStackService { diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoActionServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoActionServiceImpl.java index 93a796cfb..bda1f206a 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoActionServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoActionServiceImpl.java @@ -137,7 +137,7 @@ public String cast(String envId, String actionId, Map arguments) .entity(entity) .execute(); - return (String)result.get("task_id"); + return (String) result.get("task_id"); } /** diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoApplicationServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoApplicationServiceImpl.java index 88f419124..b77b5cc47 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoApplicationServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoApplicationServiceImpl.java @@ -23,8 +23,8 @@ public List list(String environmentId, String sessionId) Invocation invocation; invocation = get( - MuranoApplication.ApplicationList.class, - uri("/environments/%s/services", environmentId) + MuranoApplication.ApplicationList.class, + uri("/environments/%s/services", environmentId) ); if (sessionId != null) { @@ -50,8 +50,8 @@ public List get(String environmentId, String path, String Invocation invocation; invocation = get( - JsonNode.class, - uri("/environments/%s/services/%s", environmentId, path) + JsonNode.class, + uri("/environments/%s/services/%s", environmentId, path) ); if (sessionId != null) { @@ -80,8 +80,8 @@ public Application create(String environmentId, String sessionId, Map invocation; invocation = post(MuranoApplication.class, uri("/environments/%s/services//", environmentId)) - .header("X-Configuration-Session", sessionId) - .entity(entity); + .header("X-Configuration-Session", sessionId) + .entity(entity); return invocation.execute(); } @@ -95,8 +95,8 @@ public List create(String environmentId, String sessionId MuranoApplication.ApplicationList toCreate = MuranoApplicationUtils.toApplications(jsonString); invocation = post(MuranoApplication.ApplicationList.class, uri("/environments/%s/services//", environmentId)) - .header("X-Configuration-Session", sessionId) - .entity(toCreate); + .header("X-Configuration-Session", sessionId) + .entity(toCreate); return invocation.execute(); } @@ -112,8 +112,8 @@ public Application update(String environmentId, String sessionId, Map invocation; invocation = put(MuranoApplication.class, uri("/environments/%s/services//", environmentId)) - .header("X-Configuration-Session", sessionId) - .entity(entity); + .header("X-Configuration-Session", sessionId) + .entity(entity); return invocation.execute(); } @@ -127,8 +127,8 @@ public List update(String environmentId, String sessionId MuranoApplication.ApplicationList toUpdate = MuranoApplicationUtils.toApplications(jsonString); invocation = put(MuranoApplication.ApplicationList.class, uri("/environments/%s/services//", environmentId)) - .header("X-Configuration-Session", sessionId) - .entity(toUpdate); + .header("X-Configuration-Session", sessionId) + .entity(toUpdate); return invocation.execute(); } @@ -139,7 +139,7 @@ public List update(String environmentId, String sessionId @Override public ActionResponse delete(String environmentId, String path, String sessionId) { return deleteWithResponse(uri("/environments/%s/services/%s", environmentId, path)) - .header("X-Configuration-Session", sessionId) - .execute(); + .header("X-Configuration-Session", sessionId) + .execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoDeploymentServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoDeploymentServiceImpl.java index d81859f53..bf4c7cad1 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoDeploymentServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoDeploymentServiceImpl.java @@ -19,8 +19,8 @@ public class MuranoDeploymentServiceImpl extends BaseMuranoServices implements M @Override public List list(String environmentId) { return get( - MuranoDeployment.MuranoDeployments.class, - uri("/environments/%s/deployments", environmentId) + MuranoDeployment.MuranoDeployments.class, + uri("/environments/%s/deployments", environmentId) ).execute().getList(); } diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoEnvironmentServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoEnvironmentServiceImpl.java index f609c8af0..b3fa1dc4b 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoEnvironmentServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoEnvironmentServiceImpl.java @@ -11,11 +11,10 @@ import static com.google.common.base.Preconditions.checkNotNull; /** -* This class implements all methods for manipulation of {@link MuranoEnvironment} objects. -* -* @author Nikolay Mahotkin -* -*/ + * This class implements all methods for manipulation of {@link MuranoEnvironment} objects. + * + * @author Nikolay Mahotkin + */ public class MuranoEnvironmentServiceImpl extends BaseMuranoServices implements MuranoEnvironmentService { /** diff --git a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoSessionServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoSessionServiceImpl.java index 5c620f6bf..da2ff7f6c 100644 --- a/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoSessionServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/murano/v1/internal/MuranoSessionServiceImpl.java @@ -1,9 +1,7 @@ package org.openstack4j.openstack.murano.v1.internal; import org.openstack4j.api.murano.v1.MuranoSessionService; -import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.murano.v1.domain.AppCatalogSession; import org.openstack4j.openstack.murano.v1.domain.MuranoEnvironment; import org.openstack4j.openstack.murano.v1.domain.MuranoSession; @@ -13,7 +11,6 @@ * This class implements all methods for manipulation of {@link MuranoEnvironment} objects. * * @author Nikolay Mahotkin - * */ public class MuranoSessionServiceImpl extends BaseMuranoServices implements MuranoSessionService { /** diff --git a/core/src/main/java/org/openstack4j/openstack/networking/builder/NeutronBuilders.java b/core/src/main/java/org/openstack4j/openstack/networking/builder/NeutronBuilders.java index 734e5f4d9..a81892b53 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/builder/NeutronBuilders.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/builder/NeutronBuilders.java @@ -141,53 +141,53 @@ public HealthMonitorAssociateBuilder lbPoolAssociateHealthMonitor() { } @Override - public MemberV2Builder memberV2(){ + public MemberV2Builder memberV2() { return NeutronMemberV2.builder(); } @Override - public MemberV2UpdateBuilder memberV2Update(){ + public MemberV2UpdateBuilder memberV2Update() { return NeutronMemberV2Update.builder(); } @Override - public LoadBalancerV2Builder lbV2(){ + public LoadBalancerV2Builder lbV2() { return NeutronLoadBalancerV2.builder(); } @Override - public LoadBalancerV2UpdateBuilder loadBalancerV2Update(){ + public LoadBalancerV2UpdateBuilder loadBalancerV2Update() { return NeutronLoadBalancerV2Update.builder(); } @Override - public HealthMonitorV2Builder healthMonitorV2(){ + public HealthMonitorV2Builder healthMonitorV2() { return NeutronHealthMonitorV2.builder(); } @Override - public HealthMonitorV2UpdateBuilder healthMonitorV2Update(){ + public HealthMonitorV2UpdateBuilder healthMonitorV2Update() { return NeutronHealthMonitorV2Update.builder(); } @Override - public LbPoolV2Builder lbPoolV2(){ + public LbPoolV2Builder lbPoolV2() { return NeutronLbPoolV2.builder(); } @Override - public LbPoolV2UpdateBuilder lbPoolV2Update(){ + public LbPoolV2UpdateBuilder lbPoolV2Update() { return NeutronLbPoolV2Update.builder(); } @Override - public ListenerV2Builder listenerV2(){ + public ListenerV2Builder listenerV2() { return NeutronListenerV2.builder(); } @Override - public ListenerV2UpdateBuilder listenerV2Update(){ + public ListenerV2UpdateBuilder listenerV2Update() { return NeutronListenerV2Update.builder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/AddRouterInterfaceAction.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/AddRouterInterfaceAction.java index 9ace9604f..d79fe762b 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/AddRouterInterfaceAction.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/AddRouterInterfaceAction.java @@ -1,23 +1,22 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.network.AttachInterfaceType; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import org.openstack4j.model.ModelEntity; +import org.openstack4j.model.network.AttachInterfaceType; /** * Adds a Router Interface based on a Port or Subnet identifier - * + * * @author Jeremy Unruh */ public class AddRouterInterfaceAction implements ModelEntity { private static final long serialVersionUID = 1L; - + @JsonProperty("port_id") private String portId; - + @JsonProperty("subnet_id") private String subnetId; @@ -29,15 +28,15 @@ public static AddRouterInterfaceAction create(AttachInterfaceType type, String p action.subnetId = portOrSubnetId; return action; } - + @JsonIgnore public String getPortId() { return portId; } - + @JsonIgnore public String getSubnetId() { return subnetId; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAgent.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAgent.java index b8a59a44b..610da9586 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAgent.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAgent.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.networking.domain; -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.Agent; import org.openstack4j.model.network.builder.AgentBuilder; import org.openstack4j.openstack.common.ListResult; import org.openstack4j.openstack.internal.Parser; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.Date; +import java.util.List; /** * Neutron Agent diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAllowedAddressPair.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAllowedAddressPair.java index be66641de..7d2d1b347 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAllowedAddressPair.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAllowedAddressPair.java @@ -1,9 +1,8 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.network.AllowedAddressPair; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.AllowedAddressPair; /** * A Fixed IP Address @@ -12,41 +11,42 @@ */ public class NeutronAllowedAddressPair implements AllowedAddressPair { - private static final long serialVersionUID = 1L; - - @JsonProperty("ip_address") - private String ipAddress; - - @JsonProperty("mac_address") - private String macAddress; - - public NeutronAllowedAddressPair() { } - - public NeutronAllowedAddressPair(String ipAddress, String macAddress) { - this.ipAddress = ipAddress; - this.macAddress = macAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public String getIpAddress() { - return ipAddress; - } - - @Override - public String getMacAddress() { - return macAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("ipAddress", ipAddress).add("macAddress", macAddress).toString(); - } + private static final long serialVersionUID = 1L; + + @JsonProperty("ip_address") + private String ipAddress; + + @JsonProperty("mac_address") + private String macAddress; + + public NeutronAllowedAddressPair() { + } + + public NeutronAllowedAddressPair(String ipAddress, String macAddress) { + this.ipAddress = ipAddress; + this.macAddress = macAddress; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIpAddress() { + return ipAddress; + } + + @Override + public String getMacAddress() { + return macAddress; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("ipAddress", ipAddress).add("macAddress", macAddress).toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java index a5058760d..16c9617c6 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java @@ -1,14 +1,12 @@ package org.openstack4j.openstack.networking.domain; -import java.util.List; - -import org.openstack4j.model.network.AvailabilityZone; -import org.openstack4j.model.network.Pool; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.AvailabilityZone; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * An availability zone groups network nodes that run services like DHCP, L3, FW, and others. @@ -18,86 +16,87 @@ @JsonRootName("availability_zones") public class NeutronAvailabilityZone implements AvailabilityZone { - private static final long serialVersionUID = 1L; - - private String state; - private String resource; - private String name; - - public NeutronAvailabilityZone() { } - - /** - * {@inheritDoc} - */ - @Override - public String getState() { - return state; - } - - /** - * {@inheritDoc} - */ - @Override - public String getResource() { - return resource; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues().add("state", state).add("resource", resource).add("name", name).toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return java.util.Objects.hash(state, resource, name); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - - if (obj instanceof NeutronAvailabilityZone) { - NeutronAvailabilityZone that = (NeutronAvailabilityZone) obj; - if (java.util.Objects.equals(state, that.state) && - java.util.Objects.equals(resource, that.resource) && - java.util.Objects.equals(name, that.name)) { - return true; - } - } - return false; - } - - public static class AvailabilityZones extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("availability_zones") - private List availabilityZones; - - @Override - protected List value() { - return availabilityZones; - } - } + private static final long serialVersionUID = 1L; + + private String state; + private String resource; + private String name; + + public NeutronAvailabilityZone() { + } + + /** + * {@inheritDoc} + */ + @Override + public String getState() { + return state; + } + + /** + * {@inheritDoc} + */ + @Override + public String getResource() { + return resource; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("state", state).add("resource", resource).add("name", name).toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return java.util.Objects.hash(state, resource, name); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj instanceof NeutronAvailabilityZone) { + NeutronAvailabilityZone that = (NeutronAvailabilityZone) obj; + if (java.util.Objects.equals(state, that.state) && + java.util.Objects.equals(resource, that.resource) && + java.util.Objects.equals(name, that.name)) { + return true; + } + } + return false; + } + + public static class AvailabilityZones extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("availability_zones") + private List availabilityZones; + + @Override + protected List value() { + return availabilityZones; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExternalGateway.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExternalGateway.java index 5cca29cb4..75b96692e 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExternalGateway.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExternalGateway.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.network.ExternalGateway; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ExternalGateway; /** * Configurable external gateway modes extension model. By default, when a gateway is attached to a router using the Neutron L3 extension, @@ -16,49 +15,50 @@ */ public class NeutronExternalGateway implements ExternalGateway { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("network_id") - private String networkId; + @JsonProperty("network_id") + private String networkId; - @JsonProperty("enable_snat") - private Boolean enableSnat; + @JsonProperty("enable_snat") + private Boolean enableSnat; - public NeutronExternalGateway() { } + public NeutronExternalGateway() { + } - public NeutronExternalGateway(String networkId) { - this(networkId, Boolean.TRUE); - } + public NeutronExternalGateway(String networkId) { + this(networkId, Boolean.TRUE); + } - public NeutronExternalGateway(String networkId, Boolean enableSnat) { - this.networkId = networkId; - this.enableSnat = enableSnat; - } + public NeutronExternalGateway(String networkId, Boolean enableSnat) { + this.networkId = networkId; + this.enableSnat = enableSnat; + } - /** - * {@inheritDoc} - */ - @Override - public String getNetworkId() { - return networkId; - } + /** + * {@inheritDoc} + */ + @Override + public String getNetworkId() { + return networkId; + } - /** - * {@inheritDoc} - */ - @JsonIgnore - @Override - public boolean isEnableSnat() { - return enableSnat != null && enableSnat; - } + /** + * {@inheritDoc} + */ + @JsonIgnore + @Override + public boolean isEnableSnat() { + return enableSnat != null && enableSnat; + } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("networkId", networkId).add("enable_snat", enableSnat).toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("networkId", networkId).add("enable_snat", enableSnat).toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExtraDhcpOptCreate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExtraDhcpOptCreate.java index 45e6a93fd..7bea3a2f1 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExtraDhcpOptCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExtraDhcpOptCreate.java @@ -1,23 +1,21 @@ package org.openstack4j.openstack.networking.domain; +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.network.ExtraDhcpOptCreate; import org.openstack4j.model.network.builder.ExtraDhcpOptBuilder; -import com.fasterxml.jackson.annotation.JsonProperty; - /** - * * @author Ales Kemr */ public class NeutronExtraDhcpOptCreate implements ExtraDhcpOptCreate { // {"opt_value": "testfile.1", "opt_name": "bootfile-name"} - + @JsonProperty("opt_value") public String opt_value; @JsonProperty("opt_name") public String opt_name; - + @Override public String getOptValue() { return opt_value; @@ -36,7 +34,7 @@ public static NeutronExtraDhcpOptBuilder builder() { public ExtraDhcpOptBuilder toBuilder() { return new NeutronExtraDhcpOptBuilder(this); } - + public static class NeutronExtraDhcpOptBuilder implements ExtraDhcpOptBuilder { NeutronExtraDhcpOptCreate create; @@ -44,7 +42,7 @@ public static class NeutronExtraDhcpOptBuilder implements ExtraDhcpOptBuilder { public NeutronExtraDhcpOptBuilder(NeutronExtraDhcpOptCreate create) { this.create = create; } - + @Override public ExtraDhcpOptBuilder optValue(String optValue) { create.opt_value = optValue; @@ -66,6 +64,6 @@ public ExtraDhcpOptCreate build() { public ExtraDhcpOptBuilder from(ExtraDhcpOptCreate in) { return new NeutronExtraDhcpOptBuilder((NeutronExtraDhcpOptCreate) in); } - + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java index 0174082f5..026d247ee 100755 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.networking.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.NetFloatingIP; import org.openstack4j.model.network.builder.NetFloatingIPBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * An OpenStack Neutron Floating IP Model. @@ -18,297 +17,295 @@ @JsonRootName("floatingip") public class NeutronFloatingIP implements NetFloatingIP { - private static final long serialVersionUID = 1L; - - @JsonProperty("id") - private String id; - - @JsonProperty("router_id") - private String routerId; - - @JsonProperty("tenant_id") - private String tenantId; - - @JsonProperty("floating_network_id") - private String floatingNetworkId; - - @JsonProperty("floating_ip_address") - private String floatingIpAddress; - - @JsonProperty("fixed_ip_address") - private String fixedIpAddress; - - @JsonProperty("port_id") - private String portId; - - private String status; - - /** - * {@inheritDoc} - */ - @Override - public NetFloatingIPBuilder toBuilder() { - return new FloatingIPConcreteBuilder(this); - } - - /** - * Builder. - * - * @return the net floating ip builder - */ - public static NetFloatingIPBuilder builder() { - return new FloatingIPConcreteBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getRouterId() { - return this.routerId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return this.tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFloatingNetworkId() { - return this.floatingNetworkId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFloatingIpAddress() { - return this.floatingIpAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFixedIpAddress() { - return this.fixedIpAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPortId() { - return this.portId; - } - - /** - * {@inheritDoc} - */ - public void setId(String id) { - this.id = id; - } - - /** - * {@inheritDoc} - */ - public void setRouterId(String routerId) { - this.routerId = routerId; - } - - /** - * {@inheritDoc} - */ - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - /** - * {@inheritDoc} - */ - public void setFloatingNetworkId(String floatingNetworkId) { - this.floatingNetworkId = floatingNetworkId; - } - - /** - * {@inheritDoc} - */ - public void setFloatingIpAddress(String floatingIpAddress) { - this.floatingIpAddress = floatingIpAddress; - } - - /** - * {@inheritDoc} - */ - public void setFixedIpAddress(String fixedIpAddress) { - this.fixedIpAddress = fixedIpAddress; - } - - /** - * {@inheritDoc} - */ - public void setPortId(String portId) { - this.portId = portId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - public void setStatus(String status) { - this.status = status; - } + private static final long serialVersionUID = 1L; + + @JsonProperty("id") + private String id; -/** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("routerId", routerId).add("tenantId", tenantId).add("floatingNetworkId", floatingNetworkId) - .add("floatingIpAddress", floatingIpAddress).add("fixedIpAddress", fixedIpAddress).add("portId", portId).add("status", status) - .addValue("\n") - .toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return java.util.Objects.hash(id, routerId, tenantId, floatingNetworkId, - floatingIpAddress, fixedIpAddress, portId, status); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; + @JsonProperty("router_id") + private String routerId; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("floating_network_id") + private String floatingNetworkId; + + @JsonProperty("floating_ip_address") + private String floatingIpAddress; + + @JsonProperty("fixed_ip_address") + private String fixedIpAddress; + + @JsonProperty("port_id") + private String portId; + + private String status; + + /** + * {@inheritDoc} + */ + @Override + public NetFloatingIPBuilder toBuilder() { + return new FloatingIPConcreteBuilder(this); + } + + /** + * Builder. + * + * @return the net floating ip builder + */ + public static NetFloatingIPBuilder builder() { + return new FloatingIPConcreteBuilder(); } - if (obj instanceof NeutronFloatingIP) { - NeutronFloatingIP that = (NeutronFloatingIP) obj; - if (java.util.Objects.equals(id, that.id) && - java.util.Objects.equals(routerId, that.routerId) && - java.util.Objects.equals(tenantId, that.tenantId) && - java.util.Objects.equals(floatingNetworkId, that.floatingNetworkId) && - java.util.Objects.equals(floatingIpAddress, that.floatingIpAddress) && - java.util.Objects.equals(fixedIpAddress, that.fixedIpAddress) && - java.util.Objects.equals(portId, that.portId) && - java.util.Objects.equals(status, that.status)) { - return true; - } + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return this.id; } - return false; - } - /** - * The Class FloatingIPs. - * - * - * @author Nathan Anderson - */ - public static class FloatingIPs extends ListResult { + /** + * {@inheritDoc} + */ + @Override + public String getRouterId() { + return this.routerId; + } - private static final long serialVersionUID = 1L; + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return this.tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFloatingNetworkId() { + return this.floatingNetworkId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFloatingIpAddress() { + return this.floatingIpAddress; + } - @JsonProperty("floatingips") - private List floatingIps; + /** + * {@inheritDoc} + */ + @Override + public String getFixedIpAddress() { + return this.fixedIpAddress; + } /** * {@inheritDoc} */ @Override - protected List value() { - return floatingIps; + public String getPortId() { + return this.portId; + } + + /** + * {@inheritDoc} + */ + public void setId(String id) { + this.id = id; } - } - /** - * The Class FloatingIPConcreteBuilder. - * - * - * @author Nathan Anderson - */ - public static class FloatingIPConcreteBuilder implements NetFloatingIPBuilder { + /** + * {@inheritDoc} + */ + public void setRouterId(String routerId) { + this.routerId = routerId; + } - private NeutronFloatingIP f = null; + /** + * {@inheritDoc} + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } /** - * Instantiates a new floating ip concrete builder. + * {@inheritDoc} */ - public FloatingIPConcreteBuilder() { - f = new NeutronFloatingIP(); + public void setFloatingNetworkId(String floatingNetworkId) { + this.floatingNetworkId = floatingNetworkId; } /** - * Instantiates a new floating ip concrete builder. - * - * @param in the in + * {@inheritDoc} + */ + public void setFloatingIpAddress(String floatingIpAddress) { + this.floatingIpAddress = floatingIpAddress; + } + + /** + * {@inheritDoc} */ - public FloatingIPConcreteBuilder(NetFloatingIP in) { - f = (NeutronFloatingIP) in; + public void setFixedIpAddress(String fixedIpAddress) { + this.fixedIpAddress = fixedIpAddress; + } + + /** + * {@inheritDoc} + */ + public void setPortId(String portId) { + this.portId = portId; } /** * {@inheritDoc} */ @Override - public NetFloatingIP build() { - return f; + public String getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + public void setStatus(String status) { + this.status = status; } /** * {@inheritDoc} */ @Override - public NetFloatingIPBuilder from(NetFloatingIP in) { - f = (NeutronFloatingIP) in; - return this; + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("routerId", routerId).add("tenantId", tenantId).add("floatingNetworkId", floatingNetworkId) + .add("floatingIpAddress", floatingIpAddress).add("fixedIpAddress", fixedIpAddress).add("portId", portId).add("status", status) + .addValue("\n") + .toString(); } /** * {@inheritDoc} */ @Override - public NetFloatingIPBuilder floatingNetworkId(String networkId) { - f.floatingNetworkId = networkId; - return this; + public int hashCode() { + return java.util.Objects.hash(id, routerId, tenantId, floatingNetworkId, + floatingIpAddress, fixedIpAddress, portId, status); } /** * {@inheritDoc} */ @Override - public NetFloatingIPBuilder portId(String portId) { - f.portId = portId; - return this; + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj instanceof NeutronFloatingIP) { + NeutronFloatingIP that = (NeutronFloatingIP) obj; + if (java.util.Objects.equals(id, that.id) && + java.util.Objects.equals(routerId, that.routerId) && + java.util.Objects.equals(tenantId, that.tenantId) && + java.util.Objects.equals(floatingNetworkId, that.floatingNetworkId) && + java.util.Objects.equals(floatingIpAddress, that.floatingIpAddress) && + java.util.Objects.equals(fixedIpAddress, that.fixedIpAddress) && + java.util.Objects.equals(portId, that.portId) && + java.util.Objects.equals(status, that.status)) { + return true; + } + } + return false; + } + + /** + * The Class FloatingIPs. + * + * @author Nathan Anderson + */ + public static class FloatingIPs extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("floatingips") + private List floatingIps; + + /** + * {@inheritDoc} + */ + @Override + protected List value() { + return floatingIps; + } + } + + /** + * The Class FloatingIPConcreteBuilder. + * + * @author Nathan Anderson + */ + public static class FloatingIPConcreteBuilder implements NetFloatingIPBuilder { + + private NeutronFloatingIP f = null; + + /** + * Instantiates a new floating ip concrete builder. + */ + public FloatingIPConcreteBuilder() { + f = new NeutronFloatingIP(); + } + + /** + * Instantiates a new floating ip concrete builder. + * + * @param in the in + */ + public FloatingIPConcreteBuilder(NetFloatingIP in) { + f = (NeutronFloatingIP) in; + } + + /** + * {@inheritDoc} + */ + @Override + public NetFloatingIP build() { + return f; + } + + /** + * {@inheritDoc} + */ + @Override + public NetFloatingIPBuilder from(NetFloatingIP in) { + f = (NeutronFloatingIP) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetFloatingIPBuilder floatingNetworkId(String networkId) { + f.floatingNetworkId = networkId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetFloatingIPBuilder portId(String portId) { + f.portId = portId; + return this; + } } - } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronHostRoute.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronHostRoute.java index 673567353..71735ad91 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronHostRoute.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronHostRoute.java @@ -1,8 +1,7 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.network.HostRoute; - import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.HostRoute; /** * A Network Host based Routing Entry. @@ -11,42 +10,42 @@ */ public class NeutronHostRoute implements HostRoute { - private static final long serialVersionUID = 1L; - - private String destination; - private String nexthop; - - public NeutronHostRoute() { - } - - public NeutronHostRoute(String destination, String nexthop) { - this.destination = destination; - this.nexthop = nexthop; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDestination() { - return destination; - } - - /** - * {@inheritDoc} - */ - @Override - public String getNexthop() { - return nexthop; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("destination", destination).add("nexthop", nexthop).toString(); - } + private static final long serialVersionUID = 1L; + + private String destination; + private String nexthop; + + public NeutronHostRoute() { + } + + public NeutronHostRoute(String destination, String nexthop) { + this.destination = destination; + this.nexthop = nexthop; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDestination() { + return destination; + } + + /** + * {@inheritDoc} + */ + @Override + public String getNexthop() { + return nexthop; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("destination", destination).add("nexthop", nexthop).toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronIP.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronIP.java index a4ae429f9..8bae36633 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronIP.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronIP.java @@ -1,9 +1,8 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.network.IP; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.IP; /** * A Fixed IP Address @@ -12,43 +11,44 @@ */ public class NeutronIP implements IP { - private static final long serialVersionUID = 1L; - - @JsonProperty("ip_address") - private String ipAddress; - - @JsonProperty("subnet_id") - private String subnetId; - - public NeutronIP() { } - - public NeutronIP(String address, String subnetId) { - this.ipAddress = address; - this.subnetId = subnetId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getIpAddress() { - return ipAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSubnetId() { - return subnetId; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues().add("ipAddress", ipAddress).add("subnetId", subnetId).toString(); - } + private static final long serialVersionUID = 1L; + + @JsonProperty("ip_address") + private String ipAddress; + + @JsonProperty("subnet_id") + private String subnetId; + + public NeutronIP() { + } + + public NeutronIP(String address, String subnetId) { + this.ipAddress = address; + this.subnetId = subnetId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIpAddress() { + return ipAddress; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSubnetId() { + return subnetId; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("ipAddress", ipAddress).add("subnetId", subnetId).toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQuota.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQuota.java index a93512f98..1b01ed547 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQuota.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQuota.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.networking.domain; -import static com.google.common.base.MoreObjects.toStringHelper; - -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.network.NetQuota; import org.openstack4j.model.network.builder.NetQuotaBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; + +import static com.google.common.base.MoreObjects.toStringHelper; /** * Network quotas that are bound to a Tenant @@ -158,15 +157,15 @@ public NetQuotaBuilder securityGroupRule(int securityGroupRule) { public static class NeutronNetQuotas extends ListResult { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("quotas") - private List quotas; + @JsonProperty("quotas") + private List quotas; - @Override - protected List value() { - return quotas; - } + @Override + protected List value() { + return quotas; + } } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java index de9dab458..0328d85ce 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java @@ -1,22 +1,19 @@ package org.openstack4j.openstack.networking.domain; -import java.util.ArrayList; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.api.Apis; import org.openstack4j.model.network.Network; import org.openstack4j.model.network.NetworkType; import org.openstack4j.model.network.State; import org.openstack4j.model.network.Subnet; import org.openstack4j.model.network.builder.NetworkBuilder; -import org.openstack4j.model.network.builder.PortBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.List; /** * An OpenStack (Neutron) network @@ -50,14 +47,15 @@ public class NeutronNetwork implements Network { @JsonProperty("availability_zone_hints") private List availabilityZoneHints; @JsonProperty("availability_zones") - private List availabilityZones; - - + private List availabilityZones; + @JsonProperty("created_at") + private String createdTime; + /** * The maximum transmission unit (MTU) value to address fragmentation. Minimum value is 68 for IPv4, and 1280 for IPv6. */ @JsonProperty("mtu") - private Integer mtu; + private Integer mtu; public static NetworkBuilder builder() { return new NetworkConcreteBuilder(); @@ -65,6 +63,7 @@ public static NetworkBuilder builder() { /** * Wraps this Network into a Builder + * * @return the network builder */ public NetworkBuilder toBuilder() { @@ -116,11 +115,10 @@ public List getSubnets() { */ @Override public List getNeutronSubnets() { - if ( neutronSubnets == null && (subnets != null && subnets.size() > 0)) - { - neutronSubnets = new ArrayList(); - for ( String subnetId : subnets) { - NeutronSubnet sub = (NeutronSubnet)Apis.getNetworkingServices().subnet().get(subnetId); + if (neutronSubnets == null && (subnets != null && subnets.size() > 0)) { + neutronSubnets = new ArrayList<>(); + for (String subnetId : subnets) { + NeutronSubnet sub = (NeutronSubnet) Apis.getNetworkingServices().subnet().get(subnetId); neutronSubnets.add(sub); } } @@ -204,10 +202,10 @@ public String getProviderSegID() { * {@inheritDoc} */ @Override - public Integer getMTU() { - return mtu; - } - + public Integer getMTU() { + return mtu; + } + /** * {@inheritDoc} */ @@ -215,7 +213,7 @@ public Integer getMTU() { public List getAvailabilityZoneHints() { return availabilityZoneHints; } - + /** * {@inheritDoc} */ @@ -223,7 +221,7 @@ public List getAvailabilityZoneHints() { public List getAvailabilityZones() { return availabilityZones; } - + /** * {@inheritDoc} @@ -360,14 +358,14 @@ public NetworkBuilder from(Network in) { m = (NeutronNetwork) in; return this; } - + @Override - public NetworkBuilder addAvailabilityZoneHints(String availabilityZone) { - if(m.availabilityZoneHints==null){ - m.availabilityZoneHints = new ArrayList<>(); - } - m.availabilityZoneHints.add(availabilityZone); - return this; - } + public NetworkBuilder addAvailabilityZoneHints(String availabilityZone) { + if (m.availabilityZoneHints == null) { + m.availabilityZoneHints = new ArrayList<>(); + } + m.availabilityZoneHints.add(availabilityZone); + return this; + } } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetworkUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetworkUpdate.java index d8a93235d..e7c14ddbe 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetworkUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetworkUpdate.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.network.NetworkUpdate; -import org.openstack4j.model.network.builder.NetworkUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.NetworkUpdate; +import org.openstack4j.model.network.builder.NetworkUpdateBuilder; /** * An entity used to update a network @@ -54,8 +53,8 @@ public boolean isShared() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("adminStateUp", adminStateUp).add("shared", shared) - .toString(); + .add("name", name).add("adminStateUp", adminStateUp).add("shared", shared) + .toString(); } public static class NetworkUpdateConcreteBuilder implements NetworkUpdateBuilder { diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java index 677ddffae..ab71c0830 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java @@ -1,8 +1,7 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.network.Pool; - import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.Pool; /** * An IP Address Pool which has a starting network and a ending network which becomes a pool of addresses @@ -11,68 +10,69 @@ */ public class NeutronPool implements Pool { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private String start; - private String end; + private String start; + private String end; - public NeutronPool() { } + public NeutronPool() { + } - public NeutronPool(String start, String end) { - this.start = start; - this.end = end; - } + public NeutronPool(String start, String end) { + this.start = start; + this.end = end; + } - /** - * {@inheritDoc} - */ - @Override - public String getStart() { - return start; - } + /** + * {@inheritDoc} + */ + @Override + public String getStart() { + return start; + } - /** - * {@inheritDoc} - */ - @Override - public String getEnd() { - return end; - } + /** + * {@inheritDoc} + */ + @Override + public String getEnd() { + return end; + } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues().add("start", start).add("end", end).toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("start", start).add("end", end).toString(); + } - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return java.util.Objects.hash(start, end); - } + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return java.util.Objects.hash(start, end); + } - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } - if (obj instanceof NeutronPool) { - NeutronPool that = (NeutronPool) obj; - if (java.util.Objects.equals(start, that.start) && - java.util.Objects.equals(end, that.end)) { - return true; - } - } - return false; - } + if (obj instanceof NeutronPool) { + NeutronPool that = (NeutronPool) obj; + if (java.util.Objects.equals(start, that.start) && + java.util.Objects.equals(end, that.end)) { + return true; + } + } + return false; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java index b3ace7d62..1d56342f1 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java @@ -1,26 +1,17 @@ package org.openstack4j.openstack.networking.domain; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.openstack4j.model.common.builder.ResourceBuilder; -import org.openstack4j.model.network.AllowedAddressPair; -import org.openstack4j.model.network.ExtraDhcpOptCreate; -import org.openstack4j.model.network.IP; -import org.openstack4j.model.network.Port; -import org.openstack4j.model.network.State; -import org.openstack4j.model.network.builder.PortBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import org.openstack4j.model.common.builder.ResourceBuilder; +import org.openstack4j.model.network.*; +import org.openstack4j.model.network.builder.PortBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.*; /** * A Neutron Port @@ -31,252 +22,252 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronPort implements Port { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + private String id; + private String name; + + @JsonProperty("admin_state_up") + private boolean adminStateUp = true; + + @JsonProperty("device_id") + private String deviceId; + + @JsonProperty("device_owner") + private String deviceOwner; + + @JsonProperty("fixed_ips") + private Set fixedIps; + + @JsonProperty("allowed_address_pairs") + private Set allowedAddressPairs; + + @JsonProperty("mac_address") + private String macAddress; + + @JsonProperty("network_id") + private String networkId; + + @JsonProperty("status") + private State state; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonProperty("extra_dhcp_opts") + private List extraDhcpOptCreates; + + @JsonProperty("port_security_enabled") + private Boolean portSecurityEnabled; + + @JsonProperty("binding:host_id") + private String hostId; + + @JsonProperty("binding:vif_type") + private String vifType; + + @JsonProperty("binding:vif_details") + private Map vifDetails; + + @JsonProperty("binding:vnic_type") + private String vNicType; + + @JsonProperty("binding:profile") + private Map profile; + + public static PortBuilder builder() { + return new PortConcreteBuilder(); + } + + @Override + public PortBuilder toBuilder() { + return new PortConcreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public State getState() { + return state; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + return adminStateUp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getNetworkId() { + return networkId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDeviceId() { + return deviceId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDeviceOwner() { + return deviceOwner; + } + + /** + * {@inheritDoc} + */ + @Override + public Set getFixedIps() { + return fixedIps; + } + + /** + * {@inheritDoc} + */ + @Override + public Set getAllowedAddressPairs() { + return allowedAddressPairs; + } + + /** + * {@inheritDoc} + */ + @Override + public String getMacAddress() { + return macAddress; + } + + /** + * {@inheritDoc} + */ + @Override + public List getSecurityGroups() { + return securityGroups; + } + + /** + * {@inheritDoc} + */ + @Override + public String getHostId() { + return hostId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVifType() { + return vifType; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getVifDetails() { + return vifDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public String getvNicType() { + return vNicType; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getProfile() { + return profile; + } + + /** + * {@inheritDoc} + */ + @Override + public void setId(String id) { + this.id = id; + } + + /** + * {@inheritDoc} + */ + @Override + public void setName(String name) { + this.name = name; + } + + /** + * {@inheritDoc} + */ + @Override + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public void setHostId(String hostId) { + this.hostId = hostId; + } + + public void setVifType(String vifType) { + this.vifType = vifType; + } - private String id; - private String name; + public void setVifDetails(Map vifDetails) { + this.vifDetails = vifDetails; + } - @JsonProperty("admin_state_up") - private boolean adminStateUp = true; + public void setvNicType(String vNicType) { + this.vNicType = vNicType; + } - @JsonProperty("device_id") - private String deviceId; - - @JsonProperty("device_owner") - private String deviceOwner; + public void setProfile(Map profile) { + this.profile = profile; + } - @JsonProperty("fixed_ips") - private Set fixedIps; - - @JsonProperty("allowed_address_pairs") - private Set allowedAddressPairs; - - @JsonProperty("mac_address") - private String macAddress; - - @JsonProperty("network_id") - private String networkId; - - @JsonProperty("status") - private State state; - - @JsonProperty("tenant_id") - private String tenantId; - - @JsonProperty("security_groups") - private List securityGroups; - - @JsonProperty("extra_dhcp_opts") - private List extraDhcpOptCreates; - - @JsonProperty("port_security_enabled") - private Boolean portSecurityEnabled; - - @JsonProperty("binding:host_id") - private String hostId; - - @JsonProperty("binding:vif_type") - private String vifType; - - @JsonProperty("binding:vif_details") - private Map vifDetails; - - @JsonProperty("binding:vnic_type") - private String vNicType; - - @JsonProperty("binding:profile") - private Map profile; - - public static PortBuilder builder() { - return new PortConcreteBuilder(); - } - - @Override - public PortBuilder toBuilder() { - return new PortConcreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public State getState() { - return state; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - return adminStateUp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getNetworkId() { - return networkId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDeviceId() { - return deviceId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDeviceOwner() { - return deviceOwner; - } - - /** - * {@inheritDoc} - */ - @Override - public Set getFixedIps() { - return fixedIps; - } - - /** - * {@inheritDoc} - */ - @Override - public Set getAllowedAddressPairs() { - return allowedAddressPairs; - } - - /** - * {@inheritDoc} - */ - @Override - public String getMacAddress() { - return macAddress; - } - - /** - * {@inheritDoc} - */ - @Override - public List getSecurityGroups() { - return securityGroups; - } - - /** - * {@inheritDoc} - */ - @Override - public String getHostId() { - return hostId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVifType() { - return vifType; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getVifDetails() { - return vifDetails; - } - - /** - * {@inheritDoc} - */ - @Override - public String getvNicType() { - return vNicType; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getProfile() { - return profile; - } - - /** - * {@inheritDoc} - */ - @Override - public void setId(String id) { - this.id = id; - } - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) { - this.name = name; - } - - /** - * {@inheritDoc} - */ - @Override - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public void setHostId(String hostId) { - this.hostId = hostId; - } - - public void setVifType(String vifType) { - this.vifType = vifType; - } - - public void setVifDetails(Map vifDetails) { - this.vifDetails = vifDetails; - } - - public void setvNicType(String vNicType) { - this.vNicType = vNicType; - } - - public void setProfile(Map profile) { - this.profile = profile; - } - - /** + /** * {@inheritDoc} */ @Override @@ -285,250 +276,251 @@ public Boolean isPortSecurityEnabled() { } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("adminStateUp", adminStateUp).add("deviceId", deviceId) - .add("deviceOwner", deviceOwner).add("fixedIps", fixedIps).add("macAddress", macAddress) - .add("networkId", networkId).add("tenantId", tenantId).add("securityGroups", securityGroups) - .add("allowed_address_pairs", allowedAddressPairs).add("port_security_enabled ", portSecurityEnabled) - .add("binding:host_id", hostId).add("binding:vif_type", vifType).add("binding:vif_details", vifDetails) - .add("binding:vnic_type", vNicType).add("binding:profile", profile) - .toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return java.util.Objects.hash(id, name, adminStateUp, deviceId, - deviceOwner, fixedIps, macAddress, networkId, tenantId, - securityGroups, allowedAddressPairs, portSecurityEnabled, hostId, - vifType, vifDetails, vNicType, profile); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - - if (obj instanceof NeutronPort) { - NeutronPort that = (NeutronPort) obj; - if (java.util.Objects.equals(id, that.id) && - java.util.Objects.equals(name, that.name) && - java.util.Objects.equals(adminStateUp, that.adminStateUp) && - java.util.Objects.equals(deviceId, that.deviceId) && - java.util.Objects.equals(deviceOwner, that.deviceOwner) && - java.util.Objects.equals(fixedIps, that.fixedIps) && - java.util.Objects.equals(macAddress, that.macAddress) && - java.util.Objects.equals(networkId, that.networkId) && - java.util.Objects.equals(tenantId, that.tenantId) && - java.util.Objects.equals(securityGroups, that.securityGroups) && - java.util.Objects.equals(allowedAddressPairs, that.allowedAddressPairs) && - java.util.Objects.equals(portSecurityEnabled, that.portSecurityEnabled) && - java.util.Objects.equals(hostId, that.hostId) && - java.util.Objects.equals(vifType, that.vifType) && - java.util.Objects.equals(vifDetails, that.vifDetails) && - java.util.Objects.equals(vNicType, that.vNicType) && - java.util.Objects.equals(profile, that.profile)) { - return true; - } - } - return false; - } - - public static class Ports extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("ports") - private List ports; - - @Override - protected List value() { - return ports; - } - } - - public static class PortConcreteBuilder extends ResourceBuilder implements PortBuilder { - - private NeutronPort m; - - PortConcreteBuilder() { - this(new NeutronPort()); - } - - PortConcreteBuilder(NeutronPort port) { - this.m = port; - } - @Override - public PortBuilder networkId(String networkId) { - m.networkId = networkId; - return this; - } - - @Override - public PortBuilder deviceId(String deviceId) { - m.deviceId = deviceId; - return this; - } - - @Override - public PortBuilder deviceOwner(String deviceOwner) { - m.deviceOwner = deviceOwner; - return this; - } - - @Override - public PortBuilder macAddress(String macAddress) { - m.macAddress = macAddress; - return this; - } - - @Override - public PortBuilder fixedIp(String address, String subnetId) { - if (m.fixedIps == null) - m.fixedIps = Sets.newHashSet(); - - m.fixedIps.add(new NeutronIP(address, subnetId)); - return this; - } - - @Override - public PortBuilder removeFixedIp(String address, String subnetId) { - if (m.fixedIps == null) - m.fixedIps = Sets.newHashSet(); - - Iterator iter = m.fixedIps.iterator(); - - while (iter.hasNext()) { - NeutronIP fixedIP = iter.next(); - if (fixedIP.getSubnetId() != null && fixedIP.getSubnetId().equals(subnetId) && - fixedIP.getIpAddress() != null && fixedIP.getIpAddress().equals(address)) { - iter.remove(); - } - } - - return this; - } - - @Override - public PortBuilder allowedAddressPair(String ipAddress, String macAddress) { - if (m.allowedAddressPairs == null) - m.allowedAddressPairs = Sets.newHashSet(); - - m.allowedAddressPairs.add(new NeutronAllowedAddressPair(ipAddress, macAddress)); - return this; - } - - @Override - public PortBuilder removeAddressPair(String ipAddress, String macAddress) { - if (m.allowedAddressPairs == null) - m.allowedAddressPairs = Sets.newHashSet(); - - Iterator iter = m.allowedAddressPairs.iterator(); - - while (iter.hasNext()) { - NeutronAllowedAddressPair allowedAddress = iter.next(); - if (allowedAddress.getIpAddress() != null && allowedAddress.getIpAddress().equals(ipAddress) && - allowedAddress.getMacAddress() != null && allowedAddress.getMacAddress().equals(macAddress)) { - iter.remove(); - } - } - - return this; - } - - - @Override - public PortBuilder adminState(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - - @Override - public PortBuilder state(State state) { - m.state = state; - return this; - } - - @Override - public Port build() { - return m; - } - - @Override - public PortBuilder from(Port in) { - m = (NeutronPort) in; - return this; - } - - @Override - protected Port reference() { - return m; - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("adminStateUp", adminStateUp).add("deviceId", deviceId) + .add("deviceOwner", deviceOwner).add("fixedIps", fixedIps).add("macAddress", macAddress) + .add("networkId", networkId).add("tenantId", tenantId).add("securityGroups", securityGroups) + .add("allowed_address_pairs", allowedAddressPairs).add("port_security_enabled ", portSecurityEnabled) + .add("binding:host_id", hostId).add("binding:vif_type", vifType).add("binding:vif_details", vifDetails) + .add("binding:vnic_type", vNicType).add("binding:profile", profile) + .toString(); + } + /** + * {@inheritDoc} + */ @Override + public int hashCode() { + return java.util.Objects.hash(id, name, adminStateUp, deviceId, + deviceOwner, fixedIps, macAddress, networkId, tenantId, + securityGroups, allowedAddressPairs, portSecurityEnabled, hostId, + vifType, vifDetails, vNicType, profile); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj instanceof NeutronPort) { + NeutronPort that = (NeutronPort) obj; + if (java.util.Objects.equals(id, that.id) && + java.util.Objects.equals(name, that.name) && + java.util.Objects.equals(adminStateUp, that.adminStateUp) && + java.util.Objects.equals(deviceId, that.deviceId) && + java.util.Objects.equals(deviceOwner, that.deviceOwner) && + java.util.Objects.equals(fixedIps, that.fixedIps) && + java.util.Objects.equals(macAddress, that.macAddress) && + java.util.Objects.equals(networkId, that.networkId) && + java.util.Objects.equals(tenantId, that.tenantId) && + java.util.Objects.equals(securityGroups, that.securityGroups) && + java.util.Objects.equals(allowedAddressPairs, that.allowedAddressPairs) && + java.util.Objects.equals(portSecurityEnabled, that.portSecurityEnabled) && + java.util.Objects.equals(hostId, that.hostId) && + java.util.Objects.equals(vifType, that.vifType) && + java.util.Objects.equals(vifDetails, that.vifDetails) && + java.util.Objects.equals(vNicType, that.vNicType) && + java.util.Objects.equals(profile, that.profile)) { + return true; + } + } + return false; + } + + public static class Ports extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("ports") + private List ports; + + @Override + protected List value() { + return ports; + } + } + + public static class PortConcreteBuilder extends ResourceBuilder implements PortBuilder { + + private NeutronPort m; + + PortConcreteBuilder() { + this(new NeutronPort()); + } + + PortConcreteBuilder(NeutronPort port) { + this.m = port; + } + + @Override + public PortBuilder networkId(String networkId) { + m.networkId = networkId; + return this; + } + + @Override + public PortBuilder deviceId(String deviceId) { + m.deviceId = deviceId; + return this; + } + + @Override + public PortBuilder deviceOwner(String deviceOwner) { + m.deviceOwner = deviceOwner; + return this; + } + + @Override + public PortBuilder macAddress(String macAddress) { + m.macAddress = macAddress; + return this; + } + + @Override + public PortBuilder fixedIp(String address, String subnetId) { + if (m.fixedIps == null) + m.fixedIps = Sets.newHashSet(); + + m.fixedIps.add(new NeutronIP(address, subnetId)); + return this; + } + + @Override + public PortBuilder removeFixedIp(String address, String subnetId) { + if (m.fixedIps == null) + m.fixedIps = Sets.newHashSet(); + + Iterator iter = m.fixedIps.iterator(); + + while (iter.hasNext()) { + NeutronIP fixedIP = iter.next(); + if (fixedIP.getSubnetId() != null && fixedIP.getSubnetId().equals(subnetId) && + fixedIP.getIpAddress() != null && fixedIP.getIpAddress().equals(address)) { + iter.remove(); + } + } + + return this; + } + + @Override + public PortBuilder allowedAddressPair(String ipAddress, String macAddress) { + if (m.allowedAddressPairs == null) + m.allowedAddressPairs = Sets.newHashSet(); + + m.allowedAddressPairs.add(new NeutronAllowedAddressPair(ipAddress, macAddress)); + return this; + } + + @Override + public PortBuilder removeAddressPair(String ipAddress, String macAddress) { + if (m.allowedAddressPairs == null) + m.allowedAddressPairs = Sets.newHashSet(); + + Iterator iter = m.allowedAddressPairs.iterator(); + + while (iter.hasNext()) { + NeutronAllowedAddressPair allowedAddress = iter.next(); + if (allowedAddress.getIpAddress() != null && allowedAddress.getIpAddress().equals(ipAddress) && + allowedAddress.getMacAddress() != null && allowedAddress.getMacAddress().equals(macAddress)) { + iter.remove(); + } + } + + return this; + } + + + @Override + public PortBuilder adminState(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + + @Override + public PortBuilder state(State state) { + m.state = state; + return this; + } + + @Override + public Port build() { + return m; + } + + @Override + public PortBuilder from(Port in) { + m = (NeutronPort) in; + return this; + } + + @Override + protected Port reference() { + return m; + } + + @Override public PortBuilder extraDhcpOpt(ExtraDhcpOptCreate extraDhcpOptCreate) { if (m.extraDhcpOptCreates == null) m.extraDhcpOptCreates = Lists.newArrayList(); - m.extraDhcpOptCreates.add((NeutronExtraDhcpOptCreate)extraDhcpOptCreate); + m.extraDhcpOptCreates.add((NeutronExtraDhcpOptCreate) extraDhcpOptCreate); return this; - } + } - @Override - public PortBuilder securityGroup(String groupName) { - if(m.securityGroups==null){ - m.securityGroups = new ArrayList<>(); - } - m.securityGroups.add(groupName); - return this; - } + @Override + public PortBuilder securityGroup(String groupName) { + if (m.securityGroups == null) { + m.securityGroups = new ArrayList<>(); + } + m.securityGroups.add(groupName); + return this; + } @Override public PortBuilder portSecurityEnabled(Boolean portSecurityEnabled) { - m.portSecurityEnabled=portSecurityEnabled; + m.portSecurityEnabled = portSecurityEnabled; return this; } @Override public PortBuilder hostId(String hostId) { - m.hostId = hostId; - return this; - } + m.hostId = hostId; + return this; + } @Override - public PortBuilder vifType(String vifType) { - m.vifType = vifType; - return this; - } + public PortBuilder vifType(String vifType) { + m.vifType = vifType; + return this; + } @Override - public PortBuilder vifDetails(Map vifDetails) { - m.vifDetails = vifDetails; - return this; - } + public PortBuilder vifDetails(Map vifDetails) { + m.vifDetails = vifDetails; + return this; + } @Override - public PortBuilder vNicType(String vNicType) { - m.vNicType = vNicType; - return this; - } + public PortBuilder vNicType(String vNicType) { + m.vNicType = vNicType; + return this; + } @Override - public PortBuilder profile(Map profile) { - m.profile = profile; - return this; - } + public PortBuilder profile(Map profile) { + m.profile = profile; + return this; + } - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPortCreate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPortCreate.java index f34ad257c..de144e82c 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPortCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPortCreate.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; - import org.openstack4j.model.ModelEntity; import org.openstack4j.model.network.Port; import org.openstack4j.openstack.common.ListEntity; @@ -14,119 +13,118 @@ /** * Represents a Port that is used during a create operation which only encapsulates the allowed properties - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ @JsonRootName("port") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronPortCreate implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + @JsonProperty + private String name; - @JsonProperty - private String name; + @JsonProperty("admin_state_up") + private boolean adminStateUp; - @JsonProperty("admin_state_up") - private boolean adminStateUp; + @JsonProperty("fixed_ips") + private Set fixedIps; - @JsonProperty("fixed_ips") - private Set fixedIps; - - @JsonProperty("mac_address") - private String macAddress; + @JsonProperty("mac_address") + private String macAddress; - @JsonProperty("network_id") - private String networkId; + @JsonProperty("network_id") + private String networkId; - @JsonProperty("tenant_id") - private String tenantId; + @JsonProperty("tenant_id") + private String tenantId; - @JsonProperty("device_id") - private String deviceId; + @JsonProperty("device_id") + private String deviceId; - @JsonProperty("device_owner") - private String deviceOwner; + @JsonProperty("device_owner") + private String deviceOwner; + + @JsonProperty("security_groups") + private List securityGroups; - @JsonProperty("security_groups") - private List securityGroups; - @JsonProperty("port_security_enabled") - private Boolean portSecurityEnabled; - - @JsonProperty("binding:host_id") - private String hostId; - - @JsonProperty("binding:vif_type") - private String vifType; - - @JsonProperty("binding:vif_details") - private Map vifDetails; - - @JsonProperty("binding:vnic_type") - private String vNicType; - - @JsonProperty("binding:profile") - private Map profile; - - - public NeutronPortCreate() { - } - - /** - * Creates a Port Create object which only encapsulates allowable fields from a port - * - * @param port the port (source) - * @return the port create object - */ - @SuppressWarnings("unchecked") + private Boolean portSecurityEnabled; + + @JsonProperty("binding:host_id") + private String hostId; + + @JsonProperty("binding:vif_type") + private String vifType; + + @JsonProperty("binding:vif_details") + private Map vifDetails; + + @JsonProperty("binding:vnic_type") + private String vNicType; + + @JsonProperty("binding:profile") + private Map profile; + + + public NeutronPortCreate() { + } + + /** + * Creates a Port Create object which only encapsulates allowable fields from a port + * + * @param port the port (source) + * @return the port create object + */ + @SuppressWarnings("unchecked") public static NeutronPortCreate fromPort(Port port) { - NeutronPortCreate c = new NeutronPortCreate(); - c.name = port.getName(); - c.networkId = port.getNetworkId(); - c.adminStateUp = port.isAdminStateUp(); - c.macAddress = port.getMacAddress(); - c.tenantId = port.getTenantId(); - c.deviceId = port.getDeviceId(); - c.deviceOwner = port.getDeviceOwner(); - c.securityGroups = port.getSecurityGroups(); - c.fixedIps = (Set) port.getFixedIps(); - c.portSecurityEnabled=port.isPortSecurityEnabled(); - c.hostId = port.getHostId(); - c.vifType = port.getVifType(); - c.vifDetails = port.getVifDetails(); - c.vNicType = port.getvNicType(); - c.profile = port.getProfile(); - - - return c; - } - - public static class NeutronPortsCreate implements ModelEntity { - - private static final long serialVersionUID = 1L; - - @JsonProperty("ports") - private ListEntity ports; - - public NeutronPortsCreate() { - ports = new ListEntity<>(); - } - - /** - * Creates a List of Port Create objects which only encapsulates allowable fields from a port - * - * @param ports the ports (source) - * @return the port create objects - */ - @SuppressWarnings("unchecked") - public static NeutronPortsCreate fromPorts(List ports) { - NeutronPortsCreate c = new NeutronPortsCreate(); - for (Port port : ports) { - c.ports.add(NeutronPortCreate.fromPort(port)); - } - return c; - } - - } + NeutronPortCreate c = new NeutronPortCreate(); + c.name = port.getName(); + c.networkId = port.getNetworkId(); + c.adminStateUp = port.isAdminStateUp(); + c.macAddress = port.getMacAddress(); + c.tenantId = port.getTenantId(); + c.deviceId = port.getDeviceId(); + c.deviceOwner = port.getDeviceOwner(); + c.securityGroups = port.getSecurityGroups(); + c.fixedIps = (Set) port.getFixedIps(); + c.portSecurityEnabled = port.isPortSecurityEnabled(); + c.hostId = port.getHostId(); + c.vifType = port.getVifType(); + c.vifDetails = port.getVifDetails(); + c.vNicType = port.getvNicType(); + c.profile = port.getProfile(); + + + return c; + } + + public static class NeutronPortsCreate implements ModelEntity { + + private static final long serialVersionUID = 1L; + + @JsonProperty("ports") + private ListEntity ports; + + public NeutronPortsCreate() { + ports = new ListEntity<>(); + } + + /** + * Creates a List of Port Create objects which only encapsulates allowable fields from a port + * + * @param ports the ports (source) + * @return the port create objects + */ + @SuppressWarnings("unchecked") + public static NeutronPortsCreate fromPorts(List ports) { + NeutronPortsCreate c = new NeutronPortsCreate(); + for (Port port : ports) { + c.ports.add(NeutronPortCreate.fromPort(port)); + } + return c; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java index 0d64d81db..a56669f75 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java @@ -160,11 +160,11 @@ public String toString() { /** * {@inheritDoc} */ - @Override - public int hashCode() { - return java.util.Objects.hash(id, name, status, tenantId, adminStateUp, - externalGatewayInfo, routes); - } + @Override + public int hashCode() { + return java.util.Objects.hash(id, name, status, tenantId, adminStateUp, + externalGatewayInfo, routes); + } /** * {@inheritDoc} @@ -172,7 +172,7 @@ public int hashCode() { @Override public boolean equals(Object obj) { if (this == obj) { - return true; + return true; } if (obj instanceof NeutronRouter) { @@ -184,7 +184,7 @@ public boolean equals(Object obj) { java.util.Objects.equals(adminStateUp, that.adminStateUp) && java.util.Objects.equals(externalGatewayInfo, that.externalGatewayInfo) && java.util.Objects.equals(routes, that.routes)) { - return true; + return true; } } return false; diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java index 696938595..8d3b7b815 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java @@ -1,9 +1,8 @@ package org.openstack4j.openstack.networking.domain; -import org.openstack4j.model.network.RouterInterface; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.RouterInterface; /** * An interface data model which is returned during interface association with a router @@ -12,95 +11,96 @@ */ public class NeutronRouterInterface implements RouterInterface { - private static final long serialVersionUID = 1L; - - @JsonProperty("id") - private String id; - - @JsonProperty("tenant_id") - private String tenantId; - - @JsonProperty("subnet_id") - private String subnetId; - - @JsonProperty("port_id") - private String portId; - - public NeutronRouterInterface() { } - - public NeutronRouterInterface(String subnetId, String portId) { - this.subnetId = subnetId; - this.portId = portId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSubnetId() { - return subnetId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPortId() { - return portId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("subnetId", subnetId).add("portId", portId).add("tenantId", tenantId).toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return java.util.Objects.hash(id, subnetId, portId, tenantId); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - - if (obj instanceof NeutronRouterInterface) { + private static final long serialVersionUID = 1L; + + @JsonProperty("id") + private String id; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("subnet_id") + private String subnetId; + + @JsonProperty("port_id") + private String portId; + + public NeutronRouterInterface() { + } + + public NeutronRouterInterface(String subnetId, String portId) { + this.subnetId = subnetId; + this.portId = portId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSubnetId() { + return subnetId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getPortId() { + return portId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("subnetId", subnetId).add("portId", portId).add("tenantId", tenantId).toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return java.util.Objects.hash(id, subnetId, portId, tenantId); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj instanceof NeutronRouterInterface) { NeutronRouterInterface that = (NeutronRouterInterface) obj; - if (java.util.Objects.equals(id, that.id) && - java.util.Objects.equals(subnetId, that.subnetId) && - java.util.Objects.equals(portId, that.portId) && - java.util.Objects.equals(tenantId, that.tenantId)) { - return true; - } - } - return false; - } + if (java.util.Objects.equals(id, that.id) && + java.util.Objects.equals(subnetId, that.subnetId) && + java.util.Objects.equals(portId, that.portId) && + java.util.Objects.equals(tenantId, that.tenantId)) { + return true; + } + } + return false; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java index ca6d54414..a53ccd1f1 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.networking.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.SecurityGroup; import org.openstack4j.model.network.SecurityGroupRule; import org.openstack4j.model.network.builder.NetSecurityGroupBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * An OpenStack Neutron Security Group Rule model. @@ -19,244 +18,243 @@ @JsonRootName("security_group") public class NeutronSecurityGroup implements SecurityGroup { - private static final long serialVersionUID = 1L; - - @JsonProperty("id") - private String id; - - @JsonProperty("tenant_id") - private String tenantId; - - @JsonProperty("description") - private String description; - - @JsonProperty("name") - private String name; - - @JsonProperty("security_group_rules") - private List rules; - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return this.description; - } - - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return this.tenantId; - } - - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Override - public void setId(String id) { - this.id = id; - } - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) { - this.name = name; - } - - /** - * {@inheritDoc} - */ - @Override - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - - /** - * {@inheritDoc} - */ - @Override - public List getRules() { - return rules; - } - - /** - * {@inheritDoc} - */ - @Override - public NetSecurityGroupBuilder toBuilder() { - return new SecurityGroupConcreteBuilder(this); - } - - public static NetSecurityGroupBuilder builder() { - return new SecurityGroupConcreteBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("tenantId", tenantId) - .add("name", name) - .add("description", description) - .add("security_group_rules", rules) - .addValue("\n") - .toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return java.util.Objects.hash(id, tenantId, name, description, rules); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } + private static final long serialVersionUID = 1L; - if (obj instanceof NeutronSecurityGroup) { - NeutronSecurityGroup that = (NeutronSecurityGroup) obj; - if (java.util.Objects.equals(id, that.id) && - java.util.Objects.equals(tenantId, that.tenantId) && - java.util.Objects.equals(name, that.name) && - java.util.Objects.equals(description, that.description) && - java.util.Objects.equals(rules, that.rules)) { - return true; - } - } - return false; - } + @JsonProperty("id") + private String id; - /** - * The Class SecurityGroups. - * - * @author Nathan Anderson - */ - public static class SecurityGroups extends ListResult { + @JsonProperty("tenant_id") + private String tenantId; - private static final long serialVersionUID = 1L; + @JsonProperty("description") + private String description; + + @JsonProperty("name") + private String name; - @JsonProperty("security_groups") - private List rules; + @JsonProperty("security_group_rules") + private List rules; /** * {@inheritDoc} */ @Override - protected List value() { - return rules; + public String getDescription() { + return this.description; } - } - /** - * The Class SecurityGroupConcreteBuilder. - * - * - * @author Nathan Anderson - */ - public static class SecurityGroupConcreteBuilder implements NetSecurityGroupBuilder { - NeutronSecurityGroup g; + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return this.id; + } /** - * Instantiates a new security group rule concrete builder. + * {@inheritDoc} */ - public SecurityGroupConcreteBuilder() { - g = new NeutronSecurityGroup(); + @Override + public String getTenantId() { + return this.tenantId; } + /** - * Instantiates a new security group rule concrete builder. - * - * @param rule the rule + * {@inheritDoc} */ - public SecurityGroupConcreteBuilder(SecurityGroup in) { - g = (NeutronSecurityGroup) in; + @Override + public String getName() { + return this.name; } /** * {@inheritDoc} */ @Override - public SecurityGroup build() { - return g; + public void setId(String id) { + this.id = id; } /** * {@inheritDoc} */ @Override - public NetSecurityGroupBuilder from(SecurityGroup in) { - g = (NeutronSecurityGroup) in; - return this; + public void setName(String name) { + this.name = name; } /** * {@inheritDoc} */ @Override - public NetSecurityGroupBuilder name(String name) { - g.name = name; - return this; + public void setTenantId(String tenantId) { + this.tenantId = tenantId; } + /** * {@inheritDoc} */ @Override - public NetSecurityGroupBuilder description(String description) { - g.description = description; - return this; + public List getRules() { + return rules; } /** * {@inheritDoc} */ @Override - public NetSecurityGroupBuilder id(String id) { - g.id = id; - return this; + public NetSecurityGroupBuilder toBuilder() { + return new SecurityGroupConcreteBuilder(this); + } + + public static NetSecurityGroupBuilder builder() { + return new SecurityGroupConcreteBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("tenantId", tenantId) + .add("name", name) + .add("description", description) + .add("security_group_rules", rules) + .addValue("\n") + .toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return java.util.Objects.hash(id, tenantId, name, description, rules); } /** * {@inheritDoc} */ @Override - public NetSecurityGroupBuilder tenantId(String tenantId) { - g.tenantId = tenantId; - return this; + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj instanceof NeutronSecurityGroup) { + NeutronSecurityGroup that = (NeutronSecurityGroup) obj; + if (java.util.Objects.equals(id, that.id) && + java.util.Objects.equals(tenantId, that.tenantId) && + java.util.Objects.equals(name, that.name) && + java.util.Objects.equals(description, that.description) && + java.util.Objects.equals(rules, that.rules)) { + return true; + } + } + return false; + } + + /** + * The Class SecurityGroups. + * + * @author Nathan Anderson + */ + public static class SecurityGroups extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("security_groups") + private List rules; + + /** + * {@inheritDoc} + */ + @Override + protected List value() { + return rules; + } + } + + /** + * The Class SecurityGroupConcreteBuilder. + * + * @author Nathan Anderson + */ + public static class SecurityGroupConcreteBuilder implements NetSecurityGroupBuilder { + + NeutronSecurityGroup g; + + /** + * Instantiates a new security group rule concrete builder. + */ + public SecurityGroupConcreteBuilder() { + g = new NeutronSecurityGroup(); + } + + /** + * Instantiates a new security group rule concrete builder. + * + * @param rule the rule + */ + public SecurityGroupConcreteBuilder(SecurityGroup in) { + g = (NeutronSecurityGroup) in; + } + + /** + * {@inheritDoc} + */ + @Override + public SecurityGroup build() { + return g; + } + + /** + * {@inheritDoc} + */ + @Override + public NetSecurityGroupBuilder from(SecurityGroup in) { + g = (NeutronSecurityGroup) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetSecurityGroupBuilder name(String name) { + g.name = name; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetSecurityGroupBuilder description(String description) { + g.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetSecurityGroupBuilder id(String id) { + g.id = id; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetSecurityGroupBuilder tenantId(String tenantId) { + g.tenantId = tenantId; + return this; + } } - } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java index cef8c5506..fe9b6ec4e 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.networking.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.SecurityGroupRule; import org.openstack4j.model.network.builder.NetSecurityGroupRuleBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * An OpenStack Neutron Security Group Rule model. @@ -200,7 +199,6 @@ public boolean equals(Object obj) { /** * The Class SecurityGroupRules. * - * * @author Nathan Anderson */ public static class SecurityGroupRules extends ListResult { @@ -222,7 +220,6 @@ protected List value() { /** * The Class SecurityGroupRuleConcreteBuilder. * - * * @author Nathan Anderson */ public static class SecurityGroupRuleConcreteBuilder implements NetSecurityGroupRuleBuilder { diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java index 823a42fb5..ece254625 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java @@ -1,27 +1,16 @@ package org.openstack4j.openstack.networking.domain; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import org.openstack4j.model.common.builder.ResourceBuilder; -import org.openstack4j.model.network.HostRoute; -import org.openstack4j.model.network.IPVersionType; -import org.openstack4j.model.network.Ipv6AddressMode; -import org.openstack4j.model.network.Ipv6RaMode; -import org.openstack4j.model.network.Network; -import org.openstack4j.model.network.Pool; -import org.openstack4j.model.network.Subnet; -import org.openstack4j.model.network.builder.SubnetBuilder; -import org.openstack4j.openstack.common.ListResult; - +import com.fasterxml.jackson.annotation.*; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.Lists; +import org.openstack4j.model.common.builder.ResourceBuilder; +import org.openstack4j.model.network.*; +import org.openstack4j.model.network.builder.SubnetBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * A Subnet is a network with Pools and network based settings @@ -32,31 +21,31 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronSubnet implements Subnet { - private static final long serialVersionUID = 1L; - - private String id; - private String name; - @JsonProperty("enable_dhcp") - private boolean enableDHCP; - @JsonProperty("network_id") - private String networkId; - @JsonProperty("tenant_id") - private String tenantId; - @JsonProperty("dns_nameservers") - private List dnsNames; - @JsonProperty("allocation_pools") - private List pools; - @JsonProperty("host_routes") - private List hostRoutes; - @JsonProperty("ip_version") - private IPVersionType ipVersion; - @JsonProperty("gateway_ip") - private String gateway; - private String cidr; - @JsonProperty("ipv6_address_mode") - private Ipv6AddressMode ipv6AddressMode; - @JsonProperty("ipv6_ra_mode") - private Ipv6RaMode ipv6RaMode; + private static final long serialVersionUID = 1L; + + private String id; + private String name; + @JsonProperty("enable_dhcp") + private boolean enableDHCP; + @JsonProperty("network_id") + private String networkId; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("dns_nameservers") + private List dnsNames; + @JsonProperty("allocation_pools") + private List pools; + @JsonProperty("host_routes") + private List hostRoutes; + @JsonProperty("ip_version") + private IPVersionType ipVersion; + @JsonProperty("gateway_ip") + private String gateway; + private String cidr; + @JsonProperty("ipv6_address_mode") + private Ipv6AddressMode ipv6AddressMode; + @JsonProperty("ipv6_ra_mode") + private Ipv6RaMode ipv6RaMode; public NeutronSubnet() { } @@ -80,196 +69,196 @@ public NeutronSubnet(String id, String name, boolean enableDHCP, String networkI } public static SubnetBuilder builder() { - return new SubnetConcreteBuilder(); - } - - @Override - public SubnetBuilder toBuilder() { - return new SubnetConcreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public void setId(String id) { - this.id = id; - } - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) { - this.name = name; - } - - /** - * {@inheritDoc} - */ - @Override - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - @JsonIgnore - public boolean isDHCPEnabled() { - return enableDHCP; - } - - /** - * {@inheritDoc} - */ - @Override - public String getNetworkId() { - return networkId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public List getDnsNames() { - return dnsNames; - } - - /** - * {@inheritDoc} - */ - @JsonIgnore - @Override - public List getAllocationPools() { - return pools; - } - - /** - * {@inheritDoc} - */ - @Override - public List getHostRoutes() { - return hostRoutes; - } - - /** - * {@inheritDoc} - */ - @Override - public IPVersionType getIpVersion() { - return ipVersion; - } - - /** - * {@inheritDoc} - */ - @Override - public String getGateway() { - return gateway; - } - - /** - * {@inheritDoc} - */ - @Override - public String getCidr() { - return cidr; - } - - /** - * {@inheritDoc} - */ - @Override - public Ipv6AddressMode getIpv6AddressMode() { - return ipv6AddressMode; - } - - /** - * {@inheritDoc} - */ - @Override - public Ipv6RaMode getIpv6RaMode() { - return ipv6RaMode; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("enableDHCP", enableDHCP).add("network-id", networkId) - .add("tenant_id", tenantId).add("dns_nameservers", dnsNames).add("allocation_pools", pools) - .add("host_routes", hostRoutes).add("ip_version", ipVersion).add("gateway_ip", gateway).add("cidr", cidr) - .add("ipv6AddressMode", ipv6AddressMode).add("ipv6RaMode", ipv6RaMode) - .toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return java.util.Objects.hash(id, name, enableDHCP, networkId, - tenantId, dnsNames, pools, hostRoutes, ipVersion, gateway, - cidr, ipv6AddressMode, ipv6RaMode); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - - if (obj instanceof NeutronSubnet) { - NeutronSubnet that = (NeutronSubnet) obj; - if (java.util.Objects.equals(id, that.id) && - java.util.Objects.equals(name, that.name) && - java.util.Objects.equals(enableDHCP, that.enableDHCP) && - java.util.Objects.equals(networkId, that.networkId) && - java.util.Objects.equals(tenantId, that.tenantId) && - java.util.Objects.equals(dnsNames, that.dnsNames) && - java.util.Objects.equals(pools, that.pools) && - java.util.Objects.equals(hostRoutes, that.hostRoutes) && - java.util.Objects.equals(ipVersion, that.ipVersion) && - java.util.Objects.equals(gateway, that.gateway) && - java.util.Objects.equals(cidr, that.cidr) && - java.util.Objects.equals(ipv6AddressMode, that.ipv6AddressMode) && - java.util.Objects.equals(ipv6RaMode, that.ipv6RaMode)) { - return true; - } - } - return false; - } + return new SubnetConcreteBuilder(); + } + + @Override + public SubnetBuilder toBuilder() { + return new SubnetConcreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public void setId(String id) { + this.id = id; + } + + /** + * {@inheritDoc} + */ + @Override + public void setName(String name) { + this.name = name; + } + + /** + * {@inheritDoc} + */ + @Override + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + @JsonIgnore + public boolean isDHCPEnabled() { + return enableDHCP; + } + + /** + * {@inheritDoc} + */ + @Override + public String getNetworkId() { + return networkId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public List getDnsNames() { + return dnsNames; + } + + /** + * {@inheritDoc} + */ + @JsonIgnore + @Override + public List getAllocationPools() { + return pools; + } + + /** + * {@inheritDoc} + */ + @Override + public List getHostRoutes() { + return hostRoutes; + } + + /** + * {@inheritDoc} + */ + @Override + public IPVersionType getIpVersion() { + return ipVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public String getGateway() { + return gateway; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCidr() { + return cidr; + } + + /** + * {@inheritDoc} + */ + @Override + public Ipv6AddressMode getIpv6AddressMode() { + return ipv6AddressMode; + } + + /** + * {@inheritDoc} + */ + @Override + public Ipv6RaMode getIpv6RaMode() { + return ipv6RaMode; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("enableDHCP", enableDHCP).add("network-id", networkId) + .add("tenant_id", tenantId).add("dns_nameservers", dnsNames).add("allocation_pools", pools) + .add("host_routes", hostRoutes).add("ip_version", ipVersion).add("gateway_ip", gateway).add("cidr", cidr) + .add("ipv6AddressMode", ipv6AddressMode).add("ipv6RaMode", ipv6RaMode) + .toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return java.util.Objects.hash(id, name, enableDHCP, networkId, + tenantId, dnsNames, pools, hostRoutes, ipVersion, gateway, + cidr, ipv6AddressMode, ipv6RaMode); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj instanceof NeutronSubnet) { + NeutronSubnet that = (NeutronSubnet) obj; + if (java.util.Objects.equals(id, that.id) && + java.util.Objects.equals(name, that.name) && + java.util.Objects.equals(enableDHCP, that.enableDHCP) && + java.util.Objects.equals(networkId, that.networkId) && + java.util.Objects.equals(tenantId, that.tenantId) && + java.util.Objects.equals(dnsNames, that.dnsNames) && + java.util.Objects.equals(pools, that.pools) && + java.util.Objects.equals(hostRoutes, that.hostRoutes) && + java.util.Objects.equals(ipVersion, that.ipVersion) && + java.util.Objects.equals(gateway, that.gateway) && + java.util.Objects.equals(cidr, that.cidr) && + java.util.Objects.equals(ipv6AddressMode, that.ipv6AddressMode) && + java.util.Objects.equals(ipv6RaMode, that.ipv6RaMode)) { + return true; + } + } + return false; + } @JsonRootName("subnet") @JsonIgnoreProperties(ignoreUnknown = true) @@ -287,112 +276,112 @@ public NeutronSubnetNoGateway(String id, String name, boolean enableDHCP, String } } - public static class Subnets extends ListResult { + public static class Subnets extends ListResult { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("subnets") - private List subnets; + @JsonProperty("subnets") + private List subnets; - @Override - protected List value() { - return subnets; - } - } + @Override + protected List value() { + return subnets; + } + } - public static class SubnetConcreteBuilder extends ResourceBuilder implements SubnetBuilder { + public static class SubnetConcreteBuilder extends ResourceBuilder implements SubnetBuilder { - private NeutronSubnet m; + private NeutronSubnet m; private boolean isNoGateway = false; SubnetConcreteBuilder() { - this(new NeutronSubnet()); - } - - SubnetConcreteBuilder(NeutronSubnet m ) { - this.m = m; - } - - @Override - public SubnetBuilder networkId(String networkId) { - m.networkId = networkId; - return this; - } - - @Override - public SubnetBuilder network(Network network) { - m.networkId = network.getId(); - return this; - } - - @Override - public SubnetBuilder ipVersion(IPVersionType ipVersion) { - m.ipVersion = ipVersion; - return this; - } - - @Override - public SubnetBuilder cidr(String cidr) { - m.cidr = cidr; - return this; - } - - @Override - public SubnetBuilder gateway(String gateway) { - m.gateway = gateway; - return this; - } - - @Override - public SubnetBuilder addPool(String start, String end) { - if (m.pools == null) - m.pools = Lists.newArrayList(); - m.pools.add(new NeutronPool(start, end)); - return this; - } - - @Override - public SubnetBuilder enableDHCP(boolean enable) { - m.enableDHCP = enable; - return this; - } - - @Override - public SubnetBuilder noGateway() { - isNoGateway = true; - return this; - } - - @Override - public SubnetBuilder ipv6AddressMode(Ipv6AddressMode ipv6AddressMode) { - m.ipv6AddressMode = ipv6AddressMode; - return this; - } - - @Override - public SubnetBuilder ipv6RaMode(Ipv6RaMode ipv6RaMode) { - m.ipv6RaMode = ipv6RaMode; - return this; - } - - @Override - public Subnet build() { - if(isNoGateway) { + this(new NeutronSubnet()); + } + + SubnetConcreteBuilder(NeutronSubnet m) { + this.m = m; + } + + @Override + public SubnetBuilder networkId(String networkId) { + m.networkId = networkId; + return this; + } + + @Override + public SubnetBuilder network(Network network) { + m.networkId = network.getId(); + return this; + } + + @Override + public SubnetBuilder ipVersion(IPVersionType ipVersion) { + m.ipVersion = ipVersion; + return this; + } + + @Override + public SubnetBuilder cidr(String cidr) { + m.cidr = cidr; + return this; + } + + @Override + public SubnetBuilder gateway(String gateway) { + m.gateway = gateway; + return this; + } + + @Override + public SubnetBuilder addPool(String start, String end) { + if (m.pools == null) + m.pools = Lists.newArrayList(); + m.pools.add(new NeutronPool(start, end)); + return this; + } + + @Override + public SubnetBuilder enableDHCP(boolean enable) { + m.enableDHCP = enable; + return this; + } + + @Override + public SubnetBuilder noGateway() { + isNoGateway = true; + return this; + } + + @Override + public SubnetBuilder ipv6AddressMode(Ipv6AddressMode ipv6AddressMode) { + m.ipv6AddressMode = ipv6AddressMode; + return this; + } + + @Override + public SubnetBuilder ipv6RaMode(Ipv6RaMode ipv6RaMode) { + m.ipv6RaMode = ipv6RaMode; + return this; + } + + @Override + public Subnet build() { + if (isNoGateway) { return new NeutronSubnetNoGateway(m.id, m.name, m.enableDHCP, m.networkId, - m.tenantId, m.dnsNames, m.pools, m.hostRoutes, m.ipVersion, m.cidr, m.ipv6AddressMode, m.ipv6RaMode); + m.tenantId, m.dnsNames, m.pools, m.hostRoutes, m.ipVersion, m.cidr, m.ipv6AddressMode, m.ipv6RaMode); } return m; - } + } - @Override - public SubnetBuilder from(Subnet in) { - return this; - } + @Override + public SubnetBuilder from(Subnet in) { + return this; + } - @Override - protected Subnet reference() { - return m; - } + @Override + protected Subnet reference() { + return m; + } @Override public SubnetBuilder addDNSNameServer(String host) { @@ -415,5 +404,5 @@ public SubnetBuilder addHostRoute(String destination, String nexthop) { m.hostRoutes.add(new NeutronHostRoute(destination, nexthop)); return this; } - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnetUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnetUpdate.java index 3c25e78e4..5f88c4cb5 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnetUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnetUpdate.java @@ -1,18 +1,17 @@ package org.openstack4j.openstack.networking.domain; -import java.util.List; - -import org.openstack4j.model.ModelEntity; -import org.openstack4j.model.network.Subnet; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; +import org.openstack4j.model.network.Subnet; + +import java.util.List; /** * Encapsulates the updateable view for a Subnet within Neutron - * + * * @author Jeremy Unruh */ @JsonRootName("subnet") @@ -20,7 +19,7 @@ public class NeutronSubnetUpdate implements ModelEntity { private static final long serialVersionUID = 1L; - + @JsonProperty private String name; @JsonProperty("dns_nameservers") @@ -34,7 +33,7 @@ public class NeutronSubnetUpdate implements ModelEntity { private String gateway; @JsonProperty("enable_dhcp") private boolean enabledhcp; - + @SuppressWarnings("unchecked") public static NeutronSubnetUpdate createFromSubnet(Subnet in) { NeutronSubnetUpdate ns = new NeutronSubnetUpdate(); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java index f6cf5c6ef..2a376eaac 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java @@ -1,212 +1,211 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.ArrayList; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.api.Apis; import org.openstack4j.model.network.ext.FirewallPolicy; import org.openstack4j.model.network.ext.FirewallRule; import org.openstack4j.model.network.ext.builder.FirewallPolicyBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.ArrayList; +import java.util.List; /** * A Neutron Firewall (FwaaS) : Firewall Policy Entity. * *

This is the Parent class which is extended by {@link NeutronFirewallPolicy} & {@link NeutronFirewalPolicyRule} classes. - * Prior has `@JsonRootName("firewall_policy")` attribute whereas the later doesn't have - * (which is used by `rule_insert/rule_remove` calls - which doesn't require JsonRootName).

+ * Prior has `@JsonRootName("firewall_policy")` attribute whereas the later doesn't have + * (which is used by `rule_insert/rule_remove` calls - which doesn't require JsonRootName).

* + * @author Vishvesh Deshmukh * @see NeutronFirewallPolicy * @see NeutronFirewallPolicyRule - * - * @author Vishvesh Deshmukh */ public class AbstractNeutronFirewallPolicy implements FirewallPolicy { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - protected String id; + protected String id; - protected String name; + protected String name; - @JsonProperty("tenant_id") - protected String tenantId; + @JsonProperty("tenant_id") + protected String tenantId; - protected String description; + protected String description; - protected Boolean shared; + protected Boolean shared; - protected Boolean audited; + protected Boolean audited; - @JsonProperty("firewall_rules") - protected List firewallRules; + @JsonProperty("firewall_rules") + protected List firewallRules; - protected List neutronFirewallRules; + protected List neutronFirewallRules; - @JsonProperty("firewall_list") - private List firewallList; + @JsonProperty("firewall_list") + private List firewallList; - /** - * Wrap this FirewallPolicy to a builder - * @return FirewallPolicyBuilder - */ - @Override - public FirewallPolicyBuilder toBuilder() { - return new FirewallPolicyConcreteBuilder(this); - } + /** + * Wrap this FirewallPolicy to a builder + * + * @return FirewallPolicyBuilder + */ + @Override + public FirewallPolicyBuilder toBuilder() { + return new FirewallPolicyConcreteBuilder(this); + } - /** - * @return FirewallPolicyBuilder - */ - public static FirewallPolicyBuilder builder() { - return new FirewallPolicyConcreteBuilder(); - } + /** + * @return FirewallPolicyBuilder + */ + public static FirewallPolicyBuilder builder() { + return new FirewallPolicyConcreteBuilder(); + } - @Override - public String getId() { - return id; - } + @Override + public String getId() { + return id; + } - @Override - public String getName() { - return name; - } + @Override + public String getName() { + return name; + } - @Override - public String getTenantId() { - return tenantId; - } + @Override + public String getTenantId() { + return tenantId; + } - @Override - public String getDescription() { - return description; - } + @Override + public String getDescription() { + return description; + } - @Override - public Boolean isShared() { - return shared != null && shared; - } + @Override + public Boolean isShared() { + return shared != null && shared; + } - @Override - public Boolean isAudited() { - return audited != null && audited; - } + @Override + public Boolean isAudited() { + return audited != null && audited; + } - @JsonIgnore - @Override - public List getFirewallRuleIds() { - return firewallRules; - } + @JsonIgnore + @Override + public List getFirewallRuleIds() { + return firewallRules; + } - @JsonIgnore - @Override - public List getNeutronFirewallRules() { - neutronFirewallRules = new ArrayList(); + @JsonIgnore + @Override + public List getNeutronFirewallRules() { + neutronFirewallRules = new ArrayList(); if (neutronFirewallRules == null && (firewallRules != null && firewallRules.size() > 0)) { - neutronFirewallRules = new ArrayList(); + neutronFirewallRules = new ArrayList(); for (String ruleId : firewallRules) { NeutronFirewallRule rule = (NeutronFirewallRule) Apis.getNetworkingServices(). - firewalls().firewallrule().get(ruleId); + firewalls().firewallrule().get(ruleId); neutronFirewallRules.add(rule); } } return neutronFirewallRules; - } - - @Override - public List getFirewallList() { - return firewallList; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("shared", shared).add("audited", audited) - .add("tenantId", tenantId).add("description", description) - .add("firewallRuleIds", firewallRules).add("neutronFirewallRules", neutronFirewallRules) - .add("firewallList", firewallList) - .toString(); - } - - public static class FirewallPolicies extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("firewall_policies") - List firewallPolicies; - - @Override - public List value() { - return firewallPolicies; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("firewallPolicies", firewallPolicies).toString(); - } - } - - public static class FirewallPolicyConcreteBuilder implements FirewallPolicyBuilder { - NeutronFirewallPolicy f; - - @Override - public FirewallPolicy build() { - return f; - } - - public FirewallPolicyConcreteBuilder() { - this(new NeutronFirewallPolicy()); - } - - public FirewallPolicyConcreteBuilder(FirewallPolicy f) { - this.f = (NeutronFirewallPolicy) f; - } - - @Override - public FirewallPolicyBuilder from(FirewallPolicy in) { - this.f = (NeutronFirewallPolicy) in; - return this; - } - - @Override - public FirewallPolicyBuilder tenantId(String tenantId) { - f.tenantId = tenantId; - return this; - } - - @Override - public FirewallPolicyBuilder name(String name) { - f.name = name; - return this; - } - - @Override - public FirewallPolicyBuilder description(String description) { - f.description = description; - return this; - } - - @Override - public FirewallPolicyBuilder shared(Boolean shared) { - f.shared = shared; - return this; - } - - @Override - public FirewallPolicyBuilder audited(Boolean audited) { - f.audited = audited; - return this; - } - - @Override - public FirewallPolicyBuilder firewallRules(List ruleIdList) { - f.firewallRules = ruleIdList; - return this; - } - } + } + + @Override + public List getFirewallList() { + return firewallList; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("shared", shared).add("audited", audited) + .add("tenantId", tenantId).add("description", description) + .add("firewallRuleIds", firewallRules).add("neutronFirewallRules", neutronFirewallRules) + .add("firewallList", firewallList) + .toString(); + } + + public static class FirewallPolicies extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("firewall_policies") + List firewallPolicies; + + @Override + public List value() { + return firewallPolicies; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("firewallPolicies", firewallPolicies).toString(); + } + } + + public static class FirewallPolicyConcreteBuilder implements FirewallPolicyBuilder { + NeutronFirewallPolicy f; + + @Override + public FirewallPolicy build() { + return f; + } + + public FirewallPolicyConcreteBuilder() { + this(new NeutronFirewallPolicy()); + } + + public FirewallPolicyConcreteBuilder(FirewallPolicy f) { + this.f = (NeutronFirewallPolicy) f; + } + + @Override + public FirewallPolicyBuilder from(FirewallPolicy in) { + this.f = (NeutronFirewallPolicy) in; + return this; + } + + @Override + public FirewallPolicyBuilder tenantId(String tenantId) { + f.tenantId = tenantId; + return this; + } + + @Override + public FirewallPolicyBuilder name(String name) { + f.name = name; + return this; + } + + @Override + public FirewallPolicyBuilder description(String description) { + f.description = description; + return this; + } + + @Override + public FirewallPolicyBuilder shared(Boolean shared) { + f.shared = shared; + return this; + } + + @Override + public FirewallPolicyBuilder audited(Boolean audited) { + f.audited = audited; + return this; + } + + @Override + public FirewallPolicyBuilder firewallRules(List ruleIdList) { + f.firewallRules = ruleIdList; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/FirewallRuleStrategy.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/FirewallRuleStrategy.java index 7395352ef..6d8407b8f 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/FirewallRuleStrategy.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/FirewallRuleStrategy.java @@ -1,64 +1,64 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import org.openstack4j.model.ModelEntity; /** * Inserts a firewall rule in a firewall policy relative to the position of other rules. - * + * * @author Vishvesh Deshmukh */ public class FirewallRuleStrategy implements ModelEntity { - - /** - * Used to dictate insert strategy during Inserting a Firewall Rule in a Firewall Policy. - * @author Vishvesh Deshmukh - */ - public enum RuleInsertStrategyType { - BEFORE, AFTER - } + + /** + * Used to dictate insert strategy during Inserting a Firewall Rule in a Firewall Policy. + * + * @author Vishvesh Deshmukh + */ + public enum RuleInsertStrategyType { + BEFORE, AFTER + } private static final long serialVersionUID = 1L; - + @JsonProperty("firewall_rule_id") private String firewallRuleId; - + @JsonProperty("insert_after") private String insertAfterRuleId; - + @JsonProperty("insert_before") private String insertBeforeRuleId; public static FirewallRuleStrategy create(String firewallRuleId, RuleInsertStrategyType type, String insertAfterOrBeforeRuleId) { - FirewallRuleStrategy action = new FirewallRuleStrategy(); - action.firewallRuleId = firewallRuleId; + FirewallRuleStrategy action = new FirewallRuleStrategy(); + action.firewallRuleId = firewallRuleId; if (type == RuleInsertStrategyType.BEFORE) action.insertBeforeRuleId = insertAfterOrBeforeRuleId; else action.insertAfterRuleId = insertAfterOrBeforeRuleId; return action; } - + public static FirewallRuleStrategy remove(String firewallRuleId) { - FirewallRuleStrategy action = new FirewallRuleStrategy(); - action.firewallRuleId = firewallRuleId; - return action; + FirewallRuleStrategy action = new FirewallRuleStrategy(); + action.firewallRuleId = firewallRuleId; + return action; } - + @JsonIgnore public String getFirewallRuleId() { - return firewallRuleId; - } - + return firewallRuleId; + } + @JsonIgnore public String getInsertAfterRuleId() { - return insertAfterRuleId; - } - + return insertAfterRuleId; + } + @JsonIgnore public String getInsertBeforeRuleId() { - return insertBeforeRuleId; - } + return insertBeforeRuleId; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java index 2de5a0663..1d79008ed 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java @@ -2,31 +2,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * HttpMethod - * @author liujunpeng * + * @author liujunpeng */ public enum HttpMethod { - HEAD(0), GET(1), POST(2), PUT(2), PATCH(4), DELETE(5), OPTIONS(6), TRACE(7); - int code; + HEAD(0), GET(1), POST(2), PUT(2), PATCH(4), DELETE(5), OPTIONS(6), TRACE(7); + int code; - private HttpMethod(int code) { - this.code = code; - } + private HttpMethod(int code) { + this.code = code; + } - @JsonCreator - public static HttpMethod valueOf(int value) { - for (HttpMethod method : HttpMethod.values()) { - if (method.code() == value) { - return method; - } - } - return GET; - } + @JsonCreator + public static HttpMethod valueOf(int value) { + for (HttpMethod method : HttpMethod.values()) { + if (method.code() == value) { + return method; + } + } + return GET; + } - @JsonValue - public int code() { - return code; - } + @JsonValue + public int code() { + return code; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/ListItem.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/ListItem.java index d24d22ad9..a67e0e80e 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/ListItem.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/ListItem.java @@ -6,8 +6,9 @@ /** * Lbaas V2 lists of objects take the form - * "id":"the_id" + * "id":"the_id" * This class is used to hold these list items in the proper format + * * @author emjburns */ @JsonAutoDetect @@ -15,23 +16,23 @@ public class ListItem { @JsonProperty("id") String id; - public ListItem(){ + public ListItem() { } - public ListItem(String id){ + public ListItem(String id) { this.id = id; } - public String getId(){ + public String getId() { return id; } - public void setId(String id){ + public void setId(String id) { this.id = id; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronHealthMonitorV2Status.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronHealthMonitorV2Status.java index 91c60261a..608ea48c6 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronHealthMonitorV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronHealthMonitorV2Status.java @@ -9,6 +9,7 @@ /** * An object to hold status of lbaas v2 healthmonitor + * * @author emjburns */ @JsonRootName("healthmonitor") @@ -18,12 +19,12 @@ public class NeutronHealthMonitorV2Status extends Status implements HealthMonito @JsonProperty("type") private HealthMonitorType type; - public HealthMonitorType getType(){ + public HealthMonitorType getType() { return type; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("type", type) diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLbPoolV2Status.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLbPoolV2Status.java index 81b7607a8..fcff92a10 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLbPoolV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLbPoolV2Status.java @@ -12,6 +12,7 @@ /** * An object to hold status of lbaas v2 loadbalancer pool + * * @author emjburns */ @JsonRootName("pools") @@ -28,21 +29,21 @@ public class NeutronLbPoolV2Status extends Status implements LbPoolV2Status { private HealthMonitorV2Status healthMonitorStatus; @Override - public List getMemberStatuses(){ + public List getMemberStatuses() { return memberStatuses; } @Override - public HealthMonitorV2Status getHeathMonitorStatus(){ + public HealthMonitorV2Status getHeathMonitorStatus() { return healthMonitorStatus; } - public String getName(){ + public String getName() { return name; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("name", name) diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronListenerV2Status.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronListenerV2Status.java index 7a81ff39b..eef0f2e3d 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronListenerV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronListenerV2Status.java @@ -11,6 +11,7 @@ /** * An object to hold status of lbaas v2 listener + * * @author emjburns */ @JsonRootName("listeners") @@ -24,16 +25,16 @@ public class NeutronListenerV2Status extends Status implements ListenerV2Status List lbPoolStatuses; @Override - public List getLbPoolV2Statuses(){ + public List getLbPoolV2Statuses() { return lbPoolStatuses; } - public String getName(){ + public String getName() { return name; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("name", name) diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2Status.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2Status.java index 3bc3561db..7e1bf5d51 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2Status.java @@ -11,6 +11,7 @@ /** * An object to hold status of lbaas v2 loadbalancer + * * @author emjburns */ @JsonRootName("loadbalancer") @@ -23,16 +24,16 @@ public class NeutronLoadBalancerV2Status extends Status implements LoadBalancerV private List listenerStatuses; @Override - public List getListenerStatuses(){ + public List getListenerStatuses() { return listenerStatuses; } - public String getName(){ + public String getName() { return name; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("name", name) diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2StatusTree.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2StatusTree.java index 48471ea8b..089712c49 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2StatusTree.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronLoadBalancerV2StatusTree.java @@ -9,6 +9,7 @@ /** * The status tree of a lbaas v2 loadbalancer + * * @author emjburns */ @JsonRootName("statuses") @@ -19,12 +20,12 @@ public class NeutronLoadBalancerV2StatusTree implements LoadBalancerV2StatusTree private NeutronLoadBalancerV2Status loadBalancerStatus; @Override - public LoadBalancerV2Status getLoadBalancerV2Status(){ + public LoadBalancerV2Status getLoadBalancerV2Status() { return loadBalancerStatus; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("loadbalancer", loadBalancerStatus) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronMemberV2Status.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronMemberV2Status.java index 787f40e99..325cae59c 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronMemberV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/NeutronMemberV2Status.java @@ -8,6 +8,7 @@ /** * An object to hold status of lbaas v2 member + * * @author emjburns */ @JsonRootName("members") @@ -20,16 +21,16 @@ public class NeutronMemberV2Status extends Status implements MemberV2Status { @JsonProperty("address") private String address; - public Integer getProtocolPort(){ + public Integer getProtocolPort() { return protocolPort; } - public String getAddress(){ + public String getAddress() { return address; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("protocolPort", protocolPort) diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/Status.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/Status.java index 6c92a7aac..4f6c4bea6 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/Status.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/LoadBalancerV2StatusTree/Status.java @@ -5,6 +5,7 @@ /** * Abstract class for common status fields + * * @author emjburns */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -17,15 +18,15 @@ public abstract class Status { @JsonProperty("provisioning_status") public String provisioningStatus; - public String getId(){ + public String getId() { return id; } - public String getOperatingStatus(){ + public String getOperatingStatus() { return operatingStatus; } - public String getProvisioningStatus(){ + public String getProvisioningStatus() { return provisioningStatus; } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewall.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewall.java index afa22a340..0f95bbba8 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewall.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewall.java @@ -1,17 +1,12 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; - +import com.fasterxml.jackson.annotation.*; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.ext.Firewall; import org.openstack4j.model.network.ext.builder.FirewallBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * A Neutron Firewall (FwaaS) : Firewall Entity. @@ -22,214 +17,214 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronFirewall implements Firewall { - private static final long serialVersionUID = 1L; - - /** - *

The state of a Neutron (Firewall - FwaaS) entity.

- * - *

Indicates whether firewall resource is currently operational.

- * - * @author Vishvesh Deshmukh - */ - public enum FirewallStatus { - ACTIVE, - DOWN, - BUILD, - ERROR, - PENDING_CREATE, - PENDING_UPDATE, - PENDING_DELETE, - UNRECOGNIZED; - - @JsonCreator - public static FirewallStatus forValue(String value) { - if (value != null) - { - for (FirewallStatus s : FirewallStatus.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return FirewallStatus.UNRECOGNIZED; - } - } - - private String id; - - private String name; - - @JsonProperty("tenant_id") - private String tenantId; - - private String description; - - private Boolean shared; - - @JsonProperty("admin_state_up") + private static final long serialVersionUID = 1L; + + /** + *

The state of a Neutron (Firewall - FwaaS) entity.

+ * + *

Indicates whether firewall resource is currently operational.

+ * + * @author Vishvesh Deshmukh + */ + public enum FirewallStatus { + ACTIVE, + DOWN, + BUILD, + ERROR, + PENDING_CREATE, + PENDING_UPDATE, + PENDING_DELETE, + UNRECOGNIZED; + + @JsonCreator + public static FirewallStatus forValue(String value) { + if (value != null) { + for (FirewallStatus s : FirewallStatus.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return FirewallStatus.UNRECOGNIZED; + } + } + + private String id; + + private String name; + + @JsonProperty("tenant_id") + private String tenantId; + + private String description; + + private Boolean shared; + + @JsonProperty("admin_state_up") private Boolean adminStateUp; - private FirewallStatus status; - - @JsonProperty("firewall_policy_id") - private String policyId; - - @JsonProperty("router_ids") - private List routerIds; - - /** - * Wrap this Firewall to a builder - * @return FirewallBuilder - */ - @Override - public FirewallBuilder toBuilder() { - return new FirewallConcreteBuilder(this); - } - - /** - * @return FirewallBuilder - */ - public static FirewallBuilder builder() { - return new FirewallConcreteBuilder(); - } - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getTenantId() { - return tenantId; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public Boolean isAdminStateUp() { - return adminStateUp != null && adminStateUp; - } - - @Override - public Boolean isShared() { - return shared != null && shared; - } - - @Override - public FirewallStatus getStatus() { - return status; - } - - @Override - public List getRouterIds() { - return routerIds; - } - - @JsonIgnore - @Override - public String getPolicy() { - return policyId; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name) - .add("status", status).add("policyId", policyId) - .add("shared", shared).add("adminStateUp", adminStateUp) - .add("tenantId", tenantId).add("description", description) - .add("routerIds", routerIds) - .toString(); - } - - public static class Firewalls extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("firewalls") - List firewalls; - - @Override - public List value() { - return firewalls; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("firewalls", firewalls).toString(); - } - } - - public static class FirewallConcreteBuilder implements FirewallBuilder { - NeutronFirewall f; - - @Override - public Firewall build() { - return f; - } - - public FirewallConcreteBuilder() { - this(new NeutronFirewall()); - } - - public FirewallConcreteBuilder(NeutronFirewall f){ - this.f = f; - } - - @Override - public FirewallBuilder from(Firewall in) { - this.f = (NeutronFirewall) in; - return this; - } - - @Override - public FirewallBuilder tenantId(String tenantId) { - f.tenantId = tenantId; - return this; - } - - @Override - public FirewallBuilder name(String name) { - f.name = name; - return this; - } - - @Override - public FirewallBuilder description(String description) { - f.description = description; - return this; - } - - @Override - public FirewallBuilder adminStateUp(Boolean adminStateUp) { - f.adminStateUp = adminStateUp; - return this; - } - - @Override - public FirewallBuilder shared(Boolean shared) { - f.shared = shared; - return this; - } - - @Override - public FirewallBuilder policy(String policyId) { - f.policyId = policyId; - return this; - } - - @Override - public FirewallBuilder routerIds(List routerIds) { - f.routerIds = routerIds; - return this; - } - } + private FirewallStatus status; + + @JsonProperty("firewall_policy_id") + private String policyId; + + @JsonProperty("router_ids") + private List routerIds; + + /** + * Wrap this Firewall to a builder + * + * @return FirewallBuilder + */ + @Override + public FirewallBuilder toBuilder() { + return new FirewallConcreteBuilder(this); + } + + /** + * @return FirewallBuilder + */ + public static FirewallBuilder builder() { + return new FirewallConcreteBuilder(); + } + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getTenantId() { + return tenantId; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public Boolean isAdminStateUp() { + return adminStateUp != null && adminStateUp; + } + + @Override + public Boolean isShared() { + return shared != null && shared; + } + + @Override + public FirewallStatus getStatus() { + return status; + } + + @Override + public List getRouterIds() { + return routerIds; + } + + @JsonIgnore + @Override + public String getPolicy() { + return policyId; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name) + .add("status", status).add("policyId", policyId) + .add("shared", shared).add("adminStateUp", adminStateUp) + .add("tenantId", tenantId).add("description", description) + .add("routerIds", routerIds) + .toString(); + } + + public static class Firewalls extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("firewalls") + List firewalls; + + @Override + public List value() { + return firewalls; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("firewalls", firewalls).toString(); + } + } + + public static class FirewallConcreteBuilder implements FirewallBuilder { + NeutronFirewall f; + + @Override + public Firewall build() { + return f; + } + + public FirewallConcreteBuilder() { + this(new NeutronFirewall()); + } + + public FirewallConcreteBuilder(NeutronFirewall f) { + this.f = f; + } + + @Override + public FirewallBuilder from(Firewall in) { + this.f = (NeutronFirewall) in; + return this; + } + + @Override + public FirewallBuilder tenantId(String tenantId) { + f.tenantId = tenantId; + return this; + } + + @Override + public FirewallBuilder name(String name) { + f.name = name; + return this; + } + + @Override + public FirewallBuilder description(String description) { + f.description = description; + return this; + } + + @Override + public FirewallBuilder adminStateUp(Boolean adminStateUp) { + f.adminStateUp = adminStateUp; + return this; + } + + @Override + public FirewallBuilder shared(Boolean shared) { + f.shared = shared; + return this; + } + + @Override + public FirewallBuilder policy(String policyId) { + f.policyId = policyId; + return this; + } + + @Override + public FirewallBuilder routerIds(List routerIds) { + f.routerIds = routerIds; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicy.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicy.java index 93aa5df86..ce68b6c34 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicy.java @@ -4,17 +4,15 @@ import com.fasterxml.jackson.annotation.JsonRootName; /** - * * A Neutron Firewall (FwaaS) : Firewall Policy Entity. - * - *

This is the child class of {@link AbstractNeutronFirewallPolicy} - which requires JsonRootName firewall_policy.

- * - * @see AbstractNeutronFirewallPolicy - * + * + *

This is the child class of {@link AbstractNeutronFirewallPolicy} - which requires JsonRootName firewall_policy.

+ * * @author Vishvesh Deshmukh + * @see AbstractNeutronFirewallPolicy */ @JsonRootName("firewall_policy") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronFirewallPolicy extends AbstractNeutronFirewallPolicy { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyRule.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyRule.java index 6a66dfa0e..8577e9dfa 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyRule.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyRule.java @@ -4,15 +4,14 @@ /** * A Neutron Firewall (FwaaS) : Firewall Policy Entity. - * - *

This is the child class of {@link AbstractNeutronFirewallPolicy} which is used by `rule_insert/rule_remove` calls - * - which doesn't require JsonRootName firewall_policy.

- * - * @see AbstractNeutronFirewallPolicy - * + * + *

This is the child class of {@link AbstractNeutronFirewallPolicy} which is used by `rule_insert/rule_remove` calls + * - which doesn't require JsonRootName firewall_policy.

+ * * @author Vishvesh Deshmukh + * @see AbstractNeutronFirewallPolicy */ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronFirewallPolicyRule extends AbstractNeutronFirewallPolicy { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyUpdate.java index d0ed7129a..636ad49b7 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallPolicyUpdate.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; - -import org.openstack4j.model.network.ext.FirewallPolicyUpdate; -import org.openstack4j.model.network.ext.builder.FirewallPolicyUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.FirewallPolicyUpdate; +import org.openstack4j.model.network.ext.builder.FirewallPolicyUpdateBuilder; + +import java.util.List; /** * An entity used to update Neutron Firewall Policy (FwaaS). @@ -20,123 +19,124 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronFirewallPolicyUpdate implements FirewallPolicyUpdate { - private static final long serialVersionUID = 1L; - - private String name; - - @JsonProperty("tenant_id") - private String tenantId; - - private String description; - - private Boolean shared; - - private Boolean audited; - - @JsonProperty("firewall_rules") - private List firewallRules; - - /** - * Wrap this FirewallPolicyUpdate to a builder - * @return FirewallPolicyUpdateBuilder - */ - @Override - public FirewallPolicyUpdateBuilder toBuilder() { - return new FirewallPolicyUpdateConcreteBuilder(this); - } - - /** - * @return FirewallPolicyUpdateBuilder - */ - public static FirewallPolicyUpdateBuilder builder() { - return new FirewallPolicyUpdateConcreteBuilder(); - } - - @Override - public String getName() { - return name; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public Boolean isShared() { - return shared != null && shared; - } - - @Override - public Boolean isAudited() { - return audited != null && audited; - } - - @JsonIgnore - @Override - public List getFirewallRuleIds() { - return firewallRules; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("shared", shared).add("audited", audited) - .add("tenantId", tenantId).add("description", description) - .add("firewallRuleIds", firewallRules) - .toString(); - } - - public static class FirewallPolicyUpdateConcreteBuilder implements FirewallPolicyUpdateBuilder { - NeutronFirewallPolicyUpdate f; - - @Override - public FirewallPolicyUpdate build() { - return f; - } - - public FirewallPolicyUpdateConcreteBuilder() { - this(new NeutronFirewallPolicyUpdate()); - } - - public FirewallPolicyUpdateConcreteBuilder(NeutronFirewallPolicyUpdate f){ - this.f = f; - } - - @Override - public FirewallPolicyUpdateBuilder from(FirewallPolicyUpdate in) { - this.f = (NeutronFirewallPolicyUpdate) in; - return this; - } - - @Override - public FirewallPolicyUpdateBuilder name(String name) { - f.name = name; - return this; - } - - @Override - public FirewallPolicyUpdateBuilder description(String description) { - f.description = description; - return this; - } - - @Override - public FirewallPolicyUpdateBuilder shared(Boolean shared) { - f.shared = shared; - return this; - } - - @Override - public FirewallPolicyUpdateBuilder audited(Boolean audited) { - f.audited = audited; - return this; - } - - @Override - public FirewallPolicyUpdateBuilder firewallRules(List ruleIdList) { - f.firewallRules = ruleIdList; - return this; - } - } + private static final long serialVersionUID = 1L; + + private String name; + + @JsonProperty("tenant_id") + private String tenantId; + + private String description; + + private Boolean shared; + + private Boolean audited; + + @JsonProperty("firewall_rules") + private List firewallRules; + + /** + * Wrap this FirewallPolicyUpdate to a builder + * + * @return FirewallPolicyUpdateBuilder + */ + @Override + public FirewallPolicyUpdateBuilder toBuilder() { + return new FirewallPolicyUpdateConcreteBuilder(this); + } + + /** + * @return FirewallPolicyUpdateBuilder + */ + public static FirewallPolicyUpdateBuilder builder() { + return new FirewallPolicyUpdateConcreteBuilder(); + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public Boolean isShared() { + return shared != null && shared; + } + + @Override + public Boolean isAudited() { + return audited != null && audited; + } + + @JsonIgnore + @Override + public List getFirewallRuleIds() { + return firewallRules; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", name).add("shared", shared).add("audited", audited) + .add("tenantId", tenantId).add("description", description) + .add("firewallRuleIds", firewallRules) + .toString(); + } + + public static class FirewallPolicyUpdateConcreteBuilder implements FirewallPolicyUpdateBuilder { + NeutronFirewallPolicyUpdate f; + + @Override + public FirewallPolicyUpdate build() { + return f; + } + + public FirewallPolicyUpdateConcreteBuilder() { + this(new NeutronFirewallPolicyUpdate()); + } + + public FirewallPolicyUpdateConcreteBuilder(NeutronFirewallPolicyUpdate f) { + this.f = f; + } + + @Override + public FirewallPolicyUpdateBuilder from(FirewallPolicyUpdate in) { + this.f = (NeutronFirewallPolicyUpdate) in; + return this; + } + + @Override + public FirewallPolicyUpdateBuilder name(String name) { + f.name = name; + return this; + } + + @Override + public FirewallPolicyUpdateBuilder description(String description) { + f.description = description; + return this; + } + + @Override + public FirewallPolicyUpdateBuilder shared(Boolean shared) { + f.shared = shared; + return this; + } + + @Override + public FirewallPolicyUpdateBuilder audited(Boolean audited) { + f.audited = audited; + return this; + } + + @Override + public FirewallPolicyUpdateBuilder firewallRules(List ruleIdList) { + f.firewallRules = ruleIdList; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRule.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRule.java index 65be5400a..48540b404 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRule.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRule.java @@ -1,18 +1,13 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; - +import com.fasterxml.jackson.annotation.*; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.IPVersionType; import org.openstack4j.model.network.ext.FirewallRule; import org.openstack4j.model.network.ext.builder.FirewallRuleBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.common.base.MoreObjects; +import java.util.List; /** * A Neutron Firewall (FwaaS) : Firewall Rule Entity. @@ -23,319 +18,319 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronFirewallRule implements FirewallRule { - private static final long serialVersionUID = 1L; - - /** - *

Action of a Neutron (Firewall Rule - FwaaS) entity.

- * - *

Indicates whether firewall rule resource has action ALLOW/DENY.

- * - * @author Vishvesh Deshmukh - */ - public enum FirewallRuleAction { - ALLOW, - DENY, - UNRECOGNIZED; - - @JsonCreator - public static FirewallRuleAction value(String v) - { - if (v == null) return UNRECOGNIZED; - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - - @JsonValue - public String value() { - return name().toLowerCase(); - } - } - - /** - *

IPProtocolType of a Neutron (Firewall Rule - FwaaS) entity.

- * - *

Represents an IPProtocolType of a Neutron (Firewall Rule - FwaaS) entity.

- * - * @author Vishvesh Deshmukh - */ - public enum IPProtocol { - TCP, - UDP, - ICMP, - UNRECOGNIZED; - - @JsonCreator - public static IPProtocol value(String v) { - if (v == null) return UNRECOGNIZED; - try { - return valueOf(v.toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - - @JsonValue - public String value() { - return name().toLowerCase(); - } - } - - private String id; - - private String name; - - @JsonProperty("tenant_id") - private String tenantId; - - private String description; - - private Boolean enabled; - - private Boolean shared; - - @JsonProperty("firewall_policy_id") - private String policyId; - - private FirewallRuleAction action; - - @JsonProperty("source_ip_address") - private String sourceIpAddress; - - @JsonProperty("destination_ip_address") - private String destinationIpAddress; - - private Integer position; - - private IPProtocol protocol; - - @JsonProperty("ip_version") - private IPVersionType ipVersion; - - @JsonProperty("source_port") - private String sourcePort; - - @JsonProperty("destination_port") - private String destinationPort; - - /** - * Wrap this FirewallRule to a builder - * @return FirewallRuleBuilder - */ - @Override - public FirewallRuleBuilder toBuilder() { - return new FirewallRuleConcreteBuilder(this); - } - - /** - * @return FirewallRuleBuilder - */ - public static FirewallRuleBuilder builder() { - return new FirewallRuleConcreteBuilder(); - } - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getTenantId() { - return tenantId; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public Boolean isShared() { - return shared != null && shared; - } - - @Override - public String getPolicy() { - return policyId; - } - - @Override - public IPProtocol getProtocol() { - return protocol; - } - - @Override - public IPVersionType getIpVersion() { - return ipVersion; - } - - @Override - public String getSourceIpAddress() { - return sourceIpAddress; - } - - @Override - public String getDestinationIpAddress() { - return destinationIpAddress; - } - - @Override - public String getSourcePort() { - return sourcePort; - } - - @Override - public String getDestinationPort() { - return destinationPort; - } - - @Override - public Integer getPosition() { - return position; - } - - @Override - public FirewallRuleAction getAction() { - return action; - } - - @Override - public Boolean isEnabled() { - return enabled != null && enabled; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("position", position) - .add("action", action).add("ipVersion", ipVersion) - .add("policyId", policyId).add("enabled", enabled) - .add("shared", shared).add("tenantId", tenantId) - .add("sourceIpAddress", sourceIpAddress) - .add("destinationIpAddress", destinationIpAddress) - .add("sourcePort", sourcePort).add("destinationPort", destinationPort) - .add("description", description).add("protocol", protocol) - .toString(); - } - - public static class FirewallRules extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("firewall_rules") - List firewallRules; - - @Override - public List value() { - return firewallRules; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("firewall_rules", firewallRules).toString(); - } - } - - public static class FirewallRuleConcreteBuilder implements FirewallRuleBuilder { - NeutronFirewallRule f; - - @Override - public FirewallRule build() { - return f; - } - - public FirewallRuleConcreteBuilder() { - this(new NeutronFirewallRule()); - } - - public FirewallRuleConcreteBuilder(NeutronFirewallRule f){ - this.f = f; - } - - @Override - public FirewallRuleBuilder from(FirewallRule in) { - this.f = (NeutronFirewallRule) in; - return this; - } - - @Override - public FirewallRuleBuilder tenantId(String tenantId) { - f.tenantId = tenantId; - return this; - } - - @Override - public FirewallRuleBuilder name(String name) { - f.name = name; - return this; - } - - @Override - public FirewallRuleBuilder description(String description) { - f.description = description; - return this; - } - - @Override - public FirewallRuleBuilder shared(Boolean shared) { - f.shared = shared; - return this; - } - - @Override - public FirewallRuleBuilder protocol(IPProtocol protocol) { - f.protocol = protocol; - return this; - } - - @Override - public FirewallRuleBuilder ipVersion(IPVersionType ipVersion) { - f.ipVersion = ipVersion; - return this; - } - - @Override - public FirewallRuleBuilder sourceIpAddress(String sourceIpAddress) { - f.sourceIpAddress = sourceIpAddress; - return this; - } - - @Override - public FirewallRuleBuilder destinationIpAddress(String destinationIpAddress) { - f.destinationIpAddress = destinationIpAddress; - return this; - } - - @Override - public FirewallRuleBuilder sourcePort(String sourcePort) { - f.sourcePort = sourcePort; - return this; - } - - @Override - public FirewallRuleBuilder destinationPort(String destinationPort) { - f.destinationPort = destinationPort; - return this; - } - - @Override - public FirewallRuleBuilder action(FirewallRuleAction action) { - f.action = action; - return this; - } - - @Override - public FirewallRuleBuilder enabled(Boolean enabled) { - f.enabled = enabled; - return this; - } - } + private static final long serialVersionUID = 1L; + + /** + *

Action of a Neutron (Firewall Rule - FwaaS) entity.

+ * + *

Indicates whether firewall rule resource has action ALLOW/DENY.

+ * + * @author Vishvesh Deshmukh + */ + public enum FirewallRuleAction { + ALLOW, + DENY, + UNRECOGNIZED; + + @JsonCreator + public static FirewallRuleAction value(String v) { + if (v == null) return UNRECOGNIZED; + try { + return valueOf(v.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + + @JsonValue + public String value() { + return name().toLowerCase(); + } + } + + /** + *

IPProtocolType of a Neutron (Firewall Rule - FwaaS) entity.

+ * + *

Represents an IPProtocolType of a Neutron (Firewall Rule - FwaaS) entity.

+ * + * @author Vishvesh Deshmukh + */ + public enum IPProtocol { + TCP, + UDP, + ICMP, + UNRECOGNIZED; + + @JsonCreator + public static IPProtocol value(String v) { + if (v == null) return UNRECOGNIZED; + try { + return valueOf(v.toUpperCase()); + } catch (IllegalArgumentException e) { + return UNRECOGNIZED; + } + } + + @JsonValue + public String value() { + return name().toLowerCase(); + } + } + + private String id; + + private String name; + + @JsonProperty("tenant_id") + private String tenantId; + + private String description; + + private Boolean enabled; + + private Boolean shared; + + @JsonProperty("firewall_policy_id") + private String policyId; + + private FirewallRuleAction action; + + @JsonProperty("source_ip_address") + private String sourceIpAddress; + + @JsonProperty("destination_ip_address") + private String destinationIpAddress; + + private Integer position; + + private IPProtocol protocol; + + @JsonProperty("ip_version") + private IPVersionType ipVersion; + + @JsonProperty("source_port") + private String sourcePort; + + @JsonProperty("destination_port") + private String destinationPort; + + /** + * Wrap this FirewallRule to a builder + * + * @return FirewallRuleBuilder + */ + @Override + public FirewallRuleBuilder toBuilder() { + return new FirewallRuleConcreteBuilder(this); + } + + /** + * @return FirewallRuleBuilder + */ + public static FirewallRuleBuilder builder() { + return new FirewallRuleConcreteBuilder(); + } + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getTenantId() { + return tenantId; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public Boolean isShared() { + return shared != null && shared; + } + + @Override + public String getPolicy() { + return policyId; + } + + @Override + public IPProtocol getProtocol() { + return protocol; + } + + @Override + public IPVersionType getIpVersion() { + return ipVersion; + } + + @Override + public String getSourceIpAddress() { + return sourceIpAddress; + } + + @Override + public String getDestinationIpAddress() { + return destinationIpAddress; + } + + @Override + public String getSourcePort() { + return sourcePort; + } + + @Override + public String getDestinationPort() { + return destinationPort; + } + + @Override + public Integer getPosition() { + return position; + } + + @Override + public FirewallRuleAction getAction() { + return action; + } + + @Override + public Boolean isEnabled() { + return enabled != null && enabled; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("position", position) + .add("action", action).add("ipVersion", ipVersion) + .add("policyId", policyId).add("enabled", enabled) + .add("shared", shared).add("tenantId", tenantId) + .add("sourceIpAddress", sourceIpAddress) + .add("destinationIpAddress", destinationIpAddress) + .add("sourcePort", sourcePort).add("destinationPort", destinationPort) + .add("description", description).add("protocol", protocol) + .toString(); + } + + public static class FirewallRules extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("firewall_rules") + List firewallRules; + + @Override + public List value() { + return firewallRules; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("firewall_rules", firewallRules).toString(); + } + } + + public static class FirewallRuleConcreteBuilder implements FirewallRuleBuilder { + NeutronFirewallRule f; + + @Override + public FirewallRule build() { + return f; + } + + public FirewallRuleConcreteBuilder() { + this(new NeutronFirewallRule()); + } + + public FirewallRuleConcreteBuilder(NeutronFirewallRule f) { + this.f = f; + } + + @Override + public FirewallRuleBuilder from(FirewallRule in) { + this.f = (NeutronFirewallRule) in; + return this; + } + + @Override + public FirewallRuleBuilder tenantId(String tenantId) { + f.tenantId = tenantId; + return this; + } + + @Override + public FirewallRuleBuilder name(String name) { + f.name = name; + return this; + } + + @Override + public FirewallRuleBuilder description(String description) { + f.description = description; + return this; + } + + @Override + public FirewallRuleBuilder shared(Boolean shared) { + f.shared = shared; + return this; + } + + @Override + public FirewallRuleBuilder protocol(IPProtocol protocol) { + f.protocol = protocol; + return this; + } + + @Override + public FirewallRuleBuilder ipVersion(IPVersionType ipVersion) { + f.ipVersion = ipVersion; + return this; + } + + @Override + public FirewallRuleBuilder sourceIpAddress(String sourceIpAddress) { + f.sourceIpAddress = sourceIpAddress; + return this; + } + + @Override + public FirewallRuleBuilder destinationIpAddress(String destinationIpAddress) { + f.destinationIpAddress = destinationIpAddress; + return this; + } + + @Override + public FirewallRuleBuilder sourcePort(String sourcePort) { + f.sourcePort = sourcePort; + return this; + } + + @Override + public FirewallRuleBuilder destinationPort(String destinationPort) { + f.destinationPort = destinationPort; + return this; + } + + @Override + public FirewallRuleBuilder action(FirewallRuleAction action) { + f.action = action; + return this; + } + + @Override + public FirewallRuleBuilder enabled(Boolean enabled) { + f.enabled = enabled; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRuleUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRuleUpdate.java index 1190701b7..0d1a84d31 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRuleUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallRuleUpdate.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.networking.domain.ext; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.IPVersionType; import org.openstack4j.model.network.ext.FirewallRuleUpdate; import org.openstack4j.model.network.ext.builder.FirewallRuleUpdateBuilder; import org.openstack4j.openstack.networking.domain.ext.NeutronFirewallRule.FirewallRuleAction; import org.openstack4j.openstack.networking.domain.ext.NeutronFirewallRule.IPProtocol; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; - /** * An entity used to update Neutron Firewall Rule (FwaaS). * @@ -20,218 +19,219 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronFirewallRuleUpdate implements FirewallRuleUpdate { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private String name; + private String name; - @JsonProperty("tenant_id") - private String tenantId; + @JsonProperty("tenant_id") + private String tenantId; - private String description; + private String description; - private Boolean enabled; + private Boolean enabled; - private Boolean shared; + private Boolean shared; - private FirewallRuleAction action; - - @JsonProperty("source_ip_address") - private String sourceIpAddress; - - @JsonProperty("destination_ip_address") - private String destinationIpAddress; - - private IPProtocol protocol; - - @JsonProperty("ip_version") - private IPVersionType ipVersion; - - @JsonProperty("source_port") - private String sourcePort; - - @JsonProperty("destination_port") - private String destinationPort; - - /** - * Wrap this FirewallRuleUpdate to a builder - * @return FirewallRuleUpdateBuilder - */ - @Override - public FirewallRuleUpdateBuilder toBuilder() { - return new FirewallRuleUpdateConcreteBuilder(this); - } - - /** - * @return FirewallRuleUpdateBuilder - */ - public static FirewallRuleUpdateBuilder builder() { - return new FirewallRuleUpdateConcreteBuilder(); - } - - @Override - public String getName() { - return name; - } - - @Override - public String getTenantId() { - return tenantId; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public Boolean isShared() { - return shared != null && shared; - } - - @Override - public IPProtocol getProtocol() { - return protocol; - } - - @Override - public IPVersionType getIpVersion() { - return ipVersion; - } - - @Override - public String getSourceIpAddress() { - return sourceIpAddress; - } - - @Override - public String getDestinationIpAddress() { - return destinationIpAddress; - } - - @Override - public String getSourcePort() { - return sourcePort; - } - - @Override - public String getDestinationPort() { - return destinationPort; - } - - @Override - public FirewallRuleAction getAction() { - return action; - } - - @Override - public Boolean isEnabled() { - return enabled != null && enabled; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("action", action).add("ipVersion", ipVersion) - .add("enabled", enabled).add("shared", shared).add("tenantId", tenantId) - .add("sourceIpAddress", sourceIpAddress) - .add("destinationIpAddress", destinationIpAddress) - .add("sourcePort", sourcePort).add("destinationPort", destinationPort) - .add("description", description).add("protocol", protocol) - .toString(); - } - - public static class FirewallRuleUpdateConcreteBuilder implements FirewallRuleUpdateBuilder { - NeutronFirewallRuleUpdate f; - - @Override - public FirewallRuleUpdate build() { - return f; - } - - public FirewallRuleUpdateConcreteBuilder() { - this(new NeutronFirewallRuleUpdate()); - } - - public FirewallRuleUpdateConcreteBuilder(NeutronFirewallRuleUpdate f){ - this.f = f; - } - - @Override - public FirewallRuleUpdateBuilder from(FirewallRuleUpdate in) { - this.f = (NeutronFirewallRuleUpdate) in; - return this; - } - - @Override - public FirewallRuleUpdateBuilder tenantId(String tenantId) { - f.tenantId = tenantId; - return this; - } - - @Override - public FirewallRuleUpdateBuilder name(String name) { - f.name = name; - return this; - } - - @Override - public FirewallRuleUpdateBuilder description(String description) { - f.description = description; - return this; - } - - @Override - public FirewallRuleUpdateBuilder shared(Boolean shared) { - f.shared = shared; - return this; - } - - @Override - public FirewallRuleUpdateBuilder protocol(IPProtocol protocol) { - f.protocol = protocol; - return this; - } - - @Override - public FirewallRuleUpdateBuilder ipVersion(IPVersionType ipVersion) { - f.ipVersion = ipVersion; - return this; - } - - @Override - public FirewallRuleUpdateBuilder sourceIpAddress(String sourceIpAddress) { - f.sourceIpAddress = sourceIpAddress; - return this; - } - - @Override - public FirewallRuleUpdateBuilder destinationIpAddress(String destinationIpAddress) { - f.destinationIpAddress = destinationIpAddress; - return this; - } - - @Override - public FirewallRuleUpdateBuilder sourcePort(String sourcePort) { - f.sourcePort = sourcePort; - return this; - } - - @Override - public FirewallRuleUpdateBuilder destinationPort(String destinationPort) { - f.destinationPort = destinationPort; - return this; - } - - @Override - public FirewallRuleUpdateBuilder action(FirewallRuleAction action) { - f.action = action; - return this; - } - - @Override - public FirewallRuleUpdateBuilder enabled(Boolean enabled) { - f.enabled = enabled; - return this; - } - } + private FirewallRuleAction action; + + @JsonProperty("source_ip_address") + private String sourceIpAddress; + + @JsonProperty("destination_ip_address") + private String destinationIpAddress; + + private IPProtocol protocol; + + @JsonProperty("ip_version") + private IPVersionType ipVersion; + + @JsonProperty("source_port") + private String sourcePort; + + @JsonProperty("destination_port") + private String destinationPort; + + /** + * Wrap this FirewallRuleUpdate to a builder + * + * @return FirewallRuleUpdateBuilder + */ + @Override + public FirewallRuleUpdateBuilder toBuilder() { + return new FirewallRuleUpdateConcreteBuilder(this); + } + + /** + * @return FirewallRuleUpdateBuilder + */ + public static FirewallRuleUpdateBuilder builder() { + return new FirewallRuleUpdateConcreteBuilder(); + } + + @Override + public String getName() { + return name; + } + + @Override + public String getTenantId() { + return tenantId; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public Boolean isShared() { + return shared != null && shared; + } + + @Override + public IPProtocol getProtocol() { + return protocol; + } + + @Override + public IPVersionType getIpVersion() { + return ipVersion; + } + + @Override + public String getSourceIpAddress() { + return sourceIpAddress; + } + + @Override + public String getDestinationIpAddress() { + return destinationIpAddress; + } + + @Override + public String getSourcePort() { + return sourcePort; + } + + @Override + public String getDestinationPort() { + return destinationPort; + } + + @Override + public FirewallRuleAction getAction() { + return action; + } + + @Override + public Boolean isEnabled() { + return enabled != null && enabled; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", name).add("action", action).add("ipVersion", ipVersion) + .add("enabled", enabled).add("shared", shared).add("tenantId", tenantId) + .add("sourceIpAddress", sourceIpAddress) + .add("destinationIpAddress", destinationIpAddress) + .add("sourcePort", sourcePort).add("destinationPort", destinationPort) + .add("description", description).add("protocol", protocol) + .toString(); + } + + public static class FirewallRuleUpdateConcreteBuilder implements FirewallRuleUpdateBuilder { + NeutronFirewallRuleUpdate f; + + @Override + public FirewallRuleUpdate build() { + return f; + } + + public FirewallRuleUpdateConcreteBuilder() { + this(new NeutronFirewallRuleUpdate()); + } + + public FirewallRuleUpdateConcreteBuilder(NeutronFirewallRuleUpdate f) { + this.f = f; + } + + @Override + public FirewallRuleUpdateBuilder from(FirewallRuleUpdate in) { + this.f = (NeutronFirewallRuleUpdate) in; + return this; + } + + @Override + public FirewallRuleUpdateBuilder tenantId(String tenantId) { + f.tenantId = tenantId; + return this; + } + + @Override + public FirewallRuleUpdateBuilder name(String name) { + f.name = name; + return this; + } + + @Override + public FirewallRuleUpdateBuilder description(String description) { + f.description = description; + return this; + } + + @Override + public FirewallRuleUpdateBuilder shared(Boolean shared) { + f.shared = shared; + return this; + } + + @Override + public FirewallRuleUpdateBuilder protocol(IPProtocol protocol) { + f.protocol = protocol; + return this; + } + + @Override + public FirewallRuleUpdateBuilder ipVersion(IPVersionType ipVersion) { + f.ipVersion = ipVersion; + return this; + } + + @Override + public FirewallRuleUpdateBuilder sourceIpAddress(String sourceIpAddress) { + f.sourceIpAddress = sourceIpAddress; + return this; + } + + @Override + public FirewallRuleUpdateBuilder destinationIpAddress(String destinationIpAddress) { + f.destinationIpAddress = destinationIpAddress; + return this; + } + + @Override + public FirewallRuleUpdateBuilder sourcePort(String sourcePort) { + f.sourcePort = sourcePort; + return this; + } + + @Override + public FirewallRuleUpdateBuilder destinationPort(String destinationPort) { + f.destinationPort = destinationPort; + return this; + } + + @Override + public FirewallRuleUpdateBuilder action(FirewallRuleAction action) { + f.action = action; + return this; + } + + @Override + public FirewallRuleUpdateBuilder enabled(Boolean enabled) { + f.enabled = enabled; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallUpdate.java index a33541276..ae5e1769c 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFirewallUpdate.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.FirewallUpdate; -import org.openstack4j.model.network.ext.builder.FirewallUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.FirewallUpdate; +import org.openstack4j.model.network.ext.builder.FirewallUpdateBuilder; /** * An entity used to update Neutron Firewall (FwaaS). @@ -18,135 +17,137 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronFirewallUpdate implements FirewallUpdate { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private String name; + private String name; - @JsonProperty("tenant_id") - private String tenantId; + @JsonProperty("tenant_id") + private String tenantId; - private String description; + private String description; - private Boolean shared; + private Boolean shared; - @JsonProperty("admin_state_up") + @JsonProperty("admin_state_up") private Boolean adminStateUp; - @JsonProperty("firewall_policy_id") - private String policyId; - - /** - * Wrap this Firewall to a builder - * @return FirewallUpdateBuilder - */ - @Override - public FirewallUpdateBuilder toBuilder() { - return new FirewallUpdateConcreteBuilder(this); - } - - /** - * @return FirewallUpdateBuilder - */ - public static FirewallUpdateBuilder builder() { - return new FirewallUpdateConcreteBuilder(); - } - - @Override - public String getName() { - return name; - } - - @Override - public String getTenantId() { - return tenantId; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public Boolean isAdminStateUp() { - return adminStateUp != null && adminStateUp; - } - - @Override - public Boolean isShared() { - return shared != null && shared; - } - @JsonIgnore - @Override - public String getPolicy() { - return policyId; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("policyId", policyId) - .add("shared", shared).add("adminStateUp", adminStateUp) - .add("tenantId", tenantId).add("description", description) - .toString(); - } - - public static class FirewallUpdateConcreteBuilder implements FirewallUpdateBuilder { - NeutronFirewallUpdate f; - - @Override - public FirewallUpdate build() { - return f; - } - - public FirewallUpdateConcreteBuilder() { - this(new NeutronFirewallUpdate()); - } - - public FirewallUpdateConcreteBuilder(NeutronFirewallUpdate f) { - this.f = f; - } - - @Override - public FirewallUpdateBuilder from(FirewallUpdate in) { - this.f = (NeutronFirewallUpdate) in; - return this; - } - - @Override - public FirewallUpdateBuilder tenantId(String tenantId) { - f.tenantId = tenantId; - return this; - } - - @Override - public FirewallUpdateBuilder name(String name) { - f.name = name; - return this; - } - - @Override - public FirewallUpdateBuilder description(String description) { - f.description = description; - return this; - } - - @Override - public FirewallUpdateBuilder adminStateUp(Boolean adminStateUp) { - f.adminStateUp = adminStateUp; - return this; - } - - @Override - public FirewallUpdateBuilder shared(Boolean shared) { - f.shared = shared; - return this; - } - - @Override - public FirewallUpdateBuilder policy(String policyId) { - f.policyId = policyId; - return this; - } - } + @JsonProperty("firewall_policy_id") + private String policyId; + + /** + * Wrap this Firewall to a builder + * + * @return FirewallUpdateBuilder + */ + @Override + public FirewallUpdateBuilder toBuilder() { + return new FirewallUpdateConcreteBuilder(this); + } + + /** + * @return FirewallUpdateBuilder + */ + public static FirewallUpdateBuilder builder() { + return new FirewallUpdateConcreteBuilder(); + } + + @Override + public String getName() { + return name; + } + + @Override + public String getTenantId() { + return tenantId; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public Boolean isAdminStateUp() { + return adminStateUp != null && adminStateUp; + } + + @Override + public Boolean isShared() { + return shared != null && shared; + } + + @JsonIgnore + @Override + public String getPolicy() { + return policyId; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", name).add("policyId", policyId) + .add("shared", shared).add("adminStateUp", adminStateUp) + .add("tenantId", tenantId).add("description", description) + .toString(); + } + + public static class FirewallUpdateConcreteBuilder implements FirewallUpdateBuilder { + NeutronFirewallUpdate f; + + @Override + public FirewallUpdate build() { + return f; + } + + public FirewallUpdateConcreteBuilder() { + this(new NeutronFirewallUpdate()); + } + + public FirewallUpdateConcreteBuilder(NeutronFirewallUpdate f) { + this.f = f; + } + + @Override + public FirewallUpdateBuilder from(FirewallUpdate in) { + this.f = (NeutronFirewallUpdate) in; + return this; + } + + @Override + public FirewallUpdateBuilder tenantId(String tenantId) { + f.tenantId = tenantId; + return this; + } + + @Override + public FirewallUpdateBuilder name(String name) { + f.name = name; + return this; + } + + @Override + public FirewallUpdateBuilder description(String description) { + f.description = description; + return this; + } + + @Override + public FirewallUpdateBuilder adminStateUp(Boolean adminStateUp) { + f.adminStateUp = adminStateUp; + return this; + } + + @Override + public FirewallUpdateBuilder shared(Boolean shared) { + f.shared = shared; + return this; + } + + @Override + public FirewallUpdateBuilder policy(String policyId) { + f.policyId = policyId; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFlowClassifier.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFlowClassifier.java index 3a4ef5773..bbf308d41 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFlowClassifier.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronFlowClassifier.java @@ -1,20 +1,18 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.network.ext.Ethertype; import org.openstack4j.model.network.ext.FlowClassifier; import org.openstack4j.model.network.ext.builder.FlowClassifierBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; +import java.util.Map; /** * @author Dmitry Gerenrot - * */ @JsonRootName("flow_classifier") public class NeutronFlowClassifier implements FlowClassifier { diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitor.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitor.java index 77bec7abc..17ebceac0 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitor.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitor.java @@ -1,307 +1,310 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.ext.HealthMonitor; import org.openstack4j.model.network.ext.HealthMonitorType; import org.openstack4j.model.network.ext.builder.HealthMonitorBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * A health monitor entity + * * @author liujunpeng */ @JsonRootName("health_monitor") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronHealthMonitor implements HealthMonitor { - private static final long serialVersionUID = 1L; - - private String id; - @JsonProperty("tenant_id") - private String tenantId; - - private HealthMonitorType type; - private Integer delay; - private Integer timeout; - /** - * Number of allowed connection failures before changing the status of the member to INACTIVE. A valid value is from 1 to 10. - */ - @JsonProperty("max_retries") - private Integer maxRetries; - - /** - * The HTTP method that the monitor uses for requests. - */ - @JsonProperty("http_method") - private String httpMethod ; - - /** - * URL - */ - @JsonProperty("url_path") - private String urlPath ; - /** - * default 200 - */ - @JsonProperty("expected_codes") - private String expectedCodes ; - - /** - * The administrative state of the health monitor, which is up (true) or down (false) - */ - @JsonProperty("admin_state_up") - private boolean adminStateUp ; - - /** - * The status of the monitor. Indicates whether the VIP is operational. - */ - private String status; - - /** - * wrap this healthMonitor to a builder - * @return HealthMonitorBuilder - */ - @Override - public HealthMonitorBuilder toBuilder() { - return new HealthMonitorConcretebuilder(this); - } - /** - * @return HealthMonitorBuilder - */ - public static HealthMonitorBuilder builder(){ - return new HealthMonitorConcretebuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public HealthMonitorType getType() { - return type; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getDelay() { - return delay; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getTimeout() { - return timeout; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getMaxRetries() { - return maxRetries; - } - - /** - * {@inheritDoc} - */ - @Override - public String getHttpMethod() { - return httpMethod; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUrlPath() { - return urlPath; - } - - /** - * {@inheritDoc} - */ - @Override - public String getExpectedCodes() { - return expectedCodes; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - return adminStateUp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getStatus() { - return status; - } - - public static class HealthMonitors extends ListResult{ - - private static final long serialVersionUID = 1L; - @JsonProperty("health_monitors") - List healthMonitors; - @Override - public List value() { - return healthMonitors; - } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("healthMonitors", healthMonitors).toString(); - } - } - public static class HealthMonitorConcretebuilder implements HealthMonitorBuilder { - NeutronHealthMonitor m; - @Override - public HealthMonitor build() { - return m; - } - public HealthMonitorConcretebuilder(){ - this(new NeutronHealthMonitor()); - } - public HealthMonitorConcretebuilder(NeutronHealthMonitor m){ - this.m = m; - } - @Override - public HealthMonitorBuilder from(HealthMonitor in) { - this.m = (NeutronHealthMonitor)in; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder tenantId(String tenantId) { - m.tenantId = tenantId; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder type(HealthMonitorType type) { - m.type = type; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder delay(Integer delay) { - m.delay = delay; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder timeout(Integer timeout) { - m.timeout = timeout; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder maxRetries(Integer maxRetries) { - m.maxRetries = maxRetries; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder urlPath(String urlPath) { - m.urlPath = urlPath; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder expectedCodes(String expectedCodes) { - m.expectedCodes = expectedCodes; - return this; - } - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder httpMethod(String httpMethod) { - m.httpMethod = httpMethod; - return this; - } - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorBuilder adminStateUp(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id",id) - .add("adminStateUp",adminStateUp) - .add("delay",delay) - .add("expectedCodes",expectedCodes) - .add("httpMethod",httpMethod) - .add("maxRetries",maxRetries) - .add("status",status) - .add("tenantId",tenantId) - .add("timeout",timeout) - .add("type",type) - .add("urlPath",urlPath) - .toString(); - } + private static final long serialVersionUID = 1L; + + private String id; + @JsonProperty("tenant_id") + private String tenantId; + + private HealthMonitorType type; + private Integer delay; + private Integer timeout; + /** + * Number of allowed connection failures before changing the status of the member to INACTIVE. A valid value is from 1 to 10. + */ + @JsonProperty("max_retries") + private Integer maxRetries; + + /** + * The HTTP method that the monitor uses for requests. + */ + @JsonProperty("http_method") + private String httpMethod; + + /** + * URL + */ + @JsonProperty("url_path") + private String urlPath; + /** + * default 200 + */ + @JsonProperty("expected_codes") + private String expectedCodes; + + /** + * The administrative state of the health monitor, which is up (true) or down (false) + */ + @JsonProperty("admin_state_up") + private boolean adminStateUp; + + /** + * The status of the monitor. Indicates whether the VIP is operational. + */ + private String status; + + /** + * wrap this healthMonitor to a builder + * + * @return HealthMonitorBuilder + */ + @Override + public HealthMonitorBuilder toBuilder() { + return new HealthMonitorConcretebuilder(this); + } + + /** + * @return HealthMonitorBuilder + */ + public static HealthMonitorBuilder builder() { + return new HealthMonitorConcretebuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorType getType() { + return type; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getDelay() { + return delay; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getTimeout() { + return timeout; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getMaxRetries() { + return maxRetries; + } + + /** + * {@inheritDoc} + */ + @Override + public String getHttpMethod() { + return httpMethod; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUrlPath() { + return urlPath; + } + + /** + * {@inheritDoc} + */ + @Override + public String getExpectedCodes() { + return expectedCodes; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + return adminStateUp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getStatus() { + return status; + } + + public static class HealthMonitors extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("health_monitors") + List healthMonitors; + + @Override + public List value() { + return healthMonitors; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("healthMonitors", healthMonitors).toString(); + } + } + + public static class HealthMonitorConcretebuilder implements HealthMonitorBuilder { + NeutronHealthMonitor m; + + @Override + public HealthMonitor build() { + return m; + } + + public HealthMonitorConcretebuilder() { + this(new NeutronHealthMonitor()); + } + + public HealthMonitorConcretebuilder(NeutronHealthMonitor m) { + this.m = m; + } + + @Override + public HealthMonitorBuilder from(HealthMonitor in) { + this.m = (NeutronHealthMonitor) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder tenantId(String tenantId) { + m.tenantId = tenantId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder type(HealthMonitorType type) { + m.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder delay(Integer delay) { + m.delay = delay; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder timeout(Integer timeout) { + m.timeout = timeout; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder maxRetries(Integer maxRetries) { + m.maxRetries = maxRetries; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder urlPath(String urlPath) { + m.urlPath = urlPath; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder expectedCodes(String expectedCodes) { + m.expectedCodes = expectedCodes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder httpMethod(String httpMethod) { + m.httpMethod = httpMethod; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorBuilder adminStateUp(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id) + .add("adminStateUp", adminStateUp) + .add("delay", delay) + .add("expectedCodes", expectedCodes) + .add("httpMethod", httpMethod) + .add("maxRetries", maxRetries) + .add("status", status) + .add("tenantId", tenantId) + .add("timeout", timeout) + .add("type", type) + .add("urlPath", urlPath) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorAssociate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorAssociate.java index cc5c8917d..72cc3bdeb 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorAssociate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorAssociate.java @@ -1,71 +1,77 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.HealthMonitorAssociate; -import org.openstack4j.model.network.ext.builder.HealthMonitorAssociateBuilder; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.HealthMonitorAssociate; +import org.openstack4j.model.network.ext.builder.HealthMonitorAssociateBuilder; /** * A entity used to associate a healthMonitor with a pool + * * @author liujunpeng */ @JsonRootName("health_monitor") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronHealthMonitorAssociate implements HealthMonitorAssociate { - private static final long serialVersionUID = 1L; - - private String id; - /** - * {@inheritDoc} - */ - @Override - public HealthMonitorAssociateBuilder toBuilder() { - return new HealthMonitorAssociateConcreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("id", id).toString(); - } - - public static HealthMonitorAssociateBuilder builder(){ - return new HealthMonitorAssociateConcreteBuilder(); - } - public static class HealthMonitorAssociateConcreteBuilder implements HealthMonitorAssociateBuilder{ - - NeutronHealthMonitorAssociate m; - public HealthMonitorAssociateConcreteBuilder(){ - this(new NeutronHealthMonitorAssociate()); - } - public HealthMonitorAssociateConcreteBuilder(NeutronHealthMonitorAssociate m){ - this.m = m; - } - @Override - public HealthMonitorAssociate build() { - return m; - } - - @Override - public HealthMonitorAssociateBuilder from(HealthMonitorAssociate in) { - m = (NeutronHealthMonitorAssociate)in; - return this; - } - - @Override - public HealthMonitorAssociateBuilder id(String id) { - m.id = id; - return this; - } - } + private static final long serialVersionUID = 1L; + + private String id; + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorAssociateBuilder toBuilder() { + return new HealthMonitorAssociateConcreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("id", id).toString(); + } + + public static HealthMonitorAssociateBuilder builder() { + return new HealthMonitorAssociateConcreteBuilder(); + } + + public static class HealthMonitorAssociateConcreteBuilder implements HealthMonitorAssociateBuilder { + + NeutronHealthMonitorAssociate m; + + public HealthMonitorAssociateConcreteBuilder() { + this(new NeutronHealthMonitorAssociate()); + } + + public HealthMonitorAssociateConcreteBuilder(NeutronHealthMonitorAssociate m) { + this.m = m; + } + + @Override + public HealthMonitorAssociate build() { + return m; + } + + @Override + public HealthMonitorAssociateBuilder from(HealthMonitorAssociate in) { + m = (NeutronHealthMonitorAssociate) in; + return this; + } + + @Override + public HealthMonitorAssociateBuilder id(String id) { + m.id = id; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorUpdate.java index dbfd0a57d..67dc6fc30 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorUpdate.java @@ -1,243 +1,229 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.HealthMonitorUpdate; -import org.openstack4j.model.network.ext.builder.HealthMonitorUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.HealthMonitorUpdate; +import org.openstack4j.model.network.ext.builder.HealthMonitorUpdateBuilder; /** * An entity used to update a healthmonitor * * @author liujunpeng - * */ @JsonRootName("health_monitor") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronHealthMonitorUpdate implements HealthMonitorUpdate { - private static final long serialVersionUID = 1L; - - /** - * The type of probe sent by the load balancer to verify the member state, - * which is PING, TCP, HTTP, or HTTPS. - */ - - private Integer delay; - - private Integer timeout; - /** - * Number of allowed connection failures before changing the status of the - * member to INACTIVE. A valid value is from 1 to 10. - */ - @JsonProperty("max_retries") - private Integer maxRetries; - - /** - * The HTTP method that the monitor uses for requests. - */ - @JsonProperty("http_method") - private String httpMethod; - - /** - * URL - */ - @JsonProperty("url_path") - private String urlPath; - /** - * default 200 - */ - @JsonProperty("expected_codes") - private String expectedCodes; - - /** - * The administrative state of the health monitor, which is up (true) or - * down (false) - */ - @JsonProperty("admin_state_up") - private boolean adminStateUp; - - /** - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder toBuilder() { - return new HealthMonitorUpdateConcreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getDelay() { - return delay; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUrlPath() { - return urlPath; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("delay", delay) - .add("urlPath", urlPath) - .add("adminStateUp", adminStateUp) - .add("expectedCodes", expectedCodes) - .add("httpMethod", httpMethod) - .add("maxRetries",maxRetries) - .add("timeout", timeout) - .toString(); - } - - public static HealthMonitorUpdateBuilder builder() { - return new HealthMonitorUpdateConcreteBuilder(); - } - - public static class HealthMonitorUpdateConcreteBuilder implements - HealthMonitorUpdateBuilder { - - NeutronHealthMonitorUpdate m; - - public HealthMonitorUpdateConcreteBuilder() { - this(new NeutronHealthMonitorUpdate()); - } - - public HealthMonitorUpdateConcreteBuilder(NeutronHealthMonitorUpdate m) { - this.m = m; - } - - @Override - public HealthMonitorUpdate build() { - return m; - } - - @Override - public HealthMonitorUpdateBuilder from(HealthMonitorUpdate in) { - m = (NeutronHealthMonitorUpdate) in; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder delay(Integer delay) { - m.delay = delay; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder urlPath(String urlPath) { - m.urlPath = urlPath; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder expectedCodes(String expectedCodes) { - m.expectedCodes = expectedCodes; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder httpMethod(String httpMethod) { - m.httpMethod = httpMethod; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder maxRetries(Integer maxRetries) { - m.maxRetries = maxRetries; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder adminStateUp(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public HealthMonitorUpdateBuilder timeout(Integer timeout) { - m.timeout = timeout; - return this; - } - - } - - /** - * - * {@inheritDoc} - */ - @Override - public Integer getTimeout() { - return timeout; - } - - /** - * - * {@inheritDoc} - */ - @Override - public Integer getMaxRetries() { - return maxRetries; - } - - /** - * - * {@inheritDoc} - */ - @Override - public String getHttpMethod() { - return httpMethod; - } - - /** - * - * {@inheritDoc} - */ - @Override - public String getExpectedCodes() { - return expectedCodes; - } - - /** - * - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - return adminStateUp; - } + private static final long serialVersionUID = 1L; + + /** + * The type of probe sent by the load balancer to verify the member state, + * which is PING, TCP, HTTP, or HTTPS. + */ + + private Integer delay; + + private Integer timeout; + /** + * Number of allowed connection failures before changing the status of the + * member to INACTIVE. A valid value is from 1 to 10. + */ + @JsonProperty("max_retries") + private Integer maxRetries; + + /** + * The HTTP method that the monitor uses for requests. + */ + @JsonProperty("http_method") + private String httpMethod; + + /** + * URL + */ + @JsonProperty("url_path") + private String urlPath; + /** + * default 200 + */ + @JsonProperty("expected_codes") + private String expectedCodes; + + /** + * The administrative state of the health monitor, which is up (true) or + * down (false) + */ + @JsonProperty("admin_state_up") + private boolean adminStateUp; + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder toBuilder() { + return new HealthMonitorUpdateConcreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getDelay() { + return delay; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUrlPath() { + return urlPath; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("delay", delay) + .add("urlPath", urlPath) + .add("adminStateUp", adminStateUp) + .add("expectedCodes", expectedCodes) + .add("httpMethod", httpMethod) + .add("maxRetries", maxRetries) + .add("timeout", timeout) + .toString(); + } + + public static HealthMonitorUpdateBuilder builder() { + return new HealthMonitorUpdateConcreteBuilder(); + } + + public static class HealthMonitorUpdateConcreteBuilder implements + HealthMonitorUpdateBuilder { + + NeutronHealthMonitorUpdate m; + + public HealthMonitorUpdateConcreteBuilder() { + this(new NeutronHealthMonitorUpdate()); + } + + public HealthMonitorUpdateConcreteBuilder(NeutronHealthMonitorUpdate m) { + this.m = m; + } + + @Override + public HealthMonitorUpdate build() { + return m; + } + + @Override + public HealthMonitorUpdateBuilder from(HealthMonitorUpdate in) { + m = (NeutronHealthMonitorUpdate) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder delay(Integer delay) { + m.delay = delay; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder urlPath(String urlPath) { + m.urlPath = urlPath; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder expectedCodes(String expectedCodes) { + m.expectedCodes = expectedCodes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder httpMethod(String httpMethod) { + m.httpMethod = httpMethod; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder maxRetries(Integer maxRetries) { + m.maxRetries = maxRetries; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder adminStateUp(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HealthMonitorUpdateBuilder timeout(Integer timeout) { + m.timeout = timeout; + return this; + } + + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getTimeout() { + return timeout; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getMaxRetries() { + return maxRetries; + } + + /** + * {@inheritDoc} + */ + @Override + public String getHttpMethod() { + return httpMethod; + } + + /** + * {@inheritDoc} + */ + @Override + public String getExpectedCodes() { + return expectedCodes; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + return adminStateUp; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2.java index a61e2745c..5d68da1f4 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2.java @@ -13,6 +13,7 @@ /** * A lbaas v2 health monitor entity + * * @author ashleykasim */ @JsonRootName("healthmonitor") @@ -37,13 +38,13 @@ public class NeutronHealthMonitorV2 implements HealthMonitorV2 { * The HTTP method that the monitor uses for requests. */ @JsonProperty("http_method") - private String httpMethod ; + private String httpMethod; /** * URL */ @JsonProperty("url_path") - private String urlPath ; + private String urlPath; /** * default 200 @@ -63,78 +64,79 @@ public class NeutronHealthMonitorV2 implements HealthMonitorV2 { private String poolId; @Override - public String getId(){ + public String getId() { return id; } @Override - public String getTenantId(){ + public String getTenantId() { return tenantId; } @Override - public HealthMonitorType getType(){ + public HealthMonitorType getType() { return type; } @Override - public Integer getDelay(){ + public Integer getDelay() { return delay; } @Override - public Integer getTimeout(){ + public Integer getTimeout() { return timeout; } @Override - public Integer getMaxRetries(){ + public Integer getMaxRetries() { return maxRetries; } @Override - public String getHttpMethod(){ + public String getHttpMethod() { return httpMethod; } @Override - public String getUrlPath(){ + public String getUrlPath() { return urlPath; } @Override - public String getExpectedCodes(){ + public String getExpectedCodes() { return expectedCodes; } @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @Override - public List getPools(){ + public List getPools() { return pools; } /** * wrap this healthMonitorV2 to a builder + * * @return HealthMonitorV2Builder */ @Override - public HealthMonitorV2Builder toBuilder(){ + public HealthMonitorV2Builder toBuilder() { return new HealthMonitorV2Concretebuilder(this); } /** * @return HealthMonitorV2Builder */ - public static HealthMonitorV2Builder builder(){ + public static HealthMonitorV2Builder builder() { return new HealthMonitorV2Concretebuilder(); } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("tenantId", tenantId) @@ -155,10 +157,12 @@ public static class HealthMonitorsV2 extends ListResult @JsonProperty("healthmonitors") List healthMonitors; + @Override public List value() { return healthMonitors; } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() @@ -168,23 +172,27 @@ public String toString() { public static class HealthMonitorV2Concretebuilder implements HealthMonitorV2Builder { NeutronHealthMonitorV2 m; + @Override public HealthMonitorV2 build() { return m; } - public HealthMonitorV2Concretebuilder(){ + + public HealthMonitorV2Concretebuilder() { this(new NeutronHealthMonitorV2()); } - public HealthMonitorV2Concretebuilder(NeutronHealthMonitorV2 m){ + + public HealthMonitorV2Concretebuilder(NeutronHealthMonitorV2 m) { this.m = m; } + @Override public HealthMonitorV2Builder from(HealthMonitorV2 in) { - this.m = (NeutronHealthMonitorV2)in; + this.m = (NeutronHealthMonitorV2) in; return this; } + /** - * * {@inheritDoc} */ @Override @@ -194,7 +202,6 @@ public HealthMonitorV2Builder tenantId(String tenantId) { } /** - * * {@inheritDoc} */ @Override @@ -204,7 +211,6 @@ public HealthMonitorV2Builder type(HealthMonitorType type) { } /** - * * {@inheritDoc} */ @Override @@ -214,7 +220,6 @@ public HealthMonitorV2Builder delay(Integer delay) { } /** - * * {@inheritDoc} */ @Override @@ -224,7 +229,6 @@ public HealthMonitorV2Builder timeout(Integer timeout) { } /** - * * {@inheritDoc} */ @Override @@ -234,7 +238,6 @@ public HealthMonitorV2Builder maxRetries(Integer maxRetries) { } /** - * * {@inheritDoc} */ @Override @@ -244,7 +247,6 @@ public HealthMonitorV2Builder urlPath(String urlPath) { } /** - * * {@inheritDoc} */ @Override @@ -254,7 +256,6 @@ public HealthMonitorV2Builder expectedCodes(String expectedCodes) { } /** - * * {@inheritDoc} */ @Override @@ -264,7 +265,6 @@ public HealthMonitorV2Builder httpMethod(String httpMethod) { } /** - * * {@inheritDoc} */ @Override @@ -274,11 +274,10 @@ public HealthMonitorV2Builder adminStateUp(boolean adminStateUp) { } /** - * * {@inheritDoc} */ @Override - public HealthMonitorV2Builder poolId(String poolId){ + public HealthMonitorV2Builder poolId(String poolId) { m.poolId = poolId; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2Update.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2Update.java index 1be827f88..5459b82c6 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronHealthMonitorV2Update.java @@ -9,6 +9,7 @@ /** * Entity used to update lbaas v2 heathmonitor + * * @author emjburns */ @JsonRootName("healthmonitor") @@ -31,19 +32,19 @@ public class NeutronHealthMonitorV2Update implements HealthMonitorV2Update { * The HTTP method that the monitor uses for requests. */ @JsonProperty("http_method") - private String httpMethod ; + private String httpMethod; /** * URL */ @JsonProperty("url_path") - private String urlPath ; + private String urlPath; /** * default 200 */ @JsonProperty("expected_codes") - private String expectedCodes ; + private String expectedCodes; /** * The administrative state of the health monitor, which is up (true) or down (false) @@ -55,7 +56,7 @@ public class NeutronHealthMonitorV2Update implements HealthMonitorV2Update { * {@inheritDoc} */ @Override - public Integer getDelay(){ + public Integer getDelay() { return delay; } @@ -63,7 +64,7 @@ public Integer getDelay(){ * {@inheritDoc} */ @Override - public String getUrlPath(){ + public String getUrlPath() { return urlPath; } @@ -71,7 +72,7 @@ public String getUrlPath(){ * {@inheritDoc} */ @Override - public Integer getTimeout(){ + public Integer getTimeout() { return timeout; } @@ -79,7 +80,7 @@ public Integer getTimeout(){ * {@inheritDoc} */ @Override - public Integer getMaxRetries(){ + public Integer getMaxRetries() { return maxRetries; } @@ -87,7 +88,7 @@ public Integer getMaxRetries(){ * {@inheritDoc} */ @Override - public String getHttpMethod(){ + public String getHttpMethod() { return httpMethod; } @@ -95,7 +96,7 @@ public String getHttpMethod(){ * {@inheritDoc} */ @Override - public String getExpectedCodes(){ + public String getExpectedCodes() { return expectedCodes; } @@ -103,7 +104,7 @@ public String getExpectedCodes(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -115,7 +116,7 @@ public String toString() { .add("adminStateUp", adminStateUp) .add("expectedCodes", expectedCodes) .add("httpMethod", httpMethod) - .add("maxRetries",maxRetries) + .add("maxRetries", maxRetries) .add("timeout", timeout) .toString(); } @@ -124,22 +125,22 @@ public String toString() { * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder toBuilder(){ + public HealthMonitorV2UpdateBuilder toBuilder() { return new HealthMonitorV2UpdateConcreteBuilder(this); } - public static HealthMonitorV2UpdateBuilder builder(){ + public static HealthMonitorV2UpdateBuilder builder() { return new HealthMonitorV2UpdateConcreteBuilder(); } public static class HealthMonitorV2UpdateConcreteBuilder implements HealthMonitorV2UpdateBuilder { NeutronHealthMonitorV2Update m; - public HealthMonitorV2UpdateConcreteBuilder(){ - this (new NeutronHealthMonitorV2Update()); + public HealthMonitorV2UpdateConcreteBuilder() { + this(new NeutronHealthMonitorV2Update()); } - public HealthMonitorV2UpdateConcreteBuilder(NeutronHealthMonitorV2Update m){ + public HealthMonitorV2UpdateConcreteBuilder(NeutronHealthMonitorV2Update m) { this.m = m; } @@ -147,7 +148,7 @@ public HealthMonitorV2UpdateConcreteBuilder(NeutronHealthMonitorV2Update m){ * {@inheritDoc} */ @Override - public HealthMonitorV2Update build(){ + public HealthMonitorV2Update build() { return m; } @@ -155,7 +156,7 @@ public HealthMonitorV2Update build(){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder from(HealthMonitorV2Update in){ + public HealthMonitorV2UpdateBuilder from(HealthMonitorV2Update in) { m = (NeutronHealthMonitorV2Update) in; return this; } @@ -164,7 +165,7 @@ public HealthMonitorV2UpdateBuilder from(HealthMonitorV2Update in){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder delay(Integer delay){ + public HealthMonitorV2UpdateBuilder delay(Integer delay) { m.delay = delay; return this; } @@ -173,7 +174,7 @@ public HealthMonitorV2UpdateBuilder delay(Integer delay){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder urlPath(String urlPath){ + public HealthMonitorV2UpdateBuilder urlPath(String urlPath) { m.urlPath = urlPath; return this; } @@ -182,7 +183,7 @@ public HealthMonitorV2UpdateBuilder urlPath(String urlPath){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes){ + public HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes) { m.expectedCodes = expectedCodes; return this; } @@ -191,7 +192,7 @@ public HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder httpMethod(String httpMethod){ + public HealthMonitorV2UpdateBuilder httpMethod(String httpMethod) { m.httpMethod = httpMethod; return this; } @@ -200,7 +201,7 @@ public HealthMonitorV2UpdateBuilder httpMethod(String httpMethod){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries){ + public HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries) { m.maxRetries = maxRetries; return this; } @@ -209,7 +210,7 @@ public HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -218,7 +219,7 @@ public HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder timeout(Integer timeout){ + public HealthMonitorV2UpdateBuilder timeout(Integer timeout) { m.timeout = timeout; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPool.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPool.java index 087343b28..4d893c2d0 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPool.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPool.java @@ -3,18 +3,17 @@ */ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.ext.LbMethod; import org.openstack4j.model.network.ext.LbPool; import org.openstack4j.model.network.ext.Protocol; import org.openstack4j.model.network.ext.builder.LbPoolBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * A pool of a load balancer @@ -26,287 +25,294 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronLbPool implements LbPool { - private static final long serialVersionUID = 1L; - - - @JsonProperty("health_monitors") - private List healthMonitors; - private String id; - @JsonProperty("tenant_id") - private String tenantId; - @JsonProperty("vip_id") - private String vipId; - private String name; - private String description; - @JsonProperty("subnet_id") - private String subnetId; - - private Protocol protocol; - - private String provider; - @JsonProperty("lb_method") - private LbMethod lbMethod; - - private List members; - @JsonProperty("admin_state_up") - private boolean adminStateUp; - private String status; - /** - * {@inheritDoc} - */ - @Override - public LbPoolBuilder toBuilder() { - return new LbPoolContreteBuilder(this); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVipId() { - return vipId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSubnetId() { - return subnetId; - } - - /** - * {@inheritDoc} - */ - @Override - public Protocol getProtocol() { - return protocol; - } - - /** - * {@inheritDoc} - */ - @Override - public String getProvider() { - return provider; - } - - /** - * {@inheritDoc} - */ - @Override - public LbMethod getLbMethod() { - return lbMethod; - } - - /** - * {@inheritDoc} - */ - @Override - public List getMembers() { - return members; - } - - /** - * {@inheritDoc} - */ - @Override - public List getHealthMonitors() { - return healthMonitors; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - return adminStateUp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getStatus() { - return status; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("id", id) - .add("adminStateUp", adminStateUp) - .add("description", description) - .add("healthMonitors", healthMonitors) - .add("lbMethod", lbMethod) - .add("members", members) - .add("name", name) - .add("protocol", protocol) - .add("provider", provider) - .add("status", status) - .add("subnetId", subnetId) - .add("tenantId", tenantId) - .add("vipId", vipId) - .toString(); - } - - public static class LbPoolContreteBuilder implements LbPoolBuilder{ - - private NeutronLbPool m; - @Override - public LbPool build() { - return m; - } - public LbPoolContreteBuilder(){ - this(new NeutronLbPool()); - } - public LbPoolContreteBuilder(NeutronLbPool m){ - this.m = m; - } - - @Override - public LbPoolBuilder from(LbPool in) { - m = (NeutronLbPool) in; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder tenantId(String tenantId) { - m.tenantId = tenantId; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder name(String name) { - m.name = name; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder description(String description) { - m.description = description; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder subnetId(String subnentId) { - m.subnetId = subnentId; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder provider(String provider) { - m.provider = provider; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder lbMethod(LbMethod lbMethod) { - m.lbMethod = lbMethod; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder adminStateUp(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolBuilder protocol(Protocol protocol) { - m.protocol = protocol; - return this; - } - - } - - public static class LbPools extends ListResult { - - private static final long serialVersionUID = 1L; - @JsonProperty("pools") - List lbPools; - /** - * {@inheritDoc} - */ - @Override - public List value() { - return lbPools; - } - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("lbPools", lbPools) - .toString(); - } - - } - - - public static LbPoolBuilder builder(){ - return new LbPoolContreteBuilder(); - } + private static final long serialVersionUID = 1L; + + + @JsonProperty("health_monitors") + private List healthMonitors; + private String id; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("vip_id") + private String vipId; + private String name; + private String description; + @JsonProperty("subnet_id") + private String subnetId; + + private Protocol protocol; + + private String provider; + @JsonProperty("lb_method") + private LbMethod lbMethod; + + private List members; + @JsonProperty("admin_state_up") + private boolean adminStateUp; + private String status; + + /** + * {@inheritDoc} + */ + @Override + public LbPoolBuilder toBuilder() { + return new LbPoolContreteBuilder(this); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVipId() { + return vipId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSubnetId() { + return subnetId; + } + + /** + * {@inheritDoc} + */ + @Override + public Protocol getProtocol() { + return protocol; + } + + /** + * {@inheritDoc} + */ + @Override + public String getProvider() { + return provider; + } + + /** + * {@inheritDoc} + */ + @Override + public LbMethod getLbMethod() { + return lbMethod; + } + + /** + * {@inheritDoc} + */ + @Override + public List getMembers() { + return members; + } + + /** + * {@inheritDoc} + */ + @Override + public List getHealthMonitors() { + return healthMonitors; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + return adminStateUp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getStatus() { + return status; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("id", id) + .add("adminStateUp", adminStateUp) + .add("description", description) + .add("healthMonitors", healthMonitors) + .add("lbMethod", lbMethod) + .add("members", members) + .add("name", name) + .add("protocol", protocol) + .add("provider", provider) + .add("status", status) + .add("subnetId", subnetId) + .add("tenantId", tenantId) + .add("vipId", vipId) + .toString(); + } + + public static class LbPoolContreteBuilder implements LbPoolBuilder { + + private NeutronLbPool m; + + @Override + public LbPool build() { + return m; + } + + public LbPoolContreteBuilder() { + this(new NeutronLbPool()); + } + + public LbPoolContreteBuilder(NeutronLbPool m) { + this.m = m; + } + + @Override + public LbPoolBuilder from(LbPool in) { + m = (NeutronLbPool) in; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder tenantId(String tenantId) { + m.tenantId = tenantId; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder name(String name) { + m.name = name; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder description(String description) { + m.description = description; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder subnetId(String subnentId) { + m.subnetId = subnentId; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder provider(String provider) { + m.provider = provider; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder lbMethod(LbMethod lbMethod) { + m.lbMethod = lbMethod; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder adminStateUp(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + + /** + * + * {@inheritDoc} + */ + @Override + public LbPoolBuilder protocol(Protocol protocol) { + m.protocol = protocol; + return this; + } + + } + + public static class LbPools extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("pools") + List lbPools; + + /** + * {@inheritDoc} + */ + @Override + public List value() { + return lbPools; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("lbPools", lbPools) + .toString(); + } + + } + + + public static LbPoolBuilder builder() { + return new LbPoolContreteBuilder(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolStats.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolStats.java index a70b1452d..b1874f0a7 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolStats.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolStats.java @@ -1,54 +1,52 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.LbPoolStats; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.network.ext.LbPoolStats; @JsonRootName("stats") public class NeutronLbPoolStats implements LbPoolStats { - - private static final long serialVersionUID = 1L; - @JsonProperty("bytes_in") - private Long bytesIn; - @JsonProperty("bytes_out") - private Long bytesOut; - @JsonProperty("total_connections") - private Integer totalConnections; - @JsonProperty("active_connections") - private Integer activeConnections; - - /** - * - * {@inheritDoc} - */ - @Override - public Long getBytesIn() { - return bytesIn; - } - /** - * - * {@inheritDoc} - */ - @Override - public Long getBytesOut() { - return bytesOut; - } - /** - * - * {@inheritDoc} - */ - @Override - public Integer getTotalConnections() { - return totalConnections; - } - /** - * - * {@inheritDoc} - */ - @Override - public Integer getActiveConnections() { - return activeConnections; - } + + private static final long serialVersionUID = 1L; + @JsonProperty("bytes_in") + private Long bytesIn; + @JsonProperty("bytes_out") + private Long bytesOut; + @JsonProperty("total_connections") + private Integer totalConnections; + @JsonProperty("active_connections") + private Integer activeConnections; + + /** + * {@inheritDoc} + */ + @Override + public Long getBytesIn() { + return bytesIn; + } + + /** + * {@inheritDoc} + */ + @Override + public Long getBytesOut() { + return bytesOut; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getTotalConnections() { + return totalConnections; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getActiveConnections() { + return activeConnections; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolUpdate.java index 41d37c991..142cbcfcf 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolUpdate.java @@ -1,142 +1,144 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.LbMethod; -import org.openstack4j.model.network.ext.LbPoolUpdate; -import org.openstack4j.model.network.ext.builder.LbPoolUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.LbMethod; +import org.openstack4j.model.network.ext.LbPoolUpdate; +import org.openstack4j.model.network.ext.builder.LbPoolUpdateBuilder; /** * A entity used to update a lb pool - * @author liujunpeng * + * @author liujunpeng */ @JsonRootName("pool") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronLbPoolUpdate implements LbPoolUpdate { - private static final long serialVersionUID = 1L; - private String name; - private String description; - @JsonProperty("lb_method") - private LbMethod lbMethod; - @JsonProperty("admin_state_up") - private boolean adminStateUp; - /** - * {@inheritDoc} - */ - @Override - public LbPoolUpdateBuilder toBuilder() { - return new LbPoolUpdateContreteBuilder(this); - } - - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("adminStateUp", adminStateUp) - .add("description", description) - .add("lbMethod", lbMethod) - .add("name", name) - .toString(); - } - - - /** - * - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - - return adminStateUp; - } - /** - * - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - /** - * - * {@inheritDoc} - */ - @Override - public LbMethod getLbMethod() { - return lbMethod; - } - /** - * - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - - public static class LbPoolUpdateContreteBuilder implements LbPoolUpdateBuilder { - - private NeutronLbPoolUpdate m; - public LbPoolUpdateContreteBuilder (){ - this(new NeutronLbPoolUpdate()); - } - public LbPoolUpdateContreteBuilder(NeutronLbPoolUpdate m){ - this.m = m; - } - @Override - public LbPoolUpdate build() { - - return m; - } - - @Override - public LbPoolUpdateBuilder from(LbPoolUpdate in) { - m = (NeutronLbPoolUpdate)in; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolUpdateBuilder lbMethod(LbMethod lbMethod) { - m.lbMethod = lbMethod; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolUpdateBuilder name(String name) { - m.name = name; - return this; - } - /** - * - * {@inheritDoc} - */ - @Override - public LbPoolUpdateBuilder description(String description) { - m.description = description; - return this; - } - @Override - public LbPoolUpdateBuilder adminStateUp(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - } - public static LbPoolUpdateBuilder builder(){ - return new LbPoolUpdateContreteBuilder(); - } + private static final long serialVersionUID = 1L; + private String name; + private String description; + @JsonProperty("lb_method") + private LbMethod lbMethod; + @JsonProperty("admin_state_up") + private boolean adminStateUp; + + /** + * {@inheritDoc} + */ + @Override + public LbPoolUpdateBuilder toBuilder() { + return new LbPoolUpdateContreteBuilder(this); + } + + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("adminStateUp", adminStateUp) + .add("description", description) + .add("lbMethod", lbMethod) + .add("name", name) + .toString(); + } + + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + + return adminStateUp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public LbMethod getLbMethod() { + return lbMethod; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + + public static class LbPoolUpdateContreteBuilder implements LbPoolUpdateBuilder { + + private NeutronLbPoolUpdate m; + + public LbPoolUpdateContreteBuilder() { + this(new NeutronLbPoolUpdate()); + } + + public LbPoolUpdateContreteBuilder(NeutronLbPoolUpdate m) { + this.m = m; + } + + @Override + public LbPoolUpdate build() { + + return m; + } + + @Override + public LbPoolUpdateBuilder from(LbPoolUpdate in) { + m = (NeutronLbPoolUpdate) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LbPoolUpdateBuilder lbMethod(LbMethod lbMethod) { + m.lbMethod = lbMethod; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LbPoolUpdateBuilder name(String name) { + m.name = name; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LbPoolUpdateBuilder description(String description) { + m.description = description; + return this; + } + + @Override + public LbPoolUpdateBuilder adminStateUp(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + } + + public static LbPoolUpdateBuilder builder() { + return new LbPoolUpdateContreteBuilder(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2.java index c2ced7abf..0b9cb676b 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2.java @@ -16,6 +16,7 @@ /** * Lbaas V2 load balancer pool + * * @author emjburns */ @JsonRootName("pool") @@ -66,7 +67,7 @@ public LbPoolV2Builder toBuilder() { * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @@ -74,7 +75,7 @@ public String getId(){ * {@inheritDoc} */ @Override - public String getTenantId(){ + public String getTenantId() { return tenantId; } @@ -82,7 +83,7 @@ public String getTenantId(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -90,7 +91,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -98,7 +99,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public Protocol getProtocol(){ + public Protocol getProtocol() { return protocol; } @@ -106,7 +107,7 @@ public Protocol getProtocol(){ * {@inheritDoc} */ @Override - public LbMethod getLbMethod(){ + public LbMethod getLbMethod() { return lbMethod; } @@ -114,7 +115,7 @@ public LbMethod getLbMethod(){ * {@inheritDoc} */ @Override - public SessionPersistence getSessionPersistence(){ + public SessionPersistence getSessionPersistence() { return sessionPersistence; } @@ -122,7 +123,7 @@ public SessionPersistence getSessionPersistence(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -130,7 +131,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public List getListeners(){ + public List getListeners() { return listeners; } @@ -138,7 +139,7 @@ public List getListeners(){ * {@inheritDoc} */ @Override - public List getMembers(){ + public List getMembers() { return members; } @@ -146,12 +147,12 @@ public List getMembers(){ * {@inheritDoc} */ @Override - public String getHealthMonitorId(){ + public String getHealthMonitorId() { return healthMonitorId; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("tenantId", tenantId) @@ -168,7 +169,7 @@ public String toString(){ .toString(); } - public static class LbPoolV2ConcreteBuilder implements LbPoolV2Builder{ + public static class LbPoolV2ConcreteBuilder implements LbPoolV2Builder { private NeutronLbPoolV2 m; @@ -186,7 +187,7 @@ public LbPoolV2ConcreteBuilder(NeutronLbPoolV2 m) { } @Override - public LbPoolV2Builder from(LbPoolV2 in){ + public LbPoolV2Builder from(LbPoolV2 in) { m = (NeutronLbPoolV2) in; return this; } @@ -195,7 +196,7 @@ public LbPoolV2Builder from(LbPoolV2 in){ * {@inheritDoc} */ @Override - public LbPoolV2Builder tenantId(String tenantId){ + public LbPoolV2Builder tenantId(String tenantId) { m.tenantId = tenantId; return this; } @@ -204,7 +205,7 @@ public LbPoolV2Builder tenantId(String tenantId){ * {@inheritDoc} */ @Override - public LbPoolV2Builder name(String name){ + public LbPoolV2Builder name(String name) { m.name = name; return this; } @@ -213,7 +214,7 @@ public LbPoolV2Builder name(String name){ * {@inheritDoc} */ @Override - public LbPoolV2Builder description(String description){ + public LbPoolV2Builder description(String description) { m.description = description; return this; } @@ -222,7 +223,7 @@ public LbPoolV2Builder description(String description){ * {@inheritDoc} */ @Override - public LbPoolV2Builder protocol(Protocol protocol){ + public LbPoolV2Builder protocol(Protocol protocol) { m.protocol = protocol; return this; } @@ -231,7 +232,7 @@ public LbPoolV2Builder protocol(Protocol protocol){ * {@inheritDoc} */ @Override - public LbPoolV2Builder lbMethod(LbMethod lbMethod){ + public LbPoolV2Builder lbMethod(LbMethod lbMethod) { m.lbMethod = lbMethod; return this; } @@ -240,7 +241,7 @@ public LbPoolV2Builder lbMethod(LbMethod lbMethod){ * {@inheritDoc} */ @Override - public LbPoolV2Builder sessionPersistence(SessionPersistence sessionPersistence){ + public LbPoolV2Builder sessionPersistence(SessionPersistence sessionPersistence) { m.sessionPersistence = sessionPersistence; return this; } @@ -249,7 +250,7 @@ public LbPoolV2Builder sessionPersistence(SessionPersistence sessionPersistence) * {@inheritDoc} */ @Override - public LbPoolV2Builder adminStateUp(boolean adminStateUp){ + public LbPoolV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -258,7 +259,7 @@ public LbPoolV2Builder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public LbPoolV2Builder listenerId(String listenerId){ + public LbPoolV2Builder listenerId(String listenerId) { m.listenerId = listenerId; return this; } @@ -267,16 +268,17 @@ public LbPoolV2Builder listenerId(String listenerId){ public static class LbPoolsV2 extends ListResult { @JsonProperty("pools") List lbPools; + /** * {@inheritDoc} */ @Override - protected List value(){ + protected List value() { return lbPools; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("lbPools", lbPools) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2Update.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2Update.java index a26d5f223..e6e36884c 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLbPoolV2Update.java @@ -12,6 +12,7 @@ /** * Used to update lbaas V2 lb pool + * * @author emjburns */ @JsonRootName("pool") @@ -41,32 +42,32 @@ public LbPoolV2UpdateBuilder toBuilder() { return new NeutronLbPoolV2Update.LbPoolV2UpdateContreteBuilder(this); } - public static LbPoolV2UpdateBuilder builder(){ + public static LbPoolV2UpdateBuilder builder() { return new LbPoolV2UpdateContreteBuilder(); } @Override - public String getName(){ + public String getName() { return name; } @Override - public String getDescription(){ + public String getDescription() { return description; } @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @Override - public LbMethod getLbMethod(){ + public LbMethod getLbMethod() { return lbMethod; } @Override - public SessionPersistence getSessionPersistence(){ + public SessionPersistence getSessionPersistence() { return sessionPersistence; } @@ -84,11 +85,11 @@ public static class LbPoolV2UpdateContreteBuilder implements LbPoolV2UpdateBuild private NeutronLbPoolV2Update m; - public LbPoolV2UpdateContreteBuilder (){ + public LbPoolV2UpdateContreteBuilder() { this(new NeutronLbPoolV2Update()); } - public LbPoolV2UpdateContreteBuilder(NeutronLbPoolV2Update m){ + public LbPoolV2UpdateContreteBuilder(NeutronLbPoolV2Update m) { this.m = m; } @@ -100,7 +101,7 @@ public LbPoolV2Update build() { @Override public LbPoolV2UpdateContreteBuilder from(LbPoolV2Update in) { - m = (NeutronLbPoolV2Update)in; + m = (NeutronLbPoolV2Update) in; return this; } @@ -135,7 +136,7 @@ public LbPoolV2UpdateContreteBuilder description(String description) { * {@inheritDoc} */ @Override - public LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence){ + public LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence) { m.sessionPersistence = sessionPersistence; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2.java index 0cfa906f1..1961d2193 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2.java @@ -4,8 +4,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; -import org.openstack4j.model.network.ext.ListenerV2; import org.openstack4j.model.network.ext.ListenerProtocol; +import org.openstack4j.model.network.ext.ListenerV2; import org.openstack4j.model.network.ext.builder.ListenerV2Builder; import org.openstack4j.openstack.common.ListResult; @@ -13,6 +13,7 @@ /** * lbaas v2 listener + * * @author emjburns */ @JsonRootName("listener") @@ -68,7 +69,7 @@ public class NeutronListenerV2 implements ListenerV2 { * {@inheritDoc} */ @Override - public List getLoadBalancers(){ + public List getLoadBalancers() { return loadbalancers; } @@ -76,7 +77,7 @@ public List getLoadBalancers(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -84,7 +85,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public String getDefaultPoolId(){ + public String getDefaultPoolId() { return defaultPoolId; } @@ -92,7 +93,7 @@ public String getDefaultPoolId(){ * {@inheritDoc} */ @Override - public Integer getConnectionLimit(){ + public Integer getConnectionLimit() { return connectionLimit; } @@ -100,7 +101,7 @@ public Integer getConnectionLimit(){ * {@inheritDoc} */ @Override - public Integer getProtocolPort(){ + public Integer getProtocolPort() { return protocolPort; } @@ -108,7 +109,7 @@ public Integer getProtocolPort(){ * {@inheritDoc} */ @Override - public ListenerProtocol getProtocol(){ + public ListenerProtocol getProtocol() { return protocol; } @@ -116,7 +117,7 @@ public ListenerProtocol getProtocol(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -124,7 +125,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -132,7 +133,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public String getTenantId(){ + public String getTenantId() { return tenantId; } @@ -140,7 +141,7 @@ public String getTenantId(){ * {@inheritDoc} */ @Override - public String getDefaultTlsContainerRef(){ + public String getDefaultTlsContainerRef() { return defaultTlsContainerRef; } @@ -148,7 +149,7 @@ public String getDefaultTlsContainerRef(){ * {@inheritDoc} */ @Override - public List getSniContainerRefs(){ + public List getSniContainerRefs() { return sniContainerRefs; } @@ -156,12 +157,12 @@ public List getSniContainerRefs(){ * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("adminStateUp", adminStateUp) @@ -190,18 +191,18 @@ public ListenerConcreteBuilder(NeutronListenerV2 m) { } @Override - public ListenerV2 build(){ + public ListenerV2 build() { return m; } @Override - public ListenerV2Builder from(ListenerV2 in){ + public ListenerV2Builder from(ListenerV2 in) { m = (NeutronListenerV2) in; return this; } @Override - public ListenerV2Builder loadBalancerId(String loadbalancerId){ + public ListenerV2Builder loadBalancerId(String loadbalancerId) { m.loadbalancerId = loadbalancerId; return this; } @@ -210,7 +211,7 @@ public ListenerV2Builder loadBalancerId(String loadbalancerId){ * {@inheritDoc} */ @Override - public ListenerV2Builder tenantId(String tenantId){ + public ListenerV2Builder tenantId(String tenantId) { m.tenantId = tenantId; return this; } @@ -219,7 +220,7 @@ public ListenerV2Builder tenantId(String tenantId){ * {@inheritDoc} */ @Override - public ListenerV2Builder protocol(ListenerProtocol protocol){ + public ListenerV2Builder protocol(ListenerProtocol protocol) { m.protocol = protocol; return this; } @@ -228,7 +229,7 @@ public ListenerV2Builder protocol(ListenerProtocol protocol){ * {@inheritDoc} */ @Override - public ListenerV2Builder protocolPort(Integer protocolPort){ + public ListenerV2Builder protocolPort(Integer protocolPort) { m.protocolPort = protocolPort; return this; } @@ -237,7 +238,7 @@ public ListenerV2Builder protocolPort(Integer protocolPort){ * {@inheritDoc} */ @Override - public ListenerV2Builder adminStateUp(boolean adminStateUp){ + public ListenerV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -246,7 +247,7 @@ public ListenerV2Builder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public ListenerV2Builder name(String name){ + public ListenerV2Builder name(String name) { m.name = name; return this; } @@ -255,7 +256,7 @@ public ListenerV2Builder name(String name){ * {@inheritDoc} */ @Override - public ListenerV2Builder description(String description){ + public ListenerV2Builder description(String description) { m.description = description; return this; } @@ -264,7 +265,7 @@ public ListenerV2Builder description(String description){ * {@inheritDoc} */ @Override - public ListenerV2Builder connectionLimit(Integer connectionLimit){ + public ListenerV2Builder connectionLimit(Integer connectionLimit) { m.connectionLimit = connectionLimit; return this; } @@ -273,7 +274,7 @@ public ListenerV2Builder connectionLimit(Integer connectionLimit){ * {@inheritDoc} */ @Override - public ListenerV2Builder sniContainerRefs(List sniContainerRefs){ + public ListenerV2Builder sniContainerRefs(List sniContainerRefs) { m.sniContainerRefs = sniContainerRefs; return this; } @@ -282,18 +283,18 @@ public ListenerV2Builder sniContainerRefs(List sniContainerRefs){ * {@inheritDoc} */ @Override - public ListenerV2Builder defaultTlsContainerRef(String tlsContainerRef){ + public ListenerV2Builder defaultTlsContainerRef(String tlsContainerRef) { m.defaultTlsContainerRef = tlsContainerRef; return this; } } @Override - public ListenerV2Builder toBuilder(){ + public ListenerV2Builder toBuilder() { return new ListenerConcreteBuilder(this); } - public static ListenerV2Builder builder(){ + public static ListenerV2Builder builder() { return new ListenerConcreteBuilder(); } @@ -312,7 +313,7 @@ protected List value() { } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("listeners", listeners) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2Update.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2Update.java index d87289481..451dfbe11 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronListenerV2Update.java @@ -9,6 +9,7 @@ /** * Entity for updating lbaas v2 listener + * * @author emjburns */ @JsonRootName("listener") @@ -37,7 +38,7 @@ public class NeutronListenerV2Update implements ListenerV2Update { * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder toBuilder(){ + public ListenerV2UpdateBuilder toBuilder() { return new ListenerV2UpdateConcreteBuilder(this); } @@ -45,7 +46,7 @@ public ListenerV2UpdateBuilder toBuilder(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -53,7 +54,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -61,7 +62,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -69,7 +70,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public Integer getConnectionLimit(){ + public Integer getConnectionLimit() { return connectionLimit; } @@ -77,7 +78,7 @@ public Integer getConnectionLimit(){ * {@inheritDoc} */ @Override - public String getDefaultTlsContainerRef(){ + public String getDefaultTlsContainerRef() { return defaultTlsContainerRef; } @@ -95,11 +96,11 @@ public String toString() { public static class ListenerV2UpdateConcreteBuilder implements ListenerV2UpdateBuilder { private NeutronListenerV2Update m; - public ListenerV2UpdateConcreteBuilder(){ + public ListenerV2UpdateConcreteBuilder() { this(new NeutronListenerV2Update()); } - public ListenerV2UpdateConcreteBuilder(NeutronListenerV2Update m){ + public ListenerV2UpdateConcreteBuilder(NeutronListenerV2Update m) { this.m = m; } @@ -107,7 +108,7 @@ public ListenerV2UpdateConcreteBuilder(NeutronListenerV2Update m){ * {@inheritDoc} */ @Override - public ListenerV2Update build(){ + public ListenerV2Update build() { return m; } @@ -115,7 +116,7 @@ public ListenerV2Update build(){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder from(ListenerV2Update in){ + public ListenerV2UpdateBuilder from(ListenerV2Update in) { m = (NeutronListenerV2Update) in; return this; } @@ -124,7 +125,7 @@ public ListenerV2UpdateBuilder from(ListenerV2Update in){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder name(String name){ + public ListenerV2UpdateBuilder name(String name) { m.name = name; return this; } @@ -133,7 +134,7 @@ public ListenerV2UpdateBuilder name(String name){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder description(String description){ + public ListenerV2UpdateBuilder description(String description) { m.description = description; return this; } @@ -142,7 +143,7 @@ public ListenerV2UpdateBuilder description(String description){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public ListenerV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -151,7 +152,7 @@ public ListenerV2UpdateBuilder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder connectionLimit(Integer connectionLimit){ + public ListenerV2UpdateBuilder connectionLimit(Integer connectionLimit) { m.connectionLimit = connectionLimit; return this; } @@ -160,7 +161,7 @@ public ListenerV2UpdateBuilder connectionLimit(Integer connectionLimit){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder defaultTlsContainerRef(String defaultTlsContainerRef){ + public ListenerV2UpdateBuilder defaultTlsContainerRef(String defaultTlsContainerRef) { m.defaultTlsContainerRef = defaultTlsContainerRef; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2.java index e20ac359e..919ac7a04 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2.java @@ -14,6 +14,7 @@ /** * lbaas v2 loadbalancer + * * @author emjburns */ @JsonRootName("loadbalancer") @@ -61,7 +62,7 @@ public class NeutronLoadBalancerV2 implements LoadBalancerV2 { * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @@ -69,7 +70,7 @@ public String getId(){ * {@inheritDoc} */ @Override - public String getTenantId(){ + public String getTenantId() { return tenantId; } @@ -77,7 +78,7 @@ public String getTenantId(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -85,7 +86,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -94,7 +95,7 @@ public String getDescription(){ */ @JsonProperty("vip_subnet_id") @Override - public String getVipSubnetId(){ + public String getVipSubnetId() { return vipSubnetId; } @@ -102,7 +103,7 @@ public String getVipSubnetId(){ * {@inheritDoc} */ @Override - public String getVipAddress(){ + public String getVipAddress() { return vipAddress; } @@ -110,7 +111,7 @@ public String getVipAddress(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -118,7 +119,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public List getListeners(){ + public List getListeners() { return listeners; } @@ -126,7 +127,7 @@ public List getListeners(){ * {@inheritDoc} */ @Override - public LbProvisioningStatus getProvisioningStatus(){ + public LbProvisioningStatus getProvisioningStatus() { return provisioningStatus; } @@ -134,7 +135,7 @@ public LbProvisioningStatus getProvisioningStatus(){ * {@inheritDoc} */ @Override - public LbOperatingStatus getOperatingStatus(){ + public LbOperatingStatus getOperatingStatus() { return operatingStatus; } @@ -142,7 +143,7 @@ public LbOperatingStatus getOperatingStatus(){ * {@inheritDoc} */ @Override - public String getVipPortId(){ + public String getVipPortId() { return vipPortId; } @@ -150,7 +151,7 @@ public String getVipPortId(){ * {@inheritDoc} */ @Override - public String getProvider(){ + public String getProvider() { return provider; } @@ -158,12 +159,12 @@ public String getProvider(){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder toBuilder(){ + public LoadBalancerV2Builder toBuilder() { return new LoadBalancerV2ConcreteBuilder(this); } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("tenantId", tenantId) @@ -221,7 +222,7 @@ public LoadBalancerV2 build() { * {@inheritDoc} */ @Override - public LoadBalancerV2Builder from(LoadBalancerV2 in){ + public LoadBalancerV2Builder from(LoadBalancerV2 in) { m = (NeutronLoadBalancerV2) in; return this; } @@ -230,7 +231,7 @@ public LoadBalancerV2Builder from(LoadBalancerV2 in){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder tenantId(String tenantId){ + public LoadBalancerV2Builder tenantId(String tenantId) { m.tenantId = tenantId; return this; } @@ -239,7 +240,7 @@ public LoadBalancerV2Builder tenantId(String tenantId){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder name(String name){ + public LoadBalancerV2Builder name(String name) { m.name = name; return this; } @@ -248,7 +249,7 @@ public LoadBalancerV2Builder name(String name){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder description(String description){ + public LoadBalancerV2Builder description(String description) { m.description = description; return this; } @@ -257,7 +258,7 @@ public LoadBalancerV2Builder description(String description){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder subnetId(String vipSubnetId){ + public LoadBalancerV2Builder subnetId(String vipSubnetId) { m.vipSubnetId = vipSubnetId; return this; } @@ -266,7 +267,7 @@ public LoadBalancerV2Builder subnetId(String vipSubnetId){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder address(String vipAddress){ + public LoadBalancerV2Builder address(String vipAddress) { m.vipAddress = vipAddress; return this; } @@ -275,13 +276,13 @@ public LoadBalancerV2Builder address(String vipAddress){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder adminStateUp(boolean adminStateUp){ + public LoadBalancerV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @Override - public LoadBalancerV2Builder provider(String provider){ + public LoadBalancerV2Builder provider(String provider) { m.provider = provider; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Stats.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Stats.java index 3ae0c8c03..1dd1dc70e 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Stats.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Stats.java @@ -7,6 +7,7 @@ /** * The statistics about an lbaas v2 loadbalancer + * * @author emjburns */ @JsonRootName("stats") @@ -25,31 +26,30 @@ public class NeutronLoadBalancerV2Stats implements LoadBalancerV2Stats { private Integer activeConnections; /** - * * {@inheritDoc} */ @Override public Long getBytesIn() { return bytesIn; } + /** - * * {@inheritDoc} */ @Override public Long getBytesOut() { return bytesOut; } + /** - * * {@inheritDoc} */ @Override public Integer getTotalConnections() { return totalConnections; } + /** - * * {@inheritDoc} */ @Override @@ -58,7 +58,7 @@ public Integer getActiveConnections() { } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("bytesIn", bytesIn) .add("bytesOut", bytesOut) diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Update.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Update.java index 06e85b9dd..82b12b26a 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronLoadBalancerV2Update.java @@ -9,6 +9,7 @@ /** * Entity used to update lbaas v2 loadbalancer + * * @author emjburns */ @JsonRootName("loadbalancer") @@ -26,7 +27,7 @@ public class NeutronLoadBalancerV2Update implements LoadBalancerV2Update { * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -34,7 +35,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -42,7 +43,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -59,11 +60,11 @@ public static class LoadBalancerV2UpdateConcreteBuilder implements LoadBalancerV private NeutronLoadBalancerV2Update m; - public LoadBalancerV2UpdateConcreteBuilder (){ + public LoadBalancerV2UpdateConcreteBuilder() { this(new NeutronLoadBalancerV2Update()); } - public LoadBalancerV2UpdateConcreteBuilder (NeutronLoadBalancerV2Update m){ + public LoadBalancerV2UpdateConcreteBuilder(NeutronLoadBalancerV2Update m) { this.m = m; } @@ -71,7 +72,7 @@ public LoadBalancerV2UpdateConcreteBuilder (NeutronLoadBalancerV2Update m){ * {@inheritDoc} */ @Override - public LoadBalancerV2Update build(){ + public LoadBalancerV2Update build() { return m; } @@ -79,7 +80,7 @@ public LoadBalancerV2Update build(){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder from(LoadBalancerV2Update in){ + public LoadBalancerV2UpdateBuilder from(LoadBalancerV2Update in) { m = (NeutronLoadBalancerV2Update) in; return this; } @@ -88,7 +89,7 @@ public LoadBalancerV2UpdateBuilder from(LoadBalancerV2Update in){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder description(String description){ + public LoadBalancerV2UpdateBuilder description(String description) { m.description = description; return this; } @@ -97,7 +98,7 @@ public LoadBalancerV2UpdateBuilder description(String description){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder name(String name){ + public LoadBalancerV2UpdateBuilder name(String name) { m.name = name; return this; } @@ -106,13 +107,14 @@ public LoadBalancerV2UpdateBuilder name(String name){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public LoadBalancerV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } } - public static LoadBalancerV2UpdateBuilder builder(){ + + public static LoadBalancerV2UpdateBuilder builder() { return new LoadBalancerV2UpdateConcreteBuilder(); } @@ -120,7 +122,7 @@ public static LoadBalancerV2UpdateBuilder builder(){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder toBuilder(){ + public LoadBalancerV2UpdateBuilder toBuilder() { return new LoadBalancerV2UpdateConcreteBuilder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMember.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMember.java index 2bf3ad2e3..a199a8c55 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMember.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMember.java @@ -1,239 +1,238 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; - -import org.openstack4j.model.network.ext.Member; -import org.openstack4j.model.network.ext.builder.MemberBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.Member; +import org.openstack4j.model.network.ext.builder.MemberBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** * A member of a Lbaas pool - * @author liujunpeng * + * @author liujunpeng */ @JsonRootName("member") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronMember implements Member { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; private String id; @JsonProperty("tenant_id") private String tenantId; private String address; @JsonProperty("protocol_port") private Integer protocolPort; - /** - * 1~100 - */ + /** + * 1~100 + */ private Integer weight; @JsonProperty("admin_state_up") private boolean adminStateUp; - private String status; - @JsonProperty("pool_id") - private String poolId; - /** - * {@inheritDoc} - */ - @Override - public String getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public String getAddress() { - return address; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - return adminStateUp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - - /** - * {@inheritDoc} - */ - @Override - public Integer getProtocolPort() { - return protocolPort; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getWeight() { - return weight; - } - /** - * {@inheritDoc} - */ - @Override - public String getPoolId(){ - return poolId; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id) - .add("address", address) - .add("adminStateUp", adminStateUp) - .add("poolId", poolId) - .add("protocolPort", protocolPort) - .add("status", status) - .add("tenantId", tenantId) - .add("weight",weight) - .toString(); - } - - /** - * Lbaas members - * @author liujunpeng - * - */ - public static class Members extends ListResult{ - - private static final long serialVersionUID = 1L; - @JsonProperty("members") - private Listmembers; - @Override - public List value() { - return members; - } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("members", members).toString(); - } - } - /** - * Member create builder - * @author liujunpeng - * - */ - public static class MemberConcreteBuilder implements MemberBuilder{ - - private NeutronMember m; - - public MemberConcreteBuilder() { - this(new NeutronMember()); - } - - public MemberConcreteBuilder(NeutronMember m) { - this.m = m; - } - - @Override - public Member build() { - return m; - } - - @Override - public MemberBuilder from(Member in) { - m = (NeutronMember) in; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public MemberBuilder tenantId(String tenantId) { - m.tenantId = tenantId; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public MemberBuilder adminStateUp(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public MemberBuilder address(String address) { - m.address = address; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public MemberBuilder protocolPort(Integer protocolPort) { - m.protocolPort = protocolPort; - return this; - } - - - /** - * - * {@inheritDoc} - */ - @Override - public MemberBuilder weight(Integer weight) { - m.weight = weight; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public MemberBuilder poolId(String lbPoolId) { - m.poolId = lbPoolId; - return this; - } - } - - /** - * Wraps this Member into a Builder - * @return the network builder - */ - public MemberBuilder toBuilder() { - return new MemberConcreteBuilder(this); - } - - public static MemberBuilder builder(){ - return new MemberConcreteBuilder(); - } + private String status; + @JsonProperty("pool_id") + private String poolId; + + /** + * {@inheritDoc} + */ + @Override + public String getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public String getAddress() { + return address; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + return adminStateUp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + + /** + * {@inheritDoc} + */ + @Override + public Integer getProtocolPort() { + return protocolPort; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getWeight() { + return weight; + } + + /** + * {@inheritDoc} + */ + @Override + public String getPoolId() { + return poolId; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id) + .add("address", address) + .add("adminStateUp", adminStateUp) + .add("poolId", poolId) + .add("protocolPort", protocolPort) + .add("status", status) + .add("tenantId", tenantId) + .add("weight", weight) + .toString(); + } + + /** + * Lbaas members + * + * @author liujunpeng + */ + public static class Members extends ListResult { + + private static final long serialVersionUID = 1L; + @JsonProperty("members") + private List members; + + @Override + public List value() { + return members; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("members", members).toString(); + } + } + + /** + * Member create builder + * + * @author liujunpeng + */ + public static class MemberConcreteBuilder implements MemberBuilder { + + private NeutronMember m; + + public MemberConcreteBuilder() { + this(new NeutronMember()); + } + + public MemberConcreteBuilder(NeutronMember m) { + this.m = m; + } + + @Override + public Member build() { + return m; + } + + @Override + public MemberBuilder from(Member in) { + m = (NeutronMember) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MemberBuilder tenantId(String tenantId) { + m.tenantId = tenantId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MemberBuilder adminStateUp(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MemberBuilder address(String address) { + m.address = address; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MemberBuilder protocolPort(Integer protocolPort) { + m.protocolPort = protocolPort; + return this; + } + + + /** + * {@inheritDoc} + */ + @Override + public MemberBuilder weight(Integer weight) { + m.weight = weight; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MemberBuilder poolId(String lbPoolId) { + m.poolId = lbPoolId; + return this; + } + } + + /** + * Wraps this Member into a Builder + * + * @return the network builder + */ + public MemberBuilder toBuilder() { + return new MemberConcreteBuilder(this); + } + + public static MemberBuilder builder() { + return new MemberConcreteBuilder(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberUpdate.java index 9ef8b3688..f1fd5c05d 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberUpdate.java @@ -1,126 +1,126 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.MemberUpdate; -import org.openstack4j.model.network.ext.builder.MemberUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.MemberUpdate; +import org.openstack4j.model.network.ext.builder.MemberUpdateBuilder; /** * A updated member of a Lbaas pool + * * @author liujunpeng */ @JsonRootName("member") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronMemberUpdate implements MemberUpdate { - private static final long serialVersionUID = 1L; - /** - * 1~100 - */ + private static final long serialVersionUID = 1L; + /** + * 1~100 + */ private Integer weight; @JsonProperty("admin_state_up") private boolean adminStateUp; - @JsonProperty("pool_id") - private String poolId; - /** - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - return adminStateUp; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getWeight() { - return weight; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("adminStateUp", adminStateUp) - .add("weight",weight) - .add("poolId", poolId) - .toString(); - } - - /** - * Member create builder - * @author liujunpeng - * - */ - public static class MemberUpdateConcreteBuilder implements MemberUpdateBuilder{ - - private NeutronMemberUpdate m; - - public MemberUpdateConcreteBuilder() { - this(new NeutronMemberUpdate()); - } - - public MemberUpdateConcreteBuilder(NeutronMemberUpdate m) { - this.m = m; - } - - @Override - public MemberUpdateBuilder from(MemberUpdate in) { - m = (NeutronMemberUpdate) in; - return this; - } - - @Override - public MemberUpdate build() { - return m; - } - - @Override - public MemberUpdateBuilder adminStateUp(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - - @Override - public MemberUpdateBuilder weight(Integer weight) { - m.weight = weight; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public MemberUpdateBuilder poolId(String poolId) { - m.poolId = poolId; - return this; - } - } - - /** - * Wraps this MemberUpdate into a Builder - * @return the network builder - */ - public MemberUpdateBuilder toBuilder() { - return new MemberUpdateConcreteBuilder(this); - } - - public static MemberUpdateBuilder builder(){ - return new MemberUpdateConcreteBuilder(); - } - - /** - * - * {@inheritDoc} - */ - @Override - public String getPoolId() { - - return poolId; - } + @JsonProperty("pool_id") + private String poolId; + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + return adminStateUp; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getWeight() { + return weight; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("adminStateUp", adminStateUp) + .add("weight", weight) + .add("poolId", poolId) + .toString(); + } + + /** + * Member create builder + * + * @author liujunpeng + */ + public static class MemberUpdateConcreteBuilder implements MemberUpdateBuilder { + + private NeutronMemberUpdate m; + + public MemberUpdateConcreteBuilder() { + this(new NeutronMemberUpdate()); + } + + public MemberUpdateConcreteBuilder(NeutronMemberUpdate m) { + this.m = m; + } + + @Override + public MemberUpdateBuilder from(MemberUpdate in) { + m = (NeutronMemberUpdate) in; + return this; + } + + @Override + public MemberUpdate build() { + return m; + } + + @Override + public MemberUpdateBuilder adminStateUp(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + + @Override + public MemberUpdateBuilder weight(Integer weight) { + m.weight = weight; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MemberUpdateBuilder poolId(String poolId) { + m.poolId = poolId; + return this; + } + } + + /** + * Wraps this MemberUpdate into a Builder + * + * @return the network builder + */ + public MemberUpdateBuilder toBuilder() { + return new MemberUpdateConcreteBuilder(this); + } + + public static MemberUpdateBuilder builder() { + return new MemberUpdateConcreteBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getPoolId() { + + return poolId; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2.java index d1fc85f2d..88a9fe43d 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2.java @@ -12,6 +12,7 @@ /** * A member of a v2 lbaas pool + * * @author emjburns */ @JsonRootName("member") @@ -42,7 +43,7 @@ public class NeutronMemberV2 implements MemberV2 { * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -50,7 +51,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public String getSubnetId(){ + public String getSubnetId() { return subnetId; } @@ -58,7 +59,7 @@ public String getSubnetId(){ * {@inheritDoc} */ @Override - public Integer getWeight(){ + public Integer getWeight() { return weight; } @@ -66,7 +67,7 @@ public Integer getWeight(){ * {@inheritDoc} */ @Override - public Integer getProtocolPort(){ + public Integer getProtocolPort() { return protocolPort; } @@ -74,7 +75,7 @@ public Integer getProtocolPort(){ * {@inheritDoc} */ @Override - public String getAddress(){ + public String getAddress() { return address; } @@ -82,7 +83,7 @@ public String getAddress(){ * {@inheritDoc} */ @Override - public String getTenantId(){ + public String getTenantId() { return tenantId; } @@ -90,20 +91,20 @@ public String getTenantId(){ * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("tenantId", tenantId) .add("address", address) .add("protocolPort", protocolPort) .add("adminStateUp", adminStateUp) - .add("weight",weight) - .add("subnetId",subnetId) + .add("weight", weight) + .add("subnetId", subnetId) .toString(); } @@ -142,12 +143,12 @@ public MemberV2ConcreteBuilder(NeutronMemberV2 m) { } @Override - public MemberV2 build(){ + public MemberV2 build() { return m; } @Override - public MemberV2Builder from(MemberV2 in){ + public MemberV2Builder from(MemberV2 in) { m = (NeutronMemberV2) in; return this; } @@ -156,7 +157,7 @@ public MemberV2Builder from(MemberV2 in){ * {@inheritDoc} */ @Override - public MemberV2Builder tenantId(String tenantId){ + public MemberV2Builder tenantId(String tenantId) { m.tenantId = tenantId; return this; } @@ -165,7 +166,7 @@ public MemberV2Builder tenantId(String tenantId){ * {@inheritDoc} */ @Override - public MemberV2Builder address(String address){ + public MemberV2Builder address(String address) { m.address = address; return this; } @@ -174,7 +175,7 @@ public MemberV2Builder address(String address){ * {@inheritDoc} */ @Override - public MemberV2Builder protocolPort(Integer protocolPort){ + public MemberV2Builder protocolPort(Integer protocolPort) { m.protocolPort = protocolPort; return this; } @@ -183,7 +184,7 @@ public MemberV2Builder protocolPort(Integer protocolPort){ * {@inheritDoc} */ @Override - public MemberV2Builder subnetId(String subnetId){ + public MemberV2Builder subnetId(String subnetId) { m.subnetId = subnetId; return this; } @@ -192,7 +193,7 @@ public MemberV2Builder subnetId(String subnetId){ * {@inheritDoc} */ @Override - public MemberV2Builder weight(Integer weight){ + public MemberV2Builder weight(Integer weight) { m.weight = weight; return this; } @@ -201,18 +202,18 @@ public MemberV2Builder weight(Integer weight){ * {@inheritDoc} */ @Override - public MemberV2Builder adminStateUp(boolean adminStateUp){ + public MemberV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } } @Override - public MemberV2Builder toBuilder(){ + public MemberV2Builder toBuilder() { return new MemberV2ConcreteBuilder(this); } - public static MemberV2Builder builder(){ + public static MemberV2Builder builder() { return new MemberV2ConcreteBuilder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2Update.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2Update.java index cb639e69b..f12b479fb 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronMemberV2Update.java @@ -9,6 +9,7 @@ /** * Entity for updating lbaas v2 members + * * @author emjburns */ @JsonRootName("member") @@ -27,12 +28,12 @@ public class NeutronMemberV2Update implements MemberV2Update { private boolean adminStateUp = true; @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @Override - public Integer getWeight(){ + public Integer getWeight() { return weight; } @@ -40,7 +41,7 @@ public Integer getWeight(){ public String toString() { return MoreObjects.toStringHelper(this) .add("weight", weight) - .add("adminStateUp",adminStateUp) + .add("adminStateUp", adminStateUp) .toString(); } @@ -59,7 +60,7 @@ public MemberV2UpdateConcreteBuilder(NeutronMemberV2Update m) { * {@inheritDoc} */ @Override - public MemberV2Update build(){ + public MemberV2Update build() { return m; } @@ -67,7 +68,7 @@ public MemberV2Update build(){ * {@inheritDoc} */ @Override - public MemberV2UpdateBuilder from(MemberV2Update in){ + public MemberV2UpdateBuilder from(MemberV2Update in) { m = (NeutronMemberV2Update) in; return this; } @@ -76,7 +77,7 @@ public MemberV2UpdateBuilder from(MemberV2Update in){ * {@inheritDoc} */ @Override - public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -85,18 +86,18 @@ public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public MemberV2UpdateBuilder weight(Integer weight){ + public MemberV2UpdateBuilder weight(Integer weight) { m.weight = weight; return this; } } @Override - public MemberV2UpdateBuilder toBuilder(){ + public MemberV2UpdateBuilder toBuilder() { return new MemberV2UpdateConcreteBuilder(this); } - public static MemberV2UpdateBuilder builder(){ + public static MemberV2UpdateBuilder builder() { return new MemberV2UpdateConcreteBuilder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortChain.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortChain.java index 43882473a..ae2d64f72 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortChain.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortChain.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.network.ext.PortChain; import org.openstack4j.model.network.ext.builder.PortChainBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; +import java.util.Map; /** * {@inheritDoc} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPair.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPair.java index c32822dd7..11a74e4b1 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPair.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPair.java @@ -1,20 +1,17 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.network.ext.PortPair; import org.openstack4j.model.network.ext.builder.PortPairBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; +import java.util.Map; /** - * * @author Dmitry Gerenrot - * */ @JsonRootName("port_pair") public class NeutronPortPair implements PortPair { diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPairGroup.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPairGroup.java index 6f90b104f..825e579ab 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPairGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronPortPairGroup.java @@ -1,19 +1,17 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.network.ext.PortPairGroup; import org.openstack4j.model.network.ext.builder.PortPairGroupBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; +import java.util.Map; /** * @author Dmitry Gerenrot - * */ @JsonRootName("port_pair_group") public class NeutronPortPairGroup implements PortPairGroup { @@ -88,7 +86,7 @@ public void setPortPairs(List portPairs) { } @Override - public Map getPortPairGroupParameters() { + public Map getPortPairGroupParameters() { return portPairGroupParameters; } @@ -171,7 +169,7 @@ public PortPairGroupBuilder portPairs(List portPairs) { } @Override - public PortPairGroupBuilder portPairGroupParameters(Map portPairGroupParameters) { + public PortPairGroupBuilder portPairGroupParameters(Map portPairGroupParameters) { this.neutronPortPairGroup.portPairGroupParameters = portPairGroupParameters; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSessionPersistence.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSessionPersistence.java index ae9efa13d..c6559cd5a 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSessionPersistence.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSessionPersistence.java @@ -1,110 +1,113 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.SessionPersistence; -import org.openstack4j.model.network.ext.SessionPersistenceType; -import org.openstack4j.model.network.ext.builder.SessionPersistenceBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.ext.SessionPersistence; +import org.openstack4j.model.network.ext.SessionPersistenceType; +import org.openstack4j.model.network.ext.builder.SessionPersistenceBuilder; + @JsonRootName("session_persistence") @JsonIgnoreProperties(ignoreUnknown = true) public class NeutronSessionPersistence implements SessionPersistence { - private static final long serialVersionUID = 1L; - @JsonProperty("cookie_name") - private String cookieName; - private SessionPersistenceType type; - /** - * wrap the SessionPersistence to builder - * @return SessionPersistenceBuilder - */ - @Override - public SessionPersistenceBuilder toBuilder() { - return new SessionPersistenceContreteBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getCookieName() { - return cookieName; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceType getType() { - return type; - } - /** - * SessionPersistence Builder - * @author liujunpeng - * - */ - public static class SessionPersistenceContreteBuilder implements SessionPersistenceBuilder{ - - private NeutronSessionPersistence m; - - public SessionPersistenceContreteBuilder() { - this(new NeutronSessionPersistence()); - } - - public SessionPersistenceContreteBuilder(NeutronSessionPersistence m) { - this.m = m; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceBuilder from(SessionPersistence in) { - m = (NeutronSessionPersistence)in; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceBuilder type(SessionPersistenceType type) { - m.type = type; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceBuilder cookieName(String cookieName) { - m.cookieName = cookieName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistence build() { - return m; - } - - } - - public static SessionPersistenceBuilder builder(){ - return new SessionPersistenceContreteBuilder(); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("type",type) - .add("cookieName", cookieName) - .toString(); - } + private static final long serialVersionUID = 1L; + @JsonProperty("cookie_name") + private String cookieName; + private SessionPersistenceType type; + + /** + * wrap the SessionPersistence to builder + * + * @return SessionPersistenceBuilder + */ + @Override + public SessionPersistenceBuilder toBuilder() { + return new SessionPersistenceContreteBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getCookieName() { + return cookieName; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceType getType() { + return type; + } + + /** + * SessionPersistence Builder + * + * @author liujunpeng + */ + public static class SessionPersistenceContreteBuilder implements SessionPersistenceBuilder { + + private NeutronSessionPersistence m; + + public SessionPersistenceContreteBuilder() { + this(new NeutronSessionPersistence()); + } + + public SessionPersistenceContreteBuilder(NeutronSessionPersistence m) { + this.m = m; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceBuilder from(SessionPersistence in) { + m = (NeutronSessionPersistence) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceBuilder type(SessionPersistenceType type) { + m.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceBuilder cookieName(String cookieName) { + m.cookieName = cookieName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistence build() { + return m; + } + + } + + public static SessionPersistenceBuilder builder() { + return new SessionPersistenceContreteBuilder(); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("type", type) + .add("cookieName", cookieName) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVip.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVip.java index 6c8f29f66..bb7357d05 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVip.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVip.java @@ -1,24 +1,22 @@ package org.openstack4j.openstack.networking.domain.ext; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.network.ext.Protocol; import org.openstack4j.model.network.ext.SessionPersistence; import org.openstack4j.model.network.ext.Vip; import org.openstack4j.model.network.ext.builder.VipBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; /** * @author liujunpeng - * */ @JsonRootName("vip") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NeutronVip implements Vip { private static final long serialVersionUID = 1L; @@ -78,17 +76,16 @@ public class NeutronVip implements Vip { * The status of the VIP. Indicates whether the VIP is operational. */ private String status; + /** - * * {@inheritDoc} */ @Override public VipBuilder toBuilder() { - return new VipContreteBuilder() ; + return new VipContreteBuilder(); } /** - * * {@inheritDoc} */ @Override @@ -97,7 +94,6 @@ public String getAddress() { } /** - * * {@inheritDoc} */ @Override @@ -106,7 +102,6 @@ public boolean isAdminStateUp() { } /** - * * {@inheritDoc} */ @Override @@ -115,7 +110,6 @@ public Integer getConnectionLimit() { } /** - * * {@inheritDoc} */ @Override @@ -124,7 +118,6 @@ public String getDescription() { } /** - * * {@inheritDoc} */ @Override @@ -133,7 +126,6 @@ public String getId() { } /** - * * {@inheritDoc} */ @Override @@ -142,7 +134,6 @@ public String getName() { } /** - * * {@inheritDoc} */ @Override @@ -151,7 +142,6 @@ public String getPoolId() { } /** - * * {@inheritDoc} */ @Override @@ -160,7 +150,6 @@ public Protocol getProtocol() { } /** - * * {@inheritDoc} */ @Override @@ -169,7 +158,6 @@ public Integer getProtocolPort() { } /** - * * {@inheritDoc} */ @Override @@ -178,7 +166,6 @@ public SessionPersistence getSessionPersistence() { } /** - * * {@inheritDoc} */ @Override @@ -187,7 +174,6 @@ public String getStatus() { } /** - * * {@inheritDoc} */ @Override @@ -196,7 +182,6 @@ public String getSubnetId() { } /** - * * {@inheritDoc} */ @Override @@ -226,19 +211,19 @@ public String toString() { /** - * * @author liujunpeng - * */ - public static class Vips extends ListResult{ + public static class Vips extends ListResult { private static final long serialVersionUID = 1L; @JsonProperty("vips") List vips; + @Override public List value() { return vips; } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() @@ -246,18 +231,21 @@ public String toString() { } } + public static class VipContreteBuilder implements VipBuilder { private NeutronVip m; - public VipContreteBuilder(){ + + public VipContreteBuilder() { this(new NeutronVip()); } - public VipContreteBuilder(NeutronVip m){ + + public VipContreteBuilder(NeutronVip m) { this.m = m; } + /** - * * {@inheritDoc} */ @Override @@ -267,12 +255,11 @@ public Vip build() { @Override public VipBuilder from(Vip in) { - m = (NeutronVip)in; + m = (NeutronVip) in; return this; } /** - * * {@inheritDoc} */ @Override @@ -282,7 +269,6 @@ public VipBuilder tenantId(String tenantId) { } /** - * * {@inheritDoc} */ @Override @@ -292,7 +278,6 @@ public VipBuilder name(String name) { } /** - * * {@inheritDoc} */ @Override @@ -302,7 +287,6 @@ public VipBuilder description(String description) { } /** - * * {@inheritDoc} */ @Override @@ -312,7 +296,6 @@ public VipBuilder subnetId(String subnetId) { } /** - * * {@inheritDoc} */ @Override @@ -322,7 +305,6 @@ public VipBuilder address(String address) { } /** - * * {@inheritDoc} */ @Override @@ -332,7 +314,6 @@ public VipBuilder protocol(Protocol protocol) { } /** - * * {@inheritDoc} */ @Override @@ -340,8 +321,8 @@ public VipBuilder protocolPort(Integer protocolPort) { m.protocolPort = protocolPort; return this; } + /** - * * {@inheritDoc} */ @Override @@ -349,18 +330,18 @@ public VipBuilder poolId(String poolId) { m.poolId = poolId; return this; } + /** - * * {@inheritDoc} */ @Override public VipBuilder sessionPersistence( SessionPersistence sessionPersistence) { - m.sessionPersistence = (NeutronSessionPersistence)sessionPersistence; + m.sessionPersistence = (NeutronSessionPersistence) sessionPersistence; return this; } + /** - * * {@inheritDoc} */ @Override @@ -368,8 +349,8 @@ public VipBuilder connectionLimit(Integer connectionLimit) { m.connectionLimit = connectionLimit; return this; } + /** - * * {@inheritDoc} */ @Override @@ -380,7 +361,7 @@ public VipBuilder adminStateUp(boolean adminStateUp) { } - public static VipBuilder builder(){ + public static VipBuilder builder() { return new VipContreteBuilder(); } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVipUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVipUpdate.java index 5c6924b2c..f00bb2b17 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVipUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronVipUpdate.java @@ -1,191 +1,189 @@ package org.openstack4j.openstack.networking.domain.ext; -import org.openstack4j.model.network.ext.SessionPersistence; -import org.openstack4j.model.network.ext.VipUpdate; -import org.openstack4j.model.network.ext.builder.VipUpdateBuilder; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.network.ext.SessionPersistence; +import org.openstack4j.model.network.ext.VipUpdate; +import org.openstack4j.model.network.ext.builder.VipUpdateBuilder; /** * Neutron Vip for update - * @author liujunpeng * + * @author liujunpeng */ @JsonRootName("vip") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class NeutronVipUpdate implements VipUpdate { - private static final long serialVersionUID = 1L; - - private String name; - - private String description; - - @JsonProperty("pool_id") - private String poolId; - - /** - * Session persistence parameters for the VIP. Omit the session_persistence - * parameter to prevent session persistence. When no session persistence is - * used, the session_persistence parameter does not appear in the API - * response. To clear session persistence for the VIP, set the - * session_persistence parameter to null in a VIP update request. - */ - @JsonProperty("session_persistence") - private NeutronSessionPersistence sessionPersistence; - - /** - * The maximum number of connections allowed for the VIP. Default is -1, meaning no limit. - */ - @JsonProperty("connection_limit") - private Integer connectionLimit; - - @JsonProperty("admin_state_up") - private boolean adminStateUp; - /** - * {@inheritDoc} - */ - @Override - public VipUpdateBuilder toBuilder() { - - return new VipUpdateContreteBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isAdminStateUp() { - return adminStateUp; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getConnectionLimit() { - return connectionLimit; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPoolId() { - return poolId; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistence getSessionPersistence() { - return sessionPersistence; - } - - public static class VipUpdateContreteBuilder implements VipUpdateBuilder{ - - private NeutronVipUpdate m; - - public VipUpdateContreteBuilder() { - this(new NeutronVipUpdate()); - } - public VipUpdateContreteBuilder(NeutronVipUpdate m) { - this.m = m; - } - @Override - public VipUpdate build() { - return m; - } - - @Override - public VipUpdateBuilder from(VipUpdate in) { - m = (NeutronVipUpdate) in; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public VipUpdateBuilder name(String name) { - m.name = name; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public VipUpdateBuilder description(String description) { - m.description = description; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public VipUpdateBuilder poolId(String poolId) { - m.poolId = poolId; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public VipUpdateBuilder sessionPersistence( - SessionPersistence sessionPersistence) { - m.sessionPersistence = (NeutronSessionPersistence)sessionPersistence; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public VipUpdateBuilder connectionLimit(Integer connectionLimit) { - m.connectionLimit = connectionLimit; - return this; - } - - /** - * - * {@inheritDoc} - */ - @Override - public VipUpdateBuilder adminStateUp(boolean adminStateUp) { - m.adminStateUp = adminStateUp; - return this; - } - } - public static VipUpdateBuilder builder(){ - return new VipUpdateContreteBuilder(); - - } + private static final long serialVersionUID = 1L; + + private String name; + + private String description; + + @JsonProperty("pool_id") + private String poolId; + + /** + * Session persistence parameters for the VIP. Omit the session_persistence + * parameter to prevent session persistence. When no session persistence is + * used, the session_persistence parameter does not appear in the API + * response. To clear session persistence for the VIP, set the + * session_persistence parameter to null in a VIP update request. + */ + @JsonProperty("session_persistence") + private NeutronSessionPersistence sessionPersistence; + + /** + * The maximum number of connections allowed for the VIP. Default is -1, meaning no limit. + */ + @JsonProperty("connection_limit") + private Integer connectionLimit; + + @JsonProperty("admin_state_up") + private boolean adminStateUp; + + /** + * {@inheritDoc} + */ + @Override + public VipUpdateBuilder toBuilder() { + + return new VipUpdateContreteBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAdminStateUp() { + return adminStateUp; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getConnectionLimit() { + return connectionLimit; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getPoolId() { + return poolId; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistence getSessionPersistence() { + return sessionPersistence; + } + + public static class VipUpdateContreteBuilder implements VipUpdateBuilder { + + private NeutronVipUpdate m; + + public VipUpdateContreteBuilder() { + this(new NeutronVipUpdate()); + } + + public VipUpdateContreteBuilder(NeutronVipUpdate m) { + this.m = m; + } + + @Override + public VipUpdate build() { + return m; + } + + @Override + public VipUpdateBuilder from(VipUpdate in) { + m = (NeutronVipUpdate) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VipUpdateBuilder name(String name) { + m.name = name; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VipUpdateBuilder description(String description) { + m.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VipUpdateBuilder poolId(String poolId) { + m.poolId = poolId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VipUpdateBuilder sessionPersistence( + SessionPersistence sessionPersistence) { + m.sessionPersistence = (NeutronSessionPersistence) sessionPersistence; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VipUpdateBuilder connectionLimit(Integer connectionLimit) { + m.connectionLimit = connectionLimit; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VipUpdateBuilder adminStateUp(boolean adminStateUp) { + m.adminStateUp = adminStateUp; + return this; + } + } + + public static VipUpdateBuilder builder() { + return new VipUpdateContreteBuilder(); + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/AvailabilityZoneServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/AvailabilityZoneServiceImpl.java index 6193ee942..b070172ee 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/AvailabilityZoneServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/AvailabilityZoneServiceImpl.java @@ -1,29 +1,29 @@ package org.openstack4j.openstack.networking.internal; -import java.util.List; - import org.openstack4j.api.networking.AvailabilityZoneService; import org.openstack4j.model.network.AvailabilityZone; import org.openstack4j.openstack.networking.domain.NeutronAvailabilityZone.AvailabilityZones; +import java.util.List; + /** * Availability Zone Service - * - * @author Taemin * + * @author Taemin */ public class AvailabilityZoneServiceImpl extends BaseNetworkingServices implements AvailabilityZoneService { /** * List all availability zone that the current neutron has * {@inheritDoc} + * * @author Taemin */ - @Override - public List list() { - return get(AvailabilityZones.class, uri("/availability_zones")).execute().getList(); - } + @Override + public List list() { + return get(AvailabilityZones.class, uri("/availability_zones")).execute().getList(); + } + - } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/BaseNetworkingServices.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/BaseNetworkingServices.java index fde9c29d4..5f0a53bea 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/BaseNetworkingServices.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/BaseNetworkingServices.java @@ -6,12 +6,12 @@ /** * Base Networking Operations Implementation is responsible for insuring the proper endpoint is used for all extending operation APIs - * + * * @author Jeremy Unruh */ public class BaseNetworkingServices extends BaseOpenStackService { - protected BaseNetworkingServices() { - super(ServiceType.NETWORK, EnforceVersionToURL.instance("/v2.0")); - } + protected BaseNetworkingServices() { + super(ServiceType.NETWORK, EnforceVersionToURL.instance("/v2.0")); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/FloatingIPServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/FloatingIPServiceImpl.java index c49210d0c..b31075fcc 100755 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/FloatingIPServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/FloatingIPServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.networking.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.networking.NetFloatingIPService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -13,6 +8,11 @@ import org.openstack4j.openstack.networking.domain.NeutronFloatingIP; import org.openstack4j.openstack.networking.domain.NeutronFloatingIP.FloatingIPs; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * FloatingIPService implementation that provides Neutron Floating-IP based Service Operations. * @@ -67,7 +67,7 @@ public ActionResponse delete(String id) { public NetFloatingIP create(NetFloatingIP floatingIp) { checkNotNull(floatingIp); checkNotNull(floatingIp.getFloatingNetworkId()); - return post(NeutronFloatingIP.class, uri("/floatingips")).entity(floatingIp).execute(); + return post(NeutronFloatingIP.class, uri("/floatingips")).entity(floatingIp).execute(); } /** @@ -79,7 +79,7 @@ public NetFloatingIP associateToPort(String id, String portId) { checkNotNull(portId); String inner = String.format("{ \"port_id\":\"%s\" }", portId); String json = String.format("{ \"%s\": %s }", "floatingip", inner); - return put(NeutronFloatingIP.class, uri("/floatingips/%s",id)).json(json) + return put(NeutronFloatingIP.class, uri("/floatingips/%s", id)).json(json) .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); } @@ -91,7 +91,7 @@ public NetFloatingIP associateToPort(String id, String portId) { public NetFloatingIP disassociateFromPort(String id) { checkNotNull(id); String json = String.format("{ \"%s\": %s }", "floatingip", "{ \"port_id\":null }"); - return put(NeutronFloatingIP.class, uri("/floatingips/%s",id)).json(json) + return put(NeutronFloatingIP.class, uri("/floatingips/%s", id)).json(json) .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java index 87a63c471..b1aa817db 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.networking.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.networking.NetworkService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.Network; @@ -12,64 +7,68 @@ import org.openstack4j.openstack.networking.domain.NeutronNetwork; import org.openstack4j.openstack.networking.domain.NeutronNetwork.Networks; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * OpenStack (Neutron) Network based Operations - * - * @author Jeremy Unruh + * + * @author Jeremy Unruh, bboyHan */ public class NetworkServiceImpl extends BaseNetworkingServices implements NetworkService { - - private Invocation buildInvocation(Map filteringParams) { - Invocation invocation = get(Networks.class, "/networks"); - if (filteringParams == null) { - return invocation; - } else { - for (Map.Entry entry : filteringParams.entrySet()) { - invocation = invocation.param(entry.getKey(), entry.getValue()); - } - } - return invocation; - } - - - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams){ - Invocation invocation = buildInvocation(filteringParams); - return invocation.execute().getList(); - - } - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Networks.class, uri("/networks")).execute().getList(); - } + private Invocation buildInvocation(Map filteringParams) { + Invocation invocation = get(Networks.class, "/networks"); + if (filteringParams == null) { + return invocation; + } else { + for (Map.Entry entry : filteringParams.entrySet()) { + invocation = invocation.param(entry.getKey(), entry.getValue()); + } + } + return invocation; + } + + + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation invocation = buildInvocation(filteringParams); + return invocation.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String networkId) { - checkNotNull(networkId); - return deleteWithResponse(uri("/networks/%s", networkId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Networks.class, uri("/networks")).execute().getList(); + } - @Override - public Network get(String networkId) { - checkNotNull(networkId); - return get(NeutronNetwork.class, uri("/networks/%s", networkId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String networkId) { + checkNotNull(networkId); + return deleteWithResponse(uri("/networks/%s", networkId)).execute(); + } - @Override - public Network create(Network network) { - checkNotNull(network); - return post(NeutronNetwork.class, uri("/networks")).entity(network).execute(); - } + @Override + public Network get(String networkId) { + checkNotNull(networkId); + return get(NeutronNetwork.class, uri("/networks/%s", networkId)).execute(); + } + + @Override + public Network create(Network network) { + checkNotNull(network); + return post(NeutronNetwork.class, uri("/networks")).entity(network).execute(); + } @Override public Network update(String networkId, NetworkUpdate network) { diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java index 2ddf8768e..e83ad56d2 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java @@ -1,24 +1,12 @@ package org.openstack4j.openstack.networking.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.networking.AvailabilityZoneService; -import org.openstack4j.api.networking.NetFloatingIPService; -import org.openstack4j.api.networking.NetworkService; -import org.openstack4j.api.networking.NetworkingService; -import org.openstack4j.api.networking.PortService; -import org.openstack4j.api.networking.RouterService; -import org.openstack4j.api.networking.SecurityGroupRuleService; -import org.openstack4j.api.networking.SecurityGroupService; -import org.openstack4j.api.networking.SubnetService; -import org.openstack4j.api.networking.ext.AgentService; -import org.openstack4j.api.networking.ext.FirewallAsService; -import org.openstack4j.api.networking.ext.LbaasV2Service; -import org.openstack4j.api.networking.ext.LoadBalancerService; -import org.openstack4j.api.networking.ext.NetQuotaService; +import org.openstack4j.api.networking.*; +import org.openstack4j.api.networking.ext.*; /** * OpenStack Networking Operations API - * + * * @author Jeremy Unruh */ public class NetworkingServiceImpl implements NetworkingService { @@ -99,7 +87,7 @@ public LoadBalancerService loadbalancers() { * {@inheritDoc} */ @Override - public LbaasV2Service lbaasV2(){ + public LbaasV2Service lbaasV2() { return Apis.get(LbaasV2Service.class); } @@ -109,7 +97,7 @@ public LbaasV2Service lbaasV2(){ @Override public FirewallAsService firewalls() { return Apis.get(FirewallAsService.class); - } + } /** * {@inheritDoc} @@ -118,13 +106,13 @@ public FirewallAsService firewalls() { public AgentService agent() { return Apis.get(AgentService.class); } - + /** * {@inheritDoc} */ @Override public AvailabilityZoneService availabilityzone() { return Apis.get(AvailabilityZoneService.class); - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/PortServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/PortServiceImpl.java index c1c6fd9ef..2ba3356f3 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/PortServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/PortServiceImpl.java @@ -14,7 +14,7 @@ /** * OpenStack (Neutron) Port based Operations Implementation - * + * * @author Jeremy Unruh */ public class PortServiceImpl extends BaseNetworkingServices implements PortService { @@ -31,7 +31,7 @@ public List list() { public List list(PortListOptions options) { if (options == null) return list(); - + return get(Ports.class, uri("/ports")).params(options.getOptions()).execute().getList(); } @@ -84,8 +84,8 @@ public Port update(Port port) { checkNotNull(port); checkNotNull(port.getId()); Port p = port.toBuilder().networkId(null).state(null).tenantId(null).macAddress(null) - .vifType(null).vifDetails(null) - .build(); + .vifType(null).vifDetails(null) + .build(); return put(NeutronPort.class, uri("/ports/%s", getAndClearIdentifier(p))).entity(p).execute(); } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/RouterServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/RouterServiceImpl.java index 45d20c7ce..bc604ff9d 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/RouterServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/RouterServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.networking.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; - -import java.util.List; - import org.openstack4j.api.networking.RouterService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -19,6 +14,11 @@ import org.openstack4j.openstack.networking.domain.NeutronRouter.Routers; import org.openstack4j.openstack.networking.domain.NeutronRouterInterface; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; + /** * RouterService implementation that provides Neutron Router based Service Operations. * @@ -26,97 +26,97 @@ */ public class RouterServiceImpl extends BaseNetworkingServices implements RouterService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Routers.class, uri("/routers")).execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public Router get(String routerId) { - checkNotNull(routerId); - return get(NeutronRouter.class, uri("/routers/%s", routerId)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String routerId) { - checkNotNull(routerId); - return deleteWithResponse(uri("/routers/%s", routerId)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Router create(String name, boolean adminStateUp) { - checkNotNull(name); - return post(NeutronRouter.class, uri("/routers")).entity(NeutronRouter.builder().name(name).adminStateUp(adminStateUp).build()).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Router create(Router router) { - checkNotNull(router); - return post(NeutronRouter.class, uri("/routers")).entity(router).execute(); - } - - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Routers.class, uri("/routers")).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public Router get(String routerId) { + checkNotNull(routerId); + return get(NeutronRouter.class, uri("/routers/%s", routerId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String routerId) { + checkNotNull(routerId); + return deleteWithResponse(uri("/routers/%s", routerId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Router create(String name, boolean adminStateUp) { + checkNotNull(name); + return post(NeutronRouter.class, uri("/routers")).entity(NeutronRouter.builder().name(name).adminStateUp(adminStateUp).build()).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Router create(Router router) { + checkNotNull(router); + return post(NeutronRouter.class, uri("/routers")).entity(router).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Router update(Router router) { + checkNotNull(router); + checkNotNull(router.getId()); + + RouterBuilder rb = NeutronRouter.builder().name(router.getName()).adminStateUp(router.isAdminStateUp()).externalGateway(router.getExternalGatewayInfo()); + List routes = router.getRoutes(); + + if (routes != null && !routes.isEmpty()) { + for (HostRoute route : routes) { + rb.route(route.getDestination(), route.getNexthop()); + } + } else { + rb.noRoutes(); + } + + return put(NeutronRouter.class, uri("/routers/%s", router.getId())) + .entity(rb.build()) + .execute(); + } + + @Override + public Router toggleAdminStateUp(String routerId, boolean adminStateUp) { + checkNotNull(routerId); + return put(NeutronRouter.class, uri("/routers/%s", routerId)).entity(NeutronRouter.builder().adminStateUp(adminStateUp).build()).execute(); + } + + @Override + public RouterInterface attachInterface(String routerId, AttachInterfaceType type, String portOrSubnetId) { + checkNotNull(routerId); + checkNotNull(type); + checkNotNull(portOrSubnetId); + return put(NeutronRouterInterface.class, uri("/routers/%s/add_router_interface", routerId)) + .entity(AddRouterInterfaceAction.create(type, portOrSubnetId)) + .execute(); + } + @Override - public Router update(Router router) { - checkNotNull(router); - checkNotNull(router.getId()); - - RouterBuilder rb = NeutronRouter.builder().name(router.getName()).adminStateUp(router.isAdminStateUp()).externalGateway(router.getExternalGatewayInfo()); - List routes = router.getRoutes(); - - if (routes != null && !routes.isEmpty()) { - for (HostRoute route : routes) { - rb.route(route.getDestination(), route.getNexthop()); - } - } else { - rb.noRoutes(); - } - - return put(NeutronRouter.class, uri("/routers/%s", router.getId())) - .entity(rb.build()) - .execute(); - } - - @Override - public Router toggleAdminStateUp(String routerId, boolean adminStateUp) { - checkNotNull(routerId); - return put(NeutronRouter.class, uri("/routers/%s", routerId)).entity(NeutronRouter.builder().adminStateUp(adminStateUp).build()).execute(); - } - - @Override - public RouterInterface attachInterface(String routerId, AttachInterfaceType type, String portOrSubnetId) { - checkNotNull(routerId); - checkNotNull(type); - checkNotNull(portOrSubnetId); - return put(NeutronRouterInterface.class, uri("/routers/%s/add_router_interface", routerId)) - .entity(AddRouterInterfaceAction.create(type, portOrSubnetId)) - .execute(); - } - - @Override - public RouterInterface detachInterface(String routerId, String subnetId, String portId) { - checkNotNull(routerId); - checkState(!(subnetId == null && portId == null), "Either a Subnet or Port identifier must be set"); - return put(NeutronRouterInterface.class, uri("/routers/%s/remove_router_interface", routerId)) - .entity(new NeutronRouterInterface(subnetId, portId)) - .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); - } + public RouterInterface detachInterface(String routerId, String subnetId, String portId) { + checkNotNull(routerId); + checkState(!(subnetId == null && portId == null), "Either a Subnet or Port identifier must be set"); + return put(NeutronRouterInterface.class, uri("/routers/%s/remove_router_interface", routerId)) + .entity(new NeutronRouterInterface(subnetId, portId)) + .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupRuleServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupRuleServiceImpl.java index ac5256d0b..06109142d 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupRuleServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupRuleServiceImpl.java @@ -1,15 +1,15 @@ package org.openstack4j.openstack.networking.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.networking.SecurityGroupRuleService; import org.openstack4j.model.network.SecurityGroupRule; import org.openstack4j.openstack.networking.domain.NeutronSecurityGroupRule; import org.openstack4j.openstack.networking.domain.NeutronSecurityGroupRule.SecurityGroupRules; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * FloatingIPService implementation that provides Neutron Floating-IP based Service Operations. * diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupServiceImpl.java index 1fa802dcc..5f1c84dc2 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/SecurityGroupServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.networking.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.networking.SecurityGroupService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.SecurityGroup; @@ -12,6 +7,11 @@ import org.openstack4j.openstack.networking.domain.NeutronSecurityGroup; import org.openstack4j.openstack.networking.domain.NeutronSecurityGroup.SecurityGroups; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * FloatingIPService implementation that provides Neutron Floating-IP based Service Operations. * diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/SubnetServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/SubnetServiceImpl.java index ff59d78cc..aa6236ce9 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/SubnetServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/SubnetServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.networking.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.networking.SubnetService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.Subnet; @@ -11,9 +7,13 @@ import org.openstack4j.openstack.networking.domain.NeutronSubnet.Subnets; import org.openstack4j.openstack.networking.domain.NeutronSubnetUpdate; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * OpenStack (Neutron) Subnet based Operations implementation - * + * * @author Jeremy Unruh */ public class SubnetServiceImpl extends BaseNetworkingServices implements SubnetService { diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/AgentServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/AgentServiceImpl.java index 8794f282e..4b96a71ae 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/AgentServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/AgentServiceImpl.java @@ -1,7 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; -import java.util.List; import org.openstack4j.api.networking.ext.AgentService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -11,6 +9,10 @@ import org.openstack4j.openstack.networking.domain.NeutronAgent.Agents; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Networking (Neutron) Agent Extension API * @@ -34,19 +36,19 @@ public Agent setAdminStateUp(String agentId, boolean state) { checkNotNull(agentId); String json = String.format("{\"%s\": { \"%s\": \"%b\"}}", "agent", "admin_state_up", state); return put(NeutronAgent.class, uri("/agents/%s", agentId)).json(json).execute( - ExecutionOptions. create(PropagateOnStatus.on(404))); + ExecutionOptions.create(PropagateOnStatus.on(404))); } @Override public ActionResponse attachNetworkToDhcpAgent(String agentId, String networkId) { checkNotNull(agentId); String json = String.format("{\"%s\": \"%s\"}", "network_id", networkId); - return postWithResponse(uri("/agents/%s/dhcp-networks", agentId)).json(json).execute(ExecutionOptions. create(PropagateOnStatus.on(404))); + return postWithResponse(uri("/agents/%s/dhcp-networks", agentId)).json(json).execute(ExecutionOptions.create(PropagateOnStatus.on(404))); } - + @Override public ActionResponse detachNetworkToDhcpAgent(String agentId, String networkId) { checkNotNull(agentId); - return deleteWithResponse(uri("/agents/%s/dhcp-networks/%s", agentId, networkId)).execute(ExecutionOptions. create(PropagateOnStatus.on(404))); + return deleteWithResponse(uri("/agents/%s/dhcp-networks/%s", agentId, networkId)).execute(ExecutionOptions.create(PropagateOnStatus.on(404))); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallAsServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallAsServiceImpl.java index e93101294..c0e2379f7 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallAsServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallAsServiceImpl.java @@ -8,59 +8,59 @@ /** *

OpenStack Firewall As a Service (FwaaS) Operations API.

- * + * *

- * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: - *

    - *
  • Apply firewall rules on traffic entering and leaving tenant networks.
  • - *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • - *
  • Creation and sharing of firewall policies which hold an ordered collection of the firewall rules.
  • - *
  • Audit firewall rules and policies.
  • - *
+ * The FWaaS extension provides OpenStack users with the ability to deploy firewalls to protect their networks. The FWaaS extension enables you to: + *
    + *
  • Apply firewall rules on traffic entering and leaving tenant networks.
  • + *
  • Support for applying tcp, udp, icmp, or protocol agnostic rules.
  • + *
  • Creation and sharing of firewall policies which hold an ordered collection of the firewall rules.
  • + *
  • Audit firewall rules and policies.
  • + *
*

- * + * *

- * This extension introduces these resources: - *

    - *
  • Firewall: represents a logical firewall resource that a tenant can instantiate and manage. - * A firewall is associated with one firewall policy. - *
  • - *
  • Firewall Policy: is an ordered collection of firewall_rules. - * A firewall policy can be shared across tenants. Thus it can also be made part of an audit workflow wherein the - * firewall policy can be audited by the relevant entity that is authorized (and can be different from the tenants - * which create or use the firewall policy). - *
  • - *
  • Firewall Rule: represents a collection of attributes like ports, - * ip addresses which define match criteria and action (allow, or deny) that needs to be taken on the matched data traffic. - *
  • - *
+ * This extension introduces these resources: + *
    + *
  • Firewall: represents a logical firewall resource that a tenant can instantiate and manage. + * A firewall is associated with one firewall policy. + *
  • + *
  • Firewall Policy: is an ordered collection of firewall_rules. + * A firewall policy can be shared across tenants. Thus it can also be made part of an audit workflow wherein the + * firewall policy can be audited by the relevant entity that is authorized (and can be different from the tenants + * which create or use the firewall policy). + *
  • + *
  • Firewall Rule: represents a collection of attributes like ports, + * ip addresses which define match criteria and action (allow, or deny) that needs to be taken on the matched data traffic. + *
  • + *
*

- * + * * @author Vishvesh Deshmukh */ public class FirewallAsServiceImpl implements FirewallAsService { - /** + /** * {@inheritDoc} */ - @Override - public FirewallService firewall() { - return Apis.get(FirewallService.class); - } - - /** + @Override + public FirewallService firewall() { + return Apis.get(FirewallService.class); + } + + /** * {@inheritDoc} */ - @Override - public FirewallRuleService firewallrule() { - return Apis.get(FirewallRuleService.class); - } - - /** + @Override + public FirewallRuleService firewallrule() { + return Apis.get(FirewallRuleService.class); + } + + /** * {@inheritDoc} */ - @Override - public FirewallPolicyService firewallpolicy() { - return Apis.get(FirewallPolicyService.class); - } + @Override + public FirewallPolicyService firewallpolicy() { + return Apis.get(FirewallPolicyService.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallPolicyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallPolicyServiceImpl.java index 42a2d210c..43cfde57e 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallPolicyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallPolicyServiceImpl.java @@ -1,11 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.networking.ext.FirewallPolicyService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -20,98 +14,104 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronFirewallPolicyRule; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; + /** * Networking (Neutron) FwaaS FirewallPolicy Extension API - * + * * @author Vishvesh Deshmukh */ public class FirewallPolicyServiceImpl extends BaseNetworkingServices implements FirewallPolicyService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(FirewallPolicies.class, uri("/fw/firewall_policies")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(FirewallPolicies.class, uri("/fw/firewall_policies")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(FirewallPolicies.class, uri("/fw/firewall_policies")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(FirewallPolicies.class, uri("/fw/firewall_policies")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public FirewallPolicy get(String firewallPolicyId) { - checkNotNull(firewallPolicyId); - return get(NeutronFirewallPolicy.class, uri("/fw/firewall_policies/%s", firewallPolicyId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicy get(String firewallPolicyId) { + checkNotNull(firewallPolicyId); + return get(NeutronFirewallPolicy.class, uri("/fw/firewall_policies/%s", firewallPolicyId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String firewallPolicyId) { - checkNotNull(firewallPolicyId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, - uri("/fw/firewall_policies/%s", firewallPolicyId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String firewallPolicyId) { + checkNotNull(firewallPolicyId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, + uri("/fw/firewall_policies/%s", firewallPolicyId)).executeWithResponse()); + } - /** - * {@inheritDoc} - */ - @Override - public FirewallPolicy create(FirewallPolicy firewallPolicy) { - return post(NeutronFirewallPolicy.class, uri("/fw/firewall_policies")).entity(firewallPolicy) - .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); - } + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicy create(FirewallPolicy firewallPolicy) { + return post(NeutronFirewallPolicy.class, uri("/fw/firewall_policies")).entity(firewallPolicy) + .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); + } - /** - * {@inheritDoc} - */ - @Override - public FirewallPolicy update(String firewallPolicyId, FirewallPolicyUpdate firewallPolicyUpdate) { - checkNotNull(firewallPolicyId); + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicy update(String firewallPolicyId, FirewallPolicyUpdate firewallPolicyUpdate) { + checkNotNull(firewallPolicyId); checkNotNull(firewallPolicyUpdate); return put(NeutronFirewallPolicy.class, uri("/fw/firewall_policies/%s", firewallPolicyId)).entity(firewallPolicyUpdate).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public FirewallPolicy insertFirewallRuleInPolicy( - String firewallPolicyId, String firewallRuleId, RuleInsertStrategyType type, String insertAfterOrBeforeRuleId) { - checkNotNull(firewallPolicyId); - checkNotNull(firewallRuleId); - return put(NeutronFirewallPolicyRule.class, uri("/fw/firewall_policies/%s/insert_rule", firewallPolicyId)) - .entity(FirewallRuleStrategy.create(firewallRuleId, type, insertAfterOrBeforeRuleId)) - .execute(); - } + } + + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicy insertFirewallRuleInPolicy( + String firewallPolicyId, String firewallRuleId, RuleInsertStrategyType type, String insertAfterOrBeforeRuleId) { + checkNotNull(firewallPolicyId); + checkNotNull(firewallRuleId); + return put(NeutronFirewallPolicyRule.class, uri("/fw/firewall_policies/%s/insert_rule", firewallPolicyId)) + .entity(FirewallRuleStrategy.create(firewallRuleId, type, insertAfterOrBeforeRuleId)) + .execute(); + } - /** - * {@inheritDoc} - */ - @Override - public FirewallPolicy removeFirewallRuleFromPolicy(String firewallPolicyId, String firewallRuleId) { - checkNotNull(firewallPolicyId); - checkNotNull(firewallRuleId); - checkState(!(firewallPolicyId == null && firewallRuleId == null), - "Either a Firewall Policy or Firewall Rule identifier must be set"); - return put(NeutronFirewallPolicyRule.class, uri("/fw/firewall_policies/%s/remove_rule", firewallPolicyId)) - .entity(FirewallRuleStrategy.remove(firewallRuleId)) - .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); - } + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicy removeFirewallRuleFromPolicy(String firewallPolicyId, String firewallRuleId) { + checkNotNull(firewallPolicyId); + checkNotNull(firewallRuleId); + checkState(!(firewallPolicyId == null && firewallRuleId == null), + "Either a Firewall Policy or Firewall Rule identifier must be set"); + return put(NeutronFirewallPolicyRule.class, uri("/fw/firewall_policies/%s/remove_rule", firewallPolicyId)) + .entity(FirewallRuleStrategy.remove(firewallRuleId)) + .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallRuleServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallRuleServiceImpl.java index 7984842ed..b54951e80 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallRuleServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallRuleServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.networking.ext.FirewallRuleService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -16,71 +11,76 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronFirewallRule.FirewallRules; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Networking (Neutron) FwaaS FirewallRule Rule Extension API - * + * * @author Vishvesh Deshmukh */ public class FirewallRuleServiceImpl extends BaseNetworkingServices implements FirewallRuleService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(FirewallRules.class, uri("/fw/firewall_rules")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(FirewallRules.class, uri("/fw/firewall_rules")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(FirewallRules.class, uri("/fw/firewall_rules")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(FirewallRules.class, uri("/fw/firewall_rules")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public FirewallRule get(String firewallRuleId) { - checkNotNull(firewallRuleId); - return get(NeutronFirewallRule.class, uri("/fw/firewall_rules/%s", firewallRuleId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public FirewallRule get(String firewallRuleId) { + checkNotNull(firewallRuleId); + return get(NeutronFirewallRule.class, uri("/fw/firewall_rules/%s", firewallRuleId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String firewallRuleId) { - checkNotNull(firewallRuleId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, - uri("/fw/firewall_rules/%s", firewallRuleId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String firewallRuleId) { + checkNotNull(firewallRuleId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, + uri("/fw/firewall_rules/%s", firewallRuleId)).executeWithResponse()); + } - /** - * {@inheritDoc} - */ - @Override - public FirewallRule create(FirewallRule firewall) { - return post(NeutronFirewallRule.class, uri("/fw/firewall_rules")).entity(firewall) - .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); - } + /** + * {@inheritDoc} + */ + @Override + public FirewallRule create(FirewallRule firewall) { + return post(NeutronFirewallRule.class, uri("/fw/firewall_rules")).entity(firewall) + .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); + } - /** - * {@inheritDoc} - */ - @Override - public FirewallRule update(String firewallRuleId, FirewallRuleUpdate firewallRuleUpdate) { - checkNotNull(firewallRuleId); + /** + * {@inheritDoc} + */ + @Override + public FirewallRule update(String firewallRuleId, FirewallRuleUpdate firewallRuleUpdate) { + checkNotNull(firewallRuleId); checkNotNull(firewallRuleUpdate); return put(NeutronFirewallRule.class, uri("/fw/firewall_rules/%s", firewallRuleId)).entity(firewallRuleUpdate).execute(); - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallServiceImpl.java index f6c339a80..cf4d20f0f 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FirewallServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.networking.ext.FirewallService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -16,71 +11,76 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronFirewall.Firewalls; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Networking (Neutron) FwaaS Firewall Extension API - * + * * @author Vishvesh Deshmukh */ public class FirewallServiceImpl extends BaseNetworkingServices implements FirewallService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Firewalls.class, uri("/fw/firewalls")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Firewalls.class, uri("/fw/firewalls")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(Firewalls.class, uri("/fw/firewalls")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(Firewalls.class, uri("/fw/firewalls")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public Firewall get(String firewallId) { - checkNotNull(firewallId); - return get(NeutronFirewall.class, uri("/fw/firewalls/%s", firewallId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public Firewall get(String firewallId) { + checkNotNull(firewallId); + return get(NeutronFirewall.class, uri("/fw/firewalls/%s", firewallId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String firewallId) { - checkNotNull(firewallId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, - uri("/fw/firewalls/%s", firewallId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String firewallId) { + checkNotNull(firewallId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, + uri("/fw/firewalls/%s", firewallId)).executeWithResponse()); + } - /** - * {@inheritDoc} - */ - @Override - public Firewall create(Firewall firewall) { - return post(NeutronFirewall.class, uri("/fw/firewalls")).entity(firewall) - .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); - } + /** + * {@inheritDoc} + */ + @Override + public Firewall create(Firewall firewall) { + return post(NeutronFirewall.class, uri("/fw/firewalls")).entity(firewall) + .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); + } - /** - * {@inheritDoc} - */ - @Override - public Firewall update(String firewallId, FirewallUpdate firewallUpdate) { - checkNotNull(firewallId); + /** + * {@inheritDoc} + */ + @Override + public Firewall update(String firewallId, FirewallUpdate firewallUpdate) { + checkNotNull(firewallId); checkNotNull(firewallUpdate); return put(NeutronFirewall.class, uri("/fw/firewalls/%s", firewallId)).entity(firewallUpdate).execute(); - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FlowClassifierServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FlowClassifierServiceImpl.java index 92161ceb4..a7d93cff9 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FlowClassifierServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/FlowClassifierServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.networking.ext.FlowClassifierService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.FlowClassifier; @@ -11,6 +7,10 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronFlowClassifier.FlowClassifiers; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * {@inheritDoc} */ diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorServiceImpl.java index 5f55c9255..b346c2bea 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; import org.openstack4j.api.networking.ext.HealthMonitorService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.HealthMonitor; @@ -12,72 +8,78 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronHealthMonitor; import org.openstack4j.openstack.networking.domain.ext.NeutronHealthMonitor.HealthMonitors; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** - * OpenStack (Neutron) Lbaas healthmonitor based Operations - * @author liujunpeng + * OpenStack (Neutron) Lbaas healthmonitor based Operations * + * @author liujunpeng */ public class HealthMonitorServiceImpl extends BaseNetworkingServices implements -HealthMonitorService { + HealthMonitorService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(HealthMonitors.class, uri("/lb/health_monitors")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(HealthMonitors.class, uri("/lb/health_monitors")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(HealthMonitors.class, uri("/lb/health_monitors")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(HealthMonitors.class, uri("/lb/health_monitors")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public HealthMonitor get(String healthMonitorId) { - checkNotNull(healthMonitorId); - return get(NeutronHealthMonitor.class,uri("/lb/health_monitors/%s",healthMonitorId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public HealthMonitor get(String healthMonitorId) { + checkNotNull(healthMonitorId); + return get(NeutronHealthMonitor.class, uri("/lb/health_monitors/%s", healthMonitorId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String healthMonitorId) { - checkNotNull(healthMonitorId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class,uri("/lb/health_monitors/%s",healthMonitorId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String healthMonitorId) { + checkNotNull(healthMonitorId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lb/health_monitors/%s", healthMonitorId)).executeWithResponse()); + } - /** - * {@inheritDoc} - */ - @Override - public HealthMonitor create(HealthMonitor healthMonitor) { - checkNotNull(healthMonitor); - return post(NeutronHealthMonitor.class,uri("/lb/health_monitors")).entity(healthMonitor).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public HealthMonitor create(HealthMonitor healthMonitor) { + checkNotNull(healthMonitor); + return post(NeutronHealthMonitor.class, uri("/lb/health_monitors")).entity(healthMonitor).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public HealthMonitor update(String healthMonitorId, - HealthMonitorUpdate healthMonitor) { - checkNotNull(healthMonitorId); - checkNotNull(healthMonitor); - return put(NeutronHealthMonitor.class,uri("/lb/health_monitors/%s",healthMonitorId)).entity(healthMonitor).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public HealthMonitor update(String healthMonitorId, + HealthMonitorUpdate healthMonitor) { + checkNotNull(healthMonitorId); + checkNotNull(healthMonitor); + return put(NeutronHealthMonitor.class, uri("/lb/health_monitors/%s", healthMonitorId)).entity(healthMonitor).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorV2ServiceImpl.java index f5a977f5c..3ab1ecf56 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/HealthMonitorV2ServiceImpl.java @@ -2,8 +2,8 @@ import org.openstack4j.api.networking.ext.HealthMonitorV2Service; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.network.ext.HealthMonitorV2Update; import org.openstack4j.model.network.ext.HealthMonitorV2; +import org.openstack4j.model.network.ext.HealthMonitorV2Update; import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; import org.openstack4j.openstack.networking.domain.ext.NeutronHealthMonitorV2; import org.openstack4j.openstack.networking.domain.ext.NeutronHealthMonitorV2.HealthMonitorsV2; @@ -16,14 +16,15 @@ /** * OpenStack (Neutron) lbaas v2 health monitor operations + * * @author ashleykasim */ -public class HealthMonitorV2ServiceImpl extends BaseNetworkingServices implements HealthMonitorV2Service{ +public class HealthMonitorV2ServiceImpl extends BaseNetworkingServices implements HealthMonitorV2Service { /** * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(HealthMonitorsV2.class, uri("/lbaas/healthmonitors")).execute().getList(); } @@ -31,7 +32,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(HealthMonitorsV2.class, uri("/lbaas/healthmonitors")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -45,7 +46,7 @@ public List list(Map filteringParams) * {@inheritDoc} */ @Override - public HealthMonitorV2 get(String healthMonitorId){ + public HealthMonitorV2 get(String healthMonitorId) { checkNotNull(healthMonitorId); return get(NeutronHealthMonitorV2.class, uri("/lbaas/healthmonitors/%s", healthMonitorId)).execute(); } @@ -54,7 +55,7 @@ public HealthMonitorV2 get(String healthMonitorId){ * {@inheritDoc} */ @Override - public ActionResponse delete(String healthMonitorId){ + public ActionResponse delete(String healthMonitorId) { checkNotNull(healthMonitorId); return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lbaas/healthmonitors/%s", healthMonitorId)).executeWithResponse()); } @@ -63,9 +64,9 @@ public ActionResponse delete(String healthMonitorId){ * {@inheritDoc} */ @Override - public HealthMonitorV2 create(HealthMonitorV2 healthMonitor){ + public HealthMonitorV2 create(HealthMonitorV2 healthMonitor) { checkNotNull(healthMonitor); - return post(NeutronHealthMonitorV2.class,uri("/lbaas/healthmonitors")).entity(healthMonitor).execute(); + return post(NeutronHealthMonitorV2.class, uri("/lbaas/healthmonitors")).entity(healthMonitor).execute(); } /** @@ -73,9 +74,9 @@ public HealthMonitorV2 create(HealthMonitorV2 healthMonitor){ */ @Override public HealthMonitorV2 update(String healthMonitorId, - HealthMonitorV2Update healthMonitor) { + HealthMonitorV2Update healthMonitor) { checkNotNull(healthMonitorId); checkNotNull(healthMonitor); - return put(NeutronHealthMonitorV2.class,uri("/lbaas/healthmonitors/%s",healthMonitorId)).entity(healthMonitor).execute(); + return put(NeutronHealthMonitorV2.class, uri("/lbaas/healthmonitors/%s", healthMonitorId)).entity(healthMonitor).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolServiceImpl.java index 1b32f3ac1..f1d99234a 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolServiceImpl.java @@ -1,19 +1,9 @@ - package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.Builders; import org.openstack4j.api.networking.ext.LbPoolService; import org.openstack4j.model.common.ActionResponse; -import org.openstack4j.model.network.ext.HealthMonitor; -import org.openstack4j.model.network.ext.HealthMonitorAssociate; -import org.openstack4j.model.network.ext.LbPool; -import org.openstack4j.model.network.ext.LbPoolStats; -import org.openstack4j.model.network.ext.LbPoolUpdate; +import org.openstack4j.model.network.ext.*; import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; import org.openstack4j.openstack.networking.domain.ext.NeutronHealthMonitor; import org.openstack4j.openstack.networking.domain.ext.NeutronLbPool; @@ -21,13 +11,18 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronLbPoolStats; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** - * OpenStack (Neutron) Lbaas pool based Operations - * @author liujunpeng + * OpenStack (Neutron) Lbaas pool based Operations * + * @author liujunpeng */ public class LbPoolServiceImpl extends BaseNetworkingServices implements -LbPoolService { + LbPoolService { /** * {@inheritDoc} @@ -57,7 +52,7 @@ public List list(Map filteringParams) { @Override public LbPool get(String lbPoolId) { checkNotNull(lbPoolId); - return get(NeutronLbPool.class, uri("/lb/pools/%s",lbPoolId)).execute(); + return get(NeutronLbPool.class, uri("/lb/pools/%s", lbPoolId)).execute(); } /** @@ -76,7 +71,7 @@ public ActionResponse delete(String lbPoolId) { @Override public LbPool create(LbPool lbPool) { checkNotNull(lbPool); - return post(NeutronLbPool.class,uri("/lb/pools")).entity(lbPool).execute(); + return post(NeutronLbPool.class, uri("/lb/pools")).entity(lbPool).execute(); } /** @@ -96,7 +91,7 @@ public LbPool update(String lbPoolId, LbPoolUpdate lbPool) { @Override public LbPoolStats stats(String lbPoolId) { checkNotNull(lbPoolId); - return get(NeutronLbPoolStats.class, uri("/lb/pools/%s/stats.json",lbPoolId)).execute(); + return get(NeutronLbPoolStats.class, uri("/lb/pools/%s/stats.json", lbPoolId)).execute(); } /** @@ -116,7 +111,7 @@ public HealthMonitor associateHealthMonitor(String lbPoolId, String healthMonito public HealthMonitor associateHealthMonitor(String lbPoolId, HealthMonitorAssociate associate) { checkNotNull(lbPoolId); checkNotNull(associate); - return post(NeutronHealthMonitor.class,uri("/lb/pools/%s/health_monitors",lbPoolId)).entity(associate).execute(); + return post(NeutronHealthMonitor.class, uri("/lb/pools/%s/health_monitors", lbPoolId)).entity(associate).execute(); } /** @@ -127,6 +122,6 @@ public ActionResponse disAssociateHealthMonitor(String lbPoolId, String healthMo checkNotNull(lbPoolId); checkNotNull(healthMonitorId); return ToActionResponseFunction.INSTANCE.apply(delete(void.class, - uri("/lb/pools/%s/health_monitors/%s", lbPoolId,healthMonitorId)).executeWithResponse()); + uri("/lb/pools/%s/health_monitors/%s", lbPoolId, healthMonitorId)).executeWithResponse()); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolV2ServiceImpl.java index b368caedb..dd7a50900 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbPoolV2ServiceImpl.java @@ -18,6 +18,7 @@ /** * OpenStack (Neutron) lbaas v2 lb pool operations + * * @author emjburns */ public class LbPoolV2ServiceImpl extends BaseNetworkingServices implements LbPoolV2Service { @@ -25,7 +26,7 @@ public class LbPoolV2ServiceImpl extends BaseNetworkingServices implements LbPoo * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(NeutronLbPoolV2.LbPoolsV2.class, uri("/lbaas/pools")).execute().getList(); } @@ -33,7 +34,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(NeutronLbPoolV2.LbPoolsV2.class, uri("/lbaas/pools")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -47,16 +48,16 @@ public List list(Map filteringParams){ * {@inheritDoc} */ @Override - public LbPoolV2 get(String lbPoolId){ + public LbPoolV2 get(String lbPoolId) { checkNotNull(lbPoolId); - return get(NeutronLbPoolV2.class, uri("/lbaas/pools/%s",lbPoolId)).execute(); + return get(NeutronLbPoolV2.class, uri("/lbaas/pools/%s", lbPoolId)).execute(); } /** * {@inheritDoc} */ @Override - public LbPoolV2 create(LbPoolV2 lbPool){ + public LbPoolV2 create(LbPoolV2 lbPool) { checkNotNull(lbPool); return post(NeutronLbPoolV2.class, uri("/lbaas/pools")).entity(lbPool).execute(); } @@ -65,34 +66,34 @@ public LbPoolV2 create(LbPoolV2 lbPool){ * {@inheritDoc} */ @Override - public LbPoolV2 update(String lbPoolId, LbPoolV2Update lbPool){ + public LbPoolV2 update(String lbPoolId, LbPoolV2Update lbPool) { checkNotNull(lbPoolId); checkNotNull(lbPool); - return put(NeutronLbPoolV2.class, uri("/lbaas/pools/%s",lbPoolId)).entity(lbPool).execute(); + return put(NeutronLbPoolV2.class, uri("/lbaas/pools/%s", lbPoolId)).entity(lbPool).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse delete(String lbPoolId){ + public ActionResponse delete(String lbPoolId) { checkNotNull(lbPoolId); - return ToActionResponseFunction.INSTANCE.apply(delete(void.class, uri("/lbaas/pools/%s",lbPoolId)).executeWithResponse()); + return ToActionResponseFunction.INSTANCE.apply(delete(void.class, uri("/lbaas/pools/%s", lbPoolId)).executeWithResponse()); } /** * {@inheritDoc} */ @Override - public List listMembers(String lbPoolId){ - return get(NeutronMemberV2.MembersV2.class, uri("/lbaas/pools/%s/members",lbPoolId)).execute().getList(); + public List listMembers(String lbPoolId) { + return get(NeutronMemberV2.MembersV2.class, uri("/lbaas/pools/%s/members", lbPoolId)).execute().getList(); } /** * {@inheritDoc} */ @Override - public List listMembers(String lbPoolId, Map filteringParams){ + public List listMembers(String lbPoolId, Map filteringParams) { Invocation req = get(NeutronMemberV2.MembersV2.class, uri("/lbaas/pools/%s/members", lbPoolId)); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -106,38 +107,38 @@ public List listMembers(String lbPoolId, Map * {@inheritDoc} */ @Override - public MemberV2 getMember(String lbPoolId, String memberId){ + public MemberV2 getMember(String lbPoolId, String memberId) { checkNotNull(lbPoolId); checkNotNull(memberId); - return get(NeutronMemberV2.class, uri("/lbaas/pools/%s/members/%s",lbPoolId,memberId)).execute(); + return get(NeutronMemberV2.class, uri("/lbaas/pools/%s/members/%s", lbPoolId, memberId)).execute(); } /** * {@inheritDoc} */ @Override - public MemberV2 createMember(String lbPoolId, MemberV2 member){ + public MemberV2 createMember(String lbPoolId, MemberV2 member) { checkNotNull(lbPoolId); checkNotNull(member); - return post(NeutronMemberV2.class, uri("/lbaas/pools/%s/members",lbPoolId)).entity(member).execute(); + return post(NeutronMemberV2.class, uri("/lbaas/pools/%s/members", lbPoolId)).entity(member).execute(); } /** * {@inheritDoc} */ @Override - public MemberV2 updateMember(String lbPoolId, String memberId, MemberV2Update member){ + public MemberV2 updateMember(String lbPoolId, String memberId, MemberV2Update member) { checkNotNull(lbPoolId); checkNotNull(memberId); checkNotNull(member); - return put(NeutronMemberV2.class, uri("/lbaas/pools/%s/members/%s",lbPoolId,memberId)).entity(member).execute(); + return put(NeutronMemberV2.class, uri("/lbaas/pools/%s/members/%s", lbPoolId, memberId)).entity(member).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse deleteMember(String lbPoolId, String memberId){ + public ActionResponse deleteMember(String lbPoolId, String memberId) { checkNotNull(lbPoolId); checkNotNull(memberId); return ToActionResponseFunction.INSTANCE.apply(delete(void.class, uri("/lbaas/pools/%s/members/%s", lbPoolId, memberId)).executeWithResponse()); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbaasV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbaasV2ServiceImpl.java index 9083a8b19..3b83b7e47 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbaasV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LbaasV2ServiceImpl.java @@ -1,15 +1,12 @@ package org.openstack4j.openstack.networking.internal.ext; import org.openstack4j.api.Apis; -import org.openstack4j.api.networking.ext.HealthMonitorV2Service; -import org.openstack4j.api.networking.ext.LbPoolV2Service; -import org.openstack4j.api.networking.ext.LbaasV2Service; -import org.openstack4j.api.networking.ext.ListenerV2Service; -import org.openstack4j.api.networking.ext.LoadBalancerV2Service; +import org.openstack4j.api.networking.ext.*; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; /** * OpenStack (Neutron) lbaas v2 service implementation + * * @author emjburns */ public class LbaasV2ServiceImpl extends BaseNetworkingServices implements LbaasV2Service { @@ -17,7 +14,7 @@ public class LbaasV2ServiceImpl extends BaseNetworkingServices implements LbaasV * {@inheritDoc} */ @Override - public ListenerV2Service listener(){ + public ListenerV2Service listener() { return Apis.get(ListenerV2Service.class); } @@ -25,7 +22,7 @@ public ListenerV2Service listener(){ * {@inheritDoc} */ @Override - public LbPoolV2Service lbPool(){ + public LbPoolV2Service lbPool() { return Apis.get(LbPoolV2Service.class); } @@ -33,7 +30,7 @@ public LbPoolV2Service lbPool(){ * {@inheritDoc} */ @Override - public HealthMonitorV2Service healthMonitor(){ + public HealthMonitorV2Service healthMonitor() { return Apis.get(HealthMonitorV2Service.class); } @@ -41,7 +38,7 @@ public HealthMonitorV2Service healthMonitor(){ * {@inheritDoc} */ @Override - public LoadBalancerV2Service loadbalancer(){ + public LoadBalancerV2Service loadbalancer() { return Apis.get(LoadBalancerV2Service.class); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ListenerV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ListenerV2ServiceImpl.java index d3d924475..5176997e3 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ListenerV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ListenerV2ServiceImpl.java @@ -7,6 +7,7 @@ import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; import org.openstack4j.openstack.networking.domain.ext.NeutronListenerV2; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + import java.util.List; import java.util.Map; @@ -14,6 +15,7 @@ /** * Lbaas listener imlementation + * * @author emjburns */ public class ListenerV2ServiceImpl extends BaseNetworkingServices implements ListenerV2Service { @@ -21,7 +23,7 @@ public class ListenerV2ServiceImpl extends BaseNetworkingServices implements Lis * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(NeutronListenerV2.Listeners.class, uri("/lbaas/listeners")).execute().getList(); } @@ -29,7 +31,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(NeutronListenerV2.Listeners.class, uri("/lbaas/listeners")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -43,34 +45,34 @@ public List list(Map filteringParams){ * {@inheritDoc} */ @Override - public ListenerV2 get(String listenerId){ + public ListenerV2 get(String listenerId) { checkNotNull(listenerId); - return get(NeutronListenerV2.class, uri("/lbaas/listeners/%s",listenerId)).execute(); + return get(NeutronListenerV2.class, uri("/lbaas/listeners/%s", listenerId)).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse delete(String listenerId){ + public ActionResponse delete(String listenerId) { checkNotNull(listenerId); return ToActionResponseFunction.INSTANCE.apply( - delete(Void.class, uri("/lbaas/listeners/%s",listenerId)).executeWithResponse()); + delete(Void.class, uri("/lbaas/listeners/%s", listenerId)).executeWithResponse()); } /** * {@inheritDoc} */ @Override - public ListenerV2 create(ListenerV2 listener){ + public ListenerV2 create(ListenerV2 listener) { checkNotNull(listener); return post(NeutronListenerV2.class, uri("/lbaas/listeners")).entity(listener).execute(); } @Override - public ListenerV2 update(String listenerId, ListenerV2Update listener){ + public ListenerV2 update(String listenerId, ListenerV2Update listener) { checkNotNull(listenerId); checkNotNull(listener); - return put(NeutronListenerV2.class, uri("/lbaas/listeners/%s",listenerId)).entity(listener).execute(); + return put(NeutronListenerV2.class, uri("/lbaas/listeners/%s", listenerId)).entity(listener).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerServiceImpl.java index ca985561e..26ca36250 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerServiceImpl.java @@ -1,11 +1,7 @@ package org.openstack4j.openstack.networking.internal.ext; import org.openstack4j.api.Apis; -import org.openstack4j.api.networking.ext.HealthMonitorService; -import org.openstack4j.api.networking.ext.LbPoolService; -import org.openstack4j.api.networking.ext.LoadBalancerService; -import org.openstack4j.api.networking.ext.MemberService; -import org.openstack4j.api.networking.ext.VipService; +import org.openstack4j.api.networking.ext.*; /** * LBaaS Service Implementation @@ -16,9 +12,10 @@ public class LoadBalancerServiceImpl implements LoadBalancerService { * {@inheritDoc} */ @Override - public MemberService member(){ + public MemberService member() { return Apis.get(MemberService.class); } + /** * {@inheritDoc} */ @@ -36,7 +33,6 @@ public HealthMonitorService healthMonitor() { } /** - * * {@inheritDoc} */ @Override diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerV2ServiceImpl.java index b3ada5154..ad4a11ecc 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/LoadBalancerV2ServiceImpl.java @@ -7,9 +7,9 @@ import org.openstack4j.model.network.ext.LoadBalancerV2StatusTree; import org.openstack4j.model.network.ext.LoadBalancerV2Update; import org.openstack4j.openstack.compute.functions.ToActionResponseFunction; +import org.openstack4j.openstack.networking.domain.ext.LoadBalancerV2StatusTree.NeutronLoadBalancerV2StatusTree; import org.openstack4j.openstack.networking.domain.ext.NeutronLoadBalancerV2; import org.openstack4j.openstack.networking.domain.ext.NeutronLoadBalancerV2Stats; -import org.openstack4j.openstack.networking.domain.ext.LoadBalancerV2StatusTree.NeutronLoadBalancerV2StatusTree; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; import java.util.List; @@ -19,6 +19,7 @@ /** * Openstack (Neutron) lbaas v2 load balancer operations + * * @author emjburns */ public class LoadBalancerV2ServiceImpl extends BaseNetworkingServices implements LoadBalancerV2Service { @@ -26,7 +27,7 @@ public class LoadBalancerV2ServiceImpl extends BaseNetworkingServices implements * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(NeutronLoadBalancerV2.LoadBalancersV2.class, uri("/lbaas/loadbalancers")).execute().getList(); } @@ -34,7 +35,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(NeutronLoadBalancerV2.LoadBalancersV2.class, uri("/lbaas/loadbalancers")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -48,53 +49,53 @@ public List list(Map filteringParams){ * {@inheritDoc} */ @Override - public LoadBalancerV2 get(String loadbalancerId){ + public LoadBalancerV2 get(String loadbalancerId) { checkNotNull(loadbalancerId); - return get(NeutronLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s",loadbalancerId)).execute(); + return get(NeutronLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s", loadbalancerId)).execute(); } /** * {@inheritDoc} */ @Override - public LoadBalancerV2 create(LoadBalancerV2 loadbalancer){ + public LoadBalancerV2 create(LoadBalancerV2 loadbalancer) { checkNotNull(loadbalancer); - return post(NeutronLoadBalancerV2.class,uri("/lbaas/loadbalancers")).entity(loadbalancer).execute(); + return post(NeutronLoadBalancerV2.class, uri("/lbaas/loadbalancers")).entity(loadbalancer).execute(); } /** * {@inheritDoc} */ @Override - public LoadBalancerV2 update(String loadbalancerId, LoadBalancerV2Update loadbalancer){ + public LoadBalancerV2 update(String loadbalancerId, LoadBalancerV2Update loadbalancer) { checkNotNull(loadbalancerId); checkNotNull(loadbalancer); - return put(NeutronLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s",loadbalancerId)).entity(loadbalancer).execute(); + return put(NeutronLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s", loadbalancerId)).entity(loadbalancer).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse delete(String loadbalancerId){ + public ActionResponse delete(String loadbalancerId) { checkNotNull(loadbalancerId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lbaas/loadbalancers/%s",loadbalancerId)).executeWithResponse()); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lbaas/loadbalancers/%s", loadbalancerId)).executeWithResponse()); } /** * {@inheritDoc} */ @Override - public LoadBalancerV2Stats stats(String loadbalancerId){ + public LoadBalancerV2Stats stats(String loadbalancerId) { checkNotNull(loadbalancerId); - return get(NeutronLoadBalancerV2Stats.class, uri("/lbaas/loadbalancers/%s/stats",loadbalancerId)).execute(); + return get(NeutronLoadBalancerV2Stats.class, uri("/lbaas/loadbalancers/%s/stats", loadbalancerId)).execute(); } /** * {@inheritDoc} */ @Override - public LoadBalancerV2StatusTree statusTree(String loadbalancerId){ + public LoadBalancerV2StatusTree statusTree(String loadbalancerId) { checkNotNull(loadbalancerId); return get(NeutronLoadBalancerV2StatusTree.class, uri("/lbaas/loadbalancers/%s/statuses", loadbalancerId)).execute(); } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/MemberServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/MemberServiceImpl.java index fc71106d0..dca7a4f0c 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/MemberServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/MemberServiceImpl.java @@ -1,7 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import java.util.List; -import java.util.Map; import org.openstack4j.api.networking.ext.MemberService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.Member; @@ -10,10 +8,15 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronMember; import org.openstack4j.openstack.networking.domain.ext.NeutronMember.Members; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + import static com.google.common.base.Preconditions.checkNotNull; /** * OpenStack (Neutron) Lbaas member based Operations + * * @author liujunpeng */ public class MemberServiceImpl extends BaseNetworkingServices implements MemberService { @@ -21,59 +24,59 @@ public class MemberServiceImpl extends BaseNetworkingServices implements MemberS /** * {@inheritDoc} */ - public List list() { + public List list() { - return get(Members.class, uri("/lb/members")).execute().getList(); - } + return get(Members.class, uri("/lb/members")).execute().getList(); + } /** * {@inheritDoc} */ - public List list(Map filteringParams) { - Invocation req = get(Members.class, uri("/lb/members")); - if (filteringParams != null) { + public List list(Map filteringParams) { + Invocation req = get(Members.class, uri("/lb/members")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } /** * {@inheritDoc} */ - public Member get(String memberId) { - checkNotNull(memberId); - return get(NeutronMember.class,uri("/lb/members/%s",memberId)).execute(); - } - + public Member get(String memberId) { + checkNotNull(memberId); + return get(NeutronMember.class, uri("/lb/members/%s", memberId)).execute(); + } + /** * {@inheritDoc} */ - public ActionResponse delete(String memberId){ - checkNotNull(memberId); - return ToActionResponseFunction.INSTANCE.apply( + public ActionResponse delete(String memberId) { + checkNotNull(memberId); + return ToActionResponseFunction.INSTANCE.apply( delete(Void.class, uri("/lb/members/%s", memberId)).executeWithResponse()); - } + } /** * {@inheritDoc} */ - @Override - public Member create(Member member) { - checkNotNull(member); - return post(NeutronMember.class, uri("/lb/members")).entity(member).execute(); - } - + @Override + public Member create(Member member) { + checkNotNull(member); + return post(NeutronMember.class, uri("/lb/members")).entity(member).execute(); + } + /** * {@inheritDoc} */ - @Override - public Member update(String memberId,MemberUpdate member) { - checkNotNull(memberId); - checkNotNull(member); - return put(NeutronMember.class, uri("/lb/members/%s",memberId)).entity(member).execute(); - } - - + @Override + public Member update(String memberId, MemberUpdate member) { + checkNotNull(memberId); + checkNotNull(member); + return put(NeutronMember.class, uri("/lb/members/%s", memberId)).entity(member).execute(); + } + + } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQuotaServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQuotaServiceImpl.java index 66f021ee2..374077802 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQuotaServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQuotaServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.networking.ext.NetQuotaService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.NetQuota; @@ -11,9 +7,13 @@ import org.openstack4j.openstack.networking.domain.NeutronNetQuota.NeutronNetQuotas; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Networking (Neutron) Quota Extension API - * + * * @author Jeremy Unruh */ public class NetQuotaServiceImpl extends BaseNetworkingServices implements NetQuotaService { @@ -22,13 +22,13 @@ public class NetQuotaServiceImpl extends BaseNetworkingServices implements NetQu public List get() { return get(NeutronNetQuotas.class, uri("/quotas")).execute().getList(); } - + @Override public NetQuota get(String tenantId) { checkNotNull(tenantId, "TenantId must not be null"); return get(NeutronNetQuota.class, uri("/quotas/%s", tenantId)).execute(); } - + @Override public NetQuota updateForTenant(String tenantId, NetQuota netQuota) { checkNotNull(tenantId, "TenantId must not be null"); @@ -46,7 +46,7 @@ public NetQuota update(NetQuota netQuota) { public ActionResponse reset() { return deleteWithResponse(uri("/quotas")).execute(); } - + @Override public ActionResponse reset(String tenantId) { checkNotNull(tenantId, "TenantId must not be null"); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortChainServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortChainServiceImpl.java index c57e44615..87a4440e3 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortChainServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortChainServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.networking.ext.PortChainService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.PortChain; @@ -11,6 +7,10 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronPortChain.PortChains; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * {@inheritDoc} */ diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairGroupServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairGroupServiceImpl.java index 96cc3602f..8cb5b716e 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairGroupServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairGroupServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.networking.ext.PortPairGroupService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.PortPairGroup; @@ -11,6 +7,10 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronPortPairGroup.PortPairGroups; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * {@inheritDoc} */ diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairServiceImpl.java index b18e08452..cbfd33f01 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/PortPairServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.networking.ext.PortPairService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.PortPair; @@ -11,6 +7,10 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronPortPair.PortPairs; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * {@inheritDoc} */ @@ -39,7 +39,7 @@ public PortPair create(PortPair portPair) { @Override public ActionResponse delete(String portPairId) { checkNotNull(portPairId); - return deleteWithResponse(uri("/sfc/port_pairs/%s", portPairId )).execute(); + return deleteWithResponse(uri("/sfc/port_pairs/%s", portPairId)).execute(); } /** diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ServiceFunctionChainServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ServiceFunctionChainServiceImpl.java index 0ce850ef7..5a36d0396 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ServiceFunctionChainServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/ServiceFunctionChainServiceImpl.java @@ -1,11 +1,7 @@ package org.openstack4j.openstack.networking.internal.ext; import org.openstack4j.api.Apis; -import org.openstack4j.api.networking.ext.FlowClassifierService; -import org.openstack4j.api.networking.ext.PortChainService; -import org.openstack4j.api.networking.ext.PortPairGroupService; -import org.openstack4j.api.networking.ext.PortPairService; -import org.openstack4j.api.networking.ext.ServiceFunctionChainService; +import org.openstack4j.api.networking.ext.*; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; /** diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/VipServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/VipServiceImpl.java index 0a85dde2f..87c0835c9 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/VipServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/VipServiceImpl.java @@ -1,8 +1,5 @@ package org.openstack4j.openstack.networking.internal.ext; -import static com.google.common.base.Preconditions.checkNotNull; -import java.util.List; -import java.util.Map; import org.openstack4j.api.networking.ext.VipService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.network.ext.Vip; @@ -11,71 +8,77 @@ import org.openstack4j.openstack.networking.domain.ext.NeutronVip; import org.openstack4j.openstack.networking.domain.ext.NeutronVip.Vips; import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** - * OpenStack (Neutron) Lbaas vip based Operations - * @author liujunpeng + * OpenStack (Neutron) Lbaas vip based Operations * + * @author liujunpeng */ public class VipServiceImpl extends BaseNetworkingServices implements - VipService { + VipService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Vips.class, uri("/lb/vips")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Vips.class, uri("/lb/vips")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(Vips.class, uri("/lb/vips")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(Vips.class, uri("/lb/vips")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public Vip get(String vipId) { - checkNotNull(vipId); - return get(NeutronVip.class,uri("/lb/vips/%s",vipId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public Vip get(String vipId) { + checkNotNull(vipId); + return get(NeutronVip.class, uri("/lb/vips/%s", vipId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String vipId) { - checkNotNull(vipId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class,uri("/lb/vips/%s",vipId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String vipId) { + checkNotNull(vipId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lb/vips/%s", vipId)).executeWithResponse()); + } - /** - * {@inheritDoc} - */ - @Override - public Vip create(Vip vip) { - checkNotNull(vip); - return post(NeutronVip.class,uri("/lb/vips")).entity(vip).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public Vip create(Vip vip) { + checkNotNull(vip); + return post(NeutronVip.class, uri("/lb/vips")).entity(vip).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public Vip update(String vipId, VipUpdate vip) { - checkNotNull(vipId); - checkNotNull(vip); - return put(NeutronVip.class,uri("/lb/vips/%s",vipId)).entity(vip).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public Vip update(String vipId, VipUpdate vip) { + checkNotNull(vipId); + checkNotNull(vip); + return put(NeutronVip.class, uri("/lb/vips/%s", vipId)).entity(vip).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/builder/OctaviaBuilders.java b/core/src/main/java/org/openstack4j/openstack/octavia/builder/OctaviaBuilders.java index 951190c76..2996bd2d8 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/builder/OctaviaBuilders.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/builder/OctaviaBuilders.java @@ -8,27 +8,27 @@ */ public class OctaviaBuilders { - public MemberV2Builder memberV2(){ + public MemberV2Builder memberV2() { return OctaviaMemberV2.builder(); } - public MemberV2UpdateBuilder memberV2Update(){ + public MemberV2UpdateBuilder memberV2Update() { return OctaviaMemberV2Update.builder(); } - public LoadBalancerV2Builder loadBalancerV2(){ + public LoadBalancerV2Builder loadBalancerV2() { return OctaviaLoadBalancerV2.builder(); } - public LoadBalancerV2UpdateBuilder loadBalancerV2Update(){ + public LoadBalancerV2UpdateBuilder loadBalancerV2Update() { return OctaviaLoadBalancerV2Update.builder(); } - public HealthMonitorV2Builder healthMonitorV2(){ + public HealthMonitorV2Builder healthMonitorV2() { return OctaviaHealthMonitorV2.builder(); } - public HealthMonitorV2UpdateBuilder healthMonitorV2Update(){ + public HealthMonitorV2UpdateBuilder healthMonitorV2Update() { return OctaviaHealthMonitorV2Update.builder(); } @@ -36,19 +36,19 @@ public SessionPersistenceBuilder sessionPersistence() { return OctaviaSessionPersistence.builder(); } - public LbPoolV2Builder lbPoolV2(){ + public LbPoolV2Builder lbPoolV2() { return OctaviaLbPoolV2.builder(); } - public LbPoolV2UpdateBuilder lbPoolV2Update(){ + public LbPoolV2UpdateBuilder lbPoolV2Update() { return OctaviaLbPoolV2Update.builder(); } - public ListenerV2Builder listenerV2(){ + public ListenerV2Builder listenerV2() { return OctaviaListenerV2.builder(); } - public ListenerV2UpdateBuilder listenerV2Update(){ + public ListenerV2UpdateBuilder listenerV2Update() { return OctaviaListenerV2Update.builder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/ListItem.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/ListItem.java index bcc6f60a7..0e62dc4d7 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/ListItem.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/ListItem.java @@ -6,8 +6,9 @@ /** * Lbaas V2 lists of objects take the form - * "id":"the_id" + * "id":"the_id" * This class is used to hold these list items in the proper format + * * @author wei */ @JsonAutoDetect @@ -15,23 +16,23 @@ public class ListItem { @JsonProperty("id") String id; - public ListItem(){ + public ListItem() { } - public ListItem(String id){ + public ListItem(String id) { this.id = id; } - public String getId(){ + public String getId() { return id; } - public void setId(String id){ + public void setId(String id) { this.id = id; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaHealthMonitorV2Status.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaHealthMonitorV2Status.java index 63781c959..349cdda47 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaHealthMonitorV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaHealthMonitorV2Status.java @@ -9,6 +9,7 @@ /** * An object to hold status of lbaas v2 healthmonitor + * * @author wei */ @JsonRootName("healthmonitor") @@ -18,12 +19,12 @@ public class OctaviaHealthMonitorV2Status extends Status implements HealthMonito @JsonProperty("type") private HealthMonitorType type; - public HealthMonitorType getType(){ + public HealthMonitorType getType() { return type; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("type", type) diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLbPoolV2Status.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLbPoolV2Status.java index 5d58718e4..061c9ae3a 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLbPoolV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLbPoolV2Status.java @@ -12,6 +12,7 @@ /** * An object to hold status of lbaas v2 loadbalancer pool + * * @author wei */ @JsonRootName("pools") @@ -28,21 +29,21 @@ public class OctaviaLbPoolV2Status extends Status implements LbPoolV2Status { private HealthMonitorV2Status healthMonitorStatus; @Override - public List getMemberStatuses(){ + public List getMemberStatuses() { return memberStatuses; } @Override - public HealthMonitorV2Status getHeathMonitorStatus(){ + public HealthMonitorV2Status getHeathMonitorStatus() { return healthMonitorStatus; } - public String getName(){ + public String getName() { return name; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("name", name) diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaListenerV2Status.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaListenerV2Status.java index da428fc2f..fdd958471 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaListenerV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaListenerV2Status.java @@ -11,6 +11,7 @@ /** * An object to hold status of lbaas v2 listener + * * @author wei */ @JsonRootName("listeners") @@ -24,16 +25,16 @@ public class OctaviaListenerV2Status extends Status implements ListenerV2Status List lbPoolStatuses; @Override - public List getLbPoolV2Statuses(){ + public List getLbPoolV2Statuses() { return lbPoolStatuses; } - public String getName(){ + public String getName() { return name; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("name", name) diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2Status.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2Status.java index 713f1f45d..86595d117 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2Status.java @@ -11,6 +11,7 @@ /** * An object to hold status of lbaas v2 loadbalancer + * * @author wei */ @JsonRootName("loadbalancer") @@ -23,16 +24,16 @@ public class OctaviaLoadBalancerV2Status extends Status implements LoadBalancerV private List listenerStatuses; @Override - public List getListenerStatuses(){ + public List getListenerStatuses() { return listenerStatuses; } - public String getName(){ + public String getName() { return name; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("name", name) diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2StatusTree.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2StatusTree.java index 2ab3267fa..0776e9b9f 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2StatusTree.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaLoadBalancerV2StatusTree.java @@ -9,6 +9,7 @@ /** * The status tree of a lbaas v2 loadbalancer + * * @author wei */ @JsonRootName("statuses") @@ -19,12 +20,12 @@ public class OctaviaLoadBalancerV2StatusTree implements LoadBalancerV2StatusTree private OctaviaLoadBalancerV2Status loadBalancerStatus; @Override - public LoadBalancerV2Status getLoadBalancerV2Status(){ + public LoadBalancerV2Status getLoadBalancerV2Status() { return loadBalancerStatus; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("loadbalancer", loadBalancerStatus) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaMemberV2Status.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaMemberV2Status.java index eeda07096..edec9761c 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaMemberV2Status.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/OctaviaMemberV2Status.java @@ -8,6 +8,7 @@ /** * An object to hold status of lbaas v2 member + * * @author wei */ @JsonRootName("members") @@ -20,16 +21,16 @@ public class OctaviaMemberV2Status extends Status implements MemberV2Status { @JsonProperty("address") private String address; - public Integer getProtocolPort(){ + public Integer getProtocolPort() { return protocolPort; } - public String getAddress(){ + public String getAddress() { return address; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("protocolPort", protocolPort) diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/Status.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/Status.java index 26444ffa0..16b2450b8 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/Status.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/LoadBalancerV2StatusTree/Status.java @@ -5,6 +5,7 @@ /** * Abstract class for common status fields + * * @author wei */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -17,15 +18,15 @@ public abstract class Status { @JsonProperty("provisioning_status") public String provisioningStatus; - public String getId(){ + public String getId() { return id; } - public String getOperatingStatus(){ + public String getOperatingStatus() { return operatingStatus; } - public String getProvisioningStatus(){ + public String getProvisioningStatus() { return provisioningStatus; } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2.java index 7d0b36d31..b971f0191 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2.java @@ -13,6 +13,7 @@ /** * A lbaas v2 health monitor entity + * * @author wei */ @JsonRootName("healthmonitor") @@ -43,13 +44,13 @@ public class OctaviaHealthMonitorV2 implements HealthMonitorV2 { * The HTTP method that the monitor uses for requests. */ @JsonProperty("http_method") - private String httpMethod ; + private String httpMethod; /** * URL */ @JsonProperty("url_path") - private String urlPath ; + private String urlPath; /** * default 200 @@ -69,83 +70,84 @@ public class OctaviaHealthMonitorV2 implements HealthMonitorV2 { private String poolId; @Override - public String getId(){ + public String getId() { return id; } @Override - public String getProjectId(){ + public String getProjectId() { return projectId; } @Override - public HealthMonitorType getType(){ + public HealthMonitorType getType() { return type; } @Override - public Integer getDelay(){ + public Integer getDelay() { return delay; } @Override - public Integer getTimeout(){ + public Integer getTimeout() { return timeout; } @Override - public Integer getMaxRetries(){ + public Integer getMaxRetries() { return maxRetries; } @Override - public Integer getMaxRetriesDown(){ + public Integer getMaxRetriesDown() { return maxRetriesDown; } @Override - public String getHttpMethod(){ + public String getHttpMethod() { return httpMethod; } @Override - public String getUrlPath(){ + public String getUrlPath() { return urlPath; } @Override - public String getExpectedCodes(){ + public String getExpectedCodes() { return expectedCodes; } @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @Override - public List getPools(){ + public List getPools() { return pools; } /** * wrap this healthMonitorV2 to a builder + * * @return HealthMonitorV2Builder */ @Override - public HealthMonitorV2Builder toBuilder(){ + public HealthMonitorV2Builder toBuilder() { return new HealthMonitorV2Concretebuilder(this); } /** * @return HealthMonitorV2Builder */ - public static HealthMonitorV2Builder builder(){ + public static HealthMonitorV2Builder builder() { return new HealthMonitorV2Concretebuilder(); } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("projectId", projectId) @@ -153,7 +155,7 @@ public String toString(){ .add("delay", delay) .add("timeout", timeout) .add("maxRetries", maxRetries) - .add("maxRetriesDown",maxRetriesDown) + .add("maxRetriesDown", maxRetriesDown) .add("httpMethod", httpMethod) .add("urlPath", urlPath) .add("expectedCodes", expectedCodes) @@ -167,10 +169,12 @@ public static class HealthMonitorsV2 extends ListResult @JsonProperty("healthmonitors") List healthMonitors; + @Override public List value() { return healthMonitors; } + @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() @@ -180,23 +184,27 @@ public String toString() { public static class HealthMonitorV2Concretebuilder implements HealthMonitorV2Builder { OctaviaHealthMonitorV2 m; + @Override public HealthMonitorV2 build() { return m; } - public HealthMonitorV2Concretebuilder(){ + + public HealthMonitorV2Concretebuilder() { this(new OctaviaHealthMonitorV2()); } - public HealthMonitorV2Concretebuilder(OctaviaHealthMonitorV2 m){ + + public HealthMonitorV2Concretebuilder(OctaviaHealthMonitorV2 m) { this.m = m; } + @Override public HealthMonitorV2Builder from(HealthMonitorV2 in) { - this.m = (OctaviaHealthMonitorV2)in; + this.m = (OctaviaHealthMonitorV2) in; return this; } + /** - * * {@inheritDoc} */ @Override @@ -206,7 +214,6 @@ public HealthMonitorV2Builder projectId(String projectId) { } /** - * * {@inheritDoc} */ @Override @@ -216,7 +223,6 @@ public HealthMonitorV2Builder type(HealthMonitorType type) { } /** - * * {@inheritDoc} */ @Override @@ -226,7 +232,6 @@ public HealthMonitorV2Builder delay(Integer delay) { } /** - * * {@inheritDoc} */ @Override @@ -236,7 +241,6 @@ public HealthMonitorV2Builder timeout(Integer timeout) { } /** - * * {@inheritDoc} */ @Override @@ -246,7 +250,6 @@ public HealthMonitorV2Builder maxRetries(Integer maxRetries) { } /** - * * {@inheritDoc} */ @Override @@ -256,7 +259,6 @@ public HealthMonitorV2Builder maxRetriesDown(Integer maxRetriesDown) { } /** - * * {@inheritDoc} */ @Override @@ -266,7 +268,6 @@ public HealthMonitorV2Builder urlPath(String urlPath) { } /** - * * {@inheritDoc} */ @Override @@ -276,7 +277,6 @@ public HealthMonitorV2Builder expectedCodes(String expectedCodes) { } /** - * * {@inheritDoc} */ @Override @@ -286,7 +286,6 @@ public HealthMonitorV2Builder httpMethod(String httpMethod) { } /** - * * {@inheritDoc} */ @Override @@ -296,11 +295,10 @@ public HealthMonitorV2Builder adminStateUp(boolean adminStateUp) { } /** - * * {@inheritDoc} */ @Override - public HealthMonitorV2Builder poolId(String poolId){ + public HealthMonitorV2Builder poolId(String poolId) { m.poolId = poolId; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2Update.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2Update.java index 0f3a708ab..dfb8baf9d 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaHealthMonitorV2Update.java @@ -9,6 +9,7 @@ /** * Entity used to update lbaas v2 heathmonitor + * * @author wei */ @JsonRootName("healthmonitor") @@ -37,19 +38,19 @@ public class OctaviaHealthMonitorV2Update implements HealthMonitorV2Update { * The HTTP method that the monitor uses for requests. */ @JsonProperty("http_method") - private String httpMethod ; + private String httpMethod; /** * URL */ @JsonProperty("url_path") - private String urlPath ; + private String urlPath; /** * default 200 */ @JsonProperty("expected_codes") - private String expectedCodes ; + private String expectedCodes; /** * The administrative state of the health monitor, which is up (true) or down (false) @@ -61,7 +62,7 @@ public class OctaviaHealthMonitorV2Update implements HealthMonitorV2Update { * {@inheritDoc} */ @Override - public Integer getDelay(){ + public Integer getDelay() { return delay; } @@ -69,7 +70,7 @@ public Integer getDelay(){ * {@inheritDoc} */ @Override - public String getUrlPath(){ + public String getUrlPath() { return urlPath; } @@ -77,7 +78,7 @@ public String getUrlPath(){ * {@inheritDoc} */ @Override - public Integer getTimeout(){ + public Integer getTimeout() { return timeout; } @@ -85,7 +86,7 @@ public Integer getTimeout(){ * {@inheritDoc} */ @Override - public Integer getMaxRetries(){ + public Integer getMaxRetries() { return maxRetries; } @@ -93,7 +94,7 @@ public Integer getMaxRetries(){ * {@inheritDoc} */ @Override - public Integer getMaxRetriesDown(){ + public Integer getMaxRetriesDown() { return maxRetriesDown; } @@ -101,7 +102,7 @@ public Integer getMaxRetriesDown(){ * {@inheritDoc} */ @Override - public String getHttpMethod(){ + public String getHttpMethod() { return httpMethod; } @@ -109,7 +110,7 @@ public String getHttpMethod(){ * {@inheritDoc} */ @Override - public String getExpectedCodes(){ + public String getExpectedCodes() { return expectedCodes; } @@ -117,7 +118,7 @@ public String getExpectedCodes(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -129,8 +130,8 @@ public String toString() { .add("adminStateUp", adminStateUp) .add("expectedCodes", expectedCodes) .add("httpMethod", httpMethod) - .add("maxRetries",maxRetries) - .add("maxRetriesDown",maxRetriesDown) + .add("maxRetries", maxRetries) + .add("maxRetriesDown", maxRetriesDown) .add("timeout", timeout) .toString(); } @@ -139,22 +140,22 @@ public String toString() { * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder toBuilder(){ + public HealthMonitorV2UpdateBuilder toBuilder() { return new HealthMonitorV2UpdateConcreteBuilder(this); } - public static HealthMonitorV2UpdateBuilder builder(){ + public static HealthMonitorV2UpdateBuilder builder() { return new HealthMonitorV2UpdateConcreteBuilder(); } public static class HealthMonitorV2UpdateConcreteBuilder implements HealthMonitorV2UpdateBuilder { OctaviaHealthMonitorV2Update m; - public HealthMonitorV2UpdateConcreteBuilder(){ - this (new OctaviaHealthMonitorV2Update()); + public HealthMonitorV2UpdateConcreteBuilder() { + this(new OctaviaHealthMonitorV2Update()); } - public HealthMonitorV2UpdateConcreteBuilder(OctaviaHealthMonitorV2Update m){ + public HealthMonitorV2UpdateConcreteBuilder(OctaviaHealthMonitorV2Update m) { this.m = m; } @@ -162,7 +163,7 @@ public HealthMonitorV2UpdateConcreteBuilder(OctaviaHealthMonitorV2Update m){ * {@inheritDoc} */ @Override - public HealthMonitorV2Update build(){ + public HealthMonitorV2Update build() { return m; } @@ -170,7 +171,7 @@ public HealthMonitorV2Update build(){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder from(HealthMonitorV2Update in){ + public HealthMonitorV2UpdateBuilder from(HealthMonitorV2Update in) { m = (OctaviaHealthMonitorV2Update) in; return this; } @@ -179,7 +180,7 @@ public HealthMonitorV2UpdateBuilder from(HealthMonitorV2Update in){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder delay(Integer delay){ + public HealthMonitorV2UpdateBuilder delay(Integer delay) { m.delay = delay; return this; } @@ -188,7 +189,7 @@ public HealthMonitorV2UpdateBuilder delay(Integer delay){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder urlPath(String urlPath){ + public HealthMonitorV2UpdateBuilder urlPath(String urlPath) { m.urlPath = urlPath; return this; } @@ -197,7 +198,7 @@ public HealthMonitorV2UpdateBuilder urlPath(String urlPath){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes){ + public HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes) { m.expectedCodes = expectedCodes; return this; } @@ -206,7 +207,7 @@ public HealthMonitorV2UpdateBuilder expectedCodes(String expectedCodes){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder httpMethod(String httpMethod){ + public HealthMonitorV2UpdateBuilder httpMethod(String httpMethod) { m.httpMethod = httpMethod; return this; } @@ -215,7 +216,7 @@ public HealthMonitorV2UpdateBuilder httpMethod(String httpMethod){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries){ + public HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries) { m.maxRetries = maxRetries; return this; } @@ -224,7 +225,7 @@ public HealthMonitorV2UpdateBuilder maxRetries(Integer maxRetries){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder maxRetriesDown(Integer maxRetriesDown){ + public HealthMonitorV2UpdateBuilder maxRetriesDown(Integer maxRetriesDown) { m.maxRetriesDown = maxRetriesDown; return this; } @@ -233,7 +234,7 @@ public HealthMonitorV2UpdateBuilder maxRetriesDown(Integer maxRetriesDown){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -242,7 +243,7 @@ public HealthMonitorV2UpdateBuilder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public HealthMonitorV2UpdateBuilder timeout(Integer timeout){ + public HealthMonitorV2UpdateBuilder timeout(Integer timeout) { m.timeout = timeout; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2.java index 97a30c87b..9818c55f0 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2.java @@ -15,6 +15,7 @@ /** * Lbaas V2 load balancer pool + * * @author wei */ @JsonRootName("pool") @@ -67,7 +68,7 @@ public LbPoolV2Builder toBuilder() { * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @@ -75,7 +76,7 @@ public String getId(){ * {@inheritDoc} */ @Override - public String getProjectId(){ + public String getProjectId() { return projectId; } @@ -83,7 +84,7 @@ public String getProjectId(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -91,7 +92,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -99,7 +100,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public Protocol getProtocol(){ + public Protocol getProtocol() { return protocol; } @@ -107,7 +108,7 @@ public Protocol getProtocol(){ * {@inheritDoc} */ @Override - public LbMethod getLbMethod(){ + public LbMethod getLbMethod() { return lbMethod; } @@ -115,7 +116,7 @@ public LbMethod getLbMethod(){ * {@inheritDoc} */ @Override - public SessionPersistence getSessionPersistence(){ + public SessionPersistence getSessionPersistence() { return sessionPersistence; } @@ -123,7 +124,7 @@ public SessionPersistence getSessionPersistence(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -131,7 +132,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public List getListeners(){ + public List getListeners() { return listeners; } @@ -139,7 +140,7 @@ public List getListeners(){ * {@inheritDoc} */ @Override - public List getMembers(){ + public List getMembers() { return members; } @@ -147,12 +148,12 @@ public List getMembers(){ * {@inheritDoc} */ @Override - public String getHealthMonitorId(){ + public String getHealthMonitorId() { return healthMonitorId; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("projectId", projectId) @@ -170,7 +171,7 @@ public String toString(){ .toString(); } - public static class LbPoolV2ConcreteBuilder implements LbPoolV2Builder{ + public static class LbPoolV2ConcreteBuilder implements LbPoolV2Builder { private OctaviaLbPoolV2 m; @@ -188,7 +189,7 @@ public LbPoolV2ConcreteBuilder(OctaviaLbPoolV2 m) { } @Override - public LbPoolV2Builder from(LbPoolV2 in){ + public LbPoolV2Builder from(LbPoolV2 in) { m = (OctaviaLbPoolV2) in; return this; } @@ -197,7 +198,7 @@ public LbPoolV2Builder from(LbPoolV2 in){ * {@inheritDoc} */ @Override - public LbPoolV2Builder projectId(String projectId){ + public LbPoolV2Builder projectId(String projectId) { m.projectId = projectId; return this; } @@ -206,7 +207,7 @@ public LbPoolV2Builder projectId(String projectId){ * {@inheritDoc} */ @Override - public LbPoolV2Builder name(String name){ + public LbPoolV2Builder name(String name) { m.name = name; return this; } @@ -215,7 +216,7 @@ public LbPoolV2Builder name(String name){ * {@inheritDoc} */ @Override - public LbPoolV2Builder description(String description){ + public LbPoolV2Builder description(String description) { m.description = description; return this; } @@ -224,7 +225,7 @@ public LbPoolV2Builder description(String description){ * {@inheritDoc} */ @Override - public LbPoolV2Builder protocol(Protocol protocol){ + public LbPoolV2Builder protocol(Protocol protocol) { m.protocol = protocol; return this; } @@ -233,7 +234,7 @@ public LbPoolV2Builder protocol(Protocol protocol){ * {@inheritDoc} */ @Override - public LbPoolV2Builder lbMethod(LbMethod lbMethod){ + public LbPoolV2Builder lbMethod(LbMethod lbMethod) { m.lbMethod = lbMethod; return this; } @@ -242,7 +243,7 @@ public LbPoolV2Builder lbMethod(LbMethod lbMethod){ * {@inheritDoc} */ @Override - public LbPoolV2Builder sessionPersistence(SessionPersistence sessionPersistence){ + public LbPoolV2Builder sessionPersistence(SessionPersistence sessionPersistence) { m.sessionPersistence = sessionPersistence; return this; } @@ -251,7 +252,7 @@ public LbPoolV2Builder sessionPersistence(SessionPersistence sessionPersistence) * {@inheritDoc} */ @Override - public LbPoolV2Builder adminStateUp(boolean adminStateUp){ + public LbPoolV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -260,7 +261,7 @@ public LbPoolV2Builder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public LbPoolV2Builder listenerId(String listenerId){ + public LbPoolV2Builder listenerId(String listenerId) { m.listenerId = listenerId; return this; } @@ -269,7 +270,7 @@ public LbPoolV2Builder listenerId(String listenerId){ * {@inheritDoc} */ @Override - public LbPoolV2Builder loadbalancerId(String loadbalancerId){ + public LbPoolV2Builder loadbalancerId(String loadbalancerId) { m.loadbalancerId = loadbalancerId; return this; } @@ -278,16 +279,17 @@ public LbPoolV2Builder loadbalancerId(String loadbalancerId){ public static class LbPoolsV2 extends ListResult { @JsonProperty("pools") List lbPools; + /** * {@inheritDoc} */ @Override - protected List value(){ + protected List value() { return lbPools; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("lbPools", lbPools) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2Update.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2Update.java index 354b6ea09..e4062cae8 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLbPoolV2Update.java @@ -11,6 +11,7 @@ /** * Used to update lbaas V2 lb pool + * * @author wei */ @JsonRootName("pool") @@ -39,32 +40,32 @@ public LbPoolV2UpdateBuilder toBuilder() { return new OctaviaLbPoolV2Update.LbPoolV2UpdateContreteBuilder(this); } - public static LbPoolV2UpdateBuilder builder(){ + public static LbPoolV2UpdateBuilder builder() { return new LbPoolV2UpdateContreteBuilder(); } @Override - public String getName(){ + public String getName() { return name; } @Override - public String getDescription(){ + public String getDescription() { return description; } @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @Override - public LbMethod getLbMethod(){ + public LbMethod getLbMethod() { return lbMethod; } @Override - public SessionPersistence getSessionPersistence(){ + public SessionPersistence getSessionPersistence() { return sessionPersistence; } @@ -82,11 +83,11 @@ public static class LbPoolV2UpdateContreteBuilder implements LbPoolV2UpdateBuild private OctaviaLbPoolV2Update m; - public LbPoolV2UpdateContreteBuilder (){ + public LbPoolV2UpdateContreteBuilder() { this(new OctaviaLbPoolV2Update()); } - public LbPoolV2UpdateContreteBuilder(OctaviaLbPoolV2Update m){ + public LbPoolV2UpdateContreteBuilder(OctaviaLbPoolV2Update m) { this.m = m; } @@ -98,7 +99,7 @@ public LbPoolV2Update build() { @Override public LbPoolV2UpdateContreteBuilder from(LbPoolV2Update in) { - m = (OctaviaLbPoolV2Update)in; + m = (OctaviaLbPoolV2Update) in; return this; } @@ -133,7 +134,7 @@ public LbPoolV2UpdateContreteBuilder description(String description) { * {@inheritDoc} */ @Override - public LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence){ + public LbPoolV2UpdateBuilder sessionPersistence(SessionPersistence sessionPersistence) { m.sessionPersistence = sessionPersistence; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2.java index 3f705e757..d965d200a 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2.java @@ -13,6 +13,7 @@ /** * lbaas v2 listener + * * @author wei */ @JsonRootName("listener") @@ -68,7 +69,7 @@ public class OctaviaListenerV2 implements ListenerV2 { * {@inheritDoc} */ @Override - public List getLoadBalancers(){ + public List getLoadBalancers() { return loadbalancers; } @@ -76,7 +77,7 @@ public List getLoadBalancers(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -84,7 +85,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public String getDefaultPoolId(){ + public String getDefaultPoolId() { return defaultPoolId; } @@ -92,7 +93,7 @@ public String getDefaultPoolId(){ * {@inheritDoc} */ @Override - public Integer getConnectionLimit(){ + public Integer getConnectionLimit() { return connectionLimit; } @@ -100,7 +101,7 @@ public Integer getConnectionLimit(){ * {@inheritDoc} */ @Override - public Integer getProtocolPort(){ + public Integer getProtocolPort() { return protocolPort; } @@ -108,7 +109,7 @@ public Integer getProtocolPort(){ * {@inheritDoc} */ @Override - public ListenerProtocol getProtocol(){ + public ListenerProtocol getProtocol() { return protocol; } @@ -116,7 +117,7 @@ public ListenerProtocol getProtocol(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -124,7 +125,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -132,7 +133,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public String getProjectId(){ + public String getProjectId() { return projectId; } @@ -140,7 +141,7 @@ public String getProjectId(){ * {@inheritDoc} */ @Override - public String getDefaultTlsContainerRef(){ + public String getDefaultTlsContainerRef() { return defaultTlsContainerRef; } @@ -148,7 +149,7 @@ public String getDefaultTlsContainerRef(){ * {@inheritDoc} */ @Override - public List getSniContainerRefs(){ + public List getSniContainerRefs() { return sniContainerRefs; } @@ -156,12 +157,12 @@ public List getSniContainerRefs(){ * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("adminStateUp", adminStateUp) @@ -190,18 +191,18 @@ public ListenerConcreteBuilder(OctaviaListenerV2 m) { } @Override - public ListenerV2 build(){ + public ListenerV2 build() { return m; } @Override - public ListenerV2Builder from(ListenerV2 in){ + public ListenerV2Builder from(ListenerV2 in) { m = (OctaviaListenerV2) in; return this; } @Override - public ListenerV2Builder loadBalancerId(String loadbalancerId){ + public ListenerV2Builder loadBalancerId(String loadbalancerId) { m.loadbalancerId = loadbalancerId; return this; } @@ -210,7 +211,7 @@ public ListenerV2Builder loadBalancerId(String loadbalancerId){ * {@inheritDoc} */ @Override - public ListenerV2Builder projectId(String projectId){ + public ListenerV2Builder projectId(String projectId) { m.projectId = projectId; return this; } @@ -219,7 +220,7 @@ public ListenerV2Builder projectId(String projectId){ * {@inheritDoc} */ @Override - public ListenerV2Builder protocol(ListenerProtocol protocol){ + public ListenerV2Builder protocol(ListenerProtocol protocol) { m.protocol = protocol; return this; } @@ -228,7 +229,7 @@ public ListenerV2Builder protocol(ListenerProtocol protocol){ * {@inheritDoc} */ @Override - public ListenerV2Builder protocolPort(Integer protocolPort){ + public ListenerV2Builder protocolPort(Integer protocolPort) { m.protocolPort = protocolPort; return this; } @@ -237,7 +238,7 @@ public ListenerV2Builder protocolPort(Integer protocolPort){ * {@inheritDoc} */ @Override - public ListenerV2Builder adminStateUp(boolean adminStateUp){ + public ListenerV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -246,7 +247,7 @@ public ListenerV2Builder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public ListenerV2Builder name(String name){ + public ListenerV2Builder name(String name) { m.name = name; return this; } @@ -255,7 +256,7 @@ public ListenerV2Builder name(String name){ * {@inheritDoc} */ @Override - public ListenerV2Builder description(String description){ + public ListenerV2Builder description(String description) { m.description = description; return this; } @@ -264,7 +265,7 @@ public ListenerV2Builder description(String description){ * {@inheritDoc} */ @Override - public ListenerV2Builder connectionLimit(Integer connectionLimit){ + public ListenerV2Builder connectionLimit(Integer connectionLimit) { m.connectionLimit = connectionLimit; return this; } @@ -273,7 +274,7 @@ public ListenerV2Builder connectionLimit(Integer connectionLimit){ * {@inheritDoc} */ @Override - public ListenerV2Builder sniContainerRefs(List sniContainerRefs){ + public ListenerV2Builder sniContainerRefs(List sniContainerRefs) { m.sniContainerRefs = sniContainerRefs; return this; } @@ -282,18 +283,18 @@ public ListenerV2Builder sniContainerRefs(List sniContainerRefs){ * {@inheritDoc} */ @Override - public ListenerV2Builder defaultTlsContainerRef(String tlsContainerRef){ + public ListenerV2Builder defaultTlsContainerRef(String tlsContainerRef) { m.defaultTlsContainerRef = tlsContainerRef; return this; } } @Override - public ListenerV2Builder toBuilder(){ + public ListenerV2Builder toBuilder() { return new ListenerConcreteBuilder(this); } - public static ListenerV2Builder builder(){ + public static ListenerV2Builder builder() { return new ListenerConcreteBuilder(); } @@ -312,7 +313,7 @@ protected List value() { } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("listeners", listeners) .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2Update.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2Update.java index 1d3bfb539..b0cbef900 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaListenerV2Update.java @@ -9,6 +9,7 @@ /** * Entity for updating lbaas v2 listener + * * @author wei */ @JsonRootName("listener") @@ -37,7 +38,7 @@ public class OctaviaListenerV2Update implements ListenerV2Update { * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder toBuilder(){ + public ListenerV2UpdateBuilder toBuilder() { return new ListenerV2UpdateConcreteBuilder(this); } @@ -45,7 +46,7 @@ public ListenerV2UpdateBuilder toBuilder(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -53,7 +54,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -61,7 +62,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -69,7 +70,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public Integer getConnectionLimit(){ + public Integer getConnectionLimit() { return connectionLimit; } @@ -77,7 +78,7 @@ public Integer getConnectionLimit(){ * {@inheritDoc} */ @Override - public String getDefaultTlsContainerRef(){ + public String getDefaultTlsContainerRef() { return defaultTlsContainerRef; } @@ -95,11 +96,11 @@ public String toString() { public static class ListenerV2UpdateConcreteBuilder implements ListenerV2UpdateBuilder { private OctaviaListenerV2Update m; - public ListenerV2UpdateConcreteBuilder(){ + public ListenerV2UpdateConcreteBuilder() { this(new OctaviaListenerV2Update()); } - public ListenerV2UpdateConcreteBuilder(OctaviaListenerV2Update m){ + public ListenerV2UpdateConcreteBuilder(OctaviaListenerV2Update m) { this.m = m; } @@ -107,7 +108,7 @@ public ListenerV2UpdateConcreteBuilder(OctaviaListenerV2Update m){ * {@inheritDoc} */ @Override - public ListenerV2Update build(){ + public ListenerV2Update build() { return m; } @@ -115,7 +116,7 @@ public ListenerV2Update build(){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder from(ListenerV2Update in){ + public ListenerV2UpdateBuilder from(ListenerV2Update in) { m = (OctaviaListenerV2Update) in; return this; } @@ -124,7 +125,7 @@ public ListenerV2UpdateBuilder from(ListenerV2Update in){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder name(String name){ + public ListenerV2UpdateBuilder name(String name) { m.name = name; return this; } @@ -133,7 +134,7 @@ public ListenerV2UpdateBuilder name(String name){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder description(String description){ + public ListenerV2UpdateBuilder description(String description) { m.description = description; return this; } @@ -142,7 +143,7 @@ public ListenerV2UpdateBuilder description(String description){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public ListenerV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -151,7 +152,7 @@ public ListenerV2UpdateBuilder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder connectionLimit(Integer connectionLimit){ + public ListenerV2UpdateBuilder connectionLimit(Integer connectionLimit) { m.connectionLimit = connectionLimit; return this; } @@ -160,7 +161,7 @@ public ListenerV2UpdateBuilder connectionLimit(Integer connectionLimit){ * {@inheritDoc} */ @Override - public ListenerV2UpdateBuilder defaultTlsContainerRef(String defaultTlsContainerRef){ + public ListenerV2UpdateBuilder defaultTlsContainerRef(String defaultTlsContainerRef) { m.defaultTlsContainerRef = defaultTlsContainerRef; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2.java index 3ae6bd377..e3e6875e4 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2.java @@ -14,6 +14,7 @@ /** * lbaas v2 loadbalancer + * * @author wei */ @JsonRootName("loadbalancer") @@ -67,7 +68,7 @@ public class OctaviaLoadBalancerV2 implements LoadBalancerV2 { * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @@ -75,7 +76,7 @@ public String getId(){ * {@inheritDoc} */ @Override - public String getProjectId(){ + public String getProjectId() { return projectId; } @@ -83,7 +84,7 @@ public String getProjectId(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -91,7 +92,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -100,7 +101,7 @@ public String getDescription(){ */ @JsonProperty("vip_network_id") @Override - public String getVipNetworkId(){ + public String getVipNetworkId() { return vipNetworkId; } @@ -109,7 +110,7 @@ public String getVipNetworkId(){ */ @JsonProperty("vip_subnet_id") @Override - public String getVipSubnetId(){ + public String getVipSubnetId() { return vipSubnetId; } @@ -117,7 +118,7 @@ public String getVipSubnetId(){ * {@inheritDoc} */ @Override - public String getVipAddress(){ + public String getVipAddress() { return vipAddress; } @@ -125,7 +126,7 @@ public String getVipAddress(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -133,7 +134,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public List getListeners(){ + public List getListeners() { return listeners; } @@ -141,7 +142,7 @@ public List getListeners(){ * {@inheritDoc} */ @Override - public LbProvisioningStatus getProvisioningStatus(){ + public LbProvisioningStatus getProvisioningStatus() { return provisioningStatus; } @@ -149,7 +150,7 @@ public LbProvisioningStatus getProvisioningStatus(){ * {@inheritDoc} */ @Override - public LbOperatingStatus getOperatingStatus(){ + public LbOperatingStatus getOperatingStatus() { return operatingStatus; } @@ -157,7 +158,7 @@ public LbOperatingStatus getOperatingStatus(){ * {@inheritDoc} */ @Override - public String getVipPortId(){ + public String getVipPortId() { return vipPortId; } @@ -165,7 +166,7 @@ public String getVipPortId(){ * {@inheritDoc} */ @Override - public String getProvider(){ + public String getProvider() { return provider; } @@ -173,12 +174,12 @@ public String getProvider(){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder toBuilder(){ + public LoadBalancerV2Builder toBuilder() { return new LoadBalancerV2ConcreteBuilder(this); } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("projectId", projectId) @@ -237,7 +238,7 @@ public LoadBalancerV2 build() { * {@inheritDoc} */ @Override - public LoadBalancerV2Builder from(LoadBalancerV2 in){ + public LoadBalancerV2Builder from(LoadBalancerV2 in) { m = (OctaviaLoadBalancerV2) in; return this; } @@ -246,7 +247,7 @@ public LoadBalancerV2Builder from(LoadBalancerV2 in){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder projectId(String projectId){ + public LoadBalancerV2Builder projectId(String projectId) { m.projectId = projectId; return this; } @@ -255,7 +256,7 @@ public LoadBalancerV2Builder projectId(String projectId){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder name(String name){ + public LoadBalancerV2Builder name(String name) { m.name = name; return this; } @@ -264,7 +265,7 @@ public LoadBalancerV2Builder name(String name){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder description(String description){ + public LoadBalancerV2Builder description(String description) { m.description = description; return this; } @@ -273,7 +274,7 @@ public LoadBalancerV2Builder description(String description){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder networkId(String vipNetworkId){ + public LoadBalancerV2Builder networkId(String vipNetworkId) { m.vipNetworkId = vipNetworkId; return this; } @@ -282,7 +283,7 @@ public LoadBalancerV2Builder networkId(String vipNetworkId){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder subnetId(String vipSubnetId){ + public LoadBalancerV2Builder subnetId(String vipSubnetId) { m.vipSubnetId = vipSubnetId; return this; } @@ -291,7 +292,7 @@ public LoadBalancerV2Builder subnetId(String vipSubnetId){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder portId(String vipPortId){ + public LoadBalancerV2Builder portId(String vipPortId) { m.vipPortId = vipPortId; return this; } @@ -300,7 +301,7 @@ public LoadBalancerV2Builder portId(String vipPortId){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder address(String vipAddress){ + public LoadBalancerV2Builder address(String vipAddress) { m.vipAddress = vipAddress; return this; } @@ -309,13 +310,13 @@ public LoadBalancerV2Builder address(String vipAddress){ * {@inheritDoc} */ @Override - public LoadBalancerV2Builder adminStateUp(boolean adminStateUp){ + public LoadBalancerV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @Override - public LoadBalancerV2Builder provider(String provider){ + public LoadBalancerV2Builder provider(String provider) { m.provider = provider; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Stats.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Stats.java index cb78da50d..38e26fcd3 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Stats.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Stats.java @@ -7,6 +7,7 @@ /** * The statistics about an lbaas v2 loadbalancer + * * @author wei */ @JsonRootName("stats") @@ -25,31 +26,30 @@ public class OctaviaLoadBalancerV2Stats implements LoadBalancerV2Stats { private Integer activeConnections; /** - * * {@inheritDoc} */ @Override public Long getBytesIn() { return bytesIn; } + /** - * * {@inheritDoc} */ @Override public Long getBytesOut() { return bytesOut; } + /** - * * {@inheritDoc} */ @Override public Integer getTotalConnections() { return totalConnections; } + /** - * * {@inheritDoc} */ @Override @@ -58,7 +58,7 @@ public Integer getActiveConnections() { } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("bytesIn", bytesIn) .add("bytesOut", bytesOut) diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Update.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Update.java index aae1b951e..7fc71f5d8 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaLoadBalancerV2Update.java @@ -9,6 +9,7 @@ /** * Entity used to update lbaas v2 loadbalancer + * * @author wei */ @JsonRootName("loadbalancer") @@ -26,7 +27,7 @@ public class OctaviaLoadBalancerV2Update implements LoadBalancerV2Update { * {@inheritDoc} */ @Override - public String getDescription(){ + public String getDescription() { return description; } @@ -34,7 +35,7 @@ public String getDescription(){ * {@inheritDoc} */ @Override - public String getName(){ + public String getName() { return name; } @@ -42,7 +43,7 @@ public String getName(){ * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -59,11 +60,11 @@ public static class LoadBalancerV2UpdateConcreteBuilder implements LoadBalancerV private OctaviaLoadBalancerV2Update m; - public LoadBalancerV2UpdateConcreteBuilder (){ + public LoadBalancerV2UpdateConcreteBuilder() { this(new OctaviaLoadBalancerV2Update()); } - public LoadBalancerV2UpdateConcreteBuilder (OctaviaLoadBalancerV2Update m){ + public LoadBalancerV2UpdateConcreteBuilder(OctaviaLoadBalancerV2Update m) { this.m = m; } @@ -71,7 +72,7 @@ public LoadBalancerV2UpdateConcreteBuilder (OctaviaLoadBalancerV2Update m){ * {@inheritDoc} */ @Override - public LoadBalancerV2Update build(){ + public LoadBalancerV2Update build() { return m; } @@ -79,7 +80,7 @@ public LoadBalancerV2Update build(){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder from(LoadBalancerV2Update in){ + public LoadBalancerV2UpdateBuilder from(LoadBalancerV2Update in) { m = (OctaviaLoadBalancerV2Update) in; return this; } @@ -88,7 +89,7 @@ public LoadBalancerV2UpdateBuilder from(LoadBalancerV2Update in){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder description(String description){ + public LoadBalancerV2UpdateBuilder description(String description) { m.description = description; return this; } @@ -97,7 +98,7 @@ public LoadBalancerV2UpdateBuilder description(String description){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder name(String name){ + public LoadBalancerV2UpdateBuilder name(String name) { m.name = name; return this; } @@ -106,13 +107,14 @@ public LoadBalancerV2UpdateBuilder name(String name){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public LoadBalancerV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } } - public static LoadBalancerV2UpdateBuilder builder(){ + + public static LoadBalancerV2UpdateBuilder builder() { return new LoadBalancerV2UpdateConcreteBuilder(); } @@ -120,7 +122,7 @@ public static LoadBalancerV2UpdateBuilder builder(){ * {@inheritDoc} */ @Override - public LoadBalancerV2UpdateBuilder toBuilder(){ + public LoadBalancerV2UpdateBuilder toBuilder() { return new LoadBalancerV2UpdateConcreteBuilder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2.java index f276407b3..94b406628 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2.java @@ -12,6 +12,7 @@ /** * A member of a v2 lbaas pool + * * @author wei */ @JsonRootName("member") @@ -42,7 +43,7 @@ public class OctaviaMemberV2 implements MemberV2 { * {@inheritDoc} */ @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @@ -50,7 +51,7 @@ public boolean isAdminStateUp(){ * {@inheritDoc} */ @Override - public String getSubnetId(){ + public String getSubnetId() { return subnetId; } @@ -58,7 +59,7 @@ public String getSubnetId(){ * {@inheritDoc} */ @Override - public Integer getWeight(){ + public Integer getWeight() { return weight; } @@ -66,7 +67,7 @@ public Integer getWeight(){ * {@inheritDoc} */ @Override - public Integer getProtocolPort(){ + public Integer getProtocolPort() { return protocolPort; } @@ -74,7 +75,7 @@ public Integer getProtocolPort(){ * {@inheritDoc} */ @Override - public String getAddress(){ + public String getAddress() { return address; } @@ -82,7 +83,7 @@ public String getAddress(){ * {@inheritDoc} */ @Override - public String getProjectId(){ + public String getProjectId() { return projectId; } @@ -90,20 +91,20 @@ public String getProjectId(){ * {@inheritDoc} */ @Override - public String getId(){ + public String getId() { return id; } @Override - public String toString(){ + public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("projectId", projectId) .add("address", address) .add("protocolPort", protocolPort) .add("adminStateUp", adminStateUp) - .add("weight",weight) - .add("subnetId",subnetId) + .add("weight", weight) + .add("subnetId", subnetId) .toString(); } @@ -142,12 +143,12 @@ public MemberV2ConcreteBuilder(OctaviaMemberV2 m) { } @Override - public MemberV2 build(){ + public MemberV2 build() { return m; } @Override - public MemberV2Builder from(MemberV2 in){ + public MemberV2Builder from(MemberV2 in) { m = (OctaviaMemberV2) in; return this; } @@ -156,7 +157,7 @@ public MemberV2Builder from(MemberV2 in){ * {@inheritDoc} */ @Override - public MemberV2Builder projectId(String projectId){ + public MemberV2Builder projectId(String projectId) { m.projectId = projectId; return this; } @@ -165,7 +166,7 @@ public MemberV2Builder projectId(String projectId){ * {@inheritDoc} */ @Override - public MemberV2Builder address(String address){ + public MemberV2Builder address(String address) { m.address = address; return this; } @@ -174,7 +175,7 @@ public MemberV2Builder address(String address){ * {@inheritDoc} */ @Override - public MemberV2Builder protocolPort(Integer protocolPort){ + public MemberV2Builder protocolPort(Integer protocolPort) { m.protocolPort = protocolPort; return this; } @@ -183,7 +184,7 @@ public MemberV2Builder protocolPort(Integer protocolPort){ * {@inheritDoc} */ @Override - public MemberV2Builder subnetId(String subnetId){ + public MemberV2Builder subnetId(String subnetId) { m.subnetId = subnetId; return this; } @@ -192,7 +193,7 @@ public MemberV2Builder subnetId(String subnetId){ * {@inheritDoc} */ @Override - public MemberV2Builder weight(Integer weight){ + public MemberV2Builder weight(Integer weight) { m.weight = weight; return this; } @@ -201,18 +202,18 @@ public MemberV2Builder weight(Integer weight){ * {@inheritDoc} */ @Override - public MemberV2Builder adminStateUp(boolean adminStateUp){ + public MemberV2Builder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } } @Override - public MemberV2Builder toBuilder(){ + public MemberV2Builder toBuilder() { return new MemberV2ConcreteBuilder(this); } - public static MemberV2Builder builder(){ + public static MemberV2Builder builder() { return new MemberV2ConcreteBuilder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2Update.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2Update.java index df1986ae7..8b307dfe2 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2Update.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaMemberV2Update.java @@ -9,6 +9,7 @@ /** * Entity for updating lbaas v2 members + * * @author wei */ @JsonRootName("member") @@ -27,12 +28,12 @@ public class OctaviaMemberV2Update implements MemberV2Update { private boolean adminStateUp = true; @Override - public boolean isAdminStateUp(){ + public boolean isAdminStateUp() { return adminStateUp; } @Override - public Integer getWeight(){ + public Integer getWeight() { return weight; } @@ -40,7 +41,7 @@ public Integer getWeight(){ public String toString() { return MoreObjects.toStringHelper(this) .add("weight", weight) - .add("adminStateUp",adminStateUp) + .add("adminStateUp", adminStateUp) .toString(); } @@ -59,7 +60,7 @@ public MemberV2UpdateConcreteBuilder(OctaviaMemberV2Update m) { * {@inheritDoc} */ @Override - public MemberV2Update build(){ + public MemberV2Update build() { return m; } @@ -67,7 +68,7 @@ public MemberV2Update build(){ * {@inheritDoc} */ @Override - public MemberV2UpdateBuilder from(MemberV2Update in){ + public MemberV2UpdateBuilder from(MemberV2Update in) { m = (OctaviaMemberV2Update) in; return this; } @@ -76,7 +77,7 @@ public MemberV2UpdateBuilder from(MemberV2Update in){ * {@inheritDoc} */ @Override - public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp){ + public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp) { m.adminStateUp = adminStateUp; return this; } @@ -85,18 +86,18 @@ public MemberV2UpdateBuilder adminStateUp(boolean adminStateUp){ * {@inheritDoc} */ @Override - public MemberV2UpdateBuilder weight(Integer weight){ + public MemberV2UpdateBuilder weight(Integer weight) { m.weight = weight; return this; } } @Override - public MemberV2UpdateBuilder toBuilder(){ + public MemberV2UpdateBuilder toBuilder() { return new MemberV2UpdateConcreteBuilder(this); } - public static MemberV2UpdateBuilder builder(){ + public static MemberV2UpdateBuilder builder() { return new MemberV2UpdateConcreteBuilder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaSessionPersistence.java b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaSessionPersistence.java index 741c15839..3f67c063b 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaSessionPersistence.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/domain/OctaviaSessionPersistence.java @@ -7,103 +7,107 @@ import org.openstack4j.model.octavia.SessionPersistence; import org.openstack4j.model.octavia.SessionPersistenceType; import org.openstack4j.model.octavia.builder.SessionPersistenceBuilder; + @JsonRootName("session_persistence") @JsonIgnoreProperties(ignoreUnknown = true) public class OctaviaSessionPersistence implements SessionPersistence { - private static final long serialVersionUID = 1L; - @JsonProperty("cookie_name") - private String cookieName; - private SessionPersistenceType type; - /** - * wrap the SessionPersistence to builder - * @return SessionPersistenceBuilder - */ - @Override - public SessionPersistenceBuilder toBuilder() { - return new SessionPersistenceContreteBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getCookieName() { - return cookieName; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceType getType() { - return type; - } - /** - * SessionPersistence Builder - * @author wei - * - */ - public static class SessionPersistenceContreteBuilder implements SessionPersistenceBuilder{ - - private OctaviaSessionPersistence m; - - public SessionPersistenceContreteBuilder() { - this(new OctaviaSessionPersistence()); - } - - public SessionPersistenceContreteBuilder(OctaviaSessionPersistence m) { - this.m = m; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceBuilder from(SessionPersistence in) { - m = (OctaviaSessionPersistence)in; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceBuilder type(SessionPersistenceType type) { - m.type = type; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistenceBuilder cookieName(String cookieName) { - m.cookieName = cookieName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SessionPersistence build() { - return m; - } - - } - - public static SessionPersistenceBuilder builder(){ - return new SessionPersistenceContreteBuilder(); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("type",type) - .add("cookieName", cookieName) - .toString(); - } + private static final long serialVersionUID = 1L; + @JsonProperty("cookie_name") + private String cookieName; + private SessionPersistenceType type; + + /** + * wrap the SessionPersistence to builder + * + * @return SessionPersistenceBuilder + */ + @Override + public SessionPersistenceBuilder toBuilder() { + return new SessionPersistenceContreteBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getCookieName() { + return cookieName; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceType getType() { + return type; + } + + /** + * SessionPersistence Builder + * + * @author wei + */ + public static class SessionPersistenceContreteBuilder implements SessionPersistenceBuilder { + + private OctaviaSessionPersistence m; + + public SessionPersistenceContreteBuilder() { + this(new OctaviaSessionPersistence()); + } + + public SessionPersistenceContreteBuilder(OctaviaSessionPersistence m) { + this.m = m; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceBuilder from(SessionPersistence in) { + m = (OctaviaSessionPersistence) in; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceBuilder type(SessionPersistenceType type) { + m.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistenceBuilder cookieName(String cookieName) { + m.cookieName = cookieName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPersistence build() { + return m; + } + + } + + public static SessionPersistenceBuilder builder() { + return new SessionPersistenceContreteBuilder(); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("type", type) + .add("cookieName", cookieName) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/internal/BaseOctaviaServices.java b/core/src/main/java/org/openstack4j/openstack/octavia/internal/BaseOctaviaServices.java index f1e99e83a..1376ad949 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/internal/BaseOctaviaServices.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/internal/BaseOctaviaServices.java @@ -6,12 +6,12 @@ /** * Base Networking Operations Implementation is responsible for insuring the proper endpoint is used for all extending operation APIs - * + * * @author wei */ public class BaseOctaviaServices extends BaseOpenStackService { - protected BaseOctaviaServices() { - super(ServiceType.OCTAVIA, EnforceVersionToURL.instance("/v2.0")); - } + protected BaseOctaviaServices() { + super(ServiceType.OCTAVIA, EnforceVersionToURL.instance("/v2.0")); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/internal/HealthMonitorV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/octavia/internal/HealthMonitorV2ServiceImpl.java index 669faf7e4..820945eac 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/internal/HealthMonitorV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/internal/HealthMonitorV2ServiceImpl.java @@ -15,14 +15,15 @@ /** * OpenStack (Octavia) lbaas v2 health monitor operations + * * @author wei */ -public class HealthMonitorV2ServiceImpl extends BaseOctaviaServices implements HealthMonitorV2Service{ +public class HealthMonitorV2ServiceImpl extends BaseOctaviaServices implements HealthMonitorV2Service { /** * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(HealthMonitorsV2.class, uri("/lbaas/healthmonitors")).execute().getList(); } @@ -30,7 +31,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(HealthMonitorsV2.class, uri("/lbaas/healthmonitors")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -44,7 +45,7 @@ public List list(Map filteringParams) * {@inheritDoc} */ @Override - public HealthMonitorV2 get(String healthMonitorId){ + public HealthMonitorV2 get(String healthMonitorId) { checkNotNull(healthMonitorId); return get(OctaviaHealthMonitorV2.class, uri("/lbaas/healthmonitors/%s", healthMonitorId)).execute(); } @@ -53,7 +54,7 @@ public HealthMonitorV2 get(String healthMonitorId){ * {@inheritDoc} */ @Override - public ActionResponse delete(String healthMonitorId){ + public ActionResponse delete(String healthMonitorId) { checkNotNull(healthMonitorId); return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lbaas/healthmonitors/%s", healthMonitorId)).executeWithResponse()); } @@ -62,9 +63,9 @@ public ActionResponse delete(String healthMonitorId){ * {@inheritDoc} */ @Override - public HealthMonitorV2 create(HealthMonitorV2 healthMonitor){ + public HealthMonitorV2 create(HealthMonitorV2 healthMonitor) { checkNotNull(healthMonitor); - return post(OctaviaHealthMonitorV2.class,uri("/lbaas/healthmonitors")).entity(healthMonitor).execute(); + return post(OctaviaHealthMonitorV2.class, uri("/lbaas/healthmonitors")).entity(healthMonitor).execute(); } /** @@ -72,9 +73,9 @@ public HealthMonitorV2 create(HealthMonitorV2 healthMonitor){ */ @Override public HealthMonitorV2 update(String healthMonitorId, - HealthMonitorV2Update healthMonitor) { + HealthMonitorV2Update healthMonitor) { checkNotNull(healthMonitorId); checkNotNull(healthMonitor); - return put(OctaviaHealthMonitorV2.class,uri("/lbaas/healthmonitors/%s",healthMonitorId)).entity(healthMonitor).execute(); + return put(OctaviaHealthMonitorV2.class, uri("/lbaas/healthmonitors/%s", healthMonitorId)).entity(healthMonitor).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/internal/LbPoolV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/octavia/internal/LbPoolV2ServiceImpl.java index ee1b2d40f..0c1b172cd 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/internal/LbPoolV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/internal/LbPoolV2ServiceImpl.java @@ -17,6 +17,7 @@ /** * OpenStack (Octavia) lbaas v2 lb pool operations + * * @author wei */ public class LbPoolV2ServiceImpl extends BaseOctaviaServices implements LbPoolV2Service { @@ -24,7 +25,7 @@ public class LbPoolV2ServiceImpl extends BaseOctaviaServices implements LbPoolV2 * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(OctaviaLbPoolV2.LbPoolsV2.class, uri("/lbaas/pools")).execute().getList(); } @@ -32,7 +33,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(OctaviaLbPoolV2.LbPoolsV2.class, uri("/lbaas/pools")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -46,16 +47,16 @@ public List list(Map filteringParams){ * {@inheritDoc} */ @Override - public LbPoolV2 get(String lbPoolId){ + public LbPoolV2 get(String lbPoolId) { checkNotNull(lbPoolId); - return get(OctaviaLbPoolV2.class, uri("/lbaas/pools/%s",lbPoolId)).execute(); + return get(OctaviaLbPoolV2.class, uri("/lbaas/pools/%s", lbPoolId)).execute(); } /** * {@inheritDoc} */ @Override - public LbPoolV2 create(LbPoolV2 lbPool){ + public LbPoolV2 create(LbPoolV2 lbPool) { checkNotNull(lbPool); return post(OctaviaLbPoolV2.class, uri("/lbaas/pools")).entity(lbPool).execute(); } @@ -64,34 +65,34 @@ public LbPoolV2 create(LbPoolV2 lbPool){ * {@inheritDoc} */ @Override - public LbPoolV2 update(String lbPoolId, LbPoolV2Update lbPool){ + public LbPoolV2 update(String lbPoolId, LbPoolV2Update lbPool) { checkNotNull(lbPoolId); checkNotNull(lbPool); - return put(OctaviaLbPoolV2.class, uri("/lbaas/pools/%s",lbPoolId)).entity(lbPool).execute(); + return put(OctaviaLbPoolV2.class, uri("/lbaas/pools/%s", lbPoolId)).entity(lbPool).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse delete(String lbPoolId){ + public ActionResponse delete(String lbPoolId) { checkNotNull(lbPoolId); - return ToActionResponseFunction.INSTANCE.apply(delete(void.class, uri("/lbaas/pools/%s",lbPoolId)).executeWithResponse()); + return ToActionResponseFunction.INSTANCE.apply(delete(void.class, uri("/lbaas/pools/%s", lbPoolId)).executeWithResponse()); } /** * {@inheritDoc} */ @Override - public List listMembers(String lbPoolId){ - return get(OctaviaMemberV2.MembersV2.class, uri("/lbaas/pools/%s/members",lbPoolId)).execute().getList(); + public List listMembers(String lbPoolId) { + return get(OctaviaMemberV2.MembersV2.class, uri("/lbaas/pools/%s/members", lbPoolId)).execute().getList(); } /** * {@inheritDoc} */ @Override - public List listMembers(String lbPoolId, Map filteringParams){ + public List listMembers(String lbPoolId, Map filteringParams) { Invocation req = get(OctaviaMemberV2.MembersV2.class, uri("/lbaas/pools/%s/members", lbPoolId)); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -105,38 +106,38 @@ public List listMembers(String lbPoolId, Map * {@inheritDoc} */ @Override - public MemberV2 getMember(String lbPoolId, String memberId){ + public MemberV2 getMember(String lbPoolId, String memberId) { checkNotNull(lbPoolId); checkNotNull(memberId); - return get(OctaviaMemberV2.class, uri("/lbaas/pools/%s/members/%s",lbPoolId,memberId)).execute(); + return get(OctaviaMemberV2.class, uri("/lbaas/pools/%s/members/%s", lbPoolId, memberId)).execute(); } /** * {@inheritDoc} */ @Override - public MemberV2 createMember(String lbPoolId, MemberV2 member){ + public MemberV2 createMember(String lbPoolId, MemberV2 member) { checkNotNull(lbPoolId); checkNotNull(member); - return post(OctaviaMemberV2.class, uri("/lbaas/pools/%s/members",lbPoolId)).entity(member).execute(); + return post(OctaviaMemberV2.class, uri("/lbaas/pools/%s/members", lbPoolId)).entity(member).execute(); } /** * {@inheritDoc} */ @Override - public MemberV2 updateMember(String lbPoolId, String memberId, MemberV2Update member){ + public MemberV2 updateMember(String lbPoolId, String memberId, MemberV2Update member) { checkNotNull(lbPoolId); checkNotNull(memberId); checkNotNull(member); - return put(OctaviaMemberV2.class, uri("/lbaas/pools/%s/members/%s",lbPoolId,memberId)).entity(member).execute(); + return put(OctaviaMemberV2.class, uri("/lbaas/pools/%s/members/%s", lbPoolId, memberId)).entity(member).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse deleteMember(String lbPoolId, String memberId){ + public ActionResponse deleteMember(String lbPoolId, String memberId) { checkNotNull(lbPoolId); checkNotNull(memberId); return ToActionResponseFunction.INSTANCE.apply(delete(void.class, uri("/lbaas/pools/%s/members/%s", lbPoolId, memberId)).executeWithResponse()); diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/internal/ListenerV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/octavia/internal/ListenerV2ServiceImpl.java index 811fd8337..9b5091173 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/internal/ListenerV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/internal/ListenerV2ServiceImpl.java @@ -14,6 +14,7 @@ /** * Lbaas listener imlementation + * * @author wei */ public class ListenerV2ServiceImpl extends BaseOctaviaServices implements ListenerV2Service { @@ -21,7 +22,7 @@ public class ListenerV2ServiceImpl extends BaseOctaviaServices implements Listen * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(OctaviaListenerV2.Listeners.class, uri("/lbaas/listeners")).execute().getList(); } @@ -29,7 +30,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(OctaviaListenerV2.Listeners.class, uri("/lbaas/listeners")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -43,34 +44,34 @@ public List list(Map filteringParams){ * {@inheritDoc} */ @Override - public ListenerV2 get(String listenerId){ + public ListenerV2 get(String listenerId) { checkNotNull(listenerId); - return get(OctaviaListenerV2.class, uri("/lbaas/listeners/%s",listenerId)).execute(); + return get(OctaviaListenerV2.class, uri("/lbaas/listeners/%s", listenerId)).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse delete(String listenerId){ + public ActionResponse delete(String listenerId) { checkNotNull(listenerId); return ToActionResponseFunction.INSTANCE.apply( - delete(Void.class, uri("/lbaas/listeners/%s",listenerId)).executeWithResponse()); + delete(Void.class, uri("/lbaas/listeners/%s", listenerId)).executeWithResponse()); } /** * {@inheritDoc} */ @Override - public ListenerV2 create(ListenerV2 listener){ + public ListenerV2 create(ListenerV2 listener) { checkNotNull(listener); return post(OctaviaListenerV2.class, uri("/lbaas/listeners")).entity(listener).execute(); } @Override - public ListenerV2 update(String listenerId, ListenerV2Update listener){ + public ListenerV2 update(String listenerId, ListenerV2Update listener) { checkNotNull(listenerId); checkNotNull(listener); - return put(OctaviaListenerV2.class, uri("/lbaas/listeners/%s",listenerId)).entity(listener).execute(); + return put(OctaviaListenerV2.class, uri("/lbaas/listeners/%s", listenerId)).entity(listener).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/internal/LoadBalancerV2ServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/octavia/internal/LoadBalancerV2ServiceImpl.java index a6b0a902c..5322d6f5f 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/internal/LoadBalancerV2ServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/internal/LoadBalancerV2ServiceImpl.java @@ -18,6 +18,7 @@ /** * Openstack (Octavia) lbaas v2 load balancer operations + * * @author wei */ public class LoadBalancerV2ServiceImpl extends BaseOctaviaServices implements LoadBalancerV2Service { @@ -25,7 +26,7 @@ public class LoadBalancerV2ServiceImpl extends BaseOctaviaServices implements Lo * {@inheritDoc} */ @Override - public List list(){ + public List list() { return get(OctaviaLoadBalancerV2.LoadBalancersV2.class, uri("/lbaas/loadbalancers")).execute().getList(); } @@ -33,7 +34,7 @@ public List list(){ * {@inheritDoc} */ @Override - public List list(Map filteringParams){ + public List list(Map filteringParams) { Invocation req = get(OctaviaLoadBalancerV2.LoadBalancersV2.class, uri("/lbaas/loadbalancers")); if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { @@ -47,46 +48,46 @@ public List list(Map filteringParams){ * {@inheritDoc} */ @Override - public LoadBalancerV2 get(String loadbalancerId){ + public LoadBalancerV2 get(String loadbalancerId) { checkNotNull(loadbalancerId); - return get(OctaviaLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s",loadbalancerId)).execute(); + return get(OctaviaLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s", loadbalancerId)).execute(); } /** * {@inheritDoc} */ @Override - public LoadBalancerV2 create(LoadBalancerV2 loadbalancer){ + public LoadBalancerV2 create(LoadBalancerV2 loadbalancer) { checkNotNull(loadbalancer); - return post(OctaviaLoadBalancerV2.class,uri("/lbaas/loadbalancers")).entity(loadbalancer).execute(); + return post(OctaviaLoadBalancerV2.class, uri("/lbaas/loadbalancers")).entity(loadbalancer).execute(); } /** * {@inheritDoc} */ @Override - public LoadBalancerV2 update(String loadbalancerId, LoadBalancerV2Update loadbalancer){ + public LoadBalancerV2 update(String loadbalancerId, LoadBalancerV2Update loadbalancer) { checkNotNull(loadbalancerId); checkNotNull(loadbalancer); - return put(OctaviaLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s",loadbalancerId)).entity(loadbalancer).execute(); + return put(OctaviaLoadBalancerV2.class, uri("/lbaas/loadbalancers/%s", loadbalancerId)).entity(loadbalancer).execute(); } /** * {@inheritDoc} */ @Override - public ActionResponse delete(String loadbalancerId){ + public ActionResponse delete(String loadbalancerId) { checkNotNull(loadbalancerId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lbaas/loadbalancers/%s",loadbalancerId)).executeWithResponse()); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/lbaas/loadbalancers/%s", loadbalancerId)).executeWithResponse()); } /** * {@inheritDoc} */ @Override - public ActionResponse cascadeDelete(String loadbalancerId){ + public ActionResponse cascadeDelete(String loadbalancerId) { checkNotNull(loadbalancerId); - Invocation req = delete(Void.class, uri("/lbaas/loadbalancers/%s",loadbalancerId)); + Invocation req = delete(Void.class, uri("/lbaas/loadbalancers/%s", loadbalancerId)); req = req.param("cascade", "true"); return ToActionResponseFunction.INSTANCE.apply(req.executeWithResponse()); } @@ -95,16 +96,16 @@ public ActionResponse cascadeDelete(String loadbalancerId){ * {@inheritDoc} */ @Override - public LoadBalancerV2Stats stats(String loadbalancerId){ + public LoadBalancerV2Stats stats(String loadbalancerId) { checkNotNull(loadbalancerId); - return get(OctaviaLoadBalancerV2Stats.class, uri("/lbaas/loadbalancers/%s/stats",loadbalancerId)).execute(); + return get(OctaviaLoadBalancerV2Stats.class, uri("/lbaas/loadbalancers/%s/stats", loadbalancerId)).execute(); } /** * {@inheritDoc} */ @Override - public LoadBalancerV2StatusTree statusTree(String loadbalancerId){ + public LoadBalancerV2StatusTree statusTree(String loadbalancerId) { checkNotNull(loadbalancerId); return get(OctaviaLoadBalancerV2StatusTree.class, uri("/lbaas/loadbalancers/%s/status", loadbalancerId)).execute(); } diff --git a/core/src/main/java/org/openstack4j/openstack/octavia/internal/OctaviaServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/octavia/internal/OctaviaServiceImpl.java index 9874921c7..e3498537d 100644 --- a/core/src/main/java/org/openstack4j/openstack/octavia/internal/OctaviaServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/octavia/internal/OctaviaServiceImpl.java @@ -5,7 +5,7 @@ /** * OpenStack Networking Operations API - * + * * @author wei */ public class OctaviaServiceImpl implements OctaviaService { diff --git a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java index 18102e6d6..4c0668550 100644 --- a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java +++ b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java @@ -1,319 +1,68 @@ package org.openstack4j.openstack.provider; -import java.util.Map; - +import com.google.common.collect.Maps; import org.openstack4j.api.APIProvider; import org.openstack4j.api.artifact.ArtifactService; import org.openstack4j.api.artifact.ToscaTemplatesArtifactService; import org.openstack4j.api.barbican.BarbicanService; import org.openstack4j.api.barbican.ContainerService; import org.openstack4j.api.barbican.SecretService; -import org.openstack4j.api.compute.ComputeFloatingIPService; -import org.openstack4j.api.compute.ComputeImageService; -import org.openstack4j.api.compute.ComputeSecurityGroupService; -import org.openstack4j.api.compute.ComputeService; -import org.openstack4j.api.compute.FlavorService; -import org.openstack4j.api.compute.HostAggregateService; -import org.openstack4j.api.compute.HostService; -import org.openstack4j.api.compute.KeypairService; import org.openstack4j.api.compute.QuotaSetService; -import org.openstack4j.api.compute.ServerGroupService; -import org.openstack4j.api.compute.ServerService; -import org.openstack4j.api.compute.ServerTagService; -import org.openstack4j.api.compute.ext.FloatingIPDNSDomainService; -import org.openstack4j.api.compute.ext.FloatingIPDNSEntryService; -import org.openstack4j.api.compute.ext.FloatingIPDNSService; -import org.openstack4j.api.compute.ext.HypervisorService; -import org.openstack4j.api.compute.ext.InstanceActionsService; -import org.openstack4j.api.compute.ext.InterfaceService; -import org.openstack4j.api.compute.ext.MigrationService; -import org.openstack4j.api.compute.ext.ServicesService; -import org.openstack4j.api.compute.ext.ZoneService; +import org.openstack4j.api.compute.*; +import org.openstack4j.api.compute.ext.*; import org.openstack4j.api.dns.v2.DNSService; import org.openstack4j.api.dns.v2.RecordsetService; import org.openstack4j.api.exceptions.ApiNotFoundException; -import org.openstack4j.api.gbp.ExternalPolicyService; -import org.openstack4j.api.gbp.ExternalSegmentService; -import org.openstack4j.api.gbp.GbpService; -import org.openstack4j.api.gbp.L2policyService; -import org.openstack4j.api.gbp.L3policyService; -import org.openstack4j.api.gbp.NatPoolService; -import org.openstack4j.api.gbp.NetworkPolicyService; -import org.openstack4j.api.gbp.PolicyActionService; -import org.openstack4j.api.gbp.PolicyClassifierService; -import org.openstack4j.api.gbp.PolicyRuleService; -import org.openstack4j.api.gbp.PolicyRuleSetService; -import org.openstack4j.api.gbp.PolicyTargetService; -import org.openstack4j.api.gbp.ServiceProfileService; -import org.openstack4j.api.gbp.ServicechainService; -import org.openstack4j.api.heat.EventsService; -import org.openstack4j.api.heat.HeatService; -import org.openstack4j.api.heat.ResourcesService; -import org.openstack4j.api.heat.SoftwareConfigService; -import org.openstack4j.api.heat.StackService; -import org.openstack4j.api.heat.TemplateService; +import org.openstack4j.api.gbp.*; +import org.openstack4j.api.heat.*; import org.openstack4j.api.identity.v2.ServiceManagerService; import org.openstack4j.api.identity.v2.TenantService; -import org.openstack4j.api.identity.v3.CredentialService; -import org.openstack4j.api.identity.v3.DomainService; import org.openstack4j.api.identity.v3.GroupService; -import org.openstack4j.api.identity.v3.PolicyService; -import org.openstack4j.api.identity.v3.ProjectService; -import org.openstack4j.api.identity.v3.RegionService; -import org.openstack4j.api.identity.v3.RoleService; -import org.openstack4j.api.identity.v3.ServiceEndpointService; -import org.openstack4j.api.identity.v3.TokenService; import org.openstack4j.api.identity.v3.UserService; +import org.openstack4j.api.identity.v3.*; import org.openstack4j.api.image.ImageService; import org.openstack4j.api.image.v2.TaskService; import org.openstack4j.api.magnum.MagnumService; -import org.openstack4j.api.manila.SchedulerStatsService; -import org.openstack4j.api.manila.SecurityServiceService; -import org.openstack4j.api.manila.ShareInstanceService; -import org.openstack4j.api.manila.ShareNetworkService; -import org.openstack4j.api.manila.ShareServerService; -import org.openstack4j.api.manila.ShareService; -import org.openstack4j.api.manila.ShareSnapshotService; -import org.openstack4j.api.manila.ShareTypeService; -import org.openstack4j.api.manila.SharesService; -import org.openstack4j.api.murano.v1.AppCatalogService; -import org.openstack4j.api.murano.v1.MuranoActionService; -import org.openstack4j.api.murano.v1.MuranoApplicationService; -import org.openstack4j.api.murano.v1.MuranoDeploymentService; -import org.openstack4j.api.murano.v1.MuranoEnvironmentService; -import org.openstack4j.api.murano.v1.MuranoSessionService; -import org.openstack4j.api.networking.AvailabilityZoneService; -import org.openstack4j.api.networking.NetFloatingIPService; -import org.openstack4j.api.networking.NetworkService; -import org.openstack4j.api.networking.NetworkingService; -import org.openstack4j.api.networking.PortService; -import org.openstack4j.api.networking.RouterService; -import org.openstack4j.api.networking.SecurityGroupRuleService; -import org.openstack4j.api.networking.SecurityGroupService; -import org.openstack4j.api.networking.SubnetService; -import org.openstack4j.api.networking.ext.AgentService; -import org.openstack4j.api.networking.ext.FirewallAsService; -import org.openstack4j.api.networking.ext.FirewallPolicyService; -import org.openstack4j.api.networking.ext.FirewallRuleService; -import org.openstack4j.api.networking.ext.FirewallService; -import org.openstack4j.api.networking.ext.FlowClassifierService; -import org.openstack4j.api.networking.ext.HealthMonitorService; -import org.openstack4j.api.networking.ext.HealthMonitorV2Service; -import org.openstack4j.api.networking.ext.LbPoolService; -import org.openstack4j.api.networking.ext.LbPoolV2Service; -import org.openstack4j.api.networking.ext.LbaasV2Service; -import org.openstack4j.api.networking.ext.ListenerV2Service; -import org.openstack4j.api.networking.ext.LoadBalancerService; -import org.openstack4j.api.networking.ext.LoadBalancerV2Service; -import org.openstack4j.api.networking.ext.MemberService; -import org.openstack4j.api.networking.ext.NetQuotaService; -import org.openstack4j.api.networking.ext.ServiceFunctionChainService; -import org.openstack4j.api.networking.ext.PortPairService; -import org.openstack4j.api.networking.ext.PortPairGroupService; -import org.openstack4j.api.networking.ext.PortChainService; -import org.openstack4j.api.networking.ext.VipService; +import org.openstack4j.api.manila.*; +import org.openstack4j.api.murano.v1.*; +import org.openstack4j.api.networking.*; +import org.openstack4j.api.networking.ext.*; import org.openstack4j.api.octavia.OctaviaService; -import org.openstack4j.api.sahara.ClusterService; -import org.openstack4j.api.sahara.ClusterTemplateService; -import org.openstack4j.api.sahara.DataSourceService; -import org.openstack4j.api.sahara.JobBinaryInternalService; -import org.openstack4j.api.sahara.JobBinaryService; -import org.openstack4j.api.sahara.JobExecutionService; -import org.openstack4j.api.sahara.JobService; -import org.openstack4j.api.sahara.NodeGroupTemplateService; -import org.openstack4j.api.sahara.SaharaImageService; -import org.openstack4j.api.sahara.SaharaPluginService; -import org.openstack4j.api.sahara.SaharaService; -import org.openstack4j.api.senlin.SenlinActionService; -import org.openstack4j.api.senlin.SenlinBuildInfoService; -import org.openstack4j.api.senlin.SenlinClusterPolicyService; -import org.openstack4j.api.senlin.SenlinClusterService; -import org.openstack4j.api.senlin.SenlinEventService; -import org.openstack4j.api.senlin.SenlinNodeService; -import org.openstack4j.api.senlin.SenlinPolicyService; -import org.openstack4j.api.senlin.SenlinPolicyTypeService; -import org.openstack4j.api.senlin.SenlinProfileService; -import org.openstack4j.api.senlin.SenlinProfileTypeService; -import org.openstack4j.api.senlin.SenlinReceiverService; -import org.openstack4j.api.senlin.SenlinService; -import org.openstack4j.api.senlin.SenlinVersionService; -import org.openstack4j.api.senlin.SenlinWebHookService; -import org.openstack4j.api.storage.BlockQuotaSetService; -import org.openstack4j.api.storage.BlockStorageService; -import org.openstack4j.api.storage.BlockVolumeBackupService; -import org.openstack4j.api.storage.BlockVolumeService; -import org.openstack4j.api.storage.BlockVolumeSnapshotService; -import org.openstack4j.api.storage.BlockVolumeTransferService; -import org.openstack4j.api.storage.CinderZoneService; -import org.openstack4j.api.storage.ObjectStorageAccountService; -import org.openstack4j.api.storage.ObjectStorageContainerService; -import org.openstack4j.api.storage.ObjectStorageObjectService; -import org.openstack4j.api.storage.ObjectStorageService; -import org.openstack4j.api.storage.SchedulerStatsGetPoolService; +import org.openstack4j.api.sahara.*; +import org.openstack4j.api.senlin.*; +import org.openstack4j.api.storage.*; import org.openstack4j.api.storage.ext.BlockStorageServiceService; -import org.openstack4j.api.tacker.TackerService; -import org.openstack4j.api.tacker.TackerServiceImpl; -import org.openstack4j.api.tacker.VimService; -import org.openstack4j.api.tacker.VnfService; -import org.openstack4j.api.tacker.VnfdService; -import org.openstack4j.api.telemetry.AlarmAodhService; -import org.openstack4j.api.telemetry.AlarmService; -import org.openstack4j.api.telemetry.CapabilitiesService; -import org.openstack4j.api.telemetry.EventService; -import org.openstack4j.api.telemetry.MeterService; -import org.openstack4j.api.telemetry.ResourceService; -import org.openstack4j.api.telemetry.SampleService; -import org.openstack4j.api.telemetry.TelemetryAodhService; -import org.openstack4j.api.telemetry.TelemetryService; -import org.openstack4j.api.trove.DatabaseService; -import org.openstack4j.api.trove.DatastoreService; -import org.openstack4j.api.trove.InstanceFlavorService; -import org.openstack4j.api.trove.InstanceService; -import org.openstack4j.api.trove.TroveService; +import org.openstack4j.api.tacker.*; +import org.openstack4j.api.telemetry.*; +import org.openstack4j.api.trove.*; import org.openstack4j.api.workflow.*; import org.openstack4j.openstack.artifact.internal.ArtifactServiceImpl; import org.openstack4j.openstack.artifact.internal.ToscaTemplatesArtifactServiceImpl; import org.openstack4j.openstack.barbican.internal.BarbicanServiceImpl; import org.openstack4j.openstack.barbican.internal.ContainerServiceImpl; import org.openstack4j.openstack.barbican.internal.SecretServiceImpl; -import org.openstack4j.openstack.compute.internal.ComputeFloatingIPServiceImpl; -import org.openstack4j.openstack.compute.internal.ComputeImageServiceImpl; -import org.openstack4j.openstack.compute.internal.ComputeSecurityGroupServiceImpl; -import org.openstack4j.openstack.compute.internal.ComputeServiceImpl; -import org.openstack4j.openstack.compute.internal.FlavorServiceImpl; -import org.openstack4j.openstack.compute.internal.HostAggregateServiceImpl; -import org.openstack4j.openstack.compute.internal.HostServiceImpl; -import org.openstack4j.openstack.compute.internal.KeypairServiceImpl; import org.openstack4j.openstack.compute.internal.QuotaSetServiceImpl; -import org.openstack4j.openstack.compute.internal.ServerGroupServiceImpl; -import org.openstack4j.openstack.compute.internal.ServerServiceImpl; -import org.openstack4j.openstack.compute.internal.ServerTagServiceImpl; -import org.openstack4j.openstack.compute.internal.ServicesServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.FloatingIPDNSDomainServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.FloatingIPDNSEntryServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.FloatingIPDNSServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.HypervisorServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.InstanceActionsServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.InterfaceServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.MigrationServiceImpl; -import org.openstack4j.openstack.compute.internal.ext.ZoneServiceImpl; +import org.openstack4j.openstack.compute.internal.*; +import org.openstack4j.openstack.compute.internal.ext.*; import org.openstack4j.openstack.dns.v2.internal.DNSServiceImpl; import org.openstack4j.openstack.dns.v2.internal.RecordsetServiceImpl; -import org.openstack4j.openstack.gbp.internal.ExternalPolicyServiceImpl; -import org.openstack4j.openstack.gbp.internal.ExternalSegmentServiceImpl; -import org.openstack4j.openstack.gbp.internal.GbpServiceImpl; -import org.openstack4j.openstack.gbp.internal.L2policyServiceImpl; -import org.openstack4j.openstack.gbp.internal.L3policyServiceImpl; -import org.openstack4j.openstack.gbp.internal.NatPoolServiceImpl; -import org.openstack4j.openstack.gbp.internal.NetworkPolicyServiceImpl; -import org.openstack4j.openstack.gbp.internal.PolicyActionServiceImpl; -import org.openstack4j.openstack.gbp.internal.PolicyClassifierServiceImpl; -import org.openstack4j.openstack.gbp.internal.PolicyRuleServiceImpl; -import org.openstack4j.openstack.gbp.internal.PolicyRuleSetServiceImpl; -import org.openstack4j.openstack.gbp.internal.PolicyTargetServiceImpl; -import org.openstack4j.openstack.gbp.internal.ServiceProfileServiceImpl; -import org.openstack4j.openstack.gbp.internal.ServicechainServiceImpl; -import org.openstack4j.openstack.heat.internal.EventsServiceImpl; -import org.openstack4j.openstack.heat.internal.HeatServiceImpl; -import org.openstack4j.openstack.heat.internal.ResourcesServiceImpl; -import org.openstack4j.openstack.heat.internal.SoftwareConfigServiceImpl; -import org.openstack4j.openstack.heat.internal.StackServiceImpl; -import org.openstack4j.openstack.heat.internal.TemplateServiceImpl; +import org.openstack4j.openstack.gbp.internal.*; +import org.openstack4j.openstack.heat.internal.*; import org.openstack4j.openstack.identity.v2.internal.ServiceManagerServiceImpl; import org.openstack4j.openstack.identity.v2.internal.TenantServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.CredentialServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.DomainServiceImpl; import org.openstack4j.openstack.identity.v3.internal.GroupServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.PolicyServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.ProjectServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.RegionServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.RoleServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.ServiceEndpointServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.TokenServiceImpl; -import org.openstack4j.openstack.identity.v3.internal.UserServiceImpl; +import org.openstack4j.openstack.identity.v3.internal.*; import org.openstack4j.openstack.image.internal.ImageServiceImpl; import org.openstack4j.openstack.image.v2.internal.TaskServiceImpl; import org.openstack4j.openstack.magnum.internal.MagnumServiceImpl; -import org.openstack4j.openstack.manila.internal.SchedulerStatsServiceImpl; -import org.openstack4j.openstack.manila.internal.SecurityServiceServiceImpl; -import org.openstack4j.openstack.manila.internal.ShareInstanceServiceImpl; -import org.openstack4j.openstack.manila.internal.ShareNetworkServiceImpl; -import org.openstack4j.openstack.manila.internal.ShareServerServiceImpl; -import org.openstack4j.openstack.manila.internal.ShareServiceImpl; -import org.openstack4j.openstack.manila.internal.ShareSnapshotServiceImpl; -import org.openstack4j.openstack.manila.internal.ShareTypeServiceImpl; -import org.openstack4j.openstack.manila.internal.SharesServiceImpl; -import org.openstack4j.openstack.murano.v1.internal.MuranoActionServiceImpl; -import org.openstack4j.openstack.murano.v1.internal.MuranoApplicationServiceImpl; -import org.openstack4j.openstack.murano.v1.internal.MuranoDeploymentServiceImpl; -import org.openstack4j.openstack.murano.v1.internal.MuranoEnvironmentServiceImpl; -import org.openstack4j.openstack.murano.v1.internal.MuranoService; -import org.openstack4j.openstack.murano.v1.internal.MuranoSessionServiceImpl; -import org.openstack4j.openstack.networking.internal.AvailabilityZoneServiceImpl; -import org.openstack4j.openstack.networking.internal.FloatingIPServiceImpl; -import org.openstack4j.openstack.networking.internal.NetworkServiceImpl; -import org.openstack4j.openstack.networking.internal.NetworkingServiceImpl; -import org.openstack4j.openstack.networking.internal.PortServiceImpl; -import org.openstack4j.openstack.networking.internal.RouterServiceImpl; -import org.openstack4j.openstack.networking.internal.SecurityGroupRuleServiceImpl; -import org.openstack4j.openstack.networking.internal.SecurityGroupServiceImpl; -import org.openstack4j.openstack.networking.internal.SubnetServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.AgentServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.FirewallAsServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.FirewallPolicyServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.FirewallRuleServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.FirewallServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.FlowClassifierServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.HealthMonitorServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.HealthMonitorV2ServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.LbPoolServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.LbPoolV2ServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.LbaasV2ServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.ListenerV2ServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.LoadBalancerServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.LoadBalancerV2ServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.MemberServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.NetQuotaServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.ServiceFunctionChainServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.PortPairServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.PortPairGroupServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.PortChainServiceImpl; -import org.openstack4j.openstack.networking.internal.ext.VipServiceImpl; +import org.openstack4j.openstack.manila.internal.*; +import org.openstack4j.openstack.murano.v1.internal.*; +import org.openstack4j.openstack.networking.internal.*; +import org.openstack4j.openstack.networking.internal.ext.*; import org.openstack4j.openstack.octavia.internal.OctaviaServiceImpl; -import org.openstack4j.openstack.sahara.internal.ClusterServiceImpl; -import org.openstack4j.openstack.sahara.internal.ClusterTemplateServiceImpl; -import org.openstack4j.openstack.sahara.internal.DataSourceServiceImpl; -import org.openstack4j.openstack.sahara.internal.JobBinaryInternalServiceImpl; -import org.openstack4j.openstack.sahara.internal.JobBinaryServiceImpl; -import org.openstack4j.openstack.sahara.internal.JobExecutionServiceImpl; -import org.openstack4j.openstack.sahara.internal.JobServiceImpl; -import org.openstack4j.openstack.sahara.internal.NodeGroupTemplateServiceImpl; -import org.openstack4j.openstack.sahara.internal.SaharaImageServiceImpl; -import org.openstack4j.openstack.sahara.internal.SaharaPluginServiceImpl; -import org.openstack4j.openstack.sahara.internal.SaharaServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinActionServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinBuildInfoServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinClusterPolicyServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinClusterServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinEventServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinNodeServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinPolicyServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinPolicyTypeServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinProfileServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinProfileTypeServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinReceiverServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinVersionServiceImpl; -import org.openstack4j.openstack.senlin.internal.SenlinWebHookServiceImpl; -import org.openstack4j.openstack.storage.block.internal.BlockQuotaSetServiceImpl; -import org.openstack4j.openstack.storage.block.internal.BlockStorageServiceImpl; -import org.openstack4j.openstack.storage.block.internal.BlockStorageServiceServiceImpl; -import org.openstack4j.openstack.storage.block.internal.BlockVolumeBackupServiceImpl; -import org.openstack4j.openstack.storage.block.internal.BlockVolumeServiceImpl; -import org.openstack4j.openstack.storage.block.internal.BlockVolumeSnapshotServiceImpl; -import org.openstack4j.openstack.storage.block.internal.BlockVolumeTransferServiceImpl; -import org.openstack4j.openstack.storage.block.internal.CinderZoneServiceImpl; -import org.openstack4j.openstack.storage.block.internal.SchedulerStatsGetPoolServiceImpl; +import org.openstack4j.openstack.sahara.internal.*; +import org.openstack4j.openstack.senlin.internal.*; +import org.openstack4j.openstack.storage.block.internal.*; import org.openstack4j.openstack.storage.object.internal.ObjectStorageAccountServiceImpl; import org.openstack4j.openstack.storage.object.internal.ObjectStorageContainerServiceImpl; import org.openstack4j.openstack.storage.object.internal.ObjectStorageObjectServiceImpl; @@ -321,25 +70,12 @@ import org.openstack4j.openstack.tacker.internal.VimServiceImpl; import org.openstack4j.openstack.tacker.internal.VnfServiceImpl; import org.openstack4j.openstack.tacker.internal.VnfdServiceImpl; -import org.openstack4j.openstack.telemetry.internal.AlarmAodhServiceImpl; -import org.openstack4j.openstack.telemetry.internal.AlarmServiceImpl; -import org.openstack4j.openstack.telemetry.internal.CapabilitiesServiceImpl; -import org.openstack4j.openstack.telemetry.internal.EventServiceImpl; -import org.openstack4j.openstack.telemetry.internal.MeterServiceImpl; -import org.openstack4j.openstack.telemetry.internal.ResourceServiceImpl; -import org.openstack4j.openstack.telemetry.internal.SampleServiceImpl; -import org.openstack4j.openstack.telemetry.internal.TelemetryAodhServiceImpl; -import org.openstack4j.openstack.telemetry.internal.TelemetryServiceImpl; -import org.openstack4j.openstack.trove.internal.DBDatabaseServiceImpl; -import org.openstack4j.openstack.trove.internal.DBDatastoreServiceImpl; -import org.openstack4j.openstack.trove.internal.DBFlavorServiceImpl; -import org.openstack4j.openstack.trove.internal.DBInstanceServiceImpl; -import org.openstack4j.openstack.trove.internal.DBUserServiceImpl; -import org.openstack4j.openstack.trove.internal.TroveServiceImpl; - -import com.google.common.collect.Maps; +import org.openstack4j.openstack.telemetry.internal.*; +import org.openstack4j.openstack.trove.internal.*; import org.openstack4j.openstack.workflow.internal.*; +import java.util.Map; + /** * Simple API Provider which keeps internally Maps interface implementations as singletons * @@ -527,7 +263,7 @@ public void initialize() { bind(TaskService.class, TaskServiceImpl.class); bind(TaskService.class, TaskServiceImpl.class); bind(ServerTagService.class, ServerTagServiceImpl.class); - bind(TelemetryAodhService.class,TelemetryAodhServiceImpl.class); + bind(TelemetryAodhService.class, TelemetryAodhServiceImpl.class); bind(AlarmAodhService.class, AlarmAodhServiceImpl.class); bind(ServicesService.class, ServicesServiceImpl.class); bind(BlockStorageServiceService.class, BlockStorageServiceServiceImpl.class); diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaCluster.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaCluster.java index 6d3880383..f5af3ed4d 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaCluster.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaCluster.java @@ -1,10 +1,11 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; import org.openstack4j.model.compute.Image; import org.openstack4j.model.sahara.Cluster; import org.openstack4j.model.sahara.NodeGroup; @@ -13,12 +14,10 @@ import org.openstack4j.model.sahara.builder.ClusterBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * For mapping JSON response to/from java objects @@ -27,362 +26,362 @@ */ @JsonRootName("cluster") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaCluster implements Cluster { - private static final long serialVersionUID = 1L; - - private Status status; - @JsonProperty("info") - private Map infos; - @JsonProperty("cluster_template_id") - private String clusterTemplateId; - @JsonProperty("is_transient") - private Boolean isTransient; - private String description; - @JsonProperty("cluster_configs") - private Map clusterConfigs; - @JsonProperty("created_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date createdAt; - @JsonProperty("default_image_id") - private String defaultImageId; - @JsonProperty("user_keypair_id") - private String userKeypairId; - @JsonProperty("updated_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date updatedAt; - @JsonProperty("plugin_name") - private String pluginName; - @JsonProperty("neutron_management_network") - private String managementNetworkId; - @JsonProperty("anti_affinity") - private List antiAffinity; - @JsonProperty("tenant_id") - private String tenantId; - @JsonProperty("node_groups") - private List nodeGroups; - @JsonProperty("management_public_key") - private String managementPublicKey; - @JsonProperty("status_description") - private String statusDescription; - @JsonProperty("hadoop_version") - private String hadoopVersion; - private String id; - @JsonProperty("trust_id") - private String trustId; // TODO: What is trust_id? - private String name; - - /** - * {@inheritDoc} - */ - @Override - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getInfos() { - return infos; - } - - /** - * {@inheritDoc} - */ - @Override - public String getClusterTemplateId() { - return clusterTemplateId; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean isTransient() { - return isTransient; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - public Map getClusterConfigs() { - return clusterConfigs; + private static final long serialVersionUID = 1L; + + private Status status; + @JsonProperty("info") + private Map infos; + @JsonProperty("cluster_template_id") + private String clusterTemplateId; + @JsonProperty("is_transient") + private Boolean isTransient; + private String description; + @JsonProperty("cluster_configs") + private Map clusterConfigs; + @JsonProperty("created_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date createdAt; + @JsonProperty("default_image_id") + private String defaultImageId; + @JsonProperty("user_keypair_id") + private String userKeypairId; + @JsonProperty("updated_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date updatedAt; + @JsonProperty("plugin_name") + private String pluginName; + @JsonProperty("neutron_management_network") + private String managementNetworkId; + @JsonProperty("anti_affinity") + private List antiAffinity; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("node_groups") + private List nodeGroups; + @JsonProperty("management_public_key") + private String managementPublicKey; + @JsonProperty("status_description") + private String statusDescription; + @JsonProperty("hadoop_version") + private String hadoopVersion; + private String id; + @JsonProperty("trust_id") + private String trustId; // TODO: What is trust_id? + private String name; + + /** + * {@inheritDoc} + */ + @Override + public Status getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getInfos() { + return infos; + } + + /** + * {@inheritDoc} + */ + @Override + public String getClusterTemplateId() { + return clusterTemplateId; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean isTransient() { + return isTransient; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + public Map getClusterConfigs() { + return clusterConfigs; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedAt() { + return createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDefaultImageId() { + return defaultImageId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUserKeypairId() { + return userKeypairId; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public String getPluginName() { + return pluginName; + } + + /** + * {@inheritDoc} + */ + @Override + public String getManagementNetworkId() { + return managementNetworkId; + } + + /** + * {@inheritDoc} + */ + @Override + public List getAntiAffinity() { + return antiAffinity; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public List getNodeGroups() { + return nodeGroups; + } + + /** + * {@inheritDoc} + */ + @Override + public String getManagementPublicKey() { + return managementPublicKey; + } + + /** + * {@inheritDoc} + */ + @Override + public String getStatusDescription() { + return statusDescription; + } + + /** + * {@inheritDoc} + */ + @Override + public String getHadoopVersion() { + return hadoopVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTrustId() { + return trustId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id) + .add("name", name) + .add("description", description) + .add("status", status) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("tenant_id", tenantId) + .add("cluster_template_id", clusterTemplateId) + .add("is_transient", isTransient) + .add("default_image_id", defaultImageId) + .add("user_keypair_id", userKeypairId) + .add("plugin_name", pluginName) + .add("neutron_management_network", managementNetworkId) + .add("cluster_configs", clusterConfigs) + .add("anti_affinity", antiAffinity) + .add("node_groups", nodeGroups) + .add("management_public_key", managementPublicKey) + .add("status_description", statusDescription) + .add("hadoop_version", hadoopVersion) + .add("trust_id", trustId) + .add("info", infos) + .toString(); + } + + public static class Clusters extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("clusters") + private List clusters; + + public List value() { + return clusters; } + } - /** - * {@inheritDoc} - */ - @Override - public Date getCreatedAt() { - return createdAt; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDefaultImageId() { - return defaultImageId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUserKeypairId() { - return userKeypairId; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPluginName() { - return pluginName; - } - - /** - * {@inheritDoc} - */ - @Override - public String getManagementNetworkId() { - return managementNetworkId; - } - - /** - * {@inheritDoc} - */ - @Override - public List getAntiAffinity() { - return antiAffinity; + /** + * {@inheritDoc} + */ + @Override + public ClusterBuilder toBuilder() { + return new ConcreteClusterBuilder(this); + } + + /** + * @return the cluster Builder + */ + public static ClusterBuilder builder() { + return new ConcreteClusterBuilder(); + } + + public static class ConcreteClusterBuilder implements ClusterBuilder { + + SaharaCluster m; + + ConcreteClusterBuilder() { + this(new SaharaCluster()); } - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public List getNodeGroups() { - return nodeGroups; + ConcreteClusterBuilder(SaharaCluster m) { + this.m = m; } - /** - * {@inheritDoc} - */ - @Override - public String getManagementPublicKey() { - return managementPublicKey; - } - - /** - * {@inheritDoc} - */ - @Override - public String getStatusDescription() { - return statusDescription; - } - - /** - * {@inheritDoc} - */ - @Override - public String getHadoopVersion() { - return hadoopVersion; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTrustId() { - return trustId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id",id) - .add("name", name) - .add("description", description) - .add("status", status) - .add("created_at", createdAt) - .add("updated_at", updatedAt) - .add("tenant_id", tenantId) - .add("cluster_template_id",clusterTemplateId) - .add("is_transient",isTransient) - .add("default_image_id",defaultImageId) - .add("user_keypair_id",userKeypairId) - .add("plugin_name",pluginName) - .add("neutron_management_network",managementNetworkId) - .add("cluster_configs",clusterConfigs) - .add("anti_affinity",antiAffinity) - .add("node_groups",nodeGroups) - .add("management_public_key",managementPublicKey) - .add("status_description",statusDescription) - .add("hadoop_version",hadoopVersion) - .add("trust_id",trustId) - .add("info",infos) - .toString(); - } - - public static class Clusters extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("clusters") - private List clusters; - - public List value() { - return clusters; - } - } - - /** - * {@inheritDoc} - */ @Override - public ClusterBuilder toBuilder() { - return new ConcreteClusterBuilder(this); + public ClusterBuilder name(String name) { + m.name = name; + return this; } - /** - * @return the cluster Builder - */ - public static ClusterBuilder builder() { - return new ConcreteClusterBuilder(); + @Override + public ClusterBuilder hadoopVersion(String hadoopVersion) { + m.hadoopVersion = hadoopVersion; + return this; } - public static class ConcreteClusterBuilder implements ClusterBuilder { - - SaharaCluster m; - - ConcreteClusterBuilder() { - this(new SaharaCluster()); - } - - ConcreteClusterBuilder(SaharaCluster m) { - this.m = m; - } - - @Override - public ClusterBuilder name(String name) { - m.name = name; - return this; - } - - @Override - public ClusterBuilder hadoopVersion(String hadoopVersion) { - m.hadoopVersion = hadoopVersion; - return this; - } - - @Override - public ClusterBuilder pluginName(String pluginName) { - m.pluginName = pluginName; - return this; - } - - @Override - public ClusterBuilder template(String clusterTemplateId) { - m.clusterTemplateId = clusterTemplateId; - return this; - } + @Override + public ClusterBuilder pluginName(String pluginName) { + m.pluginName = pluginName; + return this; + } - @Override - public ClusterBuilder image(String imageId) { - m.defaultImageId = imageId; - return this; - } + @Override + public ClusterBuilder template(String clusterTemplateId) { + m.clusterTemplateId = clusterTemplateId; + return this; + } - public ClusterBuilder image(Image image) { - m.defaultImageId = image.getId(); - return this; - } + @Override + public ClusterBuilder image(String imageId) { + m.defaultImageId = imageId; + return this; + } - @Override - public ClusterBuilder keypairName(String keypairName) { - m.userKeypairId = keypairName; - return this; - } + public ClusterBuilder image(Image image) { + m.defaultImageId = image.getId(); + return this; + } - @Override - public ClusterBuilder managementNetworkId(String networkId) { - m.managementNetworkId = networkId; - return this; - } + @Override + public ClusterBuilder keypairName(String keypairName) { + m.userKeypairId = keypairName; + return this; + } - @Override - public ClusterBuilder addNodeGroup(NodeGroup nodeGroup) { - if (m.nodeGroups == null) - m.nodeGroups = Lists.newArrayList(); - m.nodeGroups.add((SaharaNodeGroup) nodeGroup); - return this; - } + @Override + public ClusterBuilder managementNetworkId(String networkId) { + m.managementNetworkId = networkId; + return this; + } - @Override - public ClusterBuilder addServiceConfig(String name, ServiceConfig config) { - if (name != null && !name.isEmpty()) { - if (m.clusterConfigs == null) - m.clusterConfigs = new HashMap(); - m.clusterConfigs.put(name,(SaharaServiceConfig) config); - } - return this; - } + @Override + public ClusterBuilder addNodeGroup(NodeGroup nodeGroup) { + if (m.nodeGroups == null) + m.nodeGroups = Lists.newArrayList(); + m.nodeGroups.add((SaharaNodeGroup) nodeGroup); + return this; + } - @Override - public Cluster build() { - return m; + @Override + public ClusterBuilder addServiceConfig(String name, ServiceConfig config) { + if (name != null && !name.isEmpty()) { + if (m.clusterConfigs == null) + m.clusterConfigs = new HashMap(); + m.clusterConfigs.put(name, (SaharaServiceConfig) config); } + return this; + } - @Override - public ClusterBuilder from(Cluster in) { - m = (SaharaCluster) in; - return this; - } + @Override + public Cluster build() { + return m; + } + @Override + public ClusterBuilder from(Cluster in) { + m = (SaharaCluster) in; + return this; } + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplate.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplate.java index 29516e7a8..84c0564ba 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplate.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplate.java @@ -1,21 +1,20 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; import org.openstack4j.model.sahara.ClusterTemplate; import org.openstack4j.model.sahara.NodeGroup; import org.openstack4j.model.sahara.ServiceConfig; import org.openstack4j.model.sahara.builder.ClusterTemplateBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * An OpenStack Sahara @@ -25,259 +24,259 @@ @JsonRootName("cluster_template") public class SaharaClusterTemplate implements ClusterTemplate { - private static final long serialVersionUID = 1L; - - @JsonProperty("hadoop_version") - private String hadoopVersion; - @JsonProperty("default_image_id") - private String defaultImageId; - private String name; - @JsonProperty("updated_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date updatedAt; - @JsonProperty("tenant_id") - private String tenantId; - @JsonProperty("plugin_name") - private String pluginName; - @JsonProperty("anti_affinity") - private List antiAffinity; - private String description; - private String id; - @JsonProperty("node_groups") - private List nodeGroups; - @JsonProperty("neutron_management_network") - private String managementNetworkId; - @JsonProperty("created_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date createdAt; - @JsonProperty("cluster_configs") - private Map clusterConfigs; - - /** - * {@inheritDoc} - */ - @Override - public ClusterTemplateBuilder toBuilder() { - return new ConcreteClusterTemplateBuilder(this); - } - - /** - * @return the cluster template Builder - */ - public static ClusterTemplateBuilder builder() { - return new ConcreteClusterTemplateBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getHadoopVersion() { - return hadoopVersion; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDefaultImageId() { - return defaultImageId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPluginName() { - return pluginName; - } - - /** - * {@inheritDoc} - */ - @Override - public List getAntiAffinity() { - return antiAffinity; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public List getNodeGroups() { - return nodeGroups; - } - - /** - * {@inheritDoc} - */ - @Override - public String getManagementNetworkId() { - return managementNetworkId; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreatedAt() { - return createdAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getClusterConfigs() { - return clusterConfigs; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id) - .add("name", name) - .add("description", description) - .add("hadoop_version", hadoopVersion) - .add("tenant_id",tenantId) - .add("created_at",createdAt) - .add("updated_at",updatedAt) - .add("plugin_name",pluginName) - .add("default_image_id", defaultImageId) - .add("anti_affinity",antiAffinity) - .add("neutron_management_network_id",managementNetworkId) - .add("node_groups",nodeGroups) - .add("cluster_configs",clusterConfigs) - .toString(); - } - - public static class ClusterTemplates extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("cluster_templates") - private List nodeGroupTemplates; - - @Override - protected List value() { - return nodeGroupTemplates; - } - } - - public static class ConcreteClusterTemplateBuilder implements ClusterTemplateBuilder { - - private SaharaClusterTemplate m; - - ConcreteClusterTemplateBuilder() { - this(new SaharaClusterTemplate()); - } - - ConcreteClusterTemplateBuilder(SaharaClusterTemplate m) { - this.m = m; - } - - @Override - public ClusterTemplate build() { - return m; - } - - @Override - public ClusterTemplateBuilder from(ClusterTemplate in) { - m = (SaharaClusterTemplate) in; - return this; - } - - @Override - public ClusterTemplateBuilder pluginName(String pluginName) { - m.pluginName = pluginName; - return this; - } - - @Override - public ClusterTemplateBuilder hadoopVersion(String hadoopVersion) { - m.hadoopVersion = hadoopVersion; - return this; - } - - - @Override - public ClusterTemplateBuilder addNodeGroup(NodeGroup nodeGroup) { - if (m.nodeGroups == null) - m.nodeGroups = Lists.newArrayList(); - m.nodeGroups.add((SaharaNodeGroup) nodeGroup); - return this; - } - - @Override - public ClusterTemplateBuilder name(String name) { - m.name = name; - return this; - } - - @Override - public ClusterTemplateBuilder description(String description) { - m.description = description; - return this; - } - - @Override - public ClusterTemplateBuilder managementNetworkId(String networkId) { - m.managementNetworkId = networkId; - return this; - } - - @Override - public ClusterTemplateBuilder addServiceConfig(String name, ServiceConfig config) { - if (name != null && !name.isEmpty()) { - if (m.clusterConfigs == null) - m.clusterConfigs = new HashMap(); - m.clusterConfigs.put(name,(SaharaServiceConfig) config); - } - return this; - } - - } + private static final long serialVersionUID = 1L; + + @JsonProperty("hadoop_version") + private String hadoopVersion; + @JsonProperty("default_image_id") + private String defaultImageId; + private String name; + @JsonProperty("updated_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date updatedAt; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("plugin_name") + private String pluginName; + @JsonProperty("anti_affinity") + private List antiAffinity; + private String description; + private String id; + @JsonProperty("node_groups") + private List nodeGroups; + @JsonProperty("neutron_management_network") + private String managementNetworkId; + @JsonProperty("created_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date createdAt; + @JsonProperty("cluster_configs") + private Map clusterConfigs; + + /** + * {@inheritDoc} + */ + @Override + public ClusterTemplateBuilder toBuilder() { + return new ConcreteClusterTemplateBuilder(this); + } + + /** + * @return the cluster template Builder + */ + public static ClusterTemplateBuilder builder() { + return new ConcreteClusterTemplateBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getHadoopVersion() { + return hadoopVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDefaultImageId() { + return defaultImageId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getPluginName() { + return pluginName; + } + + /** + * {@inheritDoc} + */ + @Override + public List getAntiAffinity() { + return antiAffinity; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public List getNodeGroups() { + return nodeGroups; + } + + /** + * {@inheritDoc} + */ + @Override + public String getManagementNetworkId() { + return managementNetworkId; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedAt() { + return createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getClusterConfigs() { + return clusterConfigs; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id) + .add("name", name) + .add("description", description) + .add("hadoop_version", hadoopVersion) + .add("tenant_id", tenantId) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("plugin_name", pluginName) + .add("default_image_id", defaultImageId) + .add("anti_affinity", antiAffinity) + .add("neutron_management_network_id", managementNetworkId) + .add("node_groups", nodeGroups) + .add("cluster_configs", clusterConfigs) + .toString(); + } + + public static class ClusterTemplates extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("cluster_templates") + private List nodeGroupTemplates; + + @Override + protected List value() { + return nodeGroupTemplates; + } + } + + public static class ConcreteClusterTemplateBuilder implements ClusterTemplateBuilder { + + private SaharaClusterTemplate m; + + ConcreteClusterTemplateBuilder() { + this(new SaharaClusterTemplate()); + } + + ConcreteClusterTemplateBuilder(SaharaClusterTemplate m) { + this.m = m; + } + + @Override + public ClusterTemplate build() { + return m; + } + + @Override + public ClusterTemplateBuilder from(ClusterTemplate in) { + m = (SaharaClusterTemplate) in; + return this; + } + + @Override + public ClusterTemplateBuilder pluginName(String pluginName) { + m.pluginName = pluginName; + return this; + } + + @Override + public ClusterTemplateBuilder hadoopVersion(String hadoopVersion) { + m.hadoopVersion = hadoopVersion; + return this; + } + + + @Override + public ClusterTemplateBuilder addNodeGroup(NodeGroup nodeGroup) { + if (m.nodeGroups == null) + m.nodeGroups = Lists.newArrayList(); + m.nodeGroups.add((SaharaNodeGroup) nodeGroup); + return this; + } + + @Override + public ClusterTemplateBuilder name(String name) { + m.name = name; + return this; + } + + @Override + public ClusterTemplateBuilder description(String description) { + m.description = description; + return this; + } + + @Override + public ClusterTemplateBuilder managementNetworkId(String networkId) { + m.managementNetworkId = networkId; + return this; + } + + @Override + public ClusterTemplateBuilder addServiceConfig(String name, ServiceConfig config) { + if (name != null && !name.isEmpty()) { + if (m.clusterConfigs == null) + m.clusterConfigs = new HashMap(); + m.clusterConfigs.put(name, (SaharaServiceConfig) config); + } + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplateUnwrapped.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplateUnwrapped.java index 9620b7b00..ca8bf417b 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplateUnwrapped.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterTemplateUnwrapped.java @@ -1,30 +1,29 @@ package org.openstack4j.openstack.sahara.domain; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.ClusterTemplate; -import com.fasterxml.jackson.annotation.JsonUnwrapped; - /** * An OpenStack Sahara - * Unwrap the root name of ClusterTemplate when serialized into json request - * + * Unwrap the root name of ClusterTemplate when serialized into json request + * * @author Ekasit Kijsipongse */ public class SaharaClusterTemplateUnwrapped implements ModelEntity { - private static final long serialVersionUID = 1L; - - @JsonUnwrapped - //@JsonProperty("cluster_template") - private ClusterTemplate template; + private static final long serialVersionUID = 1L; + + @JsonUnwrapped + //@JsonProperty("cluster_template") + private ClusterTemplate template; - public SaharaClusterTemplateUnwrapped(ClusterTemplate template) { - this.template = template; - } + public SaharaClusterTemplateUnwrapped(ClusterTemplate template) { + this.template = template; + } - public ClusterTemplate getTemplate() { // need for serialization - return template; - } + public ClusterTemplate getTemplate() { // need for serialization + return template; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterUnwrapped.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterUnwrapped.java index b0eb02935..0f9c7cc88 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterUnwrapped.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaClusterUnwrapped.java @@ -1,30 +1,29 @@ package org.openstack4j.openstack.sahara.domain; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.Cluster; -import com.fasterxml.jackson.annotation.JsonUnwrapped; - /** * An OpenStack Sahara - * Unwrap the root name of Cluster when serialized into json request - * + * Unwrap the root name of Cluster when serialized into json request + * * @author ekasit.kijsipongse@nectec.or.th */ public class SaharaClusterUnwrapped implements ModelEntity { - private static final long serialVersionUID = 1L; - - @JsonUnwrapped - //@JsonProperty("cluster") - private Cluster cluster; + private static final long serialVersionUID = 1L; + + @JsonUnwrapped + //@JsonProperty("cluster") + private Cluster cluster; - public SaharaClusterUnwrapped(Cluster cluster) { - this.cluster = cluster; - } + public SaharaClusterUnwrapped(Cluster cluster) { + this.cluster = cluster; + } - public Cluster getCluster() { // need for serialization - return cluster; - } + public Cluster getCluster() { // need for serialization + return cluster; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaConfigInfo.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaConfigInfo.java index aab231848..a6a73b5bd 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaConfigInfo.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaConfigInfo.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.List; - -import org.openstack4j.model.sahara.ConfigInfo; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.ConfigInfo; + +import java.util.List; /** * For mapping JSON response to/from java objects @@ -14,7 +13,7 @@ * @author ekasit.kijsipongse@nectec.or.th */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaConfigInfo implements ConfigInfo { private static final long serialVersionUID = 1L; @@ -112,12 +111,12 @@ public String toString() { .add("name", name) .add("description", description) .add("priority", priority) - .add("config_type",type) + .add("config_type", type) .add("default_value", defaultValue) - .add("config_values",configValues) - .add("is_optional",isOptional) - .add("scope",scope) - .add("applicable_target",applicableTarget) + .add("config_values", configValues) + .add("is_optional", isOptional) + .add("scope", scope) + .add("applicable_target", applicableTarget) .toString(); } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSource.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSource.java index 89ccdc0f2..2b1804a91 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSource.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSource.java @@ -1,18 +1,17 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.sahara.DataSource; -import org.openstack4j.model.sahara.DataSourceCredentials; -import org.openstack4j.model.sahara.builder.DataSourceBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.DataSource; +import org.openstack4j.model.sahara.DataSourceCredentials; +import org.openstack4j.model.sahara.builder.DataSourceBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; /** * For mapping JSON response to/from java objects @@ -21,7 +20,7 @@ * @author siwat.pru@outlook.com */ @JsonRootName("data_source") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaDataSource implements DataSource { private static final long serialVersionUID = 1L; @@ -111,8 +110,8 @@ public String getName() { } /** - * {@inheritDoc} - */ + * {@inheritDoc} + */ @Override public DataSourceCredentials getCredentials() { return credentials; @@ -121,15 +120,15 @@ public DataSourceCredentials getCredentials() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("description", description) - .add("url", url) - .add("tenant_id", tenantId) - .add("created_at", createdAt) - .add("updated_at", updatedAt) - .add("type", type) - .add("id",id) - .add("name", name) - .toString(); + .add("description", description) + .add("url", url) + .add("tenant_id", tenantId) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("type", type) + .add("id", id) + .add("name", name) + .toString(); } public static class DataSources extends ListResult { @@ -149,14 +148,14 @@ public List value() { */ @Override public DataSourceBuilder toBuilder() { - return new ConcreteDataSourceBuilder(this); + return new ConcreteDataSourceBuilder(this); } /** * @return the data source Builder */ public static DataSourceBuilder builder() { - return new ConcreteDataSourceBuilder(); + return new ConcreteDataSourceBuilder(); } public static class ConcreteDataSourceBuilder implements DataSourceBuilder { diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceCredentials.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceCredentials.java index f37dfbe6e..6623894b6 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceCredentials.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceCredentials.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.sahara.domain; -import org.openstack4j.model.sahara.DataSourceCredentials; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.DataSourceCredentials; /** * For mapping JSON response to/from java objects @@ -13,7 +12,7 @@ * @author siwat.pru@outlook.com */ @JsonRootName("credentials") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaDataSourceCredentials implements DataSourceCredentials { private static final long serialVersionUID = 1L; @@ -45,9 +44,9 @@ public String getPassword() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("password", password) - .add("user", user) - .toString(); + .add("password", password) + .add("user", user) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceUnwrapped.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceUnwrapped.java index 7dc795644..f9c937fe2 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceUnwrapped.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaDataSourceUnwrapped.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.sahara.domain; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.DataSource; -import com.fasterxml.jackson.annotation.JsonUnwrapped; - /** * An OpenStack Sahara - * Unwrap the root name of Data Source when serialized into json request - * + * Unwrap the root name of Data Source when serialized into json request + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ @@ -16,7 +15,7 @@ public class SaharaDataSourceUnwrapped implements ModelEntity { private static final long serialVersionUID = 1L; - + @JsonUnwrapped //@JsonProperty("data_source") private DataSource dataSource; diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaImage.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaImage.java index 5d8b750b2..2b4f1a63b 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaImage.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaImage.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.sahara.Image; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.Image; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; +import java.util.Map; /** * A Sahara image @@ -19,151 +18,151 @@ @JsonRootName("image") public class SaharaImage implements Image { - private static final long serialVersionUID = 1L; - - private Status status; - private String username; - private Date updated; - @JsonProperty("OS-EXT-IMG-SIZE:size") - private long size; - private String name; - private Date created; - private List tags; - private int minDisk; - private int progress; - private int minRam; - @JsonProperty("metadata") - private Map metadata; - private String id; - private String description; - - /** - * {@inheritDoc} - */ - @Override - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUsername() { - return username; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdated() { - return updated; - } - - /** - * {@inheritDoc} - */ - @Override - public long getSize() { - return size; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreated() { - return created; - } - - /** - * {@inheritDoc} - */ - @Override - public List getTags() { - return tags; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMinDisk() { - return minDisk; - } - - /** - * {@inheritDoc} - */ - @Override - public int getProgress() { - return progress; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMinRam() { - return minRam; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getMetaData() { - return metadata; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("status", status).add("description", description).add("username", username) - .add("progress", progress).add("size", size).add("minRam", minRam) - .add("minDisk", minDisk).add("created", created).add("updated", updated) - .add("metadata", metadata).add("tags", tags).addValue("\n") - .toString(); - } - - public static class SaharaImages extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("images") - private List images; - - public List value() { - return images; - } - - } + private static final long serialVersionUID = 1L; + + private Status status; + private String username; + private Date updated; + @JsonProperty("OS-EXT-IMG-SIZE:size") + private long size; + private String name; + private Date created; + private List tags; + private int minDisk; + private int progress; + private int minRam; + @JsonProperty("metadata") + private Map metadata; + private String id; + private String description; + + /** + * {@inheritDoc} + */ + @Override + public Status getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUsername() { + return username; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdated() { + return updated; + } + + /** + * {@inheritDoc} + */ + @Override + public long getSize() { + return size; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreated() { + return created; + } + + /** + * {@inheritDoc} + */ + @Override + public List getTags() { + return tags; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMinDisk() { + return minDisk; + } + + /** + * {@inheritDoc} + */ + @Override + public int getProgress() { + return progress; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMinRam() { + return minRam; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getMetaData() { + return metadata; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("status", status).add("description", description).add("username", username) + .add("progress", progress).add("size", size).add("minRam", minRam) + .add("minDisk", minDisk).add("created", created).add("updated", updated) + .add("metadata", metadata).add("tags", tags).addValue("\n") + .toString(); + } + + public static class SaharaImages extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("images") + private List images; + + public List value() { + return images; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaInstance.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaInstance.java index 49e1cf214..8a2e59dd8 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaInstance.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaInstance.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.sahara.Instance; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.Instance; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; /** * For mapping JSON response to java objects @@ -18,116 +17,116 @@ */ //@JsonRootName("instance") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaInstance implements Instance { - private static final long serialVersionUID = 1L; - - @JsonProperty("instance_name") - private String name; - @JsonProperty("created_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date createdAt; - @JsonProperty("updated_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date updatedAt; - @JsonProperty("instance_id") - private String instanceId; // Nova instance ID - @JsonProperty("management_ip") - private String managementIp; - private List volumes; - @JsonProperty("internal_ip") - private String internalIp; - @JsonProperty("id") // Sahara instance ID - private String id; - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; + private static final long serialVersionUID = 1L; + + @JsonProperty("instance_name") + private String name; + @JsonProperty("created_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date createdAt; + @JsonProperty("updated_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date updatedAt; + @JsonProperty("instance_id") + private String instanceId; // Nova instance ID + @JsonProperty("management_ip") + private String managementIp; + private List volumes; + @JsonProperty("internal_ip") + private String internalIp; + @JsonProperty("id") // Sahara instance ID + private String id; + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedAt() { + return createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public String getInstanceId() { + return instanceId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getManagementIp() { + return managementIp; + } + + /** + * {@inheritDoc} + */ + @Override + public List getVolumes() { + return volumes; + } + + /** + * {@inheritDoc} + */ + @Override + public String getInternalIp() { + return internalIp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("instance_name", name) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("instance_id", instanceId) + .add("management_ip", managementIp) + .add("volumes", volumes) + .add("internal_ip", internalIp) + .add("id", id) + .toString(); + } + + public static class Instances extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("instances") + private List instances; + + public List value() { + return instances; } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreatedAt() { - return createdAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public String getInstanceId() { - return instanceId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getManagementIp() { - return managementIp; - } - - /** - * {@inheritDoc} - */ - @Override - public List getVolumes() { - return volumes; - } - - /** - * {@inheritDoc} - */ - @Override - public String getInternalIp() { - return internalIp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("instance_name",name) - .add("created_at", createdAt) - .add("updated_at", updatedAt) - .add("instance_id", instanceId) - .add("management_ip", managementIp) - .add("volumes", volumes) - .add("internal_ip", internalIp) - .add("id", id) - .toString(); - } - - public static class Instances extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("instances") - private List instances; - - public List value() { - return instances; - } - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJob.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJob.java index 47a57f993..b5415205a 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJob.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJob.java @@ -1,19 +1,18 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.sahara.Job; -import org.openstack4j.model.sahara.JobBinary; -import org.openstack4j.model.sahara.builder.JobBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; +import org.openstack4j.model.sahara.Job; +import org.openstack4j.model.sahara.JobBinary; +import org.openstack4j.model.sahara.builder.JobBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; /** * For mapping JSON response to/from java objects @@ -23,7 +22,7 @@ */ @JsonRootName("job") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaJob implements Job { private static final long serialVersionUID = 1L; @@ -145,17 +144,17 @@ public List getLibs() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("description", description) - .add("url", url) - .add("tenant_id", tenantId) - .add("created_at", createdAt) - .add("updated_at", updatedAt) - .add("id",id) - .add("name", name) - .add("mains", mains) - .add("libs", libs) - .add("type", type) - .toString(); + .add("description", description) + .add("url", url) + .add("tenant_id", tenantId) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("id", id) + .add("name", name) + .add("mains", mains) + .add("libs", libs) + .add("type", type) + .toString(); } public static class Jobs extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinary.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinary.java index 16913e8fe..3aa753aaa 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinary.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinary.java @@ -1,18 +1,17 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.sahara.JobBinary; -import org.openstack4j.model.sahara.JobBinaryCredentials; -import org.openstack4j.model.sahara.builder.JobBinaryBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.JobBinary; +import org.openstack4j.model.sahara.JobBinaryCredentials; +import org.openstack4j.model.sahara.builder.JobBinaryBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; /** * For mapping JSON response to/from java objects @@ -22,7 +21,7 @@ */ @JsonRootName("job_binary") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaJobBinary implements JobBinary { private static final long serialVersionUID = 1L; @@ -113,14 +112,14 @@ public JobBinaryCredentials getCredentials() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("description", description) - .add("url", url) - .add("tenant_id", tenantId) - .add("created_at", createdAt) - .add("updated_at", updatedAt) - .add("id",id) - .add("name", name) - .toString(); + .add("description", description) + .add("url", url) + .add("tenant_id", tenantId) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("id", id) + .add("name", name) + .toString(); } public static class JobBinaries extends ListResult { @@ -140,14 +139,14 @@ public List value() { */ @Override public JobBinaryBuilder toBuilder() { - return new ConcreteJobBinaryBuilder(this); + return new ConcreteJobBinaryBuilder(this); } /** * @return the job binary Builder */ public static JobBinaryBuilder builder() { - return new ConcreteJobBinaryBuilder(); + return new ConcreteJobBinaryBuilder(); } public static class ConcreteJobBinaryBuilder implements JobBinaryBuilder { diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryCredentials.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryCredentials.java index 3db7106ac..1d3b73f51 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryCredentials.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryCredentials.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.sahara.domain; -import org.openstack4j.model.sahara.JobBinaryCredentials; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.JobBinaryCredentials; /** * For mapping JSON response to/from java objects @@ -14,7 +13,7 @@ */ @JsonRootName("extra") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaJobBinaryCredentials implements JobBinaryCredentials { private static final long serialVersionUID = 1L; @@ -46,9 +45,9 @@ public String getPassword() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("password", password) - .add("user", user) - .toString(); + .add("password", password) + .add("user", user) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryInternal.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryInternal.java index 598f2593e..6fa9f1ddd 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryInternal.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryInternal.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.sahara.JobBinaryInternal; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.JobBinaryInternal; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; /** * For mapping JSON response to/from java objects @@ -20,7 +19,7 @@ */ @JsonRootName("job_binary_internal") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaJobBinaryInternal implements JobBinaryInternal { private static final long serialVersionUID = 1L; @@ -91,13 +90,13 @@ public String getId() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name) - .add("tenant_id", tenantId) - .add("created_at", createdAt) - .add("updated_at", updatedAt) - .add("id",id) - .add("datasize", dataSize) - .toString(); + .add("name", name) + .add("tenant_id", tenantId) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("id", id) + .add("datasize", dataSize) + .toString(); } public static class JobBinaryInternals extends ListResult { diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryUnwrapped.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryUnwrapped.java index 367700997..13bdf9776 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryUnwrapped.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobBinaryUnwrapped.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.sahara.domain; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.JobBinary; -import com.fasterxml.jackson.annotation.JsonUnwrapped; - /** * An OpenStack Sahara * Unwrap the root name of Job Binary when serialized into json request @@ -14,8 +13,8 @@ */ public class SaharaJobBinaryUnwrapped implements ModelEntity { - private static final long serialVersionUID = 1L; - + private static final long serialVersionUID = 1L; + @JsonUnwrapped //@JsonProperty("job_binary") private JobBinary jobBinary; diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfig.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfig.java index d3724278d..ff642193c 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfig.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfig.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.sahara.JobConfig; -import org.openstack4j.model.sahara.builder.JobConfigBuilder; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; +import org.openstack4j.model.sahara.JobConfig; +import org.openstack4j.model.sahara.builder.JobConfigBuilder; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * For mapping JSON response to/from java objects @@ -56,10 +55,10 @@ public Map getParams() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("configs", configs) - .add("args", args) - .add("params", params) - .toString(); + .add("configs", configs) + .add("args", args) + .add("params", params) + .toString(); } /** diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHint.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHint.java index 98a2d438a..8f5adb16f 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHint.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHint.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.List; - -import org.openstack4j.model.sahara.JobConfigHint; -import org.openstack4j.model.sahara.JobConfigHintConfig; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.JobConfigHint; +import org.openstack4j.model.sahara.JobConfigHintConfig; + +import java.util.List; /** * For mapping JSON response to/from java objects @@ -18,7 +17,7 @@ */ @JsonRootName("job_config") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaJobConfigHint implements JobConfigHint { private static final long serialVersionUID = 1L; @@ -46,9 +45,9 @@ public List getArgs() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("configs", configs) - .add("args", args) - .toString(); + .add("configs", configs) + .add("args", args) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHintConfig.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHintConfig.java index a9744de22..b5dda53e7 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHintConfig.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobConfigHintConfig.java @@ -1,9 +1,8 @@ package org.openstack4j.openstack.sahara.domain; -import org.openstack4j.model.sahara.JobConfigHintConfig; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.JobConfigHintConfig; /** * For mapping JSON response to/from java objects @@ -48,10 +47,10 @@ public String getDescription() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name) - .add("value", value) - .add("description", description) - .toString(); + .add("name", name) + .add("value", value) + .add("description", description) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecution.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecution.java index fc875caba..8805f3b1d 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecution.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecution.java @@ -1,19 +1,18 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.sahara.JobConfig; import org.openstack4j.model.sahara.JobExecution; import org.openstack4j.model.sahara.JobExecutionInfo; import org.openstack4j.model.sahara.builder.JobExecutionBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.Date; +import java.util.List; /** * For mapping JSON response to/from java objects @@ -23,7 +22,7 @@ */ @JsonRootName("job_execution") -@JsonIgnoreProperties(value={"jobIdForExecution"}, ignoreUnknown=true) +@JsonIgnoreProperties(value = {"jobIdForExecution"}, ignoreUnknown = true) public class SaharaJobExecution implements JobExecution { private static final long serialVersionUID = 1L; @@ -196,22 +195,22 @@ public JobExecutionInfo getInfo() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("cluster_id", clusterId) - .add("input_id", inputId) - .add("output_id", outputId) - .add("job_configs", jobConfigs) - .add("job_id", jobId) - .add("tenant_id", tenantId) - .add("start_time", startTime) - .add("end_time", endTime) - .add("created_at", createdAt) - .add("updated_at", updatedAt) - .add("oozie_job_id", oozieJobId) - .add("return_code", returnCode) - .add("progress", progress) - .add("info", info) - .add("id", id) - .toString(); + .add("cluster_id", clusterId) + .add("input_id", inputId) + .add("output_id", outputId) + .add("job_configs", jobConfigs) + .add("job_id", jobId) + .add("tenant_id", tenantId) + .add("start_time", startTime) + .add("end_time", endTime) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("oozie_job_id", oozieJobId) + .add("return_code", returnCode) + .add("progress", progress) + .add("info", info) + .add("id", id) + .toString(); } public static class JobExecutions extends ListResult { @@ -241,7 +240,7 @@ public static JobExecutionBuilder builder() { return new concreteJobExecutionBuilder(); } - public static class concreteJobExecutionBuilder implements JobExecutionBuilder { + public static class concreteJobExecutionBuilder implements JobExecutionBuilder { SaharaJobExecution m; diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionAction.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionAction.java index 83286f85f..ff203c94b 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionAction.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionAction.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; - -import org.openstack4j.model.sahara.JobExecutionAction; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.JobExecutionAction; + +import java.util.Date; /** * For mapping JSON response to/from java objects @@ -16,7 +15,7 @@ * @author siwat.pru@outlook.com */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaJobExecutionAction implements JobExecutionAction { private static final long serialVersionUID = 1L; @@ -167,26 +166,26 @@ public String getName() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("status", status) - .add("retries", retries) - .add("transition", transition) - .add("stats", stats) - .add("startTime", startTime) - .add("cred", cred) - .add("errorMessage", errorMessage) - .add("externalId", externalId) - .add("errorCode", errorCode) - .add("consoleUrl", consoleUrl) - .add("toString", toString) - .add("externalStatus", externalStatus) - .add("conf", conf) - .add("type", type) - .add("trackerUri", trackerUri) - .add("externalChildIDs", externalChildIds) - .add("endTime", endTime) - .add("data", data) - .add("id", id) - .add("name", name) - .toString(); + .add("status", status) + .add("retries", retries) + .add("transition", transition) + .add("stats", stats) + .add("startTime", startTime) + .add("cred", cred) + .add("errorMessage", errorMessage) + .add("externalId", externalId) + .add("errorCode", errorCode) + .add("consoleUrl", consoleUrl) + .add("toString", toString) + .add("externalStatus", externalStatus) + .add("conf", conf) + .add("type", type) + .add("trackerUri", trackerUri) + .add("externalChildIDs", externalChildIds) + .add("endTime", endTime) + .add("data", data) + .add("id", id) + .add("name", name) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionInfo.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionInfo.java index 9de38b88d..02c016b45 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionInfo.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionInfo.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.sahara.JobExecutionAction; -import org.openstack4j.model.sahara.JobExecutionInfo; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.JobExecutionAction; +import org.openstack4j.model.sahara.JobExecutionInfo; + +import java.util.Date; +import java.util.List; /** * For mapping JSON response to/from java objects @@ -18,7 +17,7 @@ * @author siwat.pru@outlook.com */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaJobExecutionInfo implements JobExecutionInfo { private static final long serialVersionUID = 1L; @@ -157,24 +156,24 @@ public String getId() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("status", status) - .add("externalId", externalId) - .add("run", run) - .add("startTime", startTime) - .add("appName", appName) - .add("lastModTime", lastModTime) - .add("actions", actions) - .add("acl", acl) - .add("consoleUrl", consoleUrl) - .add("appPath", appPath) - .add("toString", toString) - .add("user", user) - .add("conf", conf) - .add("parentId", parentId) - .add("createdTime", createdTime) - .add("group", group) - .add("group", group) - .add("id", id) - .toString(); + .add("status", status) + .add("externalId", externalId) + .add("run", run) + .add("startTime", startTime) + .add("appName", appName) + .add("lastModTime", lastModTime) + .add("actions", actions) + .add("acl", acl) + .add("consoleUrl", consoleUrl) + .add("appPath", appPath) + .add("toString", toString) + .add("user", user) + .add("conf", conf) + .add("parentId", parentId) + .add("createdTime", createdTime) + .add("group", group) + .add("group", group) + .add("id", id) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionUnwrapped.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionUnwrapped.java index e3aacf530..c08ff4307 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionUnwrapped.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobExecutionUnwrapped.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.sahara.domain; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.JobExecution; -import com.fasterxml.jackson.annotation.JsonUnwrapped; - /** * An OpenStack Sahara * Unwrap the root name of Job Execution when serialized into json request diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobUnwrapped.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobUnwrapped.java index 2bb04f6be..d48ff868b 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobUnwrapped.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaJobUnwrapped.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.sahara.domain; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.Job; -import com.fasterxml.jackson.annotation.JsonUnwrapped; - /** * An OpenStack Sahara * Unwrap the root name of Job when serialized into json request diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroup.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroup.java index 693dc2793..c5380805c 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroup.java @@ -1,21 +1,20 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; import org.openstack4j.model.sahara.Instance; import org.openstack4j.model.sahara.NodeGroup; import org.openstack4j.model.sahara.ServiceConfig; import org.openstack4j.model.sahara.builder.NodeGroupBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Lists; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * An OpenStack Sahara @@ -25,316 +24,316 @@ @JsonRootName("node_group") public class SaharaNodeGroup implements NodeGroup { - private static final long serialVersionUID = 1L; - - private String name; - private Integer count; - @JsonProperty("node_group_template_id") - private String nodeGroupTemplateId; - @JsonProperty("created_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date createdAt; - @JsonProperty("updated_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date updatedAt; - @JsonProperty("image_id") - private String imageId; - @JsonProperty("volumes_size") - private Integer volumesSize; - @JsonProperty("volumes_per_node") - private Integer volumesPerNode; - @JsonProperty("floating_ip_pool") - private String floatingNetworkId; - @JsonProperty("flavor_id") - private String flavorId; - @JsonProperty("volume_mount_prefix") - private String volumeMountPrefix; - @JsonProperty("auto_security_group") - private Boolean autoSecurityGroup; - - @JsonProperty("security_groups") - private List securityGroups; - - @JsonProperty("node_processes") - private List nodeProcesses; - - @JsonProperty("node_configs") - private Map serviceConfigs; - - - @JsonProperty("instances") - private List instances; // only in cluster json response - - /** - * {@inheritDoc} - */ - @Override - public NodeGroupBuilder toBuilder() { - return new ConcreteNodeGroupBuilder(this); - } - - /** - * @return the node group Builder - */ - public static NodeGroupBuilder builder() { - return new ConcreteNodeGroupBuilder(); - } - - /** - * {@inheritDoc} - */ + private static final long serialVersionUID = 1L; + + private String name; + private Integer count; + @JsonProperty("node_group_template_id") + private String nodeGroupTemplateId; + @JsonProperty("created_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date createdAt; + @JsonProperty("updated_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date updatedAt; + @JsonProperty("image_id") + private String imageId; + @JsonProperty("volumes_size") + private Integer volumesSize; + @JsonProperty("volumes_per_node") + private Integer volumesPerNode; + @JsonProperty("floating_ip_pool") + private String floatingNetworkId; + @JsonProperty("flavor_id") + private String flavorId; + @JsonProperty("volume_mount_prefix") + private String volumeMountPrefix; + @JsonProperty("auto_security_group") + private Boolean autoSecurityGroup; + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonProperty("node_processes") + private List nodeProcesses; + + @JsonProperty("node_configs") + private Map serviceConfigs; + + + @JsonProperty("instances") + private List instances; // only in cluster json response + + /** + * {@inheritDoc} + */ + @Override + public NodeGroupBuilder toBuilder() { + return new ConcreteNodeGroupBuilder(this); + } + + /** + * @return the node group Builder + */ + public static NodeGroupBuilder builder() { + return new ConcreteNodeGroupBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getCount() { + return count; + } + + /** + * {@inheritDoc} + */ + @Override + public String getNodeGroupTemplateId() { + return nodeGroupTemplateId; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedAt() { + return createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFloatingNetworkId() { + return floatingNetworkId; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getVolumesPerNode() { + return volumesPerNode; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getVolumesSize() { + return volumesSize; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVolumeMountPrefix() { + return volumeMountPrefix; + } + + /** + * {@inheritDoc} + */ + @Override + public String getImageId() { + return imageId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFlavorId() { + return flavorId; + } + + /** + * {@inheritDoc} + */ + @Override + public List getSecurityGroups() { + return securityGroups; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean isAutoSecurityGroup() { + return autoSecurityGroup; + } + + /** + * {@inheritDoc} + */ + @Override + public List getNodeProcesses() { + return nodeProcesses; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getServiceConfigs() { + return serviceConfigs; + } + + /** + * {@inheritDoc} + */ + @Override + public List getInstances() { + return instances; + } + + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", name) + .add("count", count) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("image_id", imageId) + .add("volumes_size", volumesSize) + .add("volumes_per_node", volumesPerNode) + .add("float_ip_pool", floatingNetworkId) + .add("flavor_id", flavorId) + .add("volume_mount_prefix", volumeMountPrefix) + .add("node_group_template_id", imageId) + .add("security_groups", securityGroups) + .add("auto_security_group", autoSecurityGroup) + .add("node_processes", nodeProcesses) + .add("node_configs", serviceConfigs) + .add("instances", instances) + .toString(); + } + + public static class NodeGroups extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("node_groups") + private List nodeGroups; + @Override - public String getName() { - return name; + protected List value() { + return nodeGroups; } + } - /** - * {@inheritDoc} - */ - @Override - public Integer getCount() { - return count; - } - - /** - * {@inheritDoc} - */ - @Override - public String getNodeGroupTemplateId() { - return nodeGroupTemplateId; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreatedAt() { - return createdAt; + public static class ConcreteNodeGroupBuilder implements NodeGroupBuilder { + + private SaharaNodeGroup m; + + ConcreteNodeGroupBuilder() { + this(new SaharaNodeGroup()); } - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return updatedAt; + ConcreteNodeGroupBuilder(SaharaNodeGroup m) { + this.m = m; } - /** - * {@inheritDoc} - */ @Override - public String getFloatingNetworkId() { - return floatingNetworkId; + public NodeGroup build() { + return m; } - /** - * {@inheritDoc} - */ @Override - public Integer getVolumesPerNode() { - return volumesPerNode; + public NodeGroupBuilder from(NodeGroup in) { + m = (SaharaNodeGroup) in; + return this; } - /** - * {@inheritDoc} - */ @Override - public Integer getVolumesSize() { - return volumesSize; + public NodeGroupBuilder name(String name) { + m.name = name; + return this; } - /** - * {@inheritDoc} - */ @Override - public String getVolumeMountPrefix() { - return volumeMountPrefix; + public NodeGroupBuilder nodeGroupTemplateId(String templateId) { + m.nodeGroupTemplateId = templateId; + return this; } - /** - * {@inheritDoc} - */ @Override - public String getImageId() { - return imageId; + public NodeGroupBuilder count(int count) { + m.count = count; + return this; } - /** - * {@inheritDoc} - */ @Override - public String getFlavorId() { - return flavorId; + public NodeGroupBuilder floatingIpPool(String networkId) { + m.floatingNetworkId = networkId; + return this; } - /** - * {@inheritDoc} - */ @Override - public List getSecurityGroups() { - return securityGroups; + public NodeGroupBuilder flavor(String flavorId) { + m.flavorId = flavorId; + return this; } - /** - * {@inheritDoc} - */ @Override - public Boolean isAutoSecurityGroup() { - return autoSecurityGroup; + public NodeGroupBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup) { + m.autoSecurityGroup = isAutoSecurityGroup; + return this; } - /** - * {@inheritDoc} - */ @Override - public List getNodeProcesses() { - return nodeProcesses; + public NodeGroupBuilder addSecurityGroup(String id) { + if (id != null && !id.isEmpty()) { + if (m.securityGroups == null) + m.securityGroups = Lists.newArrayList(); + m.securityGroups.add(id); + } + return this; } - /** - * {@inheritDoc} - */ @Override - public Map getServiceConfigs() { - return serviceConfigs; + public NodeGroupBuilder addNodeProcess(String name) { + if (name != null && !name.isEmpty()) { + if (m.nodeProcesses == null) + m.nodeProcesses = Lists.newArrayList(); + m.nodeProcesses.add(name); + } + return this; } - /** - * {@inheritDoc} - */ @Override - public List getInstances() { - return instances; + public NodeGroupBuilder addServiceConfig(String name, ServiceConfig config) { + if (name != null && !name.isEmpty()) { + if (m.serviceConfigs == null) + m.serviceConfigs = new HashMap(); + m.serviceConfigs.put(name, (SaharaServiceConfig) config); + } + return this; } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name) - .add("count", count) - .add("created_at",createdAt) - .add("updated_at",updatedAt) - .add("image_id", imageId) - .add("volumes_size", volumesSize) - .add("volumes_per_node", volumesPerNode) - .add("float_ip_pool",floatingNetworkId) - .add("flavor_id",flavorId) - .add("volume_mount_prefix",volumeMountPrefix) - .add("node_group_template_id", imageId) - .add("security_groups",securityGroups) - .add("auto_security_group",autoSecurityGroup) - .add("node_processes",nodeProcesses) - .add("node_configs",serviceConfigs) - .add("instances",instances) - .toString(); - } - - public static class NodeGroups extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("node_groups") - private List nodeGroups; - - @Override - protected List value() { - return nodeGroups; - } - } - - public static class ConcreteNodeGroupBuilder implements NodeGroupBuilder { - - private SaharaNodeGroup m; - - ConcreteNodeGroupBuilder() { - this(new SaharaNodeGroup()); - } - - ConcreteNodeGroupBuilder(SaharaNodeGroup m) { - this.m = m; - } - - @Override - public NodeGroup build() { - return m; - } - - @Override - public NodeGroupBuilder from(NodeGroup in) { - m = (SaharaNodeGroup) in; - return this; - } - - @Override - public NodeGroupBuilder name(String name) { - m.name = name; - return this; - } - - @Override - public NodeGroupBuilder nodeGroupTemplateId(String templateId) { - m.nodeGroupTemplateId = templateId; - return this; - } - - @Override - public NodeGroupBuilder count(int count) { - m.count = count; - return this; - } - - @Override - public NodeGroupBuilder floatingIpPool(String networkId) { - m.floatingNetworkId = networkId; - return this; - } - - @Override - public NodeGroupBuilder flavor(String flavorId) { - m.flavorId = flavorId; - return this; - } - - @Override - public NodeGroupBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup) { - m.autoSecurityGroup = isAutoSecurityGroup; - return this; - } - - @Override - public NodeGroupBuilder addSecurityGroup(String id) { - if (id != null && !id.isEmpty()) { - if (m.securityGroups == null) - m.securityGroups = Lists.newArrayList(); - m.securityGroups.add(id); - } - return this; - } - - @Override - public NodeGroupBuilder addNodeProcess(String name) { - if (name != null && !name.isEmpty()) { - if (m.nodeProcesses == null) - m.nodeProcesses = Lists.newArrayList(); - m.nodeProcesses.add(name); - } - return this; - } - - @Override - public NodeGroupBuilder addServiceConfig(String name, ServiceConfig config) { - if (name != null && !name.isEmpty()) { - if (m.serviceConfigs == null) - m.serviceConfigs = new HashMap(); - m.serviceConfigs.put(name,(SaharaServiceConfig) config); - } - return this; - } - - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplate.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplate.java index b2cca4b27..632b39d54 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplate.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplate.java @@ -1,20 +1,19 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.sahara.NodeGroupTemplate; -import org.openstack4j.model.sahara.ServiceConfig; -import org.openstack4j.model.sahara.builder.NodeGroupTemplateBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; +import org.openstack4j.model.sahara.NodeGroupTemplate; +import org.openstack4j.model.sahara.ServiceConfig; +import org.openstack4j.model.sahara.builder.NodeGroupTemplateBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * An OpenStack Sahara @@ -24,340 +23,340 @@ @JsonRootName("node_group_template") public class SaharaNodeGroupTemplate implements NodeGroupTemplate { - private static final long serialVersionUID = 1L; - - private String id; - private String name; - private String description; - @JsonProperty("hadoop_version") - private String hadoopVersion; - @JsonProperty("tenant_id") - private String tenantId; - @JsonProperty("created_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date createdAt; - @JsonProperty("updated_at") - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") - private Date updatedAt; - @JsonProperty("plugin_name") - private String pluginName; - @JsonProperty("image_id") - private String imageId; - @JsonProperty("volumes_size") - private Integer volumesSize; - @JsonProperty("volumes_per_node") - private Integer volumesPerNode; - @JsonProperty("floating_ip_pool") - private String floatingNetworkId; - @JsonProperty("flavor_id") - private String flavorId; - @JsonProperty("volume_mount_prefix") - private String volumeMountPrefix; - @JsonProperty("auto_security_group") - private Boolean autoSecurityGroup; - - @JsonProperty("security_groups") - private List securityGroups; - - @JsonProperty("node_processes") - private List nodeProcesses; - - @JsonProperty("node_configs") - private Map serviceConfigs; - - /** - * {@inheritDoc} - */ - @Override - public NodeGroupTemplateBuilder toBuilder() { - return new ConcreteNodeGroupTemplateBuilder(this); - } - - /** - * @return the node group template Builder - */ - public static NodeGroupTemplateBuilder builder() { - return new ConcreteNodeGroupTemplateBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String getHadoopVersion() { - return hadoopVersion; - } - - /** - * {@inheritDoc} - */ - @Override - public String getPluginName() { - return pluginName; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreatedAt() { - return createdAt; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * {@inheritDoc} - */ + private static final long serialVersionUID = 1L; + + private String id; + private String name; + private String description; + @JsonProperty("hadoop_version") + private String hadoopVersion; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("created_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date createdAt; + @JsonProperty("updated_at") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") + private Date updatedAt; + @JsonProperty("plugin_name") + private String pluginName; + @JsonProperty("image_id") + private String imageId; + @JsonProperty("volumes_size") + private Integer volumesSize; + @JsonProperty("volumes_per_node") + private Integer volumesPerNode; + @JsonProperty("floating_ip_pool") + private String floatingNetworkId; + @JsonProperty("flavor_id") + private String flavorId; + @JsonProperty("volume_mount_prefix") + private String volumeMountPrefix; + @JsonProperty("auto_security_group") + private Boolean autoSecurityGroup; + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonProperty("node_processes") + private List nodeProcesses; + + @JsonProperty("node_configs") + private Map serviceConfigs; + + /** + * {@inheritDoc} + */ + @Override + public NodeGroupTemplateBuilder toBuilder() { + return new ConcreteNodeGroupTemplateBuilder(this); + } + + /** + * @return the node group template Builder + */ + public static NodeGroupTemplateBuilder builder() { + return new ConcreteNodeGroupTemplateBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String getHadoopVersion() { + return hadoopVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public String getPluginName() { + return pluginName; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedAt() { + return createdAt; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFloatingNetworkId() { + return floatingNetworkId; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getVolumesPerNode() { + return volumesPerNode; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getVolumesSize() { + return volumesSize; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVolumeMountPrefix() { + return volumeMountPrefix; + } + + /** + * {@inheritDoc} + */ + @Override + public String getImageId() { + return imageId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFlavorId() { + return flavorId; + } + + /** + * {@inheritDoc} + */ + @Override + public List getSecurityGroups() { + return securityGroups; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean isAutoSecurityGroup() { + return autoSecurityGroup; + } + + /** + * {@inheritDoc} + */ + @Override + public List getNodeProcesses() { + return nodeProcesses; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getServiceConfigs() { + return serviceConfigs; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id) + .add("name", name) + .add("description", description) + .add("hadoop_version", hadoopVersion) + .add("tenant_id", tenantId) + .add("created_at", createdAt) + .add("updated_at", updatedAt) + .add("plugin_name", pluginName) + .add("image_id", imageId) + .add("volumes_size", volumesSize) + .add("volumes_per_node", volumesPerNode) + .add("float_ip_pool", floatingNetworkId) + .add("flavor_id", flavorId) + .add("volume_mount_prefix", volumeMountPrefix) + .add("security_groups", securityGroups) + .add("auto_security_group", autoSecurityGroup) + .add("node_processes", nodeProcesses) + .add("node_configs", serviceConfigs) + .toString(); + } + + public static class NodeGroupTemplates extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("node_group_templates") + private List nodeGroupTemplates; + + @Override + protected List value() { + return nodeGroupTemplates; + } + } + + public static class ConcreteNodeGroupTemplateBuilder implements NodeGroupTemplateBuilder { + + private SaharaNodeGroupTemplate m; + + ConcreteNodeGroupTemplateBuilder() { + this(new SaharaNodeGroupTemplate()); + } + + ConcreteNodeGroupTemplateBuilder(SaharaNodeGroupTemplate m) { + this.m = m; + } + + @Override + public NodeGroupTemplate build() { + return m; + } + + @Override + public NodeGroupTemplateBuilder from(NodeGroupTemplate in) { + m = (SaharaNodeGroupTemplate) in; + return this; + } + + @Override + public NodeGroupTemplateBuilder name(String name) { + m.name = name; + return this; + } + @Override - public String getFloatingNetworkId() { - return floatingNetworkId; + public NodeGroupTemplateBuilder description(String description) { + m.description = description; + return this; } - /** - * {@inheritDoc} - */ @Override - public Integer getVolumesPerNode() { - return volumesPerNode; + public NodeGroupTemplateBuilder hadoopVersion(String hadoopVersion) { + m.hadoopVersion = hadoopVersion; + return this; } - /** - * {@inheritDoc} - */ @Override - public Integer getVolumesSize() { - return volumesSize; + public NodeGroupTemplateBuilder pluginName(String pluginName) { + m.pluginName = pluginName; + return this; } - /** - * {@inheritDoc} - */ @Override - public String getVolumeMountPrefix() { - return volumeMountPrefix; + public NodeGroupTemplateBuilder floatingIpPool(String networkId) { + m.floatingNetworkId = networkId; + return this; } - /** - * {@inheritDoc} - */ @Override - public String getImageId() { - return imageId; + public NodeGroupTemplateBuilder flavor(String flavorId) { + m.flavorId = flavorId; + return this; } - /** - * {@inheritDoc} - */ @Override - public String getFlavorId() { - return flavorId; + public NodeGroupTemplateBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup) { + m.autoSecurityGroup = isAutoSecurityGroup; + return this; } - /** - * {@inheritDoc} - */ @Override - public List getSecurityGroups() { - return securityGroups; + public NodeGroupTemplateBuilder addSecurityGroup(String id) { + if (id != null && !id.isEmpty()) { + if (m.securityGroups == null) + m.securityGroups = Lists.newArrayList(); + m.securityGroups.add(id); + } + return this; } - /** - * {@inheritDoc} - */ @Override - public Boolean isAutoSecurityGroup() { - return autoSecurityGroup; + public NodeGroupTemplateBuilder addNodeProcess(String name) { + if (name != null && !name.isEmpty()) { + if (m.nodeProcesses == null) + m.nodeProcesses = Lists.newArrayList(); + m.nodeProcesses.add(name); + } + return this; } - /** - * {@inheritDoc} - */ @Override - public List getNodeProcesses() { - return nodeProcesses; + public NodeGroupTemplateBuilder addServiceConfig(String name, ServiceConfig config) { + if (name != null && !name.isEmpty()) { + if (m.serviceConfigs == null) + m.serviceConfigs = new HashMap(); + m.serviceConfigs.put(name, (SaharaServiceConfig) config); + } + return this; } - /** - * {@inheritDoc} - */ - @Override - public Map getServiceConfigs() { - return serviceConfigs; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id) - .add("name", name) - .add("description", description) - .add("hadoop_version", hadoopVersion) - .add("tenant_id",tenantId) - .add("created_at",createdAt) - .add("updated_at",updatedAt) - .add("plugin_name",pluginName) - .add("image_id", imageId) - .add("volumes_size", volumesSize) - .add("volumes_per_node", volumesPerNode) - .add("float_ip_pool",floatingNetworkId) - .add("flavor_id",flavorId) - .add("volume_mount_prefix",volumeMountPrefix) - .add("security_groups",securityGroups) - .add("auto_security_group",autoSecurityGroup) - .add("node_processes",nodeProcesses) - .add("node_configs",serviceConfigs) - .toString(); - } - - public static class NodeGroupTemplates extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("node_group_templates") - private List nodeGroupTemplates; - - @Override - protected List value() { - return nodeGroupTemplates; - } - } - - public static class ConcreteNodeGroupTemplateBuilder implements NodeGroupTemplateBuilder { - - private SaharaNodeGroupTemplate m; - - ConcreteNodeGroupTemplateBuilder() { - this(new SaharaNodeGroupTemplate()); - } - - ConcreteNodeGroupTemplateBuilder(SaharaNodeGroupTemplate m) { - this.m = m; - } - - @Override - public NodeGroupTemplate build() { - return m; - } - - @Override - public NodeGroupTemplateBuilder from(NodeGroupTemplate in) { - m = (SaharaNodeGroupTemplate) in; - return this; - } - - @Override - public NodeGroupTemplateBuilder name(String name) { - m.name = name; - return this; - } - - @Override - public NodeGroupTemplateBuilder description(String description) { - m.description = description; - return this; - } - - @Override - public NodeGroupTemplateBuilder hadoopVersion(String hadoopVersion) { - m.hadoopVersion = hadoopVersion; - return this; - } - - @Override - public NodeGroupTemplateBuilder pluginName(String pluginName) { - m.pluginName = pluginName; - return this; - } - - @Override - public NodeGroupTemplateBuilder floatingIpPool(String networkId) { - m.floatingNetworkId = networkId; - return this; - } - - @Override - public NodeGroupTemplateBuilder flavor(String flavorId) { - m.flavorId = flavorId; - return this; - } - - @Override - public NodeGroupTemplateBuilder setAutoSecurityGroup(boolean isAutoSecurityGroup) { - m.autoSecurityGroup = isAutoSecurityGroup; - return this; - } - - @Override - public NodeGroupTemplateBuilder addSecurityGroup(String id) { - if (id != null && !id.isEmpty()) { - if (m.securityGroups == null) - m.securityGroups = Lists.newArrayList(); - m.securityGroups.add(id); - } - return this; - } - - @Override - public NodeGroupTemplateBuilder addNodeProcess(String name) { - if (name != null && !name.isEmpty()) { - if (m.nodeProcesses == null) - m.nodeProcesses = Lists.newArrayList(); - m.nodeProcesses.add(name); - } - return this; - } - - @Override - public NodeGroupTemplateBuilder addServiceConfig(String name, ServiceConfig config) { - if (name != null && !name.isEmpty()) { - if (m.serviceConfigs == null) - m.serviceConfigs = new HashMap(); - m.serviceConfigs.put(name,(SaharaServiceConfig) config); - } - return this; - } - - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplateUnwrapped.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplateUnwrapped.java index 182858e05..92df9da26 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplateUnwrapped.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaNodeGroupTemplateUnwrapped.java @@ -1,30 +1,29 @@ package org.openstack4j.openstack.sahara.domain; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.NodeGroupTemplate; -import com.fasterxml.jackson.annotation.JsonUnwrapped; - /** * An OpenStack Sahara - * Unwrap the root name of NodeGroupTemplate when serialized into json request - * + * Unwrap the root name of NodeGroupTemplate when serialized into json request + * * @author Ekasit Kijsipongse */ public class SaharaNodeGroupTemplateUnwrapped implements ModelEntity { - private static final long serialVersionUID = 1L; - - @JsonUnwrapped - //@JsonProperty("node_group_template") - private NodeGroupTemplate template; + private static final long serialVersionUID = 1L; + + @JsonUnwrapped + //@JsonProperty("node_group_template") + private NodeGroupTemplate template; - public SaharaNodeGroupTemplateUnwrapped(NodeGroupTemplate template) { - this.template = template; - } + public SaharaNodeGroupTemplateUnwrapped(NodeGroupTemplate template) { + this.template = template; + } - public NodeGroupTemplate getTemplate() { // need for serialization - return template; - } + public NodeGroupTemplate getTemplate() { // need for serialization + return template; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaPlugin.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaPlugin.java index 576161a9e..4583bb96e 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaPlugin.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaPlugin.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.sahara.domain; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.sahara.ConfigInfo; -import org.openstack4j.model.sahara.Plugin; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.sahara.ConfigInfo; +import org.openstack4j.model.sahara.Plugin; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; /** * For mapping JSON response to/from java objects @@ -19,7 +18,7 @@ */ @JsonRootName("plugin") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class SaharaPlugin implements Plugin { private static final long serialVersionUID = 1L; @@ -72,7 +71,7 @@ public String getTitle() { * {@inheritDoc} */ @Override - public Map> getServiceProcesses() { + public Map> getServiceProcesses() { return serviceProcesses; } @@ -100,8 +99,8 @@ public String toString() { .add("description", description) .add("versions", versions) .add("required_image_tags", requiredImageTags) - .add("node_processes",serviceProcesses) - .add("configs",configInfos) + .add("node_processes", serviceProcesses) + .add("configs", configInfos) .toString(); } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceConfig.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceConfig.java index a07740c45..00b3d8ae3 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceConfig.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceConfig.java @@ -13,72 +13,72 @@ * @author Ekasit Kijsipongse */ -@JsonIgnoreProperties(ignoreUnknown=true) -public class SaharaServiceConfig extends HashMap implements ServiceConfig { - - public static final long serialVersionUID = 1L; - - /** - * {@inheritDoc} - */ - @Override - public Object get(String name) { - return super.get(name); - } - - /** - * {@inheritDoc} - */ - @Override - public Map getConfigs() { - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServiceConfigBuilder toBuilder() { - return new ConcreteServiceConfigBuilder(this); +@JsonIgnoreProperties(ignoreUnknown = true) +public class SaharaServiceConfig extends HashMap implements ServiceConfig { + + public static final long serialVersionUID = 1L; + + /** + * {@inheritDoc} + */ + @Override + public Object get(String name) { + return super.get(name); + } + + /** + * {@inheritDoc} + */ + @Override + public Map getConfigs() { + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceConfigBuilder toBuilder() { + return new ConcreteServiceConfigBuilder(this); + } + + /** + * {@inheritDoc} + */ + public static ServiceConfigBuilder builder() { + return new ConcreteServiceConfigBuilder(); + } + + + public static class ConcreteServiceConfigBuilder implements ServiceConfigBuilder { + + private SaharaServiceConfig m; + + ConcreteServiceConfigBuilder() { + this(new SaharaServiceConfig()); } - /** - * {@inheritDoc} - */ - public static ServiceConfigBuilder builder() { - return new ConcreteServiceConfigBuilder(); + ConcreteServiceConfigBuilder(SaharaServiceConfig m) { + this.m = m; } + @Override + public ServiceConfigBuilder set(String name, Object value) { + m.put(name, value); + return this; + } - public static class ConcreteServiceConfigBuilder implements ServiceConfigBuilder { - - private SaharaServiceConfig m; - - ConcreteServiceConfigBuilder() { - this(new SaharaServiceConfig()); - } - - ConcreteServiceConfigBuilder(SaharaServiceConfig m) { - this.m = m; - } - - @Override - public ServiceConfigBuilder set(String name, Object value) { - m.put(name,value); - return this; - } - - @Override - public ServiceConfig build() { - return m; - } - - @Override - public ConcreteServiceConfigBuilder from(ServiceConfig in) { - m = (SaharaServiceConfig)in; - return this; - } + @Override + public ServiceConfig build() { + return m; + } + @Override + public ConcreteServiceConfigBuilder from(ServiceConfig in) { + m = (SaharaServiceConfig) in; + return this; } + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceInfo.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceInfo.java index 90c78879c..b28c77e17 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceInfo.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/SaharaServiceInfo.java @@ -12,25 +12,25 @@ * @author ekasit.kijsipongse@nectec.or.th */ -@JsonIgnoreProperties(ignoreUnknown=true) -public class SaharaServiceInfo extends HashMap implements ServiceInfo { - - public static final long serialVersionUID = 1L; - - /** - * {@inheritDoc} - */ - @Override - public String get(String name) { - return super.get(name); - } - - /** - * {@inheritDoc} - */ - @Override - public Map getInfos() { - return this; - } +@JsonIgnoreProperties(ignoreUnknown = true) +public class SaharaServiceInfo extends HashMap implements ServiceInfo { + + public static final long serialVersionUID = 1L; + + /** + * {@inheritDoc} + */ + @Override + public String get(String name) { + return super.get(name); + } + + /** + * {@inheritDoc} + */ + @Override + public Map getInfos() { + return this; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/domain/actions/SaharaActions.java b/core/src/main/java/org/openstack4j/openstack/sahara/domain/actions/SaharaActions.java index 0d74e2f36..8d32b9078 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/domain/actions/SaharaActions.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/domain/actions/SaharaActions.java @@ -1,45 +1,44 @@ package org.openstack4j.openstack.sahara.domain.actions; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.collect.Lists; import org.openstack4j.api.Builders; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.sahara.NodeGroup; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; +import java.util.List; /** - * Simple Actions Classes used for Sahara Action - * + * Simple Actions Classes used for Sahara Action + * * @author ekasit.kijsipongse@nectec.or.th */ //@SuppressWarnings("serial") public final class SaharaActions { - + public static class ResizeNodeGroupAction implements ModelEntity { private static final long serialVersionUID = 1L; - + @JsonProperty("resize_node_groups") - List nodeGroups; - - public ResizeNodeGroupAction(String groupName,int count) { + List nodeGroups; + + public ResizeNodeGroupAction(String groupName, int count) { NodeGroup nodeGroup = Builders.nodeGroup().name(groupName) - .count(count).build(); + .count(count).build(); nodeGroups = Lists.newArrayList(); nodeGroups.add(nodeGroup); } } - + public static class AddNodeGroupAction implements ModelEntity { private static final long serialVersionUID = 1L; - + @JsonProperty("add_node_groups") - List nodeGroups; - - public AddNodeGroupAction(NodeGroup nodeGroup) { + List nodeGroups; + + public AddNodeGroupAction(NodeGroup nodeGroup) { nodeGroups = Lists.newArrayList(); nodeGroups.add(nodeGroup); } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/BaseSaharaServices.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/BaseSaharaServices.java index 7d41e523e..2f7f069d2 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/BaseSaharaServices.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/BaseSaharaServices.java @@ -6,14 +6,13 @@ /** * This class is extended by every Sahara Service. It is necessary to determine * the correct endpoint (url) for sahara calls. - * + * * @author Ekasit Kijipongse - * */ public class BaseSaharaServices extends BaseOpenStackService { - protected BaseSaharaServices() { - super(ServiceType.SAHARA); - } + protected BaseSaharaServices() { + super(ServiceType.SAHARA); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterServiceImpl.java index 6e1cb45e4..3875f8f95 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.sahara.ClusterService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -16,9 +12,13 @@ import org.openstack4j.openstack.sahara.domain.actions.SaharaActions.AddNodeGroupAction; import org.openstack4j.openstack.sahara.domain.actions.SaharaActions.ResizeNodeGroupAction; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations - * + * * @author ekasit.kijsipongse@nectec.or.th */ public class ClusterServiceImpl extends BaseSaharaServices implements ClusterService { @@ -48,9 +48,9 @@ public Cluster create(Cluster cluster) { checkNotNull(cluster); SaharaClusterUnwrapped unwrapped = new SaharaClusterUnwrapped(cluster); return post(SaharaCluster.class, uri("/clusters")) - .entity(unwrapped) // setup request - .execute(); - + .entity(unwrapped) // setup request + .execute(); + } /** @@ -69,7 +69,7 @@ public ActionResponse delete(String clusterId) { public Cluster resizeNodeGroup(String clusterId, String groupName, int count) { checkNotNull(clusterId); checkNotNull(groupName); - return put(SaharaCluster.class, uri("/clusters/%s", clusterId)).entity(new ResizeNodeGroupAction(groupName,count)).execute(ExecutionOptions.create(PropagateOnStatus.on(404))); // Use respongse progagation for "Not found" status to throw exception instead of return null + return put(SaharaCluster.class, uri("/clusters/%s", clusterId)).entity(new ResizeNodeGroupAction(groupName, count)).execute(ExecutionOptions.create(PropagateOnStatus.on(404))); // Use respongse progagation for "Not found" status to throw exception instead of return null } /** diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterTemplateServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterTemplateServiceImpl.java index 6d028ec70..4d0c582aa 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterTemplateServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/ClusterTemplateServiceImpl.java @@ -1,19 +1,19 @@ package org.openstack4j.openstack.sahara.internal; -import java.util.List; - import org.openstack4j.api.sahara.ClusterTemplateService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.ClusterTemplate; import org.openstack4j.openstack.sahara.domain.SaharaClusterTemplate; -import org.openstack4j.openstack.sahara.domain.SaharaClusterTemplateUnwrapped; import org.openstack4j.openstack.sahara.domain.SaharaClusterTemplate.ClusterTemplates; +import org.openstack4j.openstack.sahara.domain.SaharaClusterTemplateUnwrapped; + +import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; /** * Sahara Data Processing Operations - * + * * @author Ekasit Kijsipongse */ public class ClusterTemplateServiceImpl extends BaseSaharaServices implements ClusterTemplateService { @@ -42,11 +42,11 @@ public ClusterTemplate get(String templateId) { @Override public ClusterTemplate create(ClusterTemplate template) { checkNotNull(template); - SaharaClusterTemplateUnwrapped unwrapped = new SaharaClusterTemplateUnwrapped(template); + SaharaClusterTemplateUnwrapped unwrapped = new SaharaClusterTemplateUnwrapped(template); return post(SaharaClusterTemplate.class, uri("/cluster-templates")) - .entity(unwrapped) // setup request - .execute(); - + .entity(unwrapped) // setup request + .execute(); + } /** diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/DataSourceServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/DataSourceServiceImpl.java index 85567eb33..2c4405c06 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/DataSourceServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/DataSourceServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.sahara.DataSourceService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.DataSource; @@ -11,9 +7,13 @@ import org.openstack4j.openstack.sahara.domain.SaharaDataSource.DataSources; import org.openstack4j.openstack.sahara.domain.SaharaDataSourceUnwrapped; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations - * + * * @author ekasit.kijsipongse@nectec.or.th * @author siwat.pru@outlook.com */ @@ -44,8 +44,8 @@ public DataSource create(DataSource datasource) { checkNotNull(datasource); SaharaDataSourceUnwrapped unwrapped = new SaharaDataSourceUnwrapped(datasource); return post(SaharaDataSource.class, uri("/data-sources")) - .entity(unwrapped) // setup request - .execute(); + .entity(unwrapped) // setup request + .execute(); } /** diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryInternalServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryInternalServiceImpl.java index 4d9dbc10b..13d5d8560 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryInternalServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryInternalServiceImpl.java @@ -1,21 +1,21 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.io.File; -import java.io.InputStream; -import java.util.List; - import org.openstack4j.api.sahara.JobBinaryInternalService; import org.openstack4j.core.transport.HttpEntityHandler; import org.openstack4j.core.transport.HttpResponse; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.common.Payload; import org.openstack4j.model.common.Payloads; -import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.JobBinaryInternal; import org.openstack4j.openstack.sahara.domain.SaharaJobBinaryInternal; import org.openstack4j.openstack.sahara.domain.SaharaJobBinaryInternal.JobBinaryInternals; +import java.io.File; +import java.io.InputStream; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations * @@ -57,8 +57,8 @@ public ActionResponse delete(String jobBinaryInternalId) { public JobBinaryInternal create(Payload payload) { checkNotNull(payload); return put(SaharaJobBinaryInternal.class, uri("/job-binary-internals/%s", payload.getRaw().getName())) - .entity(payload) - .execute(); + .entity(payload) + .execute(); } /** @@ -67,13 +67,11 @@ public JobBinaryInternal create(Payload payload) { @Override public Payload getData(String jobBinaryInternalId) { HttpResponse response = get(Void.class, uri("/job-binary-internals/%s/data", jobBinaryInternalId)).executeWithResponse(); - try - { + try { if (response.getStatus() < 400) return Payloads.create(response.getInputStream()); return null; - } - finally { + } finally { HttpEntityHandler.closeQuietly(response); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryServiceImpl.java index 19f274bb0..5200620b3 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobBinaryServiceImpl.java @@ -1,21 +1,21 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.io.InputStream; -import java.util.List; - import org.openstack4j.api.sahara.JobBinaryService; import org.openstack4j.core.transport.HttpEntityHandler; import org.openstack4j.core.transport.HttpResponse; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.common.Payload; import org.openstack4j.model.common.Payloads; -import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.JobBinary; import org.openstack4j.openstack.sahara.domain.SaharaJobBinary; import org.openstack4j.openstack.sahara.domain.SaharaJobBinary.JobBinaries; import org.openstack4j.openstack.sahara.domain.SaharaJobBinaryUnwrapped; +import java.io.InputStream; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations * @@ -50,8 +50,8 @@ public JobBinary create(JobBinary jobBinary) { checkNotNull(jobBinary); SaharaJobBinaryUnwrapped unwrapped = new SaharaJobBinaryUnwrapped(jobBinary); return post(SaharaJobBinary.class, uri("/job-binaries")) - .entity(unwrapped) // setup request - .execute(); + .entity(unwrapped) // setup request + .execute(); } /** @@ -69,13 +69,11 @@ public ActionResponse delete(String JobBinaryId) { @Override public Payload getData(String JobBinaryId) { HttpResponse response = get(Void.class, uri("/job-binaries/%s/data", JobBinaryId)).executeWithResponse(); - try - { + try { if (response.getStatus() < 400) return Payloads.create(response.getInputStream()); return null; - } - finally { + } finally { HttpEntityHandler.closeQuietly(response); } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobExecutionServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobExecutionServiceImpl.java index d84f45335..6dddb389a 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobExecutionServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobExecutionServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.sahara.JobExecutionService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.JobExecution; @@ -11,6 +7,10 @@ import org.openstack4j.openstack.sahara.domain.SaharaJobExecution.JobExecutions; import org.openstack4j.openstack.sahara.domain.SaharaJobExecutionUnwrapped; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations * @@ -24,8 +24,8 @@ public JobExecution create(JobExecution jobExecution) { checkNotNull(jobExecution); SaharaJobExecutionUnwrapped unwrapped = new SaharaJobExecutionUnwrapped(jobExecution); return post(SaharaJobExecution.class, uri("/jobs/%s/execute", jobExecution.getJobIdForExecution())) - .entity(unwrapped) // setup request - .execute(); + .entity(unwrapped) // setup request + .execute(); } @Override diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobServiceImpl.java index 0120254ef..b48c06246 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/JobServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.sahara.JobService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.Job; @@ -13,6 +9,10 @@ import org.openstack4j.openstack.sahara.domain.SaharaJobConfigHint; import org.openstack4j.openstack.sahara.domain.SaharaJobUnwrapped; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations * @@ -46,8 +46,8 @@ public Job create(Job job) { checkNotNull(job); SaharaJobUnwrapped unwrapped = new SaharaJobUnwrapped(job); return post(SaharaJob.class, uri("/jobs")) - .entity(unwrapped) // setup request - .execute(); + .entity(unwrapped) // setup request + .execute(); } /** diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/NodeGroupTemplateServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/NodeGroupTemplateServiceImpl.java index b4d63d1aa..0e04cc9ef 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/NodeGroupTemplateServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/NodeGroupTemplateServiceImpl.java @@ -1,19 +1,19 @@ package org.openstack4j.openstack.sahara.internal; -import java.util.List; - import org.openstack4j.api.sahara.NodeGroupTemplateService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.sahara.NodeGroupTemplate; import org.openstack4j.openstack.sahara.domain.SaharaNodeGroupTemplate; -import org.openstack4j.openstack.sahara.domain.SaharaNodeGroupTemplateUnwrapped; import org.openstack4j.openstack.sahara.domain.SaharaNodeGroupTemplate.NodeGroupTemplates; +import org.openstack4j.openstack.sahara.domain.SaharaNodeGroupTemplateUnwrapped; + +import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; /** * Sahara Data Processing Operations - * + * * @author Ekasit Kijsipongse */ public class NodeGroupTemplateServiceImpl extends BaseSaharaServices implements NodeGroupTemplateService { @@ -42,11 +42,11 @@ public NodeGroupTemplate get(String templateId) { @Override public NodeGroupTemplate create(NodeGroupTemplate template) { checkNotNull(template); - SaharaNodeGroupTemplateUnwrapped unwrapped = new SaharaNodeGroupTemplateUnwrapped(template); + SaharaNodeGroupTemplateUnwrapped unwrapped = new SaharaNodeGroupTemplateUnwrapped(template); return post(SaharaNodeGroupTemplate.class, uri("/node-group-templates")) - .entity(unwrapped) // setup request - .execute(); - + .entity(unwrapped) // setup request + .execute(); + } /** diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaImageServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaImageServiceImpl.java index 7b8ac17d1..6164d72b5 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaImageServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaImageServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.sahara.SaharaImageService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -13,9 +9,13 @@ import org.openstack4j.openstack.sahara.domain.SaharaImage; import org.openstack4j.openstack.sahara.domain.SaharaImage.SaharaImages; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations - * + * * @author ekasit.kijsipongse@nectec.or.th */ public class SaharaImageServiceImpl extends BaseSaharaServices implements SaharaImageService { @@ -35,7 +35,7 @@ public List list() { public List list(String... tags) { Invocation invoke = get(SaharaImages.class, uri("/images")); for (String tag : tags) { - invoke = invoke.param("tags",tag); + invoke = invoke.param("tags", tag); } return invoke.execute().getList(); } @@ -56,10 +56,10 @@ public Image get(String imageId) { public Image register(String imageId, String username, String description) { checkNotNull(imageId); checkNotNull(username); - RegisterImageRequest reg = new RegisterImageRequest(username,description); - return post(SaharaImage.class, uri("/images/%s",imageId)) - .entity(reg) // setup request - .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); // Use respongse progagation for "Not found" status to throw exception instead of return null + RegisterImageRequest reg = new RegisterImageRequest(username, description); + return post(SaharaImage.class, uri("/images/%s", imageId)) + .entity(reg) // setup request + .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); // Use respongse progagation for "Not found" status to throw exception instead of return null } /** @@ -98,22 +98,22 @@ public class RegisterImageRequest implements ModelEntity { private String description; public RegisterImageRequest(String username, String description) { - this.username = username; - this.description = description; + this.username = username; + this.description = description; } /** * @return username information */ public String getUsername() { - return username; + return username; } /** * @return description */ public String getDescription() { - return description; + return description; } } @@ -124,14 +124,14 @@ public class UpdateTagsRequest implements ModelEntity { private String[] tags; public UpdateTagsRequest(String... tags) { - this.tags = tags; + this.tags = tags; } /** * @return tags */ public String[] getTags() { - return tags; + return tags; } } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaPluginServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaPluginServiceImpl.java index a760be7a5..bd5ff549d 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaPluginServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaPluginServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.sahara.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.sahara.SaharaPluginService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -14,9 +10,13 @@ import org.openstack4j.openstack.sahara.domain.SaharaPlugin; import org.openstack4j.openstack.sahara.domain.SaharaPlugin.SaharaPlugins; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Sahara Data Processing Operations - * + * * @author ekasit.kijsipongse@nectec.or.th */ public class SaharaPluginServiceImpl extends BaseSaharaServices implements SaharaPluginService { @@ -47,6 +47,7 @@ public Plugin get(String name, String version) { checkNotNull(version); return get(SaharaPlugin.class, uri("/plugins/%s/%s", name, version)).execute(); } + /** * {@inheritDoc} */ @@ -56,7 +57,7 @@ public ClusterTemplate convertConfig(String name, String version, String templat checkNotNull(version); checkNotNull(templateName); return post(SaharaClusterTemplate.class, uri("/plugins/%s/%s/convert-config/%s", name, version, templateName)).entity(payload) // setup request - .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); // Use respongse progagation for "Not found" status to throw exception instead of return null + .execute(ExecutionOptions.create(PropagateOnStatus.on(404))); // Use respongse progagation for "Not found" status to throw exception instead of return null } diff --git a/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaServiceImpl.java index 7565ed7dd..e6cd6debe 100644 --- a/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/sahara/internal/SaharaServiceImpl.java @@ -1,21 +1,11 @@ package org.openstack4j.openstack.sahara.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.sahara.ClusterService; -import org.openstack4j.api.sahara.ClusterTemplateService; -import org.openstack4j.api.sahara.JobBinaryInternalService; -import org.openstack4j.api.sahara.JobBinaryService; -import org.openstack4j.api.sahara.JobExecutionService; -import org.openstack4j.api.sahara.JobService; -import org.openstack4j.api.sahara.NodeGroupTemplateService; -import org.openstack4j.api.sahara.SaharaImageService; -import org.openstack4j.api.sahara.SaharaPluginService; -import org.openstack4j.api.sahara.SaharaService; -import org.openstack4j.api.sahara.DataSourceService; +import org.openstack4j.api.sahara.*; /** * Sahara (Data Processing) Operations API implementation - * + * * @author Ekasit Kijsipongse */ public class SaharaServiceImpl extends BaseSaharaServices implements SaharaService { @@ -25,48 +15,48 @@ public class SaharaServiceImpl extends BaseSaharaServices implements SaharaServi */ @Override public ClusterService clusters() { - return Apis.get(ClusterService.class); + return Apis.get(ClusterService.class); } /** * {@inheritDoc} */ - @Override - public NodeGroupTemplateService nodeGroupTemplates() { + @Override + public NodeGroupTemplateService nodeGroupTemplates() { return Apis.get(NodeGroupTemplateService.class); - } + } - /** - * {@inheritDoc} - */ - @Override - public ClusterTemplateService clusterTemplates() { + /** + * {@inheritDoc} + */ + @Override + public ClusterTemplateService clusterTemplates() { return Apis.get(ClusterTemplateService.class); - } + } - /** - * {@inheritDoc} - */ - @Override - public SaharaImageService images() { + /** + * {@inheritDoc} + */ + @Override + public SaharaImageService images() { return Apis.get(SaharaImageService.class); - } + } - /** - * {@inheritDoc} - */ - @Override - public SaharaPluginService plugins() { + /** + * {@inheritDoc} + */ + @Override + public SaharaPluginService plugins() { return Apis.get(SaharaPluginService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public DataSourceService dataSources() { - return Apis.get(DataSourceService.class); - } + } + + /** + * {@inheritDoc} + */ + @Override + public DataSourceService dataSources() { + return Apis.get(DataSourceService.class); + } /** * {@inheritDoc} diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinAction.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinAction.java index a4b100d10..fdfde5d10 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinAction.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinAction.java @@ -13,187 +13,185 @@ /** * This is a model of a senlinAction. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("action") public class SenlinAction implements Action { - private static final long serialVersionUID = -1125919503657762374L; - - @JsonProperty("action") - private String action; - @JsonProperty("cause") - private String cause; - @JsonProperty("context") - private Map context; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("depended_by") - private List dependedBy; - @JsonProperty("depended_on") - private List dependedOn; - @JsonProperty("end_time") - private Float endTime; - @JsonProperty("id") - private String id; - @JsonProperty("inputs") - private Map inputs; - @JsonProperty("interval") - private Integer interval; - @JsonProperty("name") - private String name; - @JsonProperty("outputs") - private Map outputs; - @JsonProperty("owner") - private String owner; - @JsonProperty("start_time") - private Float startTime; - @JsonProperty("status") - private String status; - @JsonProperty("status_reason") - private String statusReason; - @JsonProperty("target") - private String target; - @JsonProperty("timeout") - private Integer timeout; - @JsonProperty("updated_at") - private Date updatedAt; - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public Map getContext() { - return context; - } - - @Override - public String getAction() { - return action; - } - - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - @Override - public String getCause() { - return cause; - } - - @Override - public Date getCreatedAt() { - return createdAt; - } - - @Override - public List getDependedBy() { - return dependedBy; - } - - @Override - public List getDependedOn() { - return dependedOn; - } - - @Override - public Float getEndTime() { - return endTime; - } - - @Override - public Map getInputs() { - return inputs; - } - - @Override - public Integer getInterval() { - return interval; - } - - @Override - public Map getOutputs() { - return outputs; - } - - @Override - public String getOwner() { - return owner; - } - - @Override - public Float getStartTime() { - return startTime; - } - - @Override - public String getStatus() { - return status; - } - - @Override - public String getStatusReason() { - return statusReason; - } - - @Override - public String getTarget() { - return target; - } - - @Override - public Integer getTimeout() { - return timeout; - } - - @Override - public String toString() { - return "SenlinAction{" + - "action='" + action + '\'' + - ", cause='" + cause + '\'' + - ", context=" + context + - ", createdAt=" + createdAt + - ", dependedBy=" + dependedBy + - ", dependedOn=" + dependedOn + - ", endTime=" + endTime + - ", id='" + id + '\'' + - ", inputs=" + inputs + - ", interval=" + interval + - ", name='" + name + '\'' + - ", outputs=" + outputs + - ", owner='" + owner + '\'' + - ", startTime=" + startTime + - ", status='" + status + '\'' + - ", statusReason='" + statusReason + '\'' + - ", target='" + target + '\'' + - ", timeout=" + timeout + - ", updatedAt=" + updatedAt + - '}'; - } - - /** - * An inner class for representing lists of senlinAction - * - * @author lion - * - */ - public static class Action extends ListResult { - private static final long serialVersionUID = 298037693459165073L; - @JsonProperty("actions") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = -1125919503657762374L; + + @JsonProperty("action") + private String action; + @JsonProperty("cause") + private String cause; + @JsonProperty("context") + private Map context; + @JsonProperty("created_at") + private Date createdAt; + @JsonProperty("depended_by") + private List dependedBy; + @JsonProperty("depended_on") + private List dependedOn; + @JsonProperty("end_time") + private Float endTime; + @JsonProperty("id") + private String id; + @JsonProperty("inputs") + private Map inputs; + @JsonProperty("interval") + private Integer interval; + @JsonProperty("name") + private String name; + @JsonProperty("outputs") + private Map outputs; + @JsonProperty("owner") + private String owner; + @JsonProperty("start_time") + private Float startTime; + @JsonProperty("status") + private String status; + @JsonProperty("status_reason") + private String statusReason; + @JsonProperty("target") + private String target; + @JsonProperty("timeout") + private Integer timeout; + @JsonProperty("updated_at") + private Date updatedAt; + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public Map getContext() { + return context; + } + + @Override + public String getAction() { + return action; + } + + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + @Override + public String getCause() { + return cause; + } + + @Override + public Date getCreatedAt() { + return createdAt; + } + + @Override + public List getDependedBy() { + return dependedBy; + } + + @Override + public List getDependedOn() { + return dependedOn; + } + + @Override + public Float getEndTime() { + return endTime; + } + + @Override + public Map getInputs() { + return inputs; + } + + @Override + public Integer getInterval() { + return interval; + } + + @Override + public Map getOutputs() { + return outputs; + } + + @Override + public String getOwner() { + return owner; + } + + @Override + public Float getStartTime() { + return startTime; + } + + @Override + public String getStatus() { + return status; + } + + @Override + public String getStatusReason() { + return statusReason; + } + + @Override + public String getTarget() { + return target; + } + + @Override + public Integer getTimeout() { + return timeout; + } + + @Override + public String toString() { + return "SenlinAction{" + + "action='" + action + '\'' + + ", cause='" + cause + '\'' + + ", context=" + context + + ", createdAt=" + createdAt + + ", dependedBy=" + dependedBy + + ", dependedOn=" + dependedOn + + ", endTime=" + endTime + + ", id='" + id + '\'' + + ", inputs=" + inputs + + ", interval=" + interval + + ", name='" + name + '\'' + + ", outputs=" + outputs + + ", owner='" + owner + '\'' + + ", startTime=" + startTime + + ", status='" + status + '\'' + + ", statusReason='" + statusReason + '\'' + + ", target='" + target + '\'' + + ", timeout=" + timeout + + ", updatedAt=" + updatedAt + + '}'; + } + + /** + * An inner class for representing lists of senlinAction + * + * @author lion + */ + public static class Action extends ListResult { + private static final long serialVersionUID = 298037693459165073L; + @JsonProperty("actions") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinActionID.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinActionID.java index caba40a6d..26b166168 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinActionID.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinActionID.java @@ -7,26 +7,25 @@ /** * This is a model of a senlinAction. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) public class SenlinActionID implements ActionID { - private static final long serialVersionUID = -1125919503657762374L; + private static final long serialVersionUID = -1125919503657762374L; - @JsonProperty("action") - private String action; + @JsonProperty("action") + private String action; - @Override - public String getActionID() { - return action; - } + @Override + public String getActionID() { + return action; + } - @Override - public String toString() { - return "SenlinActionID{" + - "action='" + action + '\'' + - '}'; - } + @Override + public String toString() { + return "SenlinActionID{" + + "action='" + action + '\'' + + '}'; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinBuildInfo.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinBuildInfo.java index 78155fca6..a6c02dfae 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinBuildInfo.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinBuildInfo.java @@ -10,35 +10,34 @@ /** * This is a model of a senlinBuild_info. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("build_info") public class SenlinBuildInfo implements BuildInfo { - private static final long serialVersionUID = -7596480972776554810L; + private static final long serialVersionUID = -7596480972776554810L; - @JsonProperty("api") - private Map api; - @JsonProperty("engine") - private Map engine; + @JsonProperty("api") + private Map api; + @JsonProperty("engine") + private Map engine; - @Override - public Map getApi() { - return api; - } + @Override + public Map getApi() { + return api; + } - @Override - public Map getEngine() { - return engine; - } + @Override + public Map getEngine() { + return engine; + } - @Override - public String toString() { - return "SenlinBuildInfo{" + - "api=" + api + - ", engine=" + engine + - '}'; - } + @Override + public String toString() { + return "SenlinBuildInfo{" + + "api=" + api + + ", engine=" + engine + + '}'; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinCluster.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinCluster.java index 02594121d..8d912ad4a 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinCluster.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinCluster.java @@ -14,195 +14,193 @@ /** * This is a model of a senlinCluster. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("cluster") public class SenlinCluster implements Cluster { - private static final long serialVersionUID = -4148491479364580015L; - - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("data") - private Map data; - @JsonProperty("desired_capacity") - private Integer desiredCapacity; - @JsonProperty("domain") - private String domain; - @JsonProperty("id") - private String id; - @JsonProperty("init_at") - private Date initAt; - @JsonProperty("max_size") - private Integer maxSize; - @JsonProperty("metadata") - private Map metadata; - @JsonProperty("min_size") - private Integer minSize; - @JsonProperty("name") - private String name; - @JsonProperty("nodes") - private List nodes; - @JsonProperty("policies") - private List policies; - @JsonProperty("profile_id") - private String profileID; - @JsonProperty("profile_name") - private String profileName; - @JsonProperty("project") - private String project; - @JsonProperty("status") - private ClusterStatus status; - @JsonProperty("status_reason") - private String statusReason; - @JsonProperty("timeout") - private Integer timeout; - @JsonProperty("updated_at") - private Date updatedAt; - @JsonProperty("user") - private String user; - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public Date getCreatedAt() { - return createdAt; - } - - @Override - public Map getData() { - return data; - } - - @Override - public Integer getDesiredCapacity() { - return desiredCapacity; - } - - @Override - public String getDomain() { - return domain; - } - - @Override - public Date getInitAt() { - return initAt; - } - - @Override - public Integer getMaxSize() { - return maxSize; - } - - @Override - public Map getMetadata() { - return metadata; - } - - @Override - public Integer getMinSize() { - return minSize; - } - - @Override - public List getNodes() { - return nodes; - } - - @Override - public List getPolicies() { - return policies; - } - - @Override - public String getProfileID() { - return profileID; - } - - @Override - public String getProfileName() { - return profileName; - } - - @Override - public String getProject() { - return project; - } - - @Override - public ClusterStatus getStatus() { - return status; - } - - @Override - public String getStatusReason() { - return statusReason; - } - - @Override - public Integer getTimeout() { - return timeout; - } - - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - @Override - public String getUser() { - return user; - } - - @Override - public String toString() { - return "SenlinCluster{" + - "created_at='" + createdAt + '\'' + - ", data=" + data + - ", desired_capacity='" + desiredCapacity + '\'' + - ", domain='" + domain + '\'' + - ", id='" + id + '\'' + - ", init_at='" + initAt + '\'' + - ", max_size='" + maxSize + '\'' + - ", metadata=" + metadata + - ", min_size='" + minSize + '\'' + - ", name='" + name + '\'' + - ", nodes=" + nodes + - ", policies=" + policies + - ", profile_id='" + profileID + '\'' + - ", profile_name='" + profileName + '\'' + - ", project='" + project + '\'' + - ", status='" + status + '\'' + - ", status_reason='" + statusReason + '\'' + - ", timeout='" + timeout + '\'' + - ", updated_at='" + updatedAt + '\'' + - ", user='" + user + '\'' + - '}'; - } - - /** - * An inner class for representing lists of senlinCluster - * - * @author lion - * - */ - public static class Cluster extends ListResult { - private static final long serialVersionUID = -3382404528209154988L; - @JsonProperty("clusters") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = -4148491479364580015L; + + @JsonProperty("created_at") + private Date createdAt; + @JsonProperty("data") + private Map data; + @JsonProperty("desired_capacity") + private Integer desiredCapacity; + @JsonProperty("domain") + private String domain; + @JsonProperty("id") + private String id; + @JsonProperty("init_at") + private Date initAt; + @JsonProperty("max_size") + private Integer maxSize; + @JsonProperty("metadata") + private Map metadata; + @JsonProperty("min_size") + private Integer minSize; + @JsonProperty("name") + private String name; + @JsonProperty("nodes") + private List nodes; + @JsonProperty("policies") + private List policies; + @JsonProperty("profile_id") + private String profileID; + @JsonProperty("profile_name") + private String profileName; + @JsonProperty("project") + private String project; + @JsonProperty("status") + private ClusterStatus status; + @JsonProperty("status_reason") + private String statusReason; + @JsonProperty("timeout") + private Integer timeout; + @JsonProperty("updated_at") + private Date updatedAt; + @JsonProperty("user") + private String user; + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public Date getCreatedAt() { + return createdAt; + } + + @Override + public Map getData() { + return data; + } + + @Override + public Integer getDesiredCapacity() { + return desiredCapacity; + } + + @Override + public String getDomain() { + return domain; + } + + @Override + public Date getInitAt() { + return initAt; + } + + @Override + public Integer getMaxSize() { + return maxSize; + } + + @Override + public Map getMetadata() { + return metadata; + } + + @Override + public Integer getMinSize() { + return minSize; + } + + @Override + public List getNodes() { + return nodes; + } + + @Override + public List getPolicies() { + return policies; + } + + @Override + public String getProfileID() { + return profileID; + } + + @Override + public String getProfileName() { + return profileName; + } + + @Override + public String getProject() { + return project; + } + + @Override + public ClusterStatus getStatus() { + return status; + } + + @Override + public String getStatusReason() { + return statusReason; + } + + @Override + public Integer getTimeout() { + return timeout; + } + + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + @Override + public String getUser() { + return user; + } + + @Override + public String toString() { + return "SenlinCluster{" + + "created_at='" + createdAt + '\'' + + ", data=" + data + + ", desired_capacity='" + desiredCapacity + '\'' + + ", domain='" + domain + '\'' + + ", id='" + id + '\'' + + ", init_at='" + initAt + '\'' + + ", max_size='" + maxSize + '\'' + + ", metadata=" + metadata + + ", min_size='" + minSize + '\'' + + ", name='" + name + '\'' + + ", nodes=" + nodes + + ", policies=" + policies + + ", profile_id='" + profileID + '\'' + + ", profile_name='" + profileName + '\'' + + ", project='" + project + '\'' + + ", status='" + status + '\'' + + ", status_reason='" + statusReason + '\'' + + ", timeout='" + timeout + '\'' + + ", updated_at='" + updatedAt + '\'' + + ", user='" + user + '\'' + + '}'; + } + + /** + * An inner class for representing lists of senlinCluster + * + * @author lion + */ + public static class Cluster extends ListResult { + private static final long serialVersionUID = -3382404528209154988L; + @JsonProperty("clusters") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterActionCreate.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterActionCreate.java index ae268890f..1e1e5307e 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterActionCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterActionCreate.java @@ -13,152 +13,149 @@ * uses Jackson annotation for (de)serialization into JSON * * @author lion - * */ public class SenlinClusterActionCreate implements ClusterActionCreate { - private static final long serialVersionUID = 8159175788259631363L; - - @JsonProperty("add_nodes") - private Map> addNodes; - @JsonProperty("del_nodes") - private Map> delNodes; - @JsonProperty("scale_out") - private Map scaleOut; - @JsonProperty("scale_in") - private Map scaleIn; - @JsonProperty("resize") - private Map resize; - @JsonProperty("check") - private Map check; - @JsonProperty("recover") - private Map recover; - @JsonProperty("policy_attach") - private Map policyAttach; - @JsonProperty("policy_detach") - private Map policyDetach; - @JsonProperty("policy_update") - private Map policyUpdate; - - /** - * Returnes a {@link SenlinClusterActionCreateConcreteBuilder} for configuration and - * creation of a {@link SenlinClusterActionCreate} object. - * - * @return a {@link SenlinClusterActionCreateConcreteBuilder} - */ - public static SenlinClusterActionCreateConcreteBuilder build() { - return new SenlinClusterActionCreateConcreteBuilder(); - } - - @Override - public ClusterActionCreateBuilder toBuilder() { - return new SenlinClusterActionCreateConcreteBuilder(this); - } - - - /** - * A Builder to create a SenlinClusterAction. Use {@link #build()} to receive the - * {@link ClusterCreate} object. - * - * @author lion - * - */ - public static class SenlinClusterActionCreateConcreteBuilder implements - ClusterActionCreateBuilder { - - private SenlinClusterActionCreate model; - - /** - * Constructor to create a {@link SenlinClusterActionCreateConcreteBuilder} object - * with a new, empty {@link SenlinClusterActionCreate} object. - */ - public SenlinClusterActionCreateConcreteBuilder() { - - this(new SenlinClusterActionCreate()); - } - - /** - * Constructor for manipulation of an existing {@link SenlinClusterActionCreate} - * object. - * - * @param model - * the {@link SenlinClusterActionCreate} object which is to be - * modified. - */ - public SenlinClusterActionCreateConcreteBuilder(SenlinClusterActionCreate model) { - this.model = model; - } - - @Override - public ClusterActionCreate build() { - return model; - } - - @Override - public ClusterActionCreateBuilder from(ClusterActionCreate in) { - model = (SenlinClusterActionCreate) in; - return this; - } - - @Override - public ClusterActionCreateBuilder addNodes(Map> addNodes) { - model.addNodes = addNodes; - return this; - } - - @Override - public ClusterActionCreateBuilder delNodes(Map> delNodes) { - model.delNodes = delNodes; - return this; - } - - @Override - public ClusterActionCreateBuilder scaleOut(Map scaleOut) { - model.scaleOut = scaleOut; - return this; - } - - @Override - public ClusterActionCreateBuilder scaleIn(Map scaleIn) { - model.scaleIn = scaleIn; - return this; - } - - @Override - public ClusterActionCreateBuilder resize(Map resize) { - model.resize = resize; - return this; - } - - @Override - public ClusterActionCreateBuilder check(Map check) { - model.check = check; - return this; - } - - @Override - public ClusterActionCreateBuilder recover(Map recover) { - model.recover = recover; - return this; - } - - @Override - public ClusterActionCreateBuilder policyAttach(Map policyAttach) { - model.policyAttach = policyAttach; - return this; - } - - @Override - public ClusterActionCreateBuilder policyDetach(Map policyDetach) { - model.policyDetach = policyDetach; - return this; - } - - @Override - public ClusterActionCreateBuilder policyUpdate(Map policyUpdate) { - model.policyUpdate = policyUpdate; - return this; - } - - } + private static final long serialVersionUID = 8159175788259631363L; + + @JsonProperty("add_nodes") + private Map> addNodes; + @JsonProperty("del_nodes") + private Map> delNodes; + @JsonProperty("scale_out") + private Map scaleOut; + @JsonProperty("scale_in") + private Map scaleIn; + @JsonProperty("resize") + private Map resize; + @JsonProperty("check") + private Map check; + @JsonProperty("recover") + private Map recover; + @JsonProperty("policy_attach") + private Map policyAttach; + @JsonProperty("policy_detach") + private Map policyDetach; + @JsonProperty("policy_update") + private Map policyUpdate; + + /** + * Returnes a {@link SenlinClusterActionCreateConcreteBuilder} for configuration and + * creation of a {@link SenlinClusterActionCreate} object. + * + * @return a {@link SenlinClusterActionCreateConcreteBuilder} + */ + public static SenlinClusterActionCreateConcreteBuilder build() { + return new SenlinClusterActionCreateConcreteBuilder(); + } + + @Override + public ClusterActionCreateBuilder toBuilder() { + return new SenlinClusterActionCreateConcreteBuilder(this); + } + + + /** + * A Builder to create a SenlinClusterAction. Use {@link #build()} to receive the + * {@link ClusterCreate} object. + * + * @author lion + */ + public static class SenlinClusterActionCreateConcreteBuilder implements + ClusterActionCreateBuilder { + + private SenlinClusterActionCreate model; + + /** + * Constructor to create a {@link SenlinClusterActionCreateConcreteBuilder} object + * with a new, empty {@link SenlinClusterActionCreate} object. + */ + public SenlinClusterActionCreateConcreteBuilder() { + + this(new SenlinClusterActionCreate()); + } + + /** + * Constructor for manipulation of an existing {@link SenlinClusterActionCreate} + * object. + * + * @param model the {@link SenlinClusterActionCreate} object which is to be + * modified. + */ + public SenlinClusterActionCreateConcreteBuilder(SenlinClusterActionCreate model) { + this.model = model; + } + + @Override + public ClusterActionCreate build() { + return model; + } + + @Override + public ClusterActionCreateBuilder from(ClusterActionCreate in) { + model = (SenlinClusterActionCreate) in; + return this; + } + + @Override + public ClusterActionCreateBuilder addNodes(Map> addNodes) { + model.addNodes = addNodes; + return this; + } + + @Override + public ClusterActionCreateBuilder delNodes(Map> delNodes) { + model.delNodes = delNodes; + return this; + } + + @Override + public ClusterActionCreateBuilder scaleOut(Map scaleOut) { + model.scaleOut = scaleOut; + return this; + } + + @Override + public ClusterActionCreateBuilder scaleIn(Map scaleIn) { + model.scaleIn = scaleIn; + return this; + } + + @Override + public ClusterActionCreateBuilder resize(Map resize) { + model.resize = resize; + return this; + } + + @Override + public ClusterActionCreateBuilder check(Map check) { + model.check = check; + return this; + } + + @Override + public ClusterActionCreateBuilder recover(Map recover) { + model.recover = recover; + return this; + } + + @Override + public ClusterActionCreateBuilder policyAttach(Map policyAttach) { + model.policyAttach = policyAttach; + return this; + } + + @Override + public ClusterActionCreateBuilder policyDetach(Map policyDetach) { + model.policyDetach = policyDetach; + return this; + } + + @Override + public ClusterActionCreateBuilder policyUpdate(Map policyUpdate) { + model.policyUpdate = policyUpdate; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterCreate.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterCreate.java index 6c5133dcb..eb57ec9be 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterCreate.java @@ -12,120 +12,117 @@ * uses Jackson annotation for (de)serialization into JSON * * @author lion - * */ public class SenlinClusterCreate implements ClusterCreate { - private static final long serialVersionUID = 795057209038510264L; - - @JsonProperty("cluster") - private Map cluster; - - /** - * Returnes a {@link SenlinClusterCreateConcreteBuilder} for configuration and - * creation of a {@link SenlinClusterCreate} object. - * - * @return a {@link SenlinClusterCreateConcreteBuilder} - */ - public static SenlinClusterCreateConcreteBuilder build() { - return new SenlinClusterCreateConcreteBuilder(); - } - - @Override - public ClusterCreateBuilder toBuilder() { - return new SenlinClusterCreateConcreteBuilder(this); - } - - - /** - * A Builder to create a SenlinCluster. Use {@link #build()} to receive the - * {@link ClusterCreate} object. - * - * @author lion - * - */ - public static class SenlinClusterCreateConcreteBuilder implements - ClusterCreateBuilder { - - private SenlinClusterCreate model; - - /** - * Constructor to create a {@link SenlinClusterCreateConcreteBuilder} object - * with a new, empty {@link SenlinClusterCreate} object. - */ - public SenlinClusterCreateConcreteBuilder() { - - this(new SenlinClusterCreate()); - } - - /** - * Constructor for manipulation of an existing {@link SenlinClusterCreate} - * object. - * - * @param model - * the {@link SenlinClusterCreate} object which is to be - * modified. - */ - public SenlinClusterCreateConcreteBuilder(SenlinClusterCreate model) { - this.model = model; - - this.model.cluster = Maps.newHashMap(); - Map metadata = Maps.newHashMap(); - this.model.cluster.put("metadata", metadata); - } - - @Override - public ClusterCreate build() { - return model; - } - - @Override - public ClusterCreateBuilder from(ClusterCreate in) { - model = (SenlinClusterCreate) in; - return this; - } - - @Override - public ClusterCreateBuilder name(String name) { - model.cluster.put("name", name); - return this; - } - - @Override - public ClusterCreateBuilder metadata(Map metadata) { - model.cluster.put("metadata", metadata); - return this; - } - - @Override - public ClusterCreateBuilder desiredCapacity(int desiredCapacity) { - model.cluster.put("desired_capacity", desiredCapacity); - return this; - } - - @Override - public ClusterCreateBuilder maxSize(int maxSize) { - model.cluster.put("max_size", maxSize); - return this; - } - - @Override - public ClusterCreateBuilder minSize(int minSize) { - model.cluster.put("min_size", minSize); - return this; - } - - @Override - public ClusterCreateBuilder profileID(String profileID) { - model.cluster.put("profile_id", profileID); - return this; - } - - @Override - public ClusterCreateBuilder timeout(int timeout) { - model.cluster.put("timeout", timeout); - return this; - } - - } + private static final long serialVersionUID = 795057209038510264L; + + @JsonProperty("cluster") + private Map cluster; + + /** + * Returnes a {@link SenlinClusterCreateConcreteBuilder} for configuration and + * creation of a {@link SenlinClusterCreate} object. + * + * @return a {@link SenlinClusterCreateConcreteBuilder} + */ + public static SenlinClusterCreateConcreteBuilder build() { + return new SenlinClusterCreateConcreteBuilder(); + } + + @Override + public ClusterCreateBuilder toBuilder() { + return new SenlinClusterCreateConcreteBuilder(this); + } + + + /** + * A Builder to create a SenlinCluster. Use {@link #build()} to receive the + * {@link ClusterCreate} object. + * + * @author lion + */ + public static class SenlinClusterCreateConcreteBuilder implements + ClusterCreateBuilder { + + private SenlinClusterCreate model; + + /** + * Constructor to create a {@link SenlinClusterCreateConcreteBuilder} object + * with a new, empty {@link SenlinClusterCreate} object. + */ + public SenlinClusterCreateConcreteBuilder() { + + this(new SenlinClusterCreate()); + } + + /** + * Constructor for manipulation of an existing {@link SenlinClusterCreate} + * object. + * + * @param model the {@link SenlinClusterCreate} object which is to be + * modified. + */ + public SenlinClusterCreateConcreteBuilder(SenlinClusterCreate model) { + this.model = model; + + this.model.cluster = Maps.newHashMap(); + Map metadata = Maps.newHashMap(); + this.model.cluster.put("metadata", metadata); + } + + @Override + public ClusterCreate build() { + return model; + } + + @Override + public ClusterCreateBuilder from(ClusterCreate in) { + model = (SenlinClusterCreate) in; + return this; + } + + @Override + public ClusterCreateBuilder name(String name) { + model.cluster.put("name", name); + return this; + } + + @Override + public ClusterCreateBuilder metadata(Map metadata) { + model.cluster.put("metadata", metadata); + return this; + } + + @Override + public ClusterCreateBuilder desiredCapacity(int desiredCapacity) { + model.cluster.put("desired_capacity", desiredCapacity); + return this; + } + + @Override + public ClusterCreateBuilder maxSize(int maxSize) { + model.cluster.put("max_size", maxSize); + return this; + } + + @Override + public ClusterCreateBuilder minSize(int minSize) { + model.cluster.put("min_size", minSize); + return this; + } + + @Override + public ClusterCreateBuilder profileID(String profileID) { + model.cluster.put("profile_id", profileID); + return this; + } + + @Override + public ClusterCreateBuilder timeout(int timeout) { + model.cluster.put("timeout", timeout); + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterPolicy.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterPolicy.java index c391302e8..4f6ccf7ba 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterPolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinClusterPolicy.java @@ -11,92 +11,90 @@ /** * This is a model of a senlinCluster_policy. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("cluster_policy") public class SenlinClusterPolicy implements ClusterPolicy { - private static final long serialVersionUID = 5451213592273429432L; + private static final long serialVersionUID = 5451213592273429432L; - @JsonProperty("cluster_id") - private String clusterID; - @JsonProperty("cluster_name") - private String clusterName; - @JsonProperty("enabled") - private Boolean enabled; - @JsonProperty("id") - private String id; - @JsonProperty("policy_id") - private String policyID; - @JsonProperty("policy_name") - private String policyName; - @JsonProperty("policy_type") - private String policyType; + @JsonProperty("cluster_id") + private String clusterID; + @JsonProperty("cluster_name") + private String clusterName; + @JsonProperty("enabled") + private Boolean enabled; + @JsonProperty("id") + private String id; + @JsonProperty("policy_id") + private String policyID; + @JsonProperty("policy_name") + private String policyName; + @JsonProperty("policy_type") + private String policyType; - @Override - public String getId() { - return id; - } + @Override + public String getId() { + return id; + } - @Override - public String getPolicyType() { - return policyType; - } + @Override + public String getPolicyType() { + return policyType; + } - @Override - public String getClusterID() { - return clusterID; - } + @Override + public String getClusterID() { + return clusterID; + } - @Override - public String getClusterName() { - return clusterName; - } + @Override + public String getClusterName() { + return clusterName; + } - @Override - public Boolean getEnabled() { - return enabled; - } + @Override + public Boolean getEnabled() { + return enabled; + } - @Override - public String getPolicyID() { - return policyID; - } + @Override + public String getPolicyID() { + return policyID; + } - @Override - public String getPolicyName() { - return policyName; - } + @Override + public String getPolicyName() { + return policyName; + } - @Override - public String toString() { - return "SenlinClusterPolicy{" + - "cluster_id='" + clusterID + '\'' + - ", cluster_name='" + clusterName + '\'' + - ", enabled='" + enabled + '\'' + - ", id='" + id + '\'' + - ", policy_id='" + policyID + '\'' + - ", policy_name='" + policyName + '\'' + - ", policy_type='" + policyType + '\'' + - '}'; - } + @Override + public String toString() { + return "SenlinClusterPolicy{" + + "cluster_id='" + clusterID + '\'' + + ", cluster_name='" + clusterName + '\'' + + ", enabled='" + enabled + '\'' + + ", id='" + id + '\'' + + ", policy_id='" + policyID + '\'' + + ", policy_name='" + policyName + '\'' + + ", policy_type='" + policyType + '\'' + + '}'; + } - /** - * An inner class for representing lists of senlinCluster_policy - * - * @author lion - * - */ - public static class ClusterPolicy extends ListResult { - private static final long serialVersionUID = 600661296207420793L; - - @JsonProperty("cluster_policies") - private List list; + /** + * An inner class for representing lists of senlinCluster_policy + * + * @author lion + */ + public static class ClusterPolicy extends ListResult { + private static final long serialVersionUID = 600661296207420793L; - protected List value() { - return list; - } - } + @JsonProperty("cluster_policies") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinEvent.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinEvent.java index 98828f13f..32663fac0 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinEvent.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinEvent.java @@ -12,132 +12,130 @@ /** * This is a model of a senlinEvent. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("event") public class SenlinEvent implements Event { - private static final long serialVersionUID = -8305526522823061209L; - - @JsonProperty("action") - private String action; - @JsonProperty("cluster_id") - private String clusterID; - @JsonProperty("id") - private String id; - @JsonProperty("level") - private Integer level; - @JsonProperty("obj_id") - private String objID; - @JsonProperty("obj_name") - private String objName; - @JsonProperty("obj_type") - private String objType; - @JsonProperty("project") - private String project; - @JsonProperty("status") - private String status; - @JsonProperty("status_reason") - private String statusReason; - @JsonProperty("timestamp") - private Date timestamp; - @JsonProperty("user") - private String user; - - @Override - public String getId() { - return id; - } - - @Override - public String getAction() { - return action; - } - - @Override - public String getClusterID() { - return clusterID; - } - - @Override - public Integer getLevel() { - return level; - } - - @Override - public String getObjID() { - return objID; - } - - @Override - public String getObjName() { - return objName; - } - - @Override - public String getObjType() { - return objType; - } - - @Override - public String getProject() { - return project; - } - - @Override - public String getStatus() { - return status; - } - - @Override - public String getStatusReason() { - return statusReason; - } - - @Override - public Date getTimestamp() { - return timestamp; - } - - @Override - public String getUser() { - return user; - } - - @Override - public String toString() { - return "SenlinEvent{" + - "action='" + action + '\'' + - ", cluster_id='" + clusterID + '\'' + - ", id='" + id + '\'' + - ", level='" + level + '\'' + - ", obj_id='" + objID + '\'' + - ", obj_name='" + objName + '\'' + - ", obj_type='" + objType + '\'' + - ", project='" + project + '\'' + - ", status='" + status + '\'' + - ", status_reason='" + statusReason + '\'' + - ", timestamp='" + timestamp + '\'' + - ", user='" + user + '\'' + - '}'; - } - - /** - * An inner class for representing lists of senlinEvent - * - * @author lion - * - */ - public static class Event extends ListResult { - private static final long serialVersionUID = 7647975201092736501L; - - @JsonProperty("events") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = -8305526522823061209L; + + @JsonProperty("action") + private String action; + @JsonProperty("cluster_id") + private String clusterID; + @JsonProperty("id") + private String id; + @JsonProperty("level") + private Integer level; + @JsonProperty("obj_id") + private String objID; + @JsonProperty("obj_name") + private String objName; + @JsonProperty("obj_type") + private String objType; + @JsonProperty("project") + private String project; + @JsonProperty("status") + private String status; + @JsonProperty("status_reason") + private String statusReason; + @JsonProperty("timestamp") + private Date timestamp; + @JsonProperty("user") + private String user; + + @Override + public String getId() { + return id; + } + + @Override + public String getAction() { + return action; + } + + @Override + public String getClusterID() { + return clusterID; + } + + @Override + public Integer getLevel() { + return level; + } + + @Override + public String getObjID() { + return objID; + } + + @Override + public String getObjName() { + return objName; + } + + @Override + public String getObjType() { + return objType; + } + + @Override + public String getProject() { + return project; + } + + @Override + public String getStatus() { + return status; + } + + @Override + public String getStatusReason() { + return statusReason; + } + + @Override + public Date getTimestamp() { + return timestamp; + } + + @Override + public String getUser() { + return user; + } + + @Override + public String toString() { + return "SenlinEvent{" + + "action='" + action + '\'' + + ", cluster_id='" + clusterID + '\'' + + ", id='" + id + '\'' + + ", level='" + level + '\'' + + ", obj_id='" + objID + '\'' + + ", obj_name='" + objName + '\'' + + ", obj_type='" + objType + '\'' + + ", project='" + project + '\'' + + ", status='" + status + '\'' + + ", status_reason='" + statusReason + '\'' + + ", timestamp='" + timestamp + '\'' + + ", user='" + user + '\'' + + '}'; + } + + /** + * An inner class for representing lists of senlinEvent + * + * @author lion + */ + public static class Event extends ListResult { + private static final long serialVersionUID = 7647975201092736501L; + + @JsonProperty("events") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNode.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNode.java index 6ccddb65f..3961d2932 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNode.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNode.java @@ -13,188 +13,186 @@ /** * This is a model of a senlinNode. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("node") public class SenlinNode implements Node { - private static final long serialVersionUID = 4953618741806882198L; - - @JsonProperty("cluster_id") - private String clusterID; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("domain") - private String domain; - @JsonProperty("id") - private String id; - @JsonProperty("index") - private Integer index; - @JsonProperty("data") - private Map data; - @JsonProperty("details") - private Map details; - @JsonProperty("init_at") - private Date initAt; - @JsonProperty("metadata") - private Map metadata; - @JsonProperty("name") - private String name; - @JsonProperty("physical_id") - private String physicalID; - @JsonProperty("profile_id") - private String profileID; - @JsonProperty("profile_name") - private String profileName; - @JsonProperty("project") - private String project; - @JsonProperty("role") - private String role; - @JsonProperty("status") - private String status; - @JsonProperty("status_reason") - private String statusReason; - @JsonProperty("updated_at") - private Date updatedAt; - @JsonProperty("user") - private String user; - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getClusterID() { - return clusterID; - } - - @Override - public Date getCreatedAt() { - return createdAt; - } - - @Override - public String getDomain() { - return domain; - } - - @Override - public Integer getIndex() { - return index; - } - - @Override - public Map getData() { - return data; - } - - @Override - public Map getDetails() { - return details; - } - - @Override - public Date getInitAt() { - return initAt; - } - - @Override - public Map getMetadata() { - return metadata; - } - - @Override - public String getPhysicalID() { - return physicalID; - } - - @Override - public String getProfileID() { - return profileID; - } - - @Override - public String getProfileName() { - return profileName; - } - - @Override - public String getProject() { - return project; - } - - @Override - public String getRole() { - return role; - } - - @Override - public String getStatus() { - return status; - } - - @Override - public String getStatusReason() { - return statusReason; - } - - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - @Override - public String getUser() { - return user; - } - - @Override - public String toString() { - return "SenlinNode{" + - "clusterID='" + clusterID + '\'' + - ", createdAt='" + createdAt + '\'' + - ", domain='" + domain + '\'' + - ", id='" + id + '\'' + - ", index='" + index + '\'' + - ", data=" + data + - ", details=" + details + - ", initAt='" + initAt + '\'' + - ", metadata=" + metadata + - ", name='" + name + '\'' + - ", physicalID='" + physicalID + '\'' + - ", profileID='" + profileID + '\'' + - ", profileName='" + profileName + '\'' + - ", project='" + project + '\'' + - ", role='" + role + '\'' + - ", status='" + status + '\'' + - ", statusReason='" + statusReason + '\'' + - ", updatedAt='" + updatedAt + '\'' + - ", user='" + user + '\'' + - '}'; - } - - /** - * An inner class for representing lists of senlinNode - * - * @author lion - * - */ - public static class Node extends ListResult { - private static final long serialVersionUID = 9043454000625258331L; - - @JsonProperty("nodes") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = 4953618741806882198L; + + @JsonProperty("cluster_id") + private String clusterID; + @JsonProperty("created_at") + private Date createdAt; + @JsonProperty("domain") + private String domain; + @JsonProperty("id") + private String id; + @JsonProperty("index") + private Integer index; + @JsonProperty("data") + private Map data; + @JsonProperty("details") + private Map details; + @JsonProperty("init_at") + private Date initAt; + @JsonProperty("metadata") + private Map metadata; + @JsonProperty("name") + private String name; + @JsonProperty("physical_id") + private String physicalID; + @JsonProperty("profile_id") + private String profileID; + @JsonProperty("profile_name") + private String profileName; + @JsonProperty("project") + private String project; + @JsonProperty("role") + private String role; + @JsonProperty("status") + private String status; + @JsonProperty("status_reason") + private String statusReason; + @JsonProperty("updated_at") + private Date updatedAt; + @JsonProperty("user") + private String user; + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getClusterID() { + return clusterID; + } + + @Override + public Date getCreatedAt() { + return createdAt; + } + + @Override + public String getDomain() { + return domain; + } + + @Override + public Integer getIndex() { + return index; + } + + @Override + public Map getData() { + return data; + } + + @Override + public Map getDetails() { + return details; + } + + @Override + public Date getInitAt() { + return initAt; + } + + @Override + public Map getMetadata() { + return metadata; + } + + @Override + public String getPhysicalID() { + return physicalID; + } + + @Override + public String getProfileID() { + return profileID; + } + + @Override + public String getProfileName() { + return profileName; + } + + @Override + public String getProject() { + return project; + } + + @Override + public String getRole() { + return role; + } + + @Override + public String getStatus() { + return status; + } + + @Override + public String getStatusReason() { + return statusReason; + } + + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + @Override + public String getUser() { + return user; + } + + @Override + public String toString() { + return "SenlinNode{" + + "clusterID='" + clusterID + '\'' + + ", createdAt='" + createdAt + '\'' + + ", domain='" + domain + '\'' + + ", id='" + id + '\'' + + ", index='" + index + '\'' + + ", data=" + data + + ", details=" + details + + ", initAt='" + initAt + '\'' + + ", metadata=" + metadata + + ", name='" + name + '\'' + + ", physicalID='" + physicalID + '\'' + + ", profileID='" + profileID + '\'' + + ", profileName='" + profileName + '\'' + + ", project='" + project + '\'' + + ", role='" + role + '\'' + + ", status='" + status + '\'' + + ", statusReason='" + statusReason + '\'' + + ", updatedAt='" + updatedAt + '\'' + + ", user='" + user + '\'' + + '}'; + } + + /** + * An inner class for representing lists of senlinNode + * + * @author lion + */ + public static class Node extends ListResult { + private static final long serialVersionUID = 9043454000625258331L; + + @JsonProperty("nodes") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeActionCreate.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeActionCreate.java index 22205eed2..578b8202b 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeActionCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeActionCreate.java @@ -12,88 +12,85 @@ * uses Jackson annotation for (de)serialization into JSON * * @author lion - * */ public class SenlinNodeActionCreate implements NodeActionCreate { - private static final long serialVersionUID = 7461515803108018710L; - - @JsonProperty("check") - private Map check; - @JsonProperty("recover") - private Map recover; - - /** - * Returnes a {@link SenlinNodeActionCreateConcreteBuilder} for configuration and - * creation of a {@link SenlinNodeActionCreate} object. - * - * @return a {@link SenlinNodeActionCreateConcreteBuilder} - */ - public static SenlinNodeActionCreateConcreteBuilder build() { - return new SenlinNodeActionCreateConcreteBuilder(); - } - - @Override - public NodeActionCreateBuilder toBuilder() { - return new SenlinNodeActionCreateConcreteBuilder(this); - } - - - /** - * A Builder to create a SenlinNode. Use {@link #build()} to receive the - * {@link NodeCreate} object. - * - * @author lion - * - */ - public static class SenlinNodeActionCreateConcreteBuilder implements - NodeActionCreateBuilder { - - private SenlinNodeActionCreate model; - - /** - * Constructor to create a {@link SenlinNodeActionCreateConcreteBuilder} object - * with a new, empty {@link SenlinNodeActionCreate} object. - */ - public SenlinNodeActionCreateConcreteBuilder() { - - this(new SenlinNodeActionCreate()); - } - - /** - * Constructor for manipulation of an existing {@link SenlinNodeActionCreate} - * object. - * - * @param model - * the {@link SenlinNodeActionCreate} object which is to be - * modified. - */ - public SenlinNodeActionCreateConcreteBuilder(SenlinNodeActionCreate model) { - this.model = model; - } - - @Override - public NodeActionCreate build() { - return model; - } - - @Override - public NodeActionCreateBuilder from(NodeActionCreate in) { - model = (SenlinNodeActionCreate) in; - return this; - } - - @Override - public NodeActionCreateBuilder check(Map check) { - model.check = check; - return this; - } - - @Override - public NodeActionCreateBuilder recover(Map recover) { - model.recover = recover; - return this; - } - - } + private static final long serialVersionUID = 7461515803108018710L; + + @JsonProperty("check") + private Map check; + @JsonProperty("recover") + private Map recover; + + /** + * Returnes a {@link SenlinNodeActionCreateConcreteBuilder} for configuration and + * creation of a {@link SenlinNodeActionCreate} object. + * + * @return a {@link SenlinNodeActionCreateConcreteBuilder} + */ + public static SenlinNodeActionCreateConcreteBuilder build() { + return new SenlinNodeActionCreateConcreteBuilder(); + } + + @Override + public NodeActionCreateBuilder toBuilder() { + return new SenlinNodeActionCreateConcreteBuilder(this); + } + + + /** + * A Builder to create a SenlinNode. Use {@link #build()} to receive the + * {@link NodeCreate} object. + * + * @author lion + */ + public static class SenlinNodeActionCreateConcreteBuilder implements + NodeActionCreateBuilder { + + private SenlinNodeActionCreate model; + + /** + * Constructor to create a {@link SenlinNodeActionCreateConcreteBuilder} object + * with a new, empty {@link SenlinNodeActionCreate} object. + */ + public SenlinNodeActionCreateConcreteBuilder() { + + this(new SenlinNodeActionCreate()); + } + + /** + * Constructor for manipulation of an existing {@link SenlinNodeActionCreate} + * object. + * + * @param model the {@link SenlinNodeActionCreate} object which is to be + * modified. + */ + public SenlinNodeActionCreateConcreteBuilder(SenlinNodeActionCreate model) { + this.model = model; + } + + @Override + public NodeActionCreate build() { + return model; + } + + @Override + public NodeActionCreateBuilder from(NodeActionCreate in) { + model = (SenlinNodeActionCreate) in; + return this; + } + + @Override + public NodeActionCreateBuilder check(Map check) { + model.check = check; + return this; + } + + @Override + public NodeActionCreateBuilder recover(Map recover) { + model.recover = recover; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeCreate.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeCreate.java index 453df36ff..86ca8a5bd 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinNodeCreate.java @@ -13,107 +13,104 @@ * uses Jackson annotation for (de)serialization into JSON * * @author lion - * */ public class SenlinNodeCreate implements NodeCreate { - private static final long serialVersionUID = -5839890526136001718L; - - @JsonProperty("node") - private Map node; - - /** - * Returnes a {@link SenlinNodeCreateConcreteBuilder} for configuration and - * creation of a {@link SenlinNodeCreate} object. - * - * @return a {@link SenlinNodeCreateConcreteBuilder} - */ - public static SenlinNodeCreateConcreteBuilder build() { - return new SenlinNodeCreateConcreteBuilder(); - } - - @Override - public NodeCreateBuilder toBuilder() { - return new SenlinNodeCreateConcreteBuilder(this); - } - - /** - * A Builder to create a SenlinNode. Use {@link #build()} to receive the - * {@link NodeCreate} object. - * - * @author lion - * - */ - public static class SenlinNodeCreateConcreteBuilder implements - NodeCreateBuilder { - - private SenlinNodeCreate model; - - /** - * Constructor to create a {@link SenlinNodeCreateConcreteBuilder} object - * with a new, empty {@link SenlinNodeCreate} object. - */ - public SenlinNodeCreateConcreteBuilder() { - - this(new SenlinNodeCreate()); - } - - /** - * Constructor for manipulation of an existing {@link SenlinNodeCreate} - * object. - * - * @param model - * the {@link SenlinNodeCreate} object which is to be - * modified. - */ - public SenlinNodeCreateConcreteBuilder(SenlinNodeCreate model) { - this.model = model; - - this.model.node = Maps.newHashMap(); - HashMap metadata = Maps.newHashMap(); - this.model.node.put("metadata", metadata); - } - - @Override - public NodeCreate build() { - return model; - } - - @Override - public NodeCreateBuilder from(NodeCreate in) { - model = (SenlinNodeCreate) in; - return this; - } - - @Override - public NodeCreateBuilder clusterID(String clusterID) { - model.node.put("cluster_id", clusterID); - return this; - } - - @Override - public NodeCreateBuilder metadata(Map metadata) { - model.node.put("metadata", metadata); - return this; - } - - @Override - public NodeCreateBuilder name(String name) { - model.node.put("name", name); - return this; - } - - @Override - public NodeCreateBuilder profileID(String profileID) { - model.node.put("profile_id", profileID); - return this; - } - - @Override - public NodeCreateBuilder role(String role) { - model.node.put("role", role); - return this; - } - - } + private static final long serialVersionUID = -5839890526136001718L; + + @JsonProperty("node") + private Map node; + + /** + * Returnes a {@link SenlinNodeCreateConcreteBuilder} for configuration and + * creation of a {@link SenlinNodeCreate} object. + * + * @return a {@link SenlinNodeCreateConcreteBuilder} + */ + public static SenlinNodeCreateConcreteBuilder build() { + return new SenlinNodeCreateConcreteBuilder(); + } + + @Override + public NodeCreateBuilder toBuilder() { + return new SenlinNodeCreateConcreteBuilder(this); + } + + /** + * A Builder to create a SenlinNode. Use {@link #build()} to receive the + * {@link NodeCreate} object. + * + * @author lion + */ + public static class SenlinNodeCreateConcreteBuilder implements + NodeCreateBuilder { + + private SenlinNodeCreate model; + + /** + * Constructor to create a {@link SenlinNodeCreateConcreteBuilder} object + * with a new, empty {@link SenlinNodeCreate} object. + */ + public SenlinNodeCreateConcreteBuilder() { + + this(new SenlinNodeCreate()); + } + + /** + * Constructor for manipulation of an existing {@link SenlinNodeCreate} + * object. + * + * @param model the {@link SenlinNodeCreate} object which is to be + * modified. + */ + public SenlinNodeCreateConcreteBuilder(SenlinNodeCreate model) { + this.model = model; + + this.model.node = Maps.newHashMap(); + HashMap metadata = Maps.newHashMap(); + this.model.node.put("metadata", metadata); + } + + @Override + public NodeCreate build() { + return model; + } + + @Override + public NodeCreateBuilder from(NodeCreate in) { + model = (SenlinNodeCreate) in; + return this; + } + + @Override + public NodeCreateBuilder clusterID(String clusterID) { + model.node.put("cluster_id", clusterID); + return this; + } + + @Override + public NodeCreateBuilder metadata(Map metadata) { + model.node.put("metadata", metadata); + return this; + } + + @Override + public NodeCreateBuilder name(String name) { + model.node.put("name", name); + return this; + } + + @Override + public NodeCreateBuilder profileID(String profileID) { + model.node.put("profile_id", profileID); + return this; + } + + @Override + public NodeCreateBuilder role(String role) { + model.node.put("role", role); + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicy.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicy.java index b48e93728..b4d6ede6b 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicy.java @@ -13,116 +13,114 @@ /** * This is a model of a senlinPolicy. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("policy") public class SenlinPolicy implements Policy { - private static final long serialVersionUID = -8596243151035363550L; - - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("domain") - private String domain; - @JsonProperty("project") - private String project; - @JsonProperty("user") - private String user; - @JsonProperty("data") - private Map data; - @JsonProperty("spec") - private Map spec; - @JsonProperty("type") - private String type; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("updated_at") - private Date updatedAt; - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getDomain() { - return domain; - } - - @Override - public String getProject() { - return project; - } - - @Override - public String getUser() { - return user; - } - - @Override - public Map getData() { - return data; - } - - @Override - public Map getSpec() { - return spec; - } - - @Override - public String getType() { - return type; - } - - @Override - public Date getCreatedAt() { - return createdAt; - } - - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - @Override - public String toString() { - return "SenlinPolicy{" + - "id='" + id + '\'' + - ", name='" + name + '\'' + - ", domain='" + domain + '\'' + - ", project='" + project + '\'' + - ", user='" + user + '\'' + - ", data=" + data + - ", spec=" + spec + - ", type='" + type + '\'' + - ", created_at='" + createdAt + '\'' + - ", updated_at='" + updatedAt + '\'' + - '}'; - } - - /** - * An inner class for representing lists of senlinPolicy - * - * @author lion - * - */ - public static class Policy extends ListResult { - private static final long serialVersionUID = -7262524403002617445L; - - @JsonProperty("policies") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = -8596243151035363550L; + + @JsonProperty("id") + private String id; + @JsonProperty("name") + private String name; + @JsonProperty("domain") + private String domain; + @JsonProperty("project") + private String project; + @JsonProperty("user") + private String user; + @JsonProperty("data") + private Map data; + @JsonProperty("spec") + private Map spec; + @JsonProperty("type") + private String type; + @JsonProperty("created_at") + private Date createdAt; + @JsonProperty("updated_at") + private Date updatedAt; + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDomain() { + return domain; + } + + @Override + public String getProject() { + return project; + } + + @Override + public String getUser() { + return user; + } + + @Override + public Map getData() { + return data; + } + + @Override + public Map getSpec() { + return spec; + } + + @Override + public String getType() { + return type; + } + + @Override + public Date getCreatedAt() { + return createdAt; + } + + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + @Override + public String toString() { + return "SenlinPolicy{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + ", domain='" + domain + '\'' + + ", project='" + project + '\'' + + ", user='" + user + '\'' + + ", data=" + data + + ", spec=" + spec + + ", type='" + type + '\'' + + ", created_at='" + createdAt + '\'' + + ", updated_at='" + updatedAt + '\'' + + '}'; + } + + /** + * An inner class for representing lists of senlinPolicy + * + * @author lion + */ + public static class Policy extends ListResult { + private static final long serialVersionUID = -7262524403002617445L; + + @JsonProperty("policies") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyCreate.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyCreate.java index 5b0dde787..4778d433b 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyCreate.java @@ -13,155 +13,152 @@ * uses Jackson annotation for (de)serialization into JSON * * @author lion - * */ public class SenlinPolicyCreate implements PolicyCreate { - private static final long serialVersionUID = 2130740129242729916L; - - @JsonProperty("policy") - private Map policy; - - /** - * Returnes a {@link SenlinPolicyCreateConcreteBuilder} for configuration and - * creation of a {@link SenlinPolicyCreate} object. - * - * @return a {@link SenlinPolicyCreateConcreteBuilder} - */ - public static SenlinPolicyCreateConcreteBuilder build() { - return new SenlinPolicyCreateConcreteBuilder(); - } - - @Override - public PolicyCreateBuilder toBuilder() { - return new SenlinPolicyCreateConcreteBuilder(this); - } - - /** - * A Builder to create a SenlinPolicy. Use {@link #build()} to receive the - * {@link PolicyCreate} object. - * - * @author lion - * - */ - public static class SenlinPolicyCreateConcreteBuilder implements - PolicyCreateBuilder { - - private SenlinPolicyCreate model; - - /** - * Constructor to create a {@link SenlinPolicyCreateConcreteBuilder} object - * with a new, empty {@link SenlinPolicyCreate} object. - */ - public SenlinPolicyCreateConcreteBuilder() { - - this(new SenlinPolicyCreate()); - } - - /** - * Constructor for manipulation of an existing {@link SenlinPolicyCreate} - * object. - * - * @param model - * the {@link SenlinPolicyCreate} object which is to be - * modified. - */ - public SenlinPolicyCreateConcreteBuilder(SenlinPolicyCreate model) { - this.model = model; - - this.model.policy = Maps.newHashMap(); - HashMap spec = Maps.newHashMap(); - HashMap properties = Maps.newHashMap(); - HashMap adjustment = Maps.newHashMap(); - properties.put("adjustment", adjustment); - spec.put("properties", properties); - this.model.policy.put("spec", spec); - } - - @Override - public PolicyCreate build() { - return model; - } - - @Override - public PolicyCreateBuilder from(PolicyCreate in) { - model = (SenlinPolicyCreate) in; - return this; - } - - @Override - public PolicyCreateBuilder name(String name) { - model.policy.put("name", name); - return this; - } - - @Override - public PolicyCreateBuilder spec(Map spec) { - model.policy.put("spec", spec); - return this; - } - - @Override - public PolicyCreateBuilder properties(Map properties) { - HashMap spec = (HashMap)(model.policy.get("spec")); - spec.put("properties", properties); - return this; - } - - @Override - public PolicyCreateBuilder adjustment(Map adjustment) { - HashMap properties = (HashMap)(((HashMap)(model.policy.get("spec"))).get("properties")); - properties.put("adjustment", adjustment); - return this; - } - - @Override - public PolicyCreateBuilder minStep(int minStep) { - HashMap adjustment = (HashMap)(((HashMap)((HashMap)model.policy - .get("spec")).get("properties")).get("adjustment")); - adjustment.put("min_step", minStep); - return this; - } - - @Override - public PolicyCreateBuilder number(int number) { - HashMap adjustment = (HashMap)(((HashMap)((HashMap)model.policy - .get("spec")).get("properties")).get("adjustment")); - adjustment.put("number", number); - return this; - } - - @Override - public PolicyCreateBuilder adjustmentType(String adjustmentType) { - HashMap adjustment = (HashMap)(((HashMap)((HashMap)model.policy - .get("spec")).get("properties")).get("adjustment")); - adjustment.put("type", adjustmentType); - return this; - } - - @Override - public PolicyCreateBuilder event(String event) { - HashMap properties = (HashMap)((HashMap)model.policy - .get("spec")).get("properties"); - properties.put("event", event); - return this; - } - - @Override - public PolicyCreateBuilder specType(String specType) { - HashMap spec = (HashMap)model.policy - .get("spec"); - spec.put("type", specType); - return this; - } - - @Override - public PolicyCreateBuilder version(String version) { - HashMap spec = (HashMap)model.policy - .get("spec"); - spec.put("version", version); - return this; - } - - } + private static final long serialVersionUID = 2130740129242729916L; + + @JsonProperty("policy") + private Map policy; + + /** + * Returnes a {@link SenlinPolicyCreateConcreteBuilder} for configuration and + * creation of a {@link SenlinPolicyCreate} object. + * + * @return a {@link SenlinPolicyCreateConcreteBuilder} + */ + public static SenlinPolicyCreateConcreteBuilder build() { + return new SenlinPolicyCreateConcreteBuilder(); + } + + @Override + public PolicyCreateBuilder toBuilder() { + return new SenlinPolicyCreateConcreteBuilder(this); + } + + /** + * A Builder to create a SenlinPolicy. Use {@link #build()} to receive the + * {@link PolicyCreate} object. + * + * @author lion + */ + public static class SenlinPolicyCreateConcreteBuilder implements + PolicyCreateBuilder { + + private SenlinPolicyCreate model; + + /** + * Constructor to create a {@link SenlinPolicyCreateConcreteBuilder} object + * with a new, empty {@link SenlinPolicyCreate} object. + */ + public SenlinPolicyCreateConcreteBuilder() { + + this(new SenlinPolicyCreate()); + } + + /** + * Constructor for manipulation of an existing {@link SenlinPolicyCreate} + * object. + * + * @param model the {@link SenlinPolicyCreate} object which is to be + * modified. + */ + public SenlinPolicyCreateConcreteBuilder(SenlinPolicyCreate model) { + this.model = model; + + this.model.policy = Maps.newHashMap(); + HashMap spec = Maps.newHashMap(); + HashMap properties = Maps.newHashMap(); + HashMap adjustment = Maps.newHashMap(); + properties.put("adjustment", adjustment); + spec.put("properties", properties); + this.model.policy.put("spec", spec); + } + + @Override + public PolicyCreate build() { + return model; + } + + @Override + public PolicyCreateBuilder from(PolicyCreate in) { + model = (SenlinPolicyCreate) in; + return this; + } + + @Override + public PolicyCreateBuilder name(String name) { + model.policy.put("name", name); + return this; + } + + @Override + public PolicyCreateBuilder spec(Map spec) { + model.policy.put("spec", spec); + return this; + } + + @Override + public PolicyCreateBuilder properties(Map properties) { + HashMap spec = (HashMap) (model.policy.get("spec")); + spec.put("properties", properties); + return this; + } + + @Override + public PolicyCreateBuilder adjustment(Map adjustment) { + HashMap properties = (HashMap) (((HashMap) (model.policy.get("spec"))).get("properties")); + properties.put("adjustment", adjustment); + return this; + } + + @Override + public PolicyCreateBuilder minStep(int minStep) { + HashMap adjustment = (HashMap) (((HashMap) ((HashMap) model.policy + .get("spec")).get("properties")).get("adjustment")); + adjustment.put("min_step", minStep); + return this; + } + + @Override + public PolicyCreateBuilder number(int number) { + HashMap adjustment = (HashMap) (((HashMap) ((HashMap) model.policy + .get("spec")).get("properties")).get("adjustment")); + adjustment.put("number", number); + return this; + } + + @Override + public PolicyCreateBuilder adjustmentType(String adjustmentType) { + HashMap adjustment = (HashMap) (((HashMap) ((HashMap) model.policy + .get("spec")).get("properties")).get("adjustment")); + adjustment.put("type", adjustmentType); + return this; + } + + @Override + public PolicyCreateBuilder event(String event) { + HashMap properties = (HashMap) ((HashMap) model.policy + .get("spec")).get("properties"); + properties.put("event", event); + return this; + } + + @Override + public PolicyCreateBuilder specType(String specType) { + HashMap spec = (HashMap) model.policy + .get("spec"); + spec.put("type", specType); + return this; + } + + @Override + public PolicyCreateBuilder version(String version) { + HashMap spec = (HashMap) model.policy + .get("spec"); + spec.put("version", version); + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyType.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyType.java index 88de81698..8fc75d5c6 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyType.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinPolicyType.java @@ -12,52 +12,50 @@ /** * This is a model of a senlinPolicy_type. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("policy_type") public class SenlinPolicyType implements PolicyType { - private static final long serialVersionUID = -8893826725585696810L; - - @JsonProperty("name") - private String name; - @JsonProperty("schema") - private Map schema; - - @Override - public String getName() { - return name; - } - - @Override - public Map getSchema() { - return schema; - } - - @Override - public String toString() { - return "SenlinPolicyType{" + - "name='" + name + '\'' + - ", schema=" + schema + - '}'; - } - - /** - * An inner class for representing lists of senlinPolicy_type - * - * @author lion - * - */ - public static class PolicyType extends ListResult { - private static final long serialVersionUID = -4755855096962007407L; - - @JsonProperty("policy_types") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = -8893826725585696810L; + + @JsonProperty("name") + private String name; + @JsonProperty("schema") + private Map schema; + + @Override + public String getName() { + return name; + } + + @Override + public Map getSchema() { + return schema; + } + + @Override + public String toString() { + return "SenlinPolicyType{" + + "name='" + name + '\'' + + ", schema=" + schema + + '}'; + } + + /** + * An inner class for representing lists of senlinPolicy_type + * + * @author lion + */ + public static class PolicyType extends ListResult { + private static final long serialVersionUID = -4755855096962007407L; + + @JsonProperty("policy_types") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfile.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfile.java index 6351887af..f3b221872 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfile.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfile.java @@ -13,116 +13,114 @@ /** * This is a model of a senlinProfile. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("profile") public class SenlinProfile implements Profile { - private static final long serialVersionUID = 5188248340362305141L; - - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("domain") - private String domain; - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("project") - private String project; - @JsonProperty("metadata") - private Map metadata; - @JsonProperty("spec") - private Map spec; - @JsonProperty("type") - private String type; - @JsonProperty("updated_at") - private Date updated_at; - @JsonProperty("user") - private String user; - - @Override - public String getType() { - return type; - } - - @Override - public Date getUpdatedAt() { - return updated_at; - } - - @Override - public String getUser() { - return user; - } - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public Date getCreatedAt() { - return createdAt; - } - - @Override - public String getDomain() { - return domain; - } - - @Override - public String getProject() { - return project; - } - - @Override - public Map getMetadata() { - return metadata; - } - - @Override - public Map getSpec() { - return spec; - } - - @Override - public String toString() { - return "SenlinProfile{" + - "createdAt=" + createdAt + - ", domain='" + domain + '\'' + - ", id='" + id + '\'' + - ", name='" + name + '\'' + - ", project='" + project + '\'' + - ", metadata=" + metadata + - ", spec=" + spec + - ", type='" + type + '\'' + - ", updated_at=" + updated_at + - ", user='" + user + '\'' + - '}'; - } - - /** - * An inner class for representing lists of senlinProfile - * - * @author lion - * - */ - public static class Profile extends ListResult { - private static final long serialVersionUID = -3931672456549086071L; - - @JsonProperty("profiles") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = 5188248340362305141L; + + @JsonProperty("created_at") + private Date createdAt; + @JsonProperty("domain") + private String domain; + @JsonProperty("id") + private String id; + @JsonProperty("name") + private String name; + @JsonProperty("project") + private String project; + @JsonProperty("metadata") + private Map metadata; + @JsonProperty("spec") + private Map spec; + @JsonProperty("type") + private String type; + @JsonProperty("updated_at") + private Date updated_at; + @JsonProperty("user") + private String user; + + @Override + public String getType() { + return type; + } + + @Override + public Date getUpdatedAt() { + return updated_at; + } + + @Override + public String getUser() { + return user; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public Date getCreatedAt() { + return createdAt; + } + + @Override + public String getDomain() { + return domain; + } + + @Override + public String getProject() { + return project; + } + + @Override + public Map getMetadata() { + return metadata; + } + + @Override + public Map getSpec() { + return spec; + } + + @Override + public String toString() { + return "SenlinProfile{" + + "createdAt=" + createdAt + + ", domain='" + domain + '\'' + + ", id='" + id + '\'' + + ", name='" + name + '\'' + + ", project='" + project + '\'' + + ", metadata=" + metadata + + ", spec=" + spec + + ", type='" + type + '\'' + + ", updated_at=" + updated_at + + ", user='" + user + '\'' + + '}'; + } + + /** + * An inner class for representing lists of senlinProfile + * + * @author lion + */ + public static class Profile extends ListResult { + private static final long serialVersionUID = -3931672456549086071L; + + @JsonProperty("profiles") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileCreate.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileCreate.java index 4189d3d56..e1fcb2960 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileCreate.java @@ -13,97 +13,94 @@ * uses Jackson annotation for (de)serialization into JSON * * @author lion - * */ public class SenlinProfileCreate implements ProfileCreate { - private static final long serialVersionUID = -7343560700665811096L; - - @JsonProperty("profile") - private Map profile; - - /** - * Returnes a {@link SenlinProfileCreateConcreteBuilder} for configuration and - * creation of a {@link SenlinProfileCreate} object. - * - * @return a {@link SenlinProfileCreateConcreteBuilder} - */ - public static SenlinProfileCreateConcreteBuilder build() { - return new SenlinProfileCreateConcreteBuilder(); - } - - @Override - public ProfileCreateBuilder toBuilder() { - return new SenlinProfileCreateConcreteBuilder(this); - } - - /** - * A Builder to create a SenlinProfile. Use {@link #build()} to receive the - * {@link ProfileCreate} object. - * - * @author lion - * - */ - public static class SenlinProfileCreateConcreteBuilder implements - ProfileCreateBuilder { - - private SenlinProfileCreate model; - - /** - * Constructor to create a {@link SenlinProfileCreateConcreteBuilder} object - * with a new, empty {@link SenlinProfileCreate} object. - */ - public SenlinProfileCreateConcreteBuilder() { - - this(new SenlinProfileCreate()); - } - - /** - * Constructor for manipulation of an existing {@link SenlinProfileCreate} - * object. - * - * @param model - * the {@link SenlinProfileCreate} object which is to be - * modified. - */ - public SenlinProfileCreateConcreteBuilder(SenlinProfileCreate model) { - this.model = model; - - this.model.profile = Maps.newHashMap(); - HashMap metadata = Maps.newHashMap(); - HashMap spec = Maps.newHashMap(); - this.model.profile.put("metadata", metadata); - this.model.profile.put("spec", spec); - } - - @Override - public ProfileCreate build() { - return model; - } - - @Override - public ProfileCreateBuilder from(ProfileCreate in) { - model = (SenlinProfileCreate) in; - return this; - } - - @Override - public ProfileCreateBuilder name(String name) { - model.profile.put("name", name); - return this; - } - - @Override - public ProfileCreateBuilder spec(Map spec) { - model.profile.put("spec", spec); - return this; - } - - @Override - public ProfileCreateBuilder metadata(Map metadata) { - model.profile.put("metadata", metadata); - return this; - } - - } + private static final long serialVersionUID = -7343560700665811096L; + + @JsonProperty("profile") + private Map profile; + + /** + * Returnes a {@link SenlinProfileCreateConcreteBuilder} for configuration and + * creation of a {@link SenlinProfileCreate} object. + * + * @return a {@link SenlinProfileCreateConcreteBuilder} + */ + public static SenlinProfileCreateConcreteBuilder build() { + return new SenlinProfileCreateConcreteBuilder(); + } + + @Override + public ProfileCreateBuilder toBuilder() { + return new SenlinProfileCreateConcreteBuilder(this); + } + + /** + * A Builder to create a SenlinProfile. Use {@link #build()} to receive the + * {@link ProfileCreate} object. + * + * @author lion + */ + public static class SenlinProfileCreateConcreteBuilder implements + ProfileCreateBuilder { + + private SenlinProfileCreate model; + + /** + * Constructor to create a {@link SenlinProfileCreateConcreteBuilder} object + * with a new, empty {@link SenlinProfileCreate} object. + */ + public SenlinProfileCreateConcreteBuilder() { + + this(new SenlinProfileCreate()); + } + + /** + * Constructor for manipulation of an existing {@link SenlinProfileCreate} + * object. + * + * @param model the {@link SenlinProfileCreate} object which is to be + * modified. + */ + public SenlinProfileCreateConcreteBuilder(SenlinProfileCreate model) { + this.model = model; + + this.model.profile = Maps.newHashMap(); + HashMap metadata = Maps.newHashMap(); + HashMap spec = Maps.newHashMap(); + this.model.profile.put("metadata", metadata); + this.model.profile.put("spec", spec); + } + + @Override + public ProfileCreate build() { + return model; + } + + @Override + public ProfileCreateBuilder from(ProfileCreate in) { + model = (SenlinProfileCreate) in; + return this; + } + + @Override + public ProfileCreateBuilder name(String name) { + model.profile.put("name", name); + return this; + } + + @Override + public ProfileCreateBuilder spec(Map spec) { + model.profile.put("spec", spec); + return this; + } + + @Override + public ProfileCreateBuilder metadata(Map metadata) { + model.profile.put("metadata", metadata); + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileType.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileType.java index 0ae2ca883..848e286d5 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileType.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinProfileType.java @@ -12,52 +12,50 @@ /** * This is a model of a senlinProfile_type. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("profile_type") public class SenlinProfileType implements ProfileType { - private static final long serialVersionUID = -1760618273420931267L; - - @JsonProperty("name") - private String name; - @JsonProperty("schema") - private Map schema; - - @Override - public String getName() { - return name; - } - - @Override - public Map getSchema() { - return schema; - } - - @Override - public String toString() { - return "SenlinProfileType{" + - "name='" + name + '\'' + - ", schema='" + schema + '\'' + - '}'; - } - - /** - * An inner class for representing lists of senlinProfile_type - * - * @author lion - * - */ - public static class ProfileType extends ListResult { - private static final long serialVersionUID = 5526915111653514850L; - - @JsonProperty("profile_types") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = -1760618273420931267L; + + @JsonProperty("name") + private String name; + @JsonProperty("schema") + private Map schema; + + @Override + public String getName() { + return name; + } + + @Override + public Map getSchema() { + return schema; + } + + @Override + public String toString() { + return "SenlinProfileType{" + + "name='" + name + '\'' + + ", schema='" + schema + '\'' + + '}'; + } + + /** + * An inner class for representing lists of senlinProfile_type + * + * @author lion + */ + public static class ProfileType extends ListResult { + private static final long serialVersionUID = 5526915111653514850L; + + @JsonProperty("profile_types") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiver.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiver.java index 49be8ae9f..1b26b3606 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiver.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiver.java @@ -6,7 +6,6 @@ import org.openstack4j.model.senlin.Receiver; import org.openstack4j.openstack.common.ListResult; -import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -14,145 +13,143 @@ /** * This is a model of a senlinReceiver. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("receiver") public class SenlinReceiver implements Receiver { - private static final long serialVersionUID = -6208098906539289716L; - - @JsonProperty("action") - private String action; - @JsonProperty("cluster_id") - private String clusterID; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("domain") - private String domain; - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("project") - private String project; - @JsonProperty("type") - private String type; - @JsonProperty("updated_at") - private Date updatedAt; - @JsonProperty("user") - private String user; - @JsonProperty("actor") - private Map actor; - @JsonProperty("channel") - private Map channel; - @JsonProperty("params") - private Map params; - - @Override - public String getAction() { - return action; - } - - @Override - public String getClusterID() { - return clusterID; - } - - @Override - public Date getCreatedAt() { - return createdAt; - } - - @Override - public String getDomain() { - return domain; - } - - @Override - public String getProject() { - return project; - } - - @Override - public String getType() { - return type; - } - - @Override - public Date getUpdatedAt() { - return updatedAt; - } - - @Override - public String getUser() { - return user; - } - - @Override - public Map getActor() { - return actor; - } - - @Override - public Map getChannel() { - return channel; - } - - @Override - public Map getParams() { - return params; - } - - @Override - public String getId() { - return id; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getWebHook() { - return channel.get("alarm_url").toString(); - } - - @Override - public String toString() { - return "SenlinReceiver{" + - "action='" + action + '\'' + - ", cluster_id='" + clusterID + '\'' + - ", created_at='" + createdAt + '\'' + - ", domain='" + domain + '\'' + - ", id='" + id + '\'' + - ", name='" + name + '\'' + - ", project='" + project + '\'' + - ", type='" + type + '\'' + - ", updated_at='" + updatedAt + '\'' + - ", user='" + user + '\'' + - ", actor=" + actor + - ", channel=" + channel + - ", params=" + params + - '}'; - } - - /** - * An inner class for representing lists of senlinReceivers - * - * @author lion - * - */ - public static class Receiver extends ListResult { - private static final long serialVersionUID = 600661296207420793L; - - @JsonProperty("receivers") - private List list; - - protected List value() { - return list; - } - } + private static final long serialVersionUID = -6208098906539289716L; + + @JsonProperty("action") + private String action; + @JsonProperty("cluster_id") + private String clusterID; + @JsonProperty("created_at") + private Date createdAt; + @JsonProperty("domain") + private String domain; + @JsonProperty("id") + private String id; + @JsonProperty("name") + private String name; + @JsonProperty("project") + private String project; + @JsonProperty("type") + private String type; + @JsonProperty("updated_at") + private Date updatedAt; + @JsonProperty("user") + private String user; + @JsonProperty("actor") + private Map actor; + @JsonProperty("channel") + private Map channel; + @JsonProperty("params") + private Map params; + + @Override + public String getAction() { + return action; + } + + @Override + public String getClusterID() { + return clusterID; + } + + @Override + public Date getCreatedAt() { + return createdAt; + } + + @Override + public String getDomain() { + return domain; + } + + @Override + public String getProject() { + return project; + } + + @Override + public String getType() { + return type; + } + + @Override + public Date getUpdatedAt() { + return updatedAt; + } + + @Override + public String getUser() { + return user; + } + + @Override + public Map getActor() { + return actor; + } + + @Override + public Map getChannel() { + return channel; + } + + @Override + public Map getParams() { + return params; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getWebHook() { + return channel.get("alarm_url").toString(); + } + + @Override + public String toString() { + return "SenlinReceiver{" + + "action='" + action + '\'' + + ", cluster_id='" + clusterID + '\'' + + ", created_at='" + createdAt + '\'' + + ", domain='" + domain + '\'' + + ", id='" + id + '\'' + + ", name='" + name + '\'' + + ", project='" + project + '\'' + + ", type='" + type + '\'' + + ", updated_at='" + updatedAt + '\'' + + ", user='" + user + '\'' + + ", actor=" + actor + + ", channel=" + channel + + ", params=" + params + + '}'; + } + + /** + * An inner class for representing lists of senlinReceivers + * + * @author lion + */ + public static class Receiver extends ListResult { + private static final long serialVersionUID = 600661296207420793L; + + @JsonProperty("receivers") + private List list; + + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiverCreate.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiverCreate.java index 56e802e39..412572449 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiverCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinReceiverCreate.java @@ -13,107 +13,104 @@ * uses Jackson annotation for (de)serialization into JSON * * @author lion - * */ public class SenlinReceiverCreate implements ReceiverCreate { - private static final long serialVersionUID = 280106309296409150L; - - @JsonProperty("receiver") - private Map receiver; - - /** - * Returnes a {@link SenlinReceiverCreateConcreteBuilder} for configuration and - * creation of a {@link SenlinReceiverCreate} object. - * - * @return a {@link SenlinReceiverCreateConcreteBuilder} - */ - public static SenlinReceiverCreateConcreteBuilder build() { - return new SenlinReceiverCreateConcreteBuilder(); - } - - @Override - public ReceiverCreateBuilder toBuilder() { - return new SenlinReceiverCreateConcreteBuilder(this); - } - - /** - * A Builder to create a SenlinReceiver. Use {@link #build()} to receive the - * {@link ReceiverCreate} object. - * - * @author lion - * - */ - public static class SenlinReceiverCreateConcreteBuilder implements - ReceiverCreateBuilder { - - private SenlinReceiverCreate model; - - /** - * Constructor to create a {@link SenlinReceiverCreateConcreteBuilder} object - * with a new, empty {@link SenlinReceiverCreate} object. - */ - public SenlinReceiverCreateConcreteBuilder() { - - this(new SenlinReceiverCreate()); - } - - /** - * Constructor for manipulation of an existing {@link SenlinReceiverCreate} - * object. - * - * @param model - * the {@link SenlinReceiverCreate} object which is to be - * modified. - */ - public SenlinReceiverCreateConcreteBuilder(SenlinReceiverCreate model) { - this.model = model; - - this.model.receiver = Maps.newHashMap(); - HashMap params = Maps.newHashMap(); - this.model.receiver.put("params", params); - } - - @Override - public ReceiverCreate build() { - return model; - } - - @Override - public ReceiverCreateBuilder from(ReceiverCreate in) { - model = (SenlinReceiverCreate) in; - return this; - } - - @Override - public ReceiverCreateBuilder action(String action) { - model.receiver.put("action", action); - return this; - } - - @Override - public ReceiverCreateBuilder clusterID(String clusterID) { - model.receiver.put("cluster_id", clusterID); - return this; - } - - @Override - public ReceiverCreateBuilder name(String name) { - model.receiver.put("name", name); - return this; - } - - @Override - public ReceiverCreateBuilder type(String type) { - model.receiver.put("type", type); - return this; - } - - @Override - public ReceiverCreateBuilder params(Map params) { - model.receiver.put("params", params); - return this; - } - - } + private static final long serialVersionUID = 280106309296409150L; + + @JsonProperty("receiver") + private Map receiver; + + /** + * Returnes a {@link SenlinReceiverCreateConcreteBuilder} for configuration and + * creation of a {@link SenlinReceiverCreate} object. + * + * @return a {@link SenlinReceiverCreateConcreteBuilder} + */ + public static SenlinReceiverCreateConcreteBuilder build() { + return new SenlinReceiverCreateConcreteBuilder(); + } + + @Override + public ReceiverCreateBuilder toBuilder() { + return new SenlinReceiverCreateConcreteBuilder(this); + } + + /** + * A Builder to create a SenlinReceiver. Use {@link #build()} to receive the + * {@link ReceiverCreate} object. + * + * @author lion + */ + public static class SenlinReceiverCreateConcreteBuilder implements + ReceiverCreateBuilder { + + private SenlinReceiverCreate model; + + /** + * Constructor to create a {@link SenlinReceiverCreateConcreteBuilder} object + * with a new, empty {@link SenlinReceiverCreate} object. + */ + public SenlinReceiverCreateConcreteBuilder() { + + this(new SenlinReceiverCreate()); + } + + /** + * Constructor for manipulation of an existing {@link SenlinReceiverCreate} + * object. + * + * @param model the {@link SenlinReceiverCreate} object which is to be + * modified. + */ + public SenlinReceiverCreateConcreteBuilder(SenlinReceiverCreate model) { + this.model = model; + + this.model.receiver = Maps.newHashMap(); + HashMap params = Maps.newHashMap(); + this.model.receiver.put("params", params); + } + + @Override + public ReceiverCreate build() { + return model; + } + + @Override + public ReceiverCreateBuilder from(ReceiverCreate in) { + model = (SenlinReceiverCreate) in; + return this; + } + + @Override + public ReceiverCreateBuilder action(String action) { + model.receiver.put("action", action); + return this; + } + + @Override + public ReceiverCreateBuilder clusterID(String clusterID) { + model.receiver.put("cluster_id", clusterID); + return this; + } + + @Override + public ReceiverCreateBuilder name(String name) { + model.receiver.put("name", name); + return this; + } + + @Override + public ReceiverCreateBuilder type(String type) { + model.receiver.put("type", type); + return this; + } + + @Override + public ReceiverCreateBuilder params(Map params) { + model.receiver.put("params", params); + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinVersion.java b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinVersion.java index 28c4f48d4..97f57c5c9 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinVersion.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/domain/SenlinVersion.java @@ -6,66 +6,63 @@ import org.openstack4j.model.senlin.Version; import org.openstack4j.openstack.common.ListResult; -import java.util.ArrayList; import java.util.List; import java.util.Map; /** * This is a model of a senlinVersion. It uses Jackson annotations for * (de)serialization into JSON format - * + * * @author lion - * */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonRootName("version") public class SenlinVersion implements Version { - private static final long serialVersionUID = -3019833373605658588L; + private static final long serialVersionUID = -3019833373605658588L; - @JsonProperty("status") - private String status; - @JsonProperty("id") - private String id; - @JsonProperty("links") - private List> links; + @JsonProperty("status") + private String status; + @JsonProperty("id") + private String id; + @JsonProperty("links") + private List> links; - @Override - public String getStatus() { - return status; - } + @Override + public String getStatus() { + return status; + } - @Override - public String getId() { - return id; - } + @Override + public String getId() { + return id; + } - @Override - public List> getLinks() { - return links; - } + @Override + public List> getLinks() { + return links; + } - @Override - public String toString() { - return "SenlinVersion{" + - "status='" + status + '\'' + - ", id='" + id + '\'' + - ", links=" + links + - '}'; - } + @Override + public String toString() { + return "SenlinVersion{" + + "status='" + status + '\'' + + ", id='" + id + '\'' + + ", links=" + links + + '}'; + } - /** - * An inner class for representing lists of senlinVersion - * - * @author lion - * - */ - public static class Version extends ListResult { - private static final long serialVersionUID = 6026392138824408084L; - @JsonProperty("versions") - private List list; + /** + * An inner class for representing lists of senlinVersion + * + * @author lion + */ + public static class Version extends ListResult { + private static final long serialVersionUID = 6026392138824408084L; + @JsonProperty("versions") + private List list; - protected List value() { - return list; - } - } + protected List value() { + return list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/BaseSenlinServices.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/BaseSenlinServices.java index 0fe62c915..6c302901d 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/BaseSenlinServices.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/BaseSenlinServices.java @@ -7,14 +7,13 @@ /** * This class is extended by every senlin Service. It is necessary to determine * the correct endpoint (url) for senlin calls. - * + * * @author lion - * */ public class BaseSenlinServices extends BaseOpenStackService { - protected BaseSenlinServices() { - super(ServiceType.CLUSTERING, EnforceVersionToURL.instance("/v1", true)); - } + protected BaseSenlinServices() { + super(ServiceType.CLUSTERING, EnforceVersionToURL.instance("/v1", true)); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinActionServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinActionServiceImpl.java index 066c847fd..24f8b6832 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinActionServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinActionServiceImpl.java @@ -10,19 +10,19 @@ /** * This class contains getters for all implementation of the available action services - * + * * @author lion */ public class SenlinActionServiceImpl extends BaseSenlinServices implements SenlinActionService { - @Override - public List list() { - return get(SenlinAction.Action.class, uri("/actions")).execute().getList(); - } + @Override + public List list() { + return get(SenlinAction.Action.class, uri("/actions")).execute().getList(); + } - @Override - public Action get(String actionID) { - checkNotNull(actionID); - return get(SenlinAction.class, uri("/actions/%s", actionID)).execute(); - } + @Override + public Action get(String actionID) { + checkNotNull(actionID); + return get(SenlinAction.class, uri("/actions/%s", actionID)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinBuildInfoServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinBuildInfoServiceImpl.java index c22f3af07..0997689ba 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinBuildInfoServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinBuildInfoServiceImpl.java @@ -6,13 +6,13 @@ /** * This class contains getters for all implementation of the available build-info services - * + * * @author lion */ public class SenlinBuildInfoServiceImpl extends BaseSenlinServices implements SenlinBuildInfoService { - @Override - public BuildInfo get() { - return get(SenlinBuildInfo.class, uri("/build-info")).execute(); - } + @Override + public BuildInfo get() { + return get(SenlinBuildInfo.class, uri("/build-info")).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterPolicyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterPolicyServiceImpl.java index a8f4c8221..1be95ee5b 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterPolicyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterPolicyServiceImpl.java @@ -10,22 +10,22 @@ /** * This class contains getters for all implementation of the available cluster services - * + * * @author lion */ public class SenlinClusterPolicyServiceImpl extends BaseSenlinServices implements SenlinClusterPolicyService { - @Override - public List list(String clusterID) { - checkNotNull(clusterID); - return get(SenlinClusterPolicy.ClusterPolicy.class, uri("/clusters/%s/policies", clusterID)).execute().getList(); - } + @Override + public List list(String clusterID) { + checkNotNull(clusterID); + return get(SenlinClusterPolicy.ClusterPolicy.class, uri("/clusters/%s/policies", clusterID)).execute().getList(); + } - @Override - public ClusterPolicy get(String clusterID, String policyID) { - checkNotNull(clusterID); - checkNotNull(policyID); - return get(SenlinClusterPolicy.class, uri("/clusters/%s/policies/%s", clusterID, policyID)).execute(); - } + @Override + public ClusterPolicy get(String clusterID, String policyID) { + checkNotNull(clusterID); + checkNotNull(policyID); + return get(SenlinClusterPolicy.class, uri("/clusters/%s/policies/%s", clusterID, policyID)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterServiceImpl.java index 466bd7ba9..33083d4b7 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinClusterServiceImpl.java @@ -15,46 +15,46 @@ /** * This class contains getters for all implementation of the available cluster services - * + * * @author lion */ public class SenlinClusterServiceImpl extends BaseSenlinServices implements SenlinClusterService { - @Override - public List list() { - return get(SenlinCluster.Cluster.class, uri("/clusters")).execute().getList(); - } - - @Override - public Cluster get(String clusterID) { - checkNotNull(clusterID); - return get(SenlinCluster.class, uri("/clusters/%s", clusterID)).execute(); - } - - @Override - public Cluster create(ClusterCreate newCluster) { - checkNotNull(newCluster); - return post(SenlinCluster.class, uri("/clusters")).entity(newCluster).execute(); - } - - @Override - public ActionResponse delete(String clusterID) { - checkNotNull(clusterID); - return deleteWithResponse(uri("/clusters/%s", clusterID)).execute(); - } - - @Override - public Cluster update(String clusterID, ClusterCreate newCluster) { - checkNotNull(clusterID); - checkNotNull(newCluster); - return patch(SenlinCluster.class, uri("/clusters/%s", clusterID)).entity(newCluster).execute(); - } - - @Override - public ActionID action(String clusterID, ClusterActionCreate newClusterAction) { - checkNotNull(clusterID); - checkNotNull(newClusterAction); - return post(SenlinActionID.class, uri("/clusters/%s/actions", clusterID)).entity(newClusterAction).execute(); - } + @Override + public List list() { + return get(SenlinCluster.Cluster.class, uri("/clusters")).execute().getList(); + } + + @Override + public Cluster get(String clusterID) { + checkNotNull(clusterID); + return get(SenlinCluster.class, uri("/clusters/%s", clusterID)).execute(); + } + + @Override + public Cluster create(ClusterCreate newCluster) { + checkNotNull(newCluster); + return post(SenlinCluster.class, uri("/clusters")).entity(newCluster).execute(); + } + + @Override + public ActionResponse delete(String clusterID) { + checkNotNull(clusterID); + return deleteWithResponse(uri("/clusters/%s", clusterID)).execute(); + } + + @Override + public Cluster update(String clusterID, ClusterCreate newCluster) { + checkNotNull(clusterID); + checkNotNull(newCluster); + return patch(SenlinCluster.class, uri("/clusters/%s", clusterID)).entity(newCluster).execute(); + } + + @Override + public ActionID action(String clusterID, ClusterActionCreate newClusterAction) { + checkNotNull(clusterID); + checkNotNull(newClusterAction); + return post(SenlinActionID.class, uri("/clusters/%s/actions", clusterID)).entity(newClusterAction).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinEventServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinEventServiceImpl.java index 4821c2e55..bf0522f72 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinEventServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinEventServiceImpl.java @@ -10,19 +10,19 @@ /** * This class contains getters for all implementation of the available event services - * + * * @author lion */ public class SenlinEventServiceImpl extends BaseSenlinServices implements SenlinEventService { - @Override - public List list() { - return get(SenlinEvent.Event.class, uri("/events")).execute().getList(); - } + @Override + public List list() { + return get(SenlinEvent.Event.class, uri("/events")).execute().getList(); + } - @Override - public Event get(String eventID) { - checkNotNull(eventID); - return get(SenlinEvent.class, uri("/events/%s", eventID)).execute(); - } + @Override + public Event get(String eventID) { + checkNotNull(eventID); + return get(SenlinEvent.class, uri("/events/%s", eventID)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinNodeServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinNodeServiceImpl.java index 7cb1829f5..498ac43b2 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinNodeServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinNodeServiceImpl.java @@ -15,52 +15,52 @@ /** * This class contains getters for all implementation of the available node services - * + * * @author lion */ public class SenlinNodeServiceImpl extends BaseSenlinServices implements SenlinNodeService { - @Override - public List list() { - return get(SenlinNode.Node.class, uri("/nodes")).execute().getList(); - } + @Override + public List list() { + return get(SenlinNode.Node.class, uri("/nodes")).execute().getList(); + } - @Override - public Node create(NodeCreate newNode) { - checkNotNull(newNode); - return post(SenlinNode.class, uri("/nodes")).entity(newNode).execute(); - } + @Override + public Node create(NodeCreate newNode) { + checkNotNull(newNode); + return post(SenlinNode.class, uri("/nodes")).entity(newNode).execute(); + } - @Override - public Node get(String nodeID) { - return get(nodeID, false); //false for backward compatibility - } + @Override + public Node get(String nodeID) { + return get(nodeID, false); //false for backward compatibility + } - @Override - public Node get(final String nodeID, final boolean showDetails) { - checkNotNull(nodeID); - //see at https://developer.openstack.org/api-ref/clustering/?expanded=show-node-details-detail - return get(SenlinNode.class, uri("/nodes/%s", nodeID)).param("show_details", showDetails).execute(); - } + @Override + public Node get(final String nodeID, final boolean showDetails) { + checkNotNull(nodeID); + //see at https://developer.openstack.org/api-ref/clustering/?expanded=show-node-details-detail + return get(SenlinNode.class, uri("/nodes/%s", nodeID)).param("show_details", showDetails).execute(); + } - @Override - public ActionResponse delete(String nodeID) { - checkNotNull(nodeID); - return deleteWithResponse(uri("/nodes/%s", nodeID)).execute(); - } + @Override + public ActionResponse delete(String nodeID) { + checkNotNull(nodeID); + return deleteWithResponse(uri("/nodes/%s", nodeID)).execute(); + } - @Override - public Node update(String nodeID, NodeCreate newNode) { - checkNotNull(nodeID); - checkNotNull(newNode); - return patch(SenlinNode.class, uri("/nodes/%s", nodeID)).entity(newNode).execute(); - } + @Override + public Node update(String nodeID, NodeCreate newNode) { + checkNotNull(nodeID); + checkNotNull(newNode); + return patch(SenlinNode.class, uri("/nodes/%s", nodeID)).entity(newNode).execute(); + } - @Override - public ActionID action(String nodeID, NodeActionCreate newNodeAction) { - checkNotNull(nodeID); - checkNotNull(newNodeAction); - return post(SenlinActionID.class, uri("/nodes/%s/actions", nodeID)).entity(newNodeAction).execute(); - } + @Override + public ActionID action(String nodeID, NodeActionCreate newNodeAction) { + checkNotNull(nodeID); + checkNotNull(newNodeAction); + return post(SenlinActionID.class, uri("/nodes/%s/actions", nodeID)).entity(newNodeAction).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyServiceImpl.java index 1f019c10b..96a871f15 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyServiceImpl.java @@ -12,39 +12,39 @@ /** * This class contains getters for all implementation of the available policy services - * + * * @author lion */ public class SenlinPolicyServiceImpl extends BaseSenlinServices implements SenlinPolicyService { - @Override - public List list() { - return get(SenlinPolicy.Policy.class, uri("/policies")).execute().getList(); - } - - @Override - public Policy create(PolicyCreate newPolicy) { - checkNotNull(newPolicy); - return post(SenlinPolicy.class, uri("/policies")).entity(newPolicy).execute(); - } - - @Override - public Policy get(String policyID) { - checkNotNull(policyID); - return get(SenlinPolicy.class, uri("/policies/%s", policyID)).execute(); - } - - @Override - public Policy update(String policyID, PolicyCreate newPolicy) { - checkNotNull(policyID); - checkNotNull(newPolicy); - return patch(SenlinPolicy.class, uri("/policies/%s", policyID)).entity(newPolicy).execute(); - } - - @Override - public ActionResponse delete(String policyID) { - checkNotNull(policyID); - return deleteWithResponse(uri("/policies/%s", policyID)).execute(); - } + @Override + public List list() { + return get(SenlinPolicy.Policy.class, uri("/policies")).execute().getList(); + } + + @Override + public Policy create(PolicyCreate newPolicy) { + checkNotNull(newPolicy); + return post(SenlinPolicy.class, uri("/policies")).entity(newPolicy).execute(); + } + + @Override + public Policy get(String policyID) { + checkNotNull(policyID); + return get(SenlinPolicy.class, uri("/policies/%s", policyID)).execute(); + } + + @Override + public Policy update(String policyID, PolicyCreate newPolicy) { + checkNotNull(policyID); + checkNotNull(newPolicy); + return patch(SenlinPolicy.class, uri("/policies/%s", policyID)).entity(newPolicy).execute(); + } + + @Override + public ActionResponse delete(String policyID) { + checkNotNull(policyID); + return deleteWithResponse(uri("/policies/%s", policyID)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyTypeServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyTypeServiceImpl.java index 4cb848ec9..9c87062eb 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyTypeServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinPolicyTypeServiceImpl.java @@ -10,19 +10,19 @@ /** * This class contains getters for all implementation of the available policy-type services - * + * * @author lion */ public class SenlinPolicyTypeServiceImpl extends BaseSenlinServices implements SenlinPolicyTypeService { - @Override - public List list() { - return get(SenlinPolicyType.PolicyType.class, uri("/policy-types")).execute().getList(); - } + @Override + public List list() { + return get(SenlinPolicyType.PolicyType.class, uri("/policy-types")).execute().getList(); + } - @Override - public PolicyType get(String policyType) { - checkNotNull(policyType); - return get(SenlinPolicyType.class, uri("/policy-types/%s", policyType)).execute(); - } + @Override + public PolicyType get(String policyType) { + checkNotNull(policyType); + return get(SenlinPolicyType.class, uri("/policy-types/%s", policyType)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileServiceImpl.java index d05782a8c..4093819fd 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileServiceImpl.java @@ -12,38 +12,38 @@ /** * This class contains getters for all implementation of the available profile services - * + * * @author lion */ public class SenlinProfileServiceImpl extends BaseSenlinServices implements SenlinProfileService { - @Override - public List list() { - return get(SenlinProfile.Profile.class, uri("/profiles")).execute().getList(); - } - - @Override - public Profile create(ProfileCreate newProfile) { - checkNotNull(newProfile); - return post(SenlinProfile.class, uri("/profiles")).entity(newProfile).execute(); - } - - @Override - public Profile get(String policyID) { - checkNotNull(policyID); - return get(SenlinProfile.class, uri("/profiles/%s", policyID)).execute(); - } - - @Override - public Profile update(String policyID, ProfileCreate newPolicy) { - checkNotNull(policyID); - checkNotNull(newPolicy); - return patch(SenlinProfile.class, uri("/profiles/%s", policyID)).entity(newPolicy).execute(); - } - - @Override - public ActionResponse delete(String policyID) { - checkNotNull(policyID); - return deleteWithResponse(uri("/profiles/%s", policyID)).execute(); - } + @Override + public List list() { + return get(SenlinProfile.Profile.class, uri("/profiles")).execute().getList(); + } + + @Override + public Profile create(ProfileCreate newProfile) { + checkNotNull(newProfile); + return post(SenlinProfile.class, uri("/profiles")).entity(newProfile).execute(); + } + + @Override + public Profile get(String policyID) { + checkNotNull(policyID); + return get(SenlinProfile.class, uri("/profiles/%s", policyID)).execute(); + } + + @Override + public Profile update(String policyID, ProfileCreate newPolicy) { + checkNotNull(policyID); + checkNotNull(newPolicy); + return patch(SenlinProfile.class, uri("/profiles/%s", policyID)).entity(newPolicy).execute(); + } + + @Override + public ActionResponse delete(String policyID) { + checkNotNull(policyID); + return deleteWithResponse(uri("/profiles/%s", policyID)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileTypeServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileTypeServiceImpl.java index 6e200c495..218685c07 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileTypeServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinProfileTypeServiceImpl.java @@ -10,19 +10,19 @@ /** * This class contains getters for all implementation of the available profile-type services - * + * * @author lion */ public class SenlinProfileTypeServiceImpl extends BaseSenlinServices implements SenlinProfileTypeService { - @Override - public List list() { - return get(SenlinProfileType.ProfileType.class, uri("/profile-types")).execute().getList(); - } + @Override + public List list() { + return get(SenlinProfileType.ProfileType.class, uri("/profile-types")).execute().getList(); + } - @Override - public ProfileType get(String ProfileType) { - checkNotNull(ProfileType); - return get(SenlinProfileType.class, uri("/profile-types/%s", ProfileType)).execute(); - } + @Override + public ProfileType get(String ProfileType) { + checkNotNull(ProfileType); + return get(SenlinProfileType.class, uri("/profile-types/%s", ProfileType)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinReceiverServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinReceiverServiceImpl.java index fa5bb0fa3..bd4db199b 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinReceiverServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinReceiverServiceImpl.java @@ -12,31 +12,31 @@ /** * This class contains getters for all implementation of the available receiver services - * + * * @author lion */ public class SenlinReceiverServiceImpl extends BaseSenlinServices implements SenlinReceiverService { - @Override - public List list() { - return get(SenlinReceiver.Receiver.class, uri("/receivers")).execute().getList(); - } - - @Override - public Receiver create(ReceiverCreate newReceiver) { - checkNotNull(newReceiver); - return post(SenlinReceiver.class, uri("/receivers")).entity(newReceiver).execute(); - } - - @Override - public Receiver get(String policyID) { - checkNotNull(policyID); - return get(SenlinReceiver.class, uri("/receivers/%s", policyID)).execute(); - } - - @Override - public ActionResponse delete(String policyID) { - checkNotNull(policyID); - return deleteWithResponse(uri("/receivers/%s", policyID)).execute(); - } + @Override + public List list() { + return get(SenlinReceiver.Receiver.class, uri("/receivers")).execute().getList(); + } + + @Override + public Receiver create(ReceiverCreate newReceiver) { + checkNotNull(newReceiver); + return post(SenlinReceiver.class, uri("/receivers")).entity(newReceiver).execute(); + } + + @Override + public Receiver get(String policyID) { + checkNotNull(policyID); + return get(SenlinReceiver.class, uri("/receivers/%s", policyID)).execute(); + } + + @Override + public ActionResponse delete(String policyID) { + checkNotNull(policyID); + return deleteWithResponse(uri("/receivers/%s", policyID)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinServiceImpl.java index f6a82e180..729bd2fad 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinServiceImpl.java @@ -6,73 +6,73 @@ /** * This class contains getters for all implementation of the available senlin services - * + * * @author lion */ public class SenlinServiceImpl extends BaseSenlinServices implements SenlinService { - @Override - public SenlinPolicyService policy() { - return Apis.get(SenlinPolicyService.class); - } - - @Override - public SenlinActionService action() { - return Apis.get(SenlinActionService.class); - } - - @Override - public SenlinBuildInfoService buildInfo() { - return Apis.get(SenlinBuildInfoService.class); - } - - @Override - public SenlinClusterPolicyService clusterPolicy() { - return Apis.get(SenlinClusterPolicyService.class); - } - - @Override - public SenlinClusterService cluster() { - return Apis.get(SenlinClusterService.class); - } - - @Override - public SenlinEventService event() { - return Apis.get(SenlinEventService.class); - } - - @Override - public SenlinNodeService node() { - return Apis.get(SenlinNodeService.class); - } - - @Override - public SenlinProfileService profile() { - return Apis.get(SenlinProfileService.class); - } - - @Override - public SenlinProfileTypeService profileType() { - return Apis.get(SenlinProfileTypeService.class); - } - - @Override - public SenlinPolicyTypeService policyType() { - return Apis.get(SenlinPolicyTypeService.class); - } - - @Override - public SenlinReceiverService receiver() { - return Apis.get(SenlinReceiverService.class); - } - - @Override - public SenlinWebHookService webHook() { - return Apis.get(SenlinWebHookService.class); - } - - @Override - public SenlinVersionService version() { - return Apis.get(SenlinVersionService.class); - } + @Override + public SenlinPolicyService policy() { + return Apis.get(SenlinPolicyService.class); + } + + @Override + public SenlinActionService action() { + return Apis.get(SenlinActionService.class); + } + + @Override + public SenlinBuildInfoService buildInfo() { + return Apis.get(SenlinBuildInfoService.class); + } + + @Override + public SenlinClusterPolicyService clusterPolicy() { + return Apis.get(SenlinClusterPolicyService.class); + } + + @Override + public SenlinClusterService cluster() { + return Apis.get(SenlinClusterService.class); + } + + @Override + public SenlinEventService event() { + return Apis.get(SenlinEventService.class); + } + + @Override + public SenlinNodeService node() { + return Apis.get(SenlinNodeService.class); + } + + @Override + public SenlinProfileService profile() { + return Apis.get(SenlinProfileService.class); + } + + @Override + public SenlinProfileTypeService profileType() { + return Apis.get(SenlinProfileTypeService.class); + } + + @Override + public SenlinPolicyTypeService policyType() { + return Apis.get(SenlinPolicyTypeService.class); + } + + @Override + public SenlinReceiverService receiver() { + return Apis.get(SenlinReceiverService.class); + } + + @Override + public SenlinWebHookService webHook() { + return Apis.get(SenlinWebHookService.class); + } + + @Override + public SenlinVersionService version() { + return Apis.get(SenlinVersionService.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinVersionServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinVersionServiceImpl.java index fee13f022..5db2c1796 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinVersionServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinVersionServiceImpl.java @@ -10,17 +10,17 @@ /** * This class contains getters for all implementation of the available version services - * + * * @author lion */ public class SenlinVersionServiceImpl extends BaseOpenStackService implements SenlinVersionService { - public SenlinVersionServiceImpl() { - super(ServiceType.CLUSTERING); - } + public SenlinVersionServiceImpl() { + super(ServiceType.CLUSTERING); + } - @Override - public List list() { - return get(SenlinVersion.Version.class, uri("/")).execute().getList(); - } + @Override + public List list() { + return get(SenlinVersion.Version.class, uri("/")).execute().getList(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java index 8c8dcb796..dc12dd90c 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java @@ -12,17 +12,17 @@ /** * This class contains getters for all implementation of the available webHook services - * + * * @author lion */ public class SenlinWebHookServiceImpl extends BaseOpenStackService implements SenlinWebHookService { - @Override - public ActionID action(String webHookUrl) { - checkNotNull(webHookUrl); - HttpRequest newReq = new HttpRequest(); - newReq.toBuilder().methodPost().endpoint(webHookUrl).path(""); - newReq.builder(SenlinAction.class); - return HttpExecutor.create().execute(newReq).getEntity(SenlinActionID.class); - } + @Override + public ActionID action(String webHookUrl) { + checkNotNull(webHookUrl); + HttpRequest newReq = new HttpRequest(); + newReq.toBuilder().methodPost().endpoint(webHookUrl).path(""); + newReq.builder(SenlinAction.class); + return HttpExecutor.create().execute(newReq).getEntity(SenlinActionID.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/builder/CinderBuilders.java b/core/src/main/java/org/openstack4j/openstack/storage/block/builder/CinderBuilders.java index b6120a960..7c5baa5bf 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/builder/CinderBuilders.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/builder/CinderBuilders.java @@ -2,7 +2,10 @@ import org.openstack4j.model.storage.block.builder.*; -import org.openstack4j.openstack.storage.block.domain.*; +import org.openstack4j.openstack.storage.block.domain.CinderBlockQuotaSet; +import org.openstack4j.openstack.storage.block.domain.CinderVolume; +import org.openstack4j.openstack.storage.block.domain.CinderVolumeBackupCreate; +import org.openstack4j.openstack.storage.block.domain.CinderVolumeSnapshot; public class CinderBuilders implements StorageBuilders { @@ -24,9 +27,9 @@ public VolumeBuilder volume() { public VolumeSnapshotBuilder volumeSnapshot() { return CinderVolumeSnapshot.builder(); } - + @Override - public VolumeBackupCreateBuilder volumeBackupCreate(){ - return CinderVolumeBackupCreate.builder(); + public VolumeBackupCreateBuilder volumeBackupCreate() { + return CinderVolumeBackupCreate.builder(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AttachAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AttachAction.java index 6aa729921..705012d13 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AttachAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AttachAction.java @@ -1,71 +1,71 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; /** * os attach - * @author Wang Ting/王婷 * + * @author Wang Ting/王婷 */ @JsonRootName("os-attach") public class AttachAction implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + /** + * The UUID of the attaching instance. + */ + @JsonProperty("instance_uuid") + private String instanceId; + + /** + * The attaching mount point. + */ + @JsonProperty + private String mountpoint; + + /** + * The name of the attaching host. + */ + @JsonProperty("host_name") + private String hostName; - /** - * The UUID of the attaching instance. - */ - @JsonProperty("instance_uuid") - private String instanceId; - - /** - * The attaching mount point. - */ - @JsonProperty - private String mountpoint; + /** + *
Description: + *

Author:Wang Ting/王婷

+ * + * @param instanceId + * @param mountpoint + * @param hostName + * @param serverId + */ - /** - * The name of the attaching host. - */ - @JsonProperty("host_name") - private String hostName ; - - /** - *
Description: - *

Author:Wang Ting/王婷

- * @param instanceId - * @param mountpoint - * @param hostName - * @param serverId - */ - - public AttachAction(String instanceId, String mountpoint, String hostName) { - super(); - this.instanceId = instanceId; - this.mountpoint = mountpoint; - this.hostName = hostName; - } + public AttachAction(String instanceId, String mountpoint, String hostName) { + super(); + this.instanceId = instanceId; + this.mountpoint = mountpoint; + this.hostName = hostName; + } - public String getMountpoint() { - return mountpoint; - } + public String getMountpoint() { + return mountpoint; + } - public void setMountpoint(String mountpoint) { - this.mountpoint = mountpoint; - } + public void setMountpoint(String mountpoint) { + this.mountpoint = mountpoint; + } - public String getHostName() { - return hostName; - } + public String getHostName() { + return hostName; + } - public void setHostName(String hostName) { - this.hostName = hostName; - } + public void setHostName(String hostName) { + this.hostName = hostName; + } - public String getInstanceId() { - return instanceId; - } + public String getInstanceId() { + return instanceId; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java index 0ef2ed60a..e3039bb81 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java @@ -4,8 +4,8 @@ /** * Availability Zone Model Entity - * - * @author Jeff Hu + * + * @author Jeff Hu */ public interface AvailabilityZone extends ModelEntity { @@ -19,8 +19,8 @@ public interface AvailabilityZone extends ModelEntity { * @return zone's name */ String getZoneName(); - - + + public interface ZoneState extends ModelEntity { /** @@ -30,6 +30,5 @@ public interface ZoneState extends ModelEntity { } - } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBackendStoragePool.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBackendStoragePool.java index 49adb41de..f548f086f 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBackendStoragePool.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBackendStoragePool.java @@ -9,7 +9,6 @@ * Represents a back-end storage pool for Cinder. * * @author chenguofeng - * */ public class CinderBackendStoragePool implements VolumeBackendPool { private String name; @@ -69,39 +68,71 @@ public static class CinderCapabilities implements Capabilities { private String storageProtocol; - @Override public String getPoolname() { return poolname; } @Override - public String getGoodnessfunction() { return goodnessfunction; } + public String getGoodnessfunction() { + return goodnessfunction; + } + @Override public Integer getTotalvolumes() { return totalvolumes; } + @Override - public Boolean getMultiattach() { return multiattach; } + public Boolean getMultiattach() { + return multiattach; + } + @Override - public Long getProvisionedcapacitygb() { return provisionedcapacitygb; } + public Long getProvisionedcapacitygb() { + return provisionedcapacitygb; + } + @Override - public String getTimestamp() { return timestamp; } + public String getTimestamp() { + return timestamp; + } + @Override - public Integer getAllocatedcapacitygb() { return allocatedcapacitygb; } + public Integer getAllocatedcapacitygb() { + return allocatedcapacitygb; + } @Override - public Boolean getThinprovisioningsupport() { return thinprovisioningsupport; } + public Boolean getThinprovisioningsupport() { + return thinprovisioningsupport; + } + @Override - public String getLocationinfo() { return locationinfo; } + public String getLocationinfo() { + return locationinfo; + } + @Override - public Boolean getThickprovisioningsupport() { return thickprovisioningsupport; } + public Boolean getThickprovisioningsupport() { + return thickprovisioningsupport; + } + @Override - public Long getMaxoversubscription_ratio() { return maxoversubscription_ratio; } + public Long getMaxoversubscription_ratio() { + return maxoversubscription_ratio; + } + @Override - public String getvendorname() { return vendorname; } + public String getvendorname() { + return vendorname; + } + @Override - public String getFilterfunction() { return filterfunction; } + public String getFilterfunction() { + return filterfunction; + } + @Override public Boolean getQosSupport() { return qosSupport; diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockLimits.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockLimits.java index 486b9dc7a..6a5847563 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockLimits.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockLimits.java @@ -1,11 +1,10 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.storage.block.BlockLimits; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.storage.block.BlockLimits; /** * Show absolute limits for a tenant @@ -13,7 +12,7 @@ * @author Jeremy Unruh */ @JsonRootName("limits") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class CinderBlockLimits implements BlockLimits { @JsonProperty @@ -95,12 +94,12 @@ public int getTotalGigabytesUsed() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("totalSnapshotsUsed", totalSnapshotsUsed).add("maxTotalBackups", maxTotalBackups) - .add("maxTotalVolumeGigabytes", maxTotalVolumeGigabytes).add("maxTotalSnapshots", maxTotalSnapshots) - .add("maxTotalBackupGigabytes", maxTotalBackupGigabytes).add("totalBackupGigabytesUsed", totalBackupGigabytesUsed) - .add("maxTotalVolumes", maxTotalVolumes).add("totalVolumesUsed", totalVolumesUsed) - .add("totalBackupsUsed", totalBackupsUsed).add("totalGigabytesUsed", totalGigabytesUsed) - .toString(); + .add("totalSnapshotsUsed", totalSnapshotsUsed).add("maxTotalBackups", maxTotalBackups) + .add("maxTotalVolumeGigabytes", maxTotalVolumeGigabytes).add("maxTotalSnapshots", maxTotalSnapshots) + .add("maxTotalBackupGigabytes", maxTotalBackupGigabytes).add("totalBackupGigabytesUsed", totalBackupGigabytesUsed) + .add("maxTotalVolumes", maxTotalVolumes).add("totalVolumesUsed", totalVolumesUsed) + .add("totalBackupsUsed", totalBackupsUsed).add("totalGigabytesUsed", totalGigabytesUsed) + .toString(); } } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSet.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSet.java index 9dda62b85..1733eb69e 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSet.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSet.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.storage.block.domain; -import static com.google.common.base.MoreObjects.toStringHelper; - -import org.openstack4j.model.storage.block.BlockQuotaSet; -import org.openstack4j.model.storage.block.builder.BlockQuotaSetBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.storage.block.BlockQuotaSet; +import org.openstack4j.model.storage.block.builder.BlockQuotaSetBuilder; + +import static com.google.common.base.MoreObjects.toStringHelper; /** * An OpenStack Quota-Set @@ -15,7 +14,7 @@ * @author Jeremy Unruh */ @JsonRootName("quota_set") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class CinderBlockQuotaSet implements BlockQuotaSet { private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSetUsage.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSetUsage.java index afffe6493..6d5d273b8 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSetUsage.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderBlockQuotaSetUsage.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.storage.block.domain; -import static com.google.common.base.MoreObjects.toStringHelper; - +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.common.QuotaDetails; import org.openstack4j.model.storage.block.BlockQuotaSetUsage; import org.openstack4j.openstack.common.QuotaDetailsEntity; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import static com.google.common.base.MoreObjects.toStringHelper; /** * Block Quota-Set Usage Details @@ -16,7 +15,7 @@ * @author Jeremy Unruh */ @JsonRootName("quota_set") -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class CinderBlockQuotaSetUsage implements BlockQuotaSetUsage { private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderUploadImageData.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderUploadImageData.java index cb6795f39..5c8bda14c 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderUploadImageData.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderUploadImageData.java @@ -1,16 +1,15 @@ package org.openstack4j.openstack.storage.block.domain; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.ModelEntity; import org.openstack4j.model.image.ContainerFormat; import org.openstack4j.model.image.DiskFormat; import org.openstack4j.model.storage.block.options.UploadImageData; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; - /** * REST Entity for uploading a Volume to the Image Service - * + * * @author Jeremy Unruh */ @JsonRootName("os-volume_upload_image") @@ -25,10 +24,10 @@ public class CinderUploadImageData implements ModelEntity { private DiskFormat diskFormat; @JsonProperty("force") private boolean force; - + public CinderUploadImageData() { } - + public static CinderUploadImageData create(UploadImageData data) { CinderUploadImageData ret = new CinderUploadImageData(); ret.imageName = data.getImageName(); @@ -37,5 +36,5 @@ public static CinderUploadImageData create(UploadImageData data) { ret.force = data.isForce(); return ret; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolume.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolume.java index 709b32424..22d78a0ad 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolume.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolume.java @@ -1,20 +1,19 @@ package org.openstack4j.openstack.storage.block.domain; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import org.openstack4j.model.storage.block.Volume; -import org.openstack4j.model.storage.block.VolumeAttachment; -import org.openstack4j.model.storage.block.builder.VolumeBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.storage.block.Volume; +import org.openstack4j.model.storage.block.VolumeAttachment; +import org.openstack4j.model.storage.block.builder.VolumeBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; +import java.util.Map; /** * An OpenStack Volume @@ -24,359 +23,362 @@ @JsonRootName("volume") public class CinderVolume implements Volume { - private static final long serialVersionUID = 1L; - - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("display_name") - private String displayName; - @JsonProperty("description") - private String description; - @JsonProperty("display_description") - private String displayDescription; - private Status status; - @JsonInclude(Include.NON_DEFAULT) - @JsonProperty("size") - private Integer size; - @JsonProperty("availability_zone") - private String zone; - @JsonProperty("created_at") - private Date created; - @JsonProperty("volume_type") - private String volumeType; - @JsonProperty("imageRef") - private String imageRef; - @JsonProperty("multiattach") - private Boolean multiattach; - @JsonProperty("source_volid") - private String sourceVolid; - @JsonProperty("snapshot_id") - private String snapshotId; - @JsonProperty("metadata") - private Map metadata; - @JsonProperty("bootable") - private Boolean bootable; - @JsonProperty("attachments") - private List attachments; - @JsonProperty("image_id") - private String imageId; - @JsonProperty("volume_image_metadata") - private Map imageMetadata; - @JsonProperty("os-vol-mig-status-attr:migstat") - private MigrationStatus migrateStatus; - @JsonProperty("os-vol-tenant-attr:tenant_id") - private String tenantId; - @JsonProperty("encrypted") - private Boolean encrypted; - @JsonProperty("os-vol-host-attr:host") - private String host; - /** - * {@inheritDoc} - */ - @Override - public VolumeBuilder toBuilder() { - return new ConcreteVolumeBuilder(this); - } - - /** - * @return the Volume Builder - */ - public static VolumeBuilder builder() { - return new ConcreteVolumeBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDisplayName() { - return displayName; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDisplayDescription() { - return displayDescription; - } - - /** - * {@inheritDoc} - */ - @Override - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public int getSize() { - return (size == null) ? 0 : size; - } - - /** - * {@inheritDoc} - */ - @Override - public String getZone() { - return zone; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreated() { - return created; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVolumeType() { - return volumeType; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSnapshotId() { - return snapshotId; - } - - /** - * {@inheritDoc} - */ - @Override - public MigrationStatus getMigrateStatus() { - return migrateStatus != null ? migrateStatus : MigrationStatus.NONE; - } - - /** - * {@inheritDoc} - */ - @Override - public String getImageRef() { - if (imageRef != null) - return imageRef; - - // Depending on whether this is a Listing or a direct Get the information is different so we are smart - // about returning the proper imageId if applicable - if (imageId == null && imageMetadata != null && imageMetadata.containsKey("image_id")) - imageId = String.valueOf(imageMetadata.get("image_id")); - - return imageId; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean multiattach(){ - return multiattach; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSourceVolid() { - return sourceVolid; - } - - /** - * {@inheritDoc} - */ - @JsonIgnore - @Override - public Map getMetaData() { - return metadata; - } - - /** - * {@inheritDoc} - */ - @Override - public List getAttachments() { - return attachments; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTenantId() { - return tenantId; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean bootable(){ - return bootable; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean encrypted(){ - return encrypted; - } - - /** - * {@inheritDoc} - */ - @Override - public String host() { return host; } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("description", description) - .add("status", status).add("size", size).add("zone", zone).add("created", created) - .add("volumeType", volumeType).add("imageRef", getImageRef()).add("multiattach", multiattach) - .add("sourceVolid", sourceVolid).add("snapshotId", snapshotId).add("metadata", metadata) - .add("bootable", bootable) - .toString(); - } - - public static class Volumes extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("volumes") - private List volumes; - - @Override - protected List value() { - return volumes; - } - } - - public static class ConcreteVolumeBuilder implements VolumeBuilder { - - private CinderVolume m; - - ConcreteVolumeBuilder() { - this(new CinderVolume()); - } - - ConcreteVolumeBuilder(CinderVolume m) { - this.m = m; - } - - @Override - public VolumeBuilder name(String name) { - m.name = name; - m.displayName = name; - return this; - } - - @Override - public VolumeBuilder description(String description) { - m.description = description; - m.displayDescription = description; - return this; - } - - @Override - public VolumeBuilder source_volid(String uuid) { - m.sourceVolid = uuid; - return this; - } - - @Override - public VolumeBuilder snapshot(String snapshotId) { - m.snapshotId = snapshotId; - return this; - } - - @Override - public VolumeBuilder imageRef(String imageRef) { - m.imageRef = imageRef; - return this; - } - - @Override - public VolumeBuilder multiattach(Boolean multiattach) { - m.multiattach = multiattach; - return this; - } - - @Override - public VolumeBuilder size(int size) { - m.size = size; - return this; - } - - @Override - public VolumeBuilder volumeType(String volumeType) { - m.volumeType = volumeType; - return this; - } - - @Override - public VolumeBuilder bootable(boolean isBootable) { - m.bootable = isBootable; - return this; - } - - @Override - public VolumeBuilder metadata(Map metadata) { - m.metadata = metadata; - return this; - } - - @Override - public Volume build() { - return m; - } - - @Override - public VolumeBuilder from(Volume in) { - m = (CinderVolume) in; - return this; - } + private static final long serialVersionUID = 1L; + + private String id; + @JsonProperty("name") + private String name; + @JsonProperty("display_name") + private String displayName; + @JsonProperty("description") + private String description; + @JsonProperty("display_description") + private String displayDescription; + private Status status; + @JsonInclude(Include.NON_DEFAULT) + @JsonProperty("size") + private Integer size; + @JsonProperty("availability_zone") + private String zone; + @JsonProperty("created_at") + private Date created; + @JsonProperty("volume_type") + private String volumeType; + @JsonProperty("imageRef") + private String imageRef; + @JsonProperty("multiattach") + private Boolean multiattach; + @JsonProperty("source_volid") + private String sourceVolid; + @JsonProperty("snapshot_id") + private String snapshotId; + @JsonProperty("metadata") + private Map metadata; + @JsonProperty("bootable") + private Boolean bootable; + @JsonProperty("attachments") + private List attachments; + @JsonProperty("image_id") + private String imageId; + @JsonProperty("volume_image_metadata") + private Map imageMetadata; + @JsonProperty("os-vol-mig-status-attr:migstat") + private MigrationStatus migrateStatus; + @JsonProperty("os-vol-tenant-attr:tenant_id") + private String tenantId; + @JsonProperty("encrypted") + private Boolean encrypted; + @JsonProperty("os-vol-host-attr:host") + private String host; + + /** + * {@inheritDoc} + */ + @Override + public VolumeBuilder toBuilder() { + return new ConcreteVolumeBuilder(this); + } + + /** + * @return the Volume Builder + */ + public static VolumeBuilder builder() { + return new ConcreteVolumeBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDisplayName() { + return displayName; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDisplayDescription() { + return displayDescription; + } + + /** + * {@inheritDoc} + */ + @Override + public Status getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSize() { + return (size == null) ? 0 : size; + } + + /** + * {@inheritDoc} + */ + @Override + public String getZone() { + return zone; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreated() { + return created; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVolumeType() { + return volumeType; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSnapshotId() { + return snapshotId; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrationStatus getMigrateStatus() { + return migrateStatus != null ? migrateStatus : MigrationStatus.NONE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getImageRef() { + if (imageRef != null) + return imageRef; + + // Depending on whether this is a Listing or a direct Get the information is different so we are smart + // about returning the proper imageId if applicable + if (imageId == null && imageMetadata != null && imageMetadata.containsKey("image_id")) + imageId = String.valueOf(imageMetadata.get("image_id")); + + return imageId; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean multiattach() { + return multiattach; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSourceVolid() { + return sourceVolid; + } + + /** + * {@inheritDoc} + */ + @JsonIgnore + @Override + public Map getMetaData() { + return metadata; + } + + /** + * {@inheritDoc} + */ + @Override + public List getAttachments() { + return attachments; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTenantId() { + return tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean bootable() { + return bootable; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean encrypted() { + return encrypted; + } + + /** + * {@inheritDoc} + */ + @Override + public String host() { + return host; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("description", description) + .add("status", status).add("size", size).add("zone", zone).add("created", created) + .add("volumeType", volumeType).add("imageRef", getImageRef()).add("multiattach", multiattach) + .add("sourceVolid", sourceVolid).add("snapshotId", snapshotId).add("metadata", metadata) + .add("bootable", bootable) + .toString(); + } + + public static class Volumes extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("volumes") + private List volumes; + + @Override + protected List value() { + return volumes; + } + } + + public static class ConcreteVolumeBuilder implements VolumeBuilder { + + private CinderVolume m; + + ConcreteVolumeBuilder() { + this(new CinderVolume()); + } + + ConcreteVolumeBuilder(CinderVolume m) { + this.m = m; + } + + @Override + public VolumeBuilder name(String name) { + m.name = name; + m.displayName = name; + return this; + } + + @Override + public VolumeBuilder description(String description) { + m.description = description; + m.displayDescription = description; + return this; + } + + @Override + public VolumeBuilder source_volid(String uuid) { + m.sourceVolid = uuid; + return this; + } + + @Override + public VolumeBuilder snapshot(String snapshotId) { + m.snapshotId = snapshotId; + return this; + } + + @Override + public VolumeBuilder imageRef(String imageRef) { + m.imageRef = imageRef; + return this; + } + + @Override + public VolumeBuilder multiattach(Boolean multiattach) { + m.multiattach = multiattach; + return this; + } + + @Override + public VolumeBuilder size(int size) { + m.size = size; + return this; + } + + @Override + public VolumeBuilder volumeType(String volumeType) { + m.volumeType = volumeType; + return this; + } + + @Override + public VolumeBuilder bootable(boolean isBootable) { + m.bootable = isBootable; + return this; + } + + @Override + public VolumeBuilder metadata(Map metadata) { + m.metadata = metadata; + return this; + } + + @Override + public Volume build() { + return m; + } + + @Override + public VolumeBuilder from(Volume in) { + m = (CinderVolume) in; + return this; + } @Override public VolumeBuilder zone(String zone) { m.zone = zone; return this; } - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeAttachment.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeAttachment.java index f9385cb63..5ca1574a3 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeAttachment.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeAttachment.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.storage.block.VolumeAttachment; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.storage.block.VolumeAttachment; /** * return a description for this volume attachment job @@ -14,60 +13,59 @@ @JsonRootName("volumeAttachment") public class CinderVolumeAttachment implements VolumeAttachment { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty - private String device; + @JsonProperty + private String device; - @JsonProperty - private String host_name; + @JsonProperty + private String host_name; - @JsonProperty - private String id; + @JsonProperty + private String id; - @JsonProperty - private String server_id; - - @JsonProperty - private String attachment_id; + @JsonProperty + private String server_id; - @JsonProperty - private String volume_id; + @JsonProperty + private String attachment_id; - @Override - public String getDevice() { - return device; - } + @JsonProperty + private String volume_id; - @Override - public String getHostname() { - return host_name; - } + @Override + public String getDevice() { + return device; + } - @Override - public String getId() { - return id; - } + @Override + public String getHostname() { + return host_name; + } - @Override - public String getServerId() { - return server_id; + @Override + public String getId() { + return id; + } - } + @Override + public String getServerId() { + return server_id; - @Override - public String getVolumeId() { - return volume_id; - } + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("device", device).add("id", id).add("serverId", server_id) - .add("volumeId", volume_id).add("hostname", host_name).toString(); + @Override + public String getVolumeId() { + return volume_id; + } - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("device", device).add("id", id).add("serverId", server_id) + .add("volumeId", volume_id).add("hostname", host_name).toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackup.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackup.java index 1d7d5f72c..69b5a9169 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackup.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackup.java @@ -1,181 +1,179 @@ package org.openstack4j.openstack.storage.block.domain; -import java.util.Date; -import java.util.List; - -import javax.annotation.Nullable; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.storage.block.VolumeBackup; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import javax.annotation.Nullable; +import java.util.Date; +import java.util.List; @JsonRootName("backup") -public class CinderVolumeBackup implements VolumeBackup{ - private static final long serialVersionUID = 1L; - - private String id; - private String name; - @Nullable - private Status status; - private String description; - private int size; - private String container; - - @JsonProperty("volume_id") - private String volumeId; - - @JsonProperty("availability_zone") - @Nullable - private String zone; - - @JsonProperty("created_at") - private Date created; - - @JsonProperty("fail_reason") - private String failReason; - - @JsonProperty("object_count") - private int objectCount; - - @JsonProperty("has_dependent_backups") - @Nullable - private Boolean hasDependent; - - @JsonProperty("is_incremental") - @Nullable - private Boolean incremental; - - @JsonProperty("snapshot_id") - @Nullable - private String snapshotId; - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVolumeId() { - return volumeId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getZone() { - return zone; - } - - /** - * {@inheritDoc} - */ - @Override - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean isIncremental(){ - return incremental; - } - - /** - * {@inheritDoc} - */ - @Override - public int getSize() { - return size; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreated() { - return created; - } - - /** - * {@inheritDoc} - */ - @Override - public String getContainer() { - return container; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFailReason() { - return failReason; - } - - /** - * {@inheritDoc} - */ - @Override - public int getObjectCount() { - return objectCount; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean hasDependent() { - return hasDependent; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSnapshotId() { - return snapshotId; - } - - - public static class VolumeBackups extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("backups") - private List backups; - - @Override - protected List value() { - return backups; - } - } +public class CinderVolumeBackup implements VolumeBackup { + private static final long serialVersionUID = 1L; + + private String id; + private String name; + @Nullable + private Status status; + private String description; + private int size; + private String container; + + @JsonProperty("volume_id") + private String volumeId; + + @JsonProperty("availability_zone") + @Nullable + private String zone; + + @JsonProperty("created_at") + private Date created; + + @JsonProperty("fail_reason") + private String failReason; + + @JsonProperty("object_count") + private int objectCount; + + @JsonProperty("has_dependent_backups") + @Nullable + private Boolean hasDependent; + + @JsonProperty("is_incremental") + @Nullable + private Boolean incremental; + + @JsonProperty("snapshot_id") + @Nullable + private String snapshotId; + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVolumeId() { + return volumeId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getZone() { + return zone; + } + + /** + * {@inheritDoc} + */ + @Override + public Status getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean isIncremental() { + return incremental; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSize() { + return size; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreated() { + return created; + } + + /** + * {@inheritDoc} + */ + @Override + public String getContainer() { + return container; + } + + /** + * {@inheritDoc} + */ + @Override + public String getFailReason() { + return failReason; + } + + /** + * {@inheritDoc} + */ + @Override + public int getObjectCount() { + return objectCount; + } + + /** + * {@inheritDoc} + */ + @Override + public Boolean hasDependent() { + return hasDependent; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSnapshotId() { + return snapshotId; + } + + + public static class VolumeBackups extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("backups") + private List backups; + + @Override + protected List value() { + return backups; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupCreate.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupCreate.java index b368cbb63..a72e9591f 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupCreate.java @@ -1,157 +1,156 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.storage.block.VolumeBackupCreate; -import org.openstack4j.model.storage.block.builder.VolumeBackupCreateBuilder; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.storage.block.VolumeBackupCreate; +import org.openstack4j.model.storage.block.builder.VolumeBackupCreateBuilder; @JsonRootName("backup") public class CinderVolumeBackupCreate implements VolumeBackupCreate { - private static final long serialVersionUID = 1L; - - private String name; - private String description; - private String container; - @JsonProperty("volume_id") - private String volumeId; - @JsonProperty("incremental") - private boolean incremental; - @JsonProperty("force") - private boolean force; - @JsonProperty("snapshot_id") - private String snapshotId; - - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVolumeId() { - return volumeId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isIncremental() { - return incremental; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isForce() { - return force; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSnapshotId() { - return snapshotId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getContainer() { - return container; - } - - public static VolumeBackupCreateConcreteBuilder builder() { - return new VolumeBackupCreateConcreteBuilder(); - } - - @Override - public VolumeBackupCreateBuilder toBuilder() { - return new VolumeBackupCreateConcreteBuilder(this); - } - - public static class VolumeBackupCreateConcreteBuilder implements VolumeBackupCreateBuilder { - - private CinderVolumeBackupCreate model; - - public VolumeBackupCreateConcreteBuilder() { - this.model = new CinderVolumeBackupCreate(); - } - - public VolumeBackupCreateConcreteBuilder(CinderVolumeBackupCreate model) { - this.model = model; - } - - @Override - public VolumeBackupCreate build() { - return model; - } - - @Override - public VolumeBackupCreateBuilder from(VolumeBackupCreate in) { - // TODO Auto-generated method stub - return null; - } - - @Override - public VolumeBackupCreateBuilder name(String name) { - model.name = name; - return this; - } - - @Override - public VolumeBackupCreateBuilder description(String description) { - model.description = description; - return this; - } - - @Override - public VolumeBackupCreateBuilder volumeId(String volumeId) { - model.volumeId = volumeId; - return this; - } - - @Override - public VolumeBackupCreateBuilder container(String container) { - model.container = container; - return this; - } - - @Override - public VolumeBackupCreateBuilder incremental(boolean incremental) { - model.incremental = incremental; - return this; - } - - @Override - public VolumeBackupCreateBuilder force(boolean force) { - model.force = force; - return this; - } - - @Override - public VolumeBackupCreateBuilder snapshotId(String snapshotId) { - model.snapshotId = snapshotId; - return this; - } - } + private static final long serialVersionUID = 1L; + + private String name; + private String description; + private String container; + @JsonProperty("volume_id") + private String volumeId; + @JsonProperty("incremental") + private boolean incremental; + @JsonProperty("force") + private boolean force; + @JsonProperty("snapshot_id") + private String snapshotId; + + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVolumeId() { + return volumeId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isIncremental() { + return incremental; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isForce() { + return force; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSnapshotId() { + return snapshotId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getContainer() { + return container; + } + + public static VolumeBackupCreateConcreteBuilder builder() { + return new VolumeBackupCreateConcreteBuilder(); + } + + @Override + public VolumeBackupCreateBuilder toBuilder() { + return new VolumeBackupCreateConcreteBuilder(this); + } + + public static class VolumeBackupCreateConcreteBuilder implements VolumeBackupCreateBuilder { + + private CinderVolumeBackupCreate model; + + public VolumeBackupCreateConcreteBuilder() { + this.model = new CinderVolumeBackupCreate(); + } + + public VolumeBackupCreateConcreteBuilder(CinderVolumeBackupCreate model) { + this.model = model; + } + + @Override + public VolumeBackupCreate build() { + return model; + } + + @Override + public VolumeBackupCreateBuilder from(VolumeBackupCreate in) { + // TODO Auto-generated method stub + return null; + } + + @Override + public VolumeBackupCreateBuilder name(String name) { + model.name = name; + return this; + } + + @Override + public VolumeBackupCreateBuilder description(String description) { + model.description = description; + return this; + } + + @Override + public VolumeBackupCreateBuilder volumeId(String volumeId) { + model.volumeId = volumeId; + return this; + } + + @Override + public VolumeBackupCreateBuilder container(String container) { + model.container = container; + return this; + } + + @Override + public VolumeBackupCreateBuilder incremental(boolean incremental) { + model.incremental = incremental; + return this; + } + + @Override + public VolumeBackupCreateBuilder force(boolean force) { + model.force = force; + return this; + } + + @Override + public VolumeBackupCreateBuilder snapshotId(String snapshotId) { + model.snapshotId = snapshotId; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupRestore.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupRestore.java index 2e34c9a3f..1a9f72741 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupRestore.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeBackupRestore.java @@ -1,62 +1,61 @@ package org.openstack4j.openstack.storage.block.domain; -import javax.annotation.Nullable; - -import org.openstack4j.model.storage.block.VolumeBackupRestore; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.storage.block.VolumeBackupRestore; + +import javax.annotation.Nullable; @JsonRootName("restore") public class CinderVolumeBackupRestore implements VolumeBackupRestore { - private static final long serialVersionUID = 1L; - - @JsonProperty("volume_name") - private String name; - @JsonProperty("volume_id") - private String volumeId; - - @Nullable - @JsonProperty("backup_id") - private String backupId; - - /** - * {@inheritDoc} - */ - @Override - public String getVolumeId() { - return volumeId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getBackupId(){ - return backupId; + private static final long serialVersionUID = 1L; + + @JsonProperty("volume_name") + private String name; + @JsonProperty("volume_id") + private String volumeId; + + @Nullable + @JsonProperty("backup_id") + private String backupId; + + /** + * {@inheritDoc} + */ + @Override + public String getVolumeId() { + return volumeId; } - public CinderVolumeBackupRestore(){ - - } - - public CinderVolumeBackupRestore(String name, String volumeId) { - this.name = name; - this.volumeId = volumeId; - } - - public CinderVolumeBackupRestore( String name, String volumeId , String backupId ) { - this.backupId = backupId; - this.name = name; - this.volumeId = volumeId; - } + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getBackupId() { + return backupId; + } + + public CinderVolumeBackupRestore() { + + } + + public CinderVolumeBackupRestore(String name, String volumeId) { + this.name = name; + this.volumeId = volumeId; + } + + public CinderVolumeBackupRestore(String name, String volumeId, String backupId) { + this.backupId = backupId; + this.name = name; + this.volumeId = volumeId; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeMigration.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeMigration.java index 8950cf365..5c268980b 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeMigration.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeMigration.java @@ -1,31 +1,31 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; @JsonRootName("os-migrate_volume") public class CinderVolumeMigration implements ModelEntity { - private static final long serialVersionUID = 1L; - - @JsonProperty("force_host_copy") - private boolean forceHostCopy; - @JsonProperty("host") - private String hostService; - - public boolean getForceHostCopy() { - return forceHostCopy; - } - public String getHostService() { - return hostService; - } - - public CinderVolumeMigration(String hostService, boolean forceHostCopy) { - this.hostService = hostService; - this.forceHostCopy = forceHostCopy; - } - + private static final long serialVersionUID = 1L; + + @JsonProperty("force_host_copy") + private boolean forceHostCopy; + @JsonProperty("host") + private String hostService; + + public boolean getForceHostCopy() { + return forceHostCopy; + } + + public String getHostService() { + return hostService; + } + + public CinderVolumeMigration(String hostService, boolean forceHostCopy) { + this.hostService = hostService; + this.forceHostCopy = forceHostCopy; + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeSnapshot.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeSnapshot.java index 55d7f37fa..b5a918650 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeSnapshot.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeSnapshot.java @@ -6,14 +6,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; -import java.util.Date; -import java.util.List; -import java.util.Map; import org.openstack4j.model.storage.block.Volume.Status; import org.openstack4j.model.storage.block.VolumeSnapshot; import org.openstack4j.model.storage.block.builder.VolumeSnapshotBuilder; import org.openstack4j.openstack.common.ListResult; +import java.util.Date; +import java.util.List; +import java.util.Map; + /** * An OpenStack Volume Snapshot which is a point-in-time copy of a volume. * @@ -22,205 +23,205 @@ @JsonRootName("snapshot") public class CinderVolumeSnapshot implements VolumeSnapshot { - private static final long serialVersionUID = 1L; - - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("display_name") - private String displayName; - @JsonProperty("description") - private String description; - @JsonProperty("display_description") - private String displayDescription; - @JsonProperty("volume_id") - private String volumeId; - private Status status; - @JsonInclude(Include.NON_DEFAULT) - @JsonProperty("size") - private Integer size; - @JsonProperty("created_at") - private Date created; - @JsonProperty - private Boolean force; - @JsonProperty("metadata") - private Map metadata; - - /** - * {@inheritDoc} - */ - @Override - public VolumeSnapshotBuilder toBuilder() { - return new ConcreteVolumeSnapshotBuilder(this); - } - - /** - * @return a new Volume Snapshot builder - */ - public static VolumeSnapshotBuilder builder() { - return new ConcreteVolumeSnapshotBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDisplayName() { - return displayName; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDisplayDescription() { - return displayDescription; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVolumeId() { - return volumeId; - } - - /** - * {@inheritDoc} - */ - @Override - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public int getSize() { - return (size != null) ? size : 0; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getCreated() { - return created; - } - - /** + private static final long serialVersionUID = 1L; + + private String id; + @JsonProperty("name") + private String name; + @JsonProperty("display_name") + private String displayName; + @JsonProperty("description") + private String description; + @JsonProperty("display_description") + private String displayDescription; + @JsonProperty("volume_id") + private String volumeId; + private Status status; + @JsonInclude(Include.NON_DEFAULT) + @JsonProperty("size") + private Integer size; + @JsonProperty("created_at") + private Date created; + @JsonProperty + private Boolean force; + @JsonProperty("metadata") + private Map metadata; + + /** + * {@inheritDoc} + */ + @Override + public VolumeSnapshotBuilder toBuilder() { + return new ConcreteVolumeSnapshotBuilder(this); + } + + /** + * @return a new Volume Snapshot builder + */ + public static VolumeSnapshotBuilder builder() { + return new ConcreteVolumeSnapshotBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDisplayName() { + return displayName; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return description; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDisplayDescription() { + return displayDescription; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVolumeId() { + return volumeId; + } + + /** + * {@inheritDoc} + */ + @Override + public Status getStatus() { + return status; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSize() { + return (size != null) ? size : 0; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getCreated() { + return created; + } + + /** + * {@inheritDoc} + */ + @JsonIgnore + @Override + public Map getMetaData() { + return metadata; + } + + /** * {@inheritDoc} */ - @JsonIgnore - @Override - public Map getMetaData() { - return metadata; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("description", description).add("volumeId", volumeId) - .add("status", status).add("created", created).add("force", force).add("size", size).add("metadata", metadata) - .toString(); - } - - public static class VolumeSnapshots extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("snapshots") - private List snapshots; - - @Override - protected List value() { - return snapshots; - } - } - - public static class ConcreteVolumeSnapshotBuilder implements VolumeSnapshotBuilder { - - private CinderVolumeSnapshot m; - - ConcreteVolumeSnapshotBuilder() { - this(new CinderVolumeSnapshot()); - } - - ConcreteVolumeSnapshotBuilder(CinderVolumeSnapshot m) { - this.m = m; - } - - @Override - public VolumeSnapshotBuilder name(String name) { - m.name = name; - m.displayName = name; - return this; - } - - @Override - public VolumeSnapshotBuilder description(String description) { - m.description = description; - m.displayDescription = description; - return this; - } - - @Override - public VolumeSnapshotBuilder volume(String volumeId) { - m.volumeId = volumeId; - return this; - } - - @Override - public VolumeSnapshotBuilder force(boolean force) { - m.force = force; - return this; - } - - @Override - public VolumeSnapshotBuilder metadata(Map metadata) { - m.metadata = metadata; - return this; - } - - @Override - public VolumeSnapshot build() { - return m; - } - - @Override - public VolumeSnapshotBuilder from(VolumeSnapshot in) { - m = (CinderVolumeSnapshot) in; - return this; - } - - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("description", description).add("volumeId", volumeId) + .add("status", status).add("created", created).add("force", force).add("size", size).add("metadata", metadata) + .toString(); + } + + public static class VolumeSnapshots extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("snapshots") + private List snapshots; + + @Override + protected List value() { + return snapshots; + } + } + + public static class ConcreteVolumeSnapshotBuilder implements VolumeSnapshotBuilder { + + private CinderVolumeSnapshot m; + + ConcreteVolumeSnapshotBuilder() { + this(new CinderVolumeSnapshot()); + } + + ConcreteVolumeSnapshotBuilder(CinderVolumeSnapshot m) { + this.m = m; + } + + @Override + public VolumeSnapshotBuilder name(String name) { + m.name = name; + m.displayName = name; + return this; + } + + @Override + public VolumeSnapshotBuilder description(String description) { + m.description = description; + m.displayDescription = description; + return this; + } + + @Override + public VolumeSnapshotBuilder volume(String volumeId) { + m.volumeId = volumeId; + return this; + } + + @Override + public VolumeSnapshotBuilder force(boolean force) { + m.force = force; + return this; + } + + @Override + public VolumeSnapshotBuilder metadata(Map metadata) { + m.metadata = metadata; + return this; + } + + @Override + public VolumeSnapshot build() { + return m; + } + + @Override + public VolumeSnapshotBuilder from(VolumeSnapshot in) { + m = (CinderVolumeSnapshot) in; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransfer.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransfer.java index 3a30245a4..a2660f7ce 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransfer.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransfer.java @@ -1,17 +1,16 @@ package org.openstack4j.openstack.storage.block.domain; -import static com.google.common.base.MoreObjects.toStringHelper; - -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.common.Link; import org.openstack4j.model.storage.block.VolumeTransfer; import org.openstack4j.openstack.common.GenericLink; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.Date; +import java.util.List; + +import static com.google.common.base.MoreObjects.toStringHelper; /** * Represents a Volume Transfer Entity which is used for creating a volume transfer diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransferAccept.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransferAccept.java index fb6d440b3..d82c0a4cc 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransferAccept.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeTransferAccept.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; /** * A request entity used for accepting a volume transfer - * + * * @author Jeremy Unruh */ @JsonRootName("accept") @@ -17,15 +16,16 @@ public class CinderVolumeTransferAccept implements ModelEntity { @JsonProperty("auth_key") private String authKey; - - public CinderVolumeTransferAccept() { } - + + public CinderVolumeTransferAccept() { + } + private CinderVolumeTransferAccept(String authKey) { this.authKey = authKey; } - + public static CinderVolumeTransferAccept create(String authKey) { return new CinderVolumeTransferAccept(authKey); } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeType.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeType.java index ae7fafe4d..d5e280fe9 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeType.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeType.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.storage.block.domain; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.storage.block.VolumeType; import org.openstack4j.model.storage.block.builder.VolumeTypeBuilder; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.List; +import java.util.Map; /** * The volume type defines the characteristics of a volume. It usually maps to a set of capabilities @@ -21,37 +20,37 @@ @JsonRootName("volume_type") public class CinderVolumeType implements VolumeType { - private static final long serialVersionUID = 1L; - - private String id; - private String name; - - @JsonProperty("extra_specs") - private Map extraSpecs; - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getExtraSpecs() { - return extraSpecs; - } + private static final long serialVersionUID = 1L; + + private String id; + private String name; + + @JsonProperty("extra_specs") + private Map extraSpecs; + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getExtraSpecs() { + return extraSpecs; + } @Override public VolumeTypeBuilder toBuilder() { @@ -65,29 +64,29 @@ public static VolumeTypeBuilder builder() { return new ConcreteVolumeTypeBuilder(); } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("extras", extraSpecs) - .toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("extras", extraSpecs) + .toString(); + } - public static class VolumeTypes extends ListResult { + public static class VolumeTypes extends ListResult { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("volume_types") - private List types; + @JsonProperty("volume_types") + private List types; - @Override - protected List value() { - return types; - } + @Override + protected List value() { + return types; + } - } + } public static class ConcreteVolumeTypeBuilder implements VolumeTypeBuilder { diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeUploadImage.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeUploadImage.java index e43ef2d4a..5bb09d460 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeUploadImage.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/CinderVolumeUploadImage.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.storage.block.domain; -import java.util.Date; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; import org.openstack4j.model.image.ContainerFormat; import org.openstack4j.model.image.DiskFormat; import org.openstack4j.model.storage.block.Volume.Status; import org.openstack4j.model.storage.block.VolumeUploadImage; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.google.common.base.MoreObjects; +import java.util.Date; /** * Represents an action state when uploading a volume to the image service @@ -85,9 +84,9 @@ public DiskFormat getDiskFormat() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("status", status).add("display_description", displayDescription) - .add("updatedAt", updatedAt).add("image_id", imageId).add("image_name", imageName) - .add("container_format", containerFormat).add("disk_format", diskFormat) - .toString(); + .add("id", id).add("status", status).add("display_description", displayDescription) + .add("updatedAt", updatedAt).add("image_id", imageId).add("image_name", imageName) + .add("container_format", containerFormat).add("disk_format", diskFormat) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/DetachAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/DetachAction.java index 763b4b2f3..32f384a93 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/DetachAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/DetachAction.java @@ -1,37 +1,36 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; /** * os-detach - * @author capitek-xuning(首信科技-徐宁) * + * @author capitek-xuning(首信科技-徐宁) */ @JsonRootName("os-detach") public class DetachAction implements ModelEntity { - private static final long serialVersionUID = 1L; - - /** - * The ID of the attachment. - */ - @JsonProperty("attachment_id") - private String attachmentId; - - /** - * @author capitek-xuning(首信科技-徐宁) - * @param attachmentId The ID of the attachment. - */ - public DetachAction(String attachmentId) { - super(); - this.attachmentId = attachmentId; - } - - public String getAttachmentId() { - return attachmentId; - } + private static final long serialVersionUID = 1L; + + /** + * The ID of the attachment. + */ + @JsonProperty("attachment_id") + private String attachmentId; + + /** + * @param attachmentId The ID of the attachment. + * @author capitek-xuning(首信科技-徐宁) + */ + public DetachAction(String attachmentId) { + super(); + this.attachmentId = attachmentId; + } + + public String getAttachmentId() { + return attachmentId; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtAvailabilityZone.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtAvailabilityZone.java index c53177945..229d6d765 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtAvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtAvailabilityZone.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.storage.block.domain; -import static com.google.common.base.MoreObjects.toStringHelper; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.openstack.common.ListResult; import java.util.List; -import org.openstack4j.openstack.common.ListResult; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import static com.google.common.base.MoreObjects.toStringHelper; public class ExtAvailabilityZone implements AvailabilityZone { @@ -50,8 +49,8 @@ public boolean getAvailable() { @Override public String toString() { return toStringHelper(this).omitNullValues() - .add("available", available) - .toString(); + .add("available", available) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtendAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtendAction.java index 213cef8bf..9137b9c23 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtendAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ExtendAction.java @@ -1,27 +1,26 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; @JsonRootName("os-extend") public class ExtendAction implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("new_size") - private final Integer newSize; + @JsonProperty("new_size") + private final Integer newSize; - public ExtendAction(Integer newSize) { - this.newSize = newSize; - } + public ExtendAction(Integer newSize) { + this.newSize = newSize; + } - public static ExtendAction create(Integer newSize) { - return new ExtendAction(newSize); - } + public static ExtendAction create(Integer newSize) { + return new ExtendAction(newSize); + } - public Integer getNewSize() { - return newSize; - } + public Integer getNewSize() { + return newSize; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDeleteAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDeleteAction.java index 58a44945f..ce81ebcff 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDeleteAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDeleteAction.java @@ -1,13 +1,13 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; @JsonRootName("os-force_delete") public class ForceDeleteAction implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public ForceDeleteAction() { } + public ForceDeleteAction() { + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachAction.java index 9401c6b70..0aebcf45f 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachAction.java @@ -1,53 +1,52 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; /** * os force detach - * @author Wang Ting/王婷 * + * @author Wang Ting/王婷 */ @JsonRootName("os-force_detach") public class ForceDetachAction implements ModelEntity { - private static final long serialVersionUID = 1L; - - /** - * The interface ID - */ - @JsonProperty("attachment_id ") - private String attachmentId ; - - /** - * The connector object. - */ - @JsonProperty - private ForceDetachConnector connector; - - public ForceDetachAction(String attachmentId, ForceDetachConnector connector) { - super(); - this.attachmentId = attachmentId; - this.connector = connector; - } - - public String getAttachmentId() { - return attachmentId; - } - - public void setAttachmentId(String attachmentId) { - this.attachmentId = attachmentId; - } - - public ForceDetachConnector getConnector() { - return connector; - } - - public void setConnector(ForceDetachConnector connector) { - this.connector = connector; - } - - + private static final long serialVersionUID = 1L; + + /** + * The interface ID + */ + @JsonProperty("attachment_id ") + private String attachmentId; + + /** + * The connector object. + */ + @JsonProperty + private ForceDetachConnector connector; + + public ForceDetachAction(String attachmentId, ForceDetachConnector connector) { + super(); + this.attachmentId = attachmentId; + this.connector = connector; + } + + public String getAttachmentId() { + return attachmentId; + } + + public void setAttachmentId(String attachmentId) { + this.attachmentId = attachmentId; + } + + public ForceDetachConnector getConnector() { + return connector; + } + + public void setConnector(ForceDetachConnector connector) { + this.connector = connector; + } + + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachConnector.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachConnector.java index f972bf9fb..18458c3e8 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachConnector.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ForceDetachConnector.java @@ -4,26 +4,26 @@ /** * Force Detach Connector - * @author Wang Ting/王婷 * + * @author Wang Ting/王婷 */ public class ForceDetachConnector implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + private String initiator; + + public ForceDetachConnector(String initiator) { + super(); + this.initiator = initiator; + } - private String initiator; - - public ForceDetachConnector(String initiator) { - super(); - this.initiator = initiator; - } + public String getInitiator() { + return initiator; + } - public String getInitiator() { - return initiator; - } + public void setInitiator(String initiator) { + this.initiator = initiator; + } - public void setInitiator(String initiator) { - this.initiator = initiator; - } - } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ResetStatusAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ResetStatusAction.java index ae8dba6cf..8e5adaf2c 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ResetStatusAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ResetStatusAction.java @@ -8,20 +8,20 @@ @JsonRootName("os-reset_status") public class ResetStatusAction implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("status") - private final Volume.Status status; + @JsonProperty("status") + private final Volume.Status status; - public ResetStatusAction(Volume.Status status) { - this.status = status; - } + public ResetStatusAction(Volume.Status status) { + this.status = status; + } - public static ResetStatusAction create(Volume.Status status) { - return new ResetStatusAction(status); - } + public static ResetStatusAction create(Volume.Status status) { + return new ResetStatusAction(status); + } - public Volume.Status getStatus() { - return status; - } + public Volume.Status getStatus() { + return status; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/SetBootableAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/SetBootableAction.java index 6cf6b7a28..de05730d5 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/SetBootableAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/SetBootableAction.java @@ -1,27 +1,26 @@ package org.openstack4j.openstack.storage.block.domain; -import org.openstack4j.model.ModelEntity; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.ModelEntity; @JsonRootName("os-set_bootable") public class SetBootableAction implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("bootable") - private final Boolean bootable; + @JsonProperty("bootable") + private final Boolean bootable; - public SetBootableAction(Boolean bootable) { - this.bootable = bootable; - } + public SetBootableAction(Boolean bootable) { + this.bootable = bootable; + } - public static SetBootableAction create(Boolean bootable) { - return new SetBootableAction(bootable); - } + public static SetBootableAction create(Boolean bootable) { + return new SetBootableAction(bootable); + } - public Boolean getBootable() { - return bootable; - } + public Boolean getBootable() { + return bootable; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/UpdateReadOnlyFlagAction.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/UpdateReadOnlyFlagAction.java index 44f620738..d6fab251f 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/UpdateReadOnlyFlagAction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/UpdateReadOnlyFlagAction.java @@ -7,21 +7,21 @@ @JsonRootName("os-update_readonly_flag") public class UpdateReadOnlyFlagAction implements ModelEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("readonly") - private final boolean readonly; + @JsonProperty("readonly") + private final boolean readonly; - public UpdateReadOnlyFlagAction(boolean readonly) { - this.readonly = readonly; - } + public UpdateReadOnlyFlagAction(boolean readonly) { + this.readonly = readonly; + } - public static UpdateReadOnlyFlagAction create(boolean readonly) { - return new UpdateReadOnlyFlagAction(readonly); - } + public static UpdateReadOnlyFlagAction create(boolean readonly) { + return new UpdateReadOnlyFlagAction(readonly); + } - public boolean isReadonly() { - return readonly; - } + public boolean isReadonly() { + return readonly; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ext/ExtService.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ext/ExtService.java index 830c97e26..eb11b13ba 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ext/ExtService.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/ext/ExtService.java @@ -1,15 +1,14 @@ package org.openstack4j.openstack.storage.block.domain.ext; -import java.util.Date; -import java.util.List; - -import org.openstack4j.model.storage.block.ext.Service; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.storage.block.ext.Service; +import org.openstack4j.openstack.common.ListResult; + +import java.util.Date; +import java.util.List; @JsonRootName("service") @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BaseBlockStorageServices.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BaseBlockStorageServices.java index 8ad4b6e56..37c536779 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BaseBlockStorageServices.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BaseBlockStorageServices.java @@ -10,8 +10,8 @@ */ public class BaseBlockStorageServices extends BaseOpenStackService { - public BaseBlockStorageServices() { - super(ServiceType.BLOCK_STORAGE); - } + public BaseBlockStorageServices() { + super(ServiceType.BLOCK_STORAGE); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockQuotaSetServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockQuotaSetServiceImpl.java index 09deaed05..23dcc33a5 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockQuotaSetServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockQuotaSetServiceImpl.java @@ -1,7 +1,5 @@ package org.openstack4j.openstack.storage.block.internal; -import static com.google.common.base.Preconditions.checkNotNull; - import org.openstack4j.api.storage.BlockQuotaSetService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.BlockQuotaSet; @@ -9,9 +7,11 @@ import org.openstack4j.openstack.storage.block.domain.CinderBlockQuotaSet; import org.openstack4j.openstack.storage.block.domain.CinderBlockQuotaSetUsage; +import static com.google.common.base.Preconditions.checkNotNull; + /** * Quota-Set Extension API for Block Storage - * + * * @author Jeremy Unruh */ public class BlockQuotaSetServiceImpl extends BaseBlockStorageServices implements BlockQuotaSetService { @@ -67,9 +67,9 @@ public BlockQuotaSetUsage usageForUser(String tenantId, String userId) { checkNotNull(tenantId, "Tenant cannot be null"); checkNotNull(userId, "User cannot be null"); return get(CinderBlockQuotaSetUsage.class, uri("/os-quota-sets/%s", tenantId)) - .param("user_id", userId) - .param("usage", true) - .execute(); + .param("user_id", userId) + .param("usage", true) + .execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceImpl.java index b09a0bf41..4cb2808ff 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceImpl.java @@ -1,43 +1,37 @@ package org.openstack4j.openstack.storage.block.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.storage.BlockQuotaSetService; -import org.openstack4j.api.storage.BlockStorageService; -import org.openstack4j.api.storage.BlockVolumeBackupService; -import org.openstack4j.api.storage.BlockVolumeService; -import org.openstack4j.api.storage.BlockVolumeSnapshotService; -import org.openstack4j.api.storage.CinderZoneService; -import org.openstack4j.api.storage.SchedulerStatsGetPoolService; +import org.openstack4j.api.storage.*; import org.openstack4j.api.storage.ext.BlockStorageServiceService; import org.openstack4j.model.storage.block.BlockLimits; import org.openstack4j.openstack.storage.block.domain.CinderBlockLimits; /** * Block Storage (Cinder) Service Operation implementation - * + * * @author Jeremy Unruh */ public class BlockStorageServiceImpl extends BaseBlockStorageServices implements BlockStorageService { - /** - * {@inheritDoc} - */ - @Override - public BlockVolumeService volumes() { - return Apis.get(BlockVolumeService.class); - } + /** + * {@inheritDoc} + */ + @Override + public BlockVolumeService volumes() { + return Apis.get(BlockVolumeService.class); + } - /** - * {@inheritDoc} - */ - @Override - public BlockVolumeSnapshotService snapshots() { - return Apis.get(BlockVolumeSnapshotService.class); - } + /** + * {@inheritDoc} + */ + @Override + public BlockVolumeSnapshotService snapshots() { + return Apis.get(BlockVolumeSnapshotService.class); + } - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ @Override public BlockLimits getLimits() { return get(CinderBlockLimits.class, "/limits").execute(); @@ -52,31 +46,32 @@ public BlockQuotaSetService quotaSets() { } @Override - public CinderZoneService zones() - { - return Apis.get(CinderZoneService.class); + public CinderZoneService zones() { + return Apis.get(CinderZoneService.class); } - /** - * {@inheritDoc} - */ - @Override - public SchedulerStatsGetPoolService schedulerStatsPools() { return Apis.get(SchedulerStatsGetPoolService.class); } + /** + * {@inheritDoc} + */ + @Override + public SchedulerStatsGetPoolService schedulerStatsPools() { + return Apis.get(SchedulerStatsGetPoolService.class); + } - /** - * {@inheritDoc} - */ - @Override - public BlockVolumeBackupService backups() { - return Apis.get(BlockVolumeBackupService.class); - } + /** + * {@inheritDoc} + */ + @Override + public BlockVolumeBackupService backups() { + return Apis.get(BlockVolumeBackupService.class); + } - /** - * {@inheritDoc} - */ - @Override - public BlockStorageServiceService services() { - return Apis.get(BlockStorageServiceService.class); - } + /** + * {@inheritDoc} + */ + @Override + public BlockStorageServiceService services() { + return Apis.get(BlockStorageServiceService.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceServiceImpl.java index bd583d664..b68e8ae96 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockStorageServiceServiceImpl.java @@ -1,11 +1,11 @@ package org.openstack4j.openstack.storage.block.internal; -import java.util.List; - import org.openstack4j.api.storage.ext.BlockStorageServiceService; import org.openstack4j.model.storage.block.ext.Service; import org.openstack4j.openstack.storage.block.domain.ext.ExtService.Services; +import java.util.List; + /** * Block Storage Services service provides CRUD capabilities for Cinder service(s). * @@ -13,12 +13,12 @@ */ public class BlockStorageServiceServiceImpl extends BaseBlockStorageServices implements BlockStorageServiceService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(Services.class, uri("/os-services")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(Services.class, uri("/os-services")).execute().getList(); + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeBackupServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeBackupServiceImpl.java index 79bee0031..594aea5b5 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeBackupServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeBackupServiceImpl.java @@ -1,11 +1,9 @@ package org.openstack4j.openstack.storage.block.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.api.storage.BlockVolumeBackupService; +import org.openstack4j.model.ModelEntity; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.VolumeBackup; import org.openstack4j.model.storage.block.VolumeBackupCreate; @@ -13,10 +11,11 @@ import org.openstack4j.openstack.storage.block.domain.CinderVolumeBackup; import org.openstack4j.openstack.storage.block.domain.CinderVolumeBackup.VolumeBackups; import org.openstack4j.openstack.storage.block.domain.CinderVolumeBackupRestore; -import org.openstack4j.model.ModelEntity; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; /** * OpenStack (Cinder) Volume Backup Operations API Implementation. @@ -25,86 +24,86 @@ */ public class BlockVolumeBackupServiceImpl extends BaseBlockStorageServices implements BlockVolumeBackupService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(VolumeBackups.class, uri("/backups/detail")).execute().getList(); - } - - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation invocation = buildInvocation(filteringParams); - return invocation.execute().getList(); - } - - private Invocation buildInvocation(Map filteringParams) { - Invocation invocation = get(VolumeBackups.class, "/backups/detail"); - if (filteringParams == null) { - return invocation; - } else { - for (Map.Entry entry : filteringParams.entrySet()) { - invocation = invocation.param(entry.getKey(), entry.getValue()); - } - } - return invocation; - } - - /** - * {@inheritDoc} - */ - @Override - public VolumeBackup get(String backupId) { - checkNotNull(backupId); - return get(CinderVolumeBackup.class, uri("/backups/%s", backupId)).execute(); - - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String backupId) { - checkNotNull(backupId); - return deleteWithResponse(uri("/backups/%s", backupId)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public VolumeBackup create(VolumeBackupCreate vbc) { - checkNotNull(vbc); - checkNotNull(vbc.getVolumeId()); - return post(CinderVolumeBackup.class, uri("/backups")).entity(vbc).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public VolumeBackupRestore restore(String backupId, String name, String volumeId) { - _VolumeBackupRestore entity = new _VolumeBackupRestore(name, volumeId); - return post(CinderVolumeBackupRestore.class, uri("/backups/%s/restore", backupId)).entity(entity).execute(); - } - - @JsonRootName("restore") - private static class _VolumeBackupRestore implements ModelEntity { - - private static final long serialVersionUID = 1L; - @JsonProperty("name") - private String name; - @JsonProperty("volume_id") - private String volumeId; - - public _VolumeBackupRestore(String name, String volumeId) { - this.name = name; - this.volumeId = volumeId; - } - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(VolumeBackups.class, uri("/backups/detail")).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation invocation = buildInvocation(filteringParams); + return invocation.execute().getList(); + } + + private Invocation buildInvocation(Map filteringParams) { + Invocation invocation = get(VolumeBackups.class, "/backups/detail"); + if (filteringParams == null) { + return invocation; + } else { + for (Map.Entry entry : filteringParams.entrySet()) { + invocation = invocation.param(entry.getKey(), entry.getValue()); + } + } + return invocation; + } + + /** + * {@inheritDoc} + */ + @Override + public VolumeBackup get(String backupId) { + checkNotNull(backupId); + return get(CinderVolumeBackup.class, uri("/backups/%s", backupId)).execute(); + + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String backupId) { + checkNotNull(backupId); + return deleteWithResponse(uri("/backups/%s", backupId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public VolumeBackup create(VolumeBackupCreate vbc) { + checkNotNull(vbc); + checkNotNull(vbc.getVolumeId()); + return post(CinderVolumeBackup.class, uri("/backups")).entity(vbc).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public VolumeBackupRestore restore(String backupId, String name, String volumeId) { + _VolumeBackupRestore entity = new _VolumeBackupRestore(name, volumeId); + return post(CinderVolumeBackupRestore.class, uri("/backups/%s/restore", backupId)).entity(entity).execute(); + } + + @JsonRootName("restore") + private static class _VolumeBackupRestore implements ModelEntity { + + private static final long serialVersionUID = 1L; + @JsonProperty("name") + private String name; + @JsonProperty("volume_id") + private String volumeId; + + public _VolumeBackupRestore(String name, String volumeId) { + this.name = name; + this.volumeId = volumeId; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeServiceImpl.java index 685967e21..8d624a466 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeServiceImpl.java @@ -103,7 +103,7 @@ public ActionResponse extend(String volumeId, Integer newSize) { .execute(); } - + /** * {@inheritDoc} */ @@ -247,20 +247,21 @@ public ActionResponse forceDetach(String volumeId, String initiator, String atta ForceDetachAction detach = new ForceDetachAction(attachmentId, connector); return post(ActionResponse.class, uri("/volumes/%s/action", volumeId)).entity(detach).execute(); } - - /** - * Detach volume from server - * @author capitek-xuning(首信科技-徐宁) - * @param volumeId - * @param attachmentId - * @return - */ - @Override - public ActionResponse detach(String volumeId, String attachmentId) { - checkNotNull(volumeId); - checkNotNull(attachmentId); - DetachAction detach = new DetachAction(attachmentId); - return post(ActionResponse.class, uri("/volumes/%s/action", volumeId)).entity(detach).execute(); - } - + + /** + * Detach volume from server + * + * @param volumeId + * @param attachmentId + * @return + * @author capitek-xuning(首信科技-徐宁) + */ + @Override + public ActionResponse detach(String volumeId, String attachmentId) { + checkNotNull(volumeId); + checkNotNull(attachmentId); + DetachAction detach = new DetachAction(attachmentId); + return post(ActionResponse.class, uri("/volumes/%s/action", volumeId)).entity(detach).execute(); + } + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeSnapshotServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeSnapshotServiceImpl.java index 6940cdbb1..1560762b3 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeSnapshotServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeSnapshotServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.storage.block.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.Builders; import org.openstack4j.api.storage.BlockVolumeSnapshotService; import org.openstack4j.model.common.ActionResponse; @@ -12,6 +7,11 @@ import org.openstack4j.openstack.storage.block.domain.CinderVolumeSnapshot; import org.openstack4j.openstack.storage.block.domain.CinderVolumeSnapshot.VolumeSnapshots; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * OpenStack (Cinder) Volume Snapshot Operations API Implementation. * @@ -19,75 +19,75 @@ */ public class BlockVolumeSnapshotServiceImpl extends BaseBlockStorageServices implements BlockVolumeSnapshotService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(VolumeSnapshots.class, uri("/snapshots")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(VolumeSnapshots.class, uri("/snapshots")).execute().getList(); + } + + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation volumeInvocation = buildInvocation(filteringParams); + return volumeInvocation.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation volumeInvocation = buildInvocation(filteringParams); - return volumeInvocation.execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public VolumeSnapshot get(String snapshotId) { + checkNotNull(snapshotId); + return get(CinderVolumeSnapshot.class, uri("/snapshots/%s", snapshotId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public VolumeSnapshot get(String snapshotId) { - checkNotNull(snapshotId); - return get(CinderVolumeSnapshot.class, uri("/snapshots/%s", snapshotId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String snapshotId) { + checkNotNull(snapshotId); + return deleteWithResponse(uri("/snapshots/%s", snapshotId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String snapshotId) { - checkNotNull(snapshotId); - return deleteWithResponse(uri("/snapshots/%s", snapshotId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse update(String snapshotId, String name, String description) { + checkNotNull(snapshotId); + if (name == null && description == null) + return ActionResponse.actionFailed("Both Name and Description are required", 412); - /** - * {@inheritDoc} - */ - @Override - public ActionResponse update(String snapshotId, String name, String description) { - checkNotNull(snapshotId); - if (name == null && description == null) - return ActionResponse.actionFailed("Both Name and Description are required", 412); - - return put(ActionResponse.class, uri("/snapshots/%s", snapshotId)) - .entity(Builders.volumeSnapshot().name(name).description(description).build()) - .execute(); - } + return put(ActionResponse.class, uri("/snapshots/%s", snapshotId)) + .entity(Builders.volumeSnapshot().name(name).description(description).build()) + .execute(); + } - /** - * {@inheritDoc} - */ - @Override - public VolumeSnapshot create(VolumeSnapshot snapshot) { - checkNotNull(snapshot); - checkNotNull(snapshot.getVolumeId()); - return post(CinderVolumeSnapshot.class, uri("/snapshots")).entity(snapshot).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public VolumeSnapshot create(VolumeSnapshot snapshot) { + checkNotNull(snapshot); + checkNotNull(snapshot.getVolumeId()); + return post(CinderVolumeSnapshot.class, uri("/snapshots")).entity(snapshot).execute(); + } - private Invocation buildInvocation(Map filteringParams) { - Invocation volumeInvocation = get(VolumeSnapshots.class, "/snapshots"); - if (filteringParams == null) { - return volumeInvocation; - } else { - for (Map.Entry entry : filteringParams.entrySet()) { - volumeInvocation = volumeInvocation.param(entry.getKey(), entry.getValue()); - } - } - return volumeInvocation; - } + private Invocation buildInvocation(Map filteringParams) { + Invocation volumeInvocation = get(VolumeSnapshots.class, "/snapshots"); + if (filteringParams == null) { + return volumeInvocation; + } else { + for (Map.Entry entry : filteringParams.entrySet()) { + volumeInvocation = volumeInvocation.param(entry.getKey(), entry.getValue()); + } + } + return volumeInvocation; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeTransferServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeTransferServiceImpl.java index 21141e1e7..20bb99a0d 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeTransferServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeTransferServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.storage.block.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.storage.BlockVolumeTransferService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.VolumeTransfer; @@ -11,9 +7,13 @@ import org.openstack4j.openstack.storage.block.domain.CinderVolumeTransfer.VolumeTransferList; import org.openstack4j.openstack.storage.block.domain.CinderVolumeTransferAccept; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Related services for managing volume transfers (os-volume-transfer) - * + * * @author Jeremy Unruh */ public class BlockVolumeTransferServiceImpl extends BaseBlockStorageServices implements BlockVolumeTransferService { @@ -22,19 +22,19 @@ public class BlockVolumeTransferServiceImpl extends BaseBlockStorageServices imp public List list() { return list(Boolean.TRUE); } - + @Override public List list(boolean detailed) { String url = (detailed) ? "/os-volume-transfer/detail" : "/os-volume-transfer"; return get(VolumeTransferList.class, url).execute().getList(); } - + @Override public VolumeTransfer get(String transferId) { checkNotNull(transferId, "TransferId must contain a value"); return get(CinderVolumeTransfer.class, uri("/os-volume-transfer/%s", transferId)).execute(); } - + @Override public VolumeTransfer create(String volumeId) { return create(volumeId, null); @@ -51,7 +51,7 @@ public VolumeTransfer accept(String transferId, String authKey) { checkNotNull(transferId, "TransferId must contain a value"); checkNotNull(authKey, "AuthKey must contain a value"); return post(CinderVolumeTransfer.class, uri("/os-volume-transfer/%s/accept", transferId)) - .entity(CinderVolumeTransferAccept.create(authKey)).execute(); + .entity(CinderVolumeTransferAccept.create(authKey)).execute(); } @Override diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/CinderZoneServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/CinderZoneServiceImpl.java index c21473d44..8d3210c4c 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/CinderZoneServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/CinderZoneServiceImpl.java @@ -1,18 +1,16 @@ package org.openstack4j.openstack.storage.block.internal; -import java.util.List; - import org.openstack4j.api.storage.CinderZoneService; import org.openstack4j.openstack.storage.block.domain.AvailabilityZone; import org.openstack4j.openstack.storage.block.domain.ExtAvailabilityZone.AvailabilityZones; -public class CinderZoneServiceImpl extends BaseBlockStorageServices implements CinderZoneService -{ +import java.util.List; + +public class CinderZoneServiceImpl extends BaseBlockStorageServices implements CinderZoneService { @Override - public List list() - { - String uri = "/os-availability-zone"; + public List list() { + String uri = "/os-availability-zone"; return get(AvailabilityZones.class, uri).execute().getList(); } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/SchedulerStatsGetPoolServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/SchedulerStatsGetPoolServiceImpl.java index 06471e7c7..5432b94e8 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/internal/SchedulerStatsGetPoolServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/internal/SchedulerStatsGetPoolServiceImpl.java @@ -20,7 +20,7 @@ public List poolsDetail() { private List list(boolean detail) { return get(CinderBackendStoragePool.VolumeBackendPools.class, uri("/scheduler-stats/get_pools")) - .param("detail" , detail) + .param("detail", detail) .execute() .getList(); } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/MetaHeaderRequestWrapper.java b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/MetaHeaderRequestWrapper.java index 4ea9df2f9..48768848d 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/MetaHeaderRequestWrapper.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/MetaHeaderRequestWrapper.java @@ -1,12 +1,12 @@ package org.openstack4j.openstack.storage.object.domain; -import java.util.Map; - import org.openstack4j.core.transport.HttpRequest; +import java.util.Map; + /** * Simple Tuple object used to hold onto an in-bound header map and request object - * + * * @author Jeremy Unruh */ public final class MetaHeaderRequestWrapper { @@ -14,27 +14,27 @@ public final class MetaHeaderRequestWrapper { private final String prefix; private final HttpRequest request; private final Map metadata; - + private MetaHeaderRequestWrapper(String prefix, Map metadata, HttpRequest request) { this.prefix = prefix; this.metadata = metadata; this.request = request; } - + public static MetaHeaderRequestWrapper of(String prefix, Map metadata, HttpRequest request) { return new MetaHeaderRequestWrapper(prefix, metadata, request); } - + public Map getMetadata() { return metadata; } - + public HttpRequest getRequest() { return request; } - + public String getPrefix() { return prefix; } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftAccountImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftAccountImpl.java index bf76e17d7..0f917d1c9 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftAccountImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftAccountImpl.java @@ -1,10 +1,9 @@ package org.openstack4j.openstack.storage.object.domain; -import java.util.Map; - +import com.google.common.base.MoreObjects; import org.openstack4j.model.storage.object.SwiftAccount; -import com.google.common.base.MoreObjects; +import java.util.Map; /** * An Account representation for OpenStack Object Storage (Swift) @@ -56,10 +55,10 @@ public static AccountBuilder builder() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("containerCount", containerCount).add("objectCount", objectCount) - .add("bytesUsed", bytesUsed).add("temporaryUrlKey", temporaryUrlKey) - .add("metadata", metadata) - .toString(); + .add("containerCount", containerCount).add("objectCount", objectCount) + .add("bytesUsed", bytesUsed).add("temporaryUrlKey", temporaryUrlKey) + .add("metadata", metadata) + .toString(); } public static class AccountBuilder { diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftContainerImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftContainerImpl.java index aaca25d10..8257ad168 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftContainerImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftContainerImpl.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.storage.object.domain; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.api.Apis; import org.openstack4j.api.storage.ObjectStorageContainerService; import org.openstack4j.model.storage.object.SwiftContainer; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.Map; /** * Represents an OpenStack Swift Container which holds Objects @@ -53,7 +52,7 @@ public Map getMetadata() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("count", objectCount).add("total size", totalSize) - .toString(); + .add("name", name).add("count", objectCount).add("total size", totalSize) + .toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftObjectImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftObjectImpl.java index 234a2e861..b05c161d1 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftObjectImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/domain/SwiftObjectImpl.java @@ -1,20 +1,19 @@ package org.openstack4j.openstack.storage.object.domain; -import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_DIRECTORY; - -import java.util.ArrayList; -import java.util.Date; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.api.Apis; import org.openstack4j.api.storage.ObjectStorageObjectService; import org.openstack4j.model.common.DLPayload; import org.openstack4j.model.storage.block.options.DownloadOptions; import org.openstack4j.model.storage.object.SwiftObject; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.ArrayList; +import java.util.Date; +import java.util.Map; + +import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_DIRECTORY; /** * Represents an Object which is a File or Directory within a Container @@ -80,7 +79,7 @@ public String getMimeType() { @Override public boolean isDirectory() { - if(directoryName != null && mimeType == null) + if (directoryName != null && mimeType == null) return true; else return CONTENT_TYPE_DIRECTORY.equals(mimeType); @@ -115,17 +114,17 @@ public DLPayload download(DownloadOptions options) { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", name).add("last_modified", lastModified).add("mimeType", mimeType) - .add("size_bytes", sizeBytes).add("ETag", eTag).add("directory", isDirectory()) - .add("containerName", containerName).add("metadata", metadata) - .toString(); + .add("name", name).add("last_modified", lastModified).add("mimeType", mimeType) + .add("size_bytes", sizeBytes).add("ETag", eTag).add("directory", isDirectory()) + .add("containerName", containerName).add("metadata", metadata) + .toString(); } public static class SwiftObjects extends ArrayList { private static final long serialVersionUID = 1L; } -public static class Builder { + public static class Builder { private SwiftObjectImpl obj = new SwiftObjectImpl(); diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ApplyContainerToObjectFunction.java b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ApplyContainerToObjectFunction.java index 1a7ef5fad..383268bc3 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ApplyContainerToObjectFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ApplyContainerToObjectFunction.java @@ -1,27 +1,25 @@ package org.openstack4j.openstack.storage.object.functions; -import org.openstack4j.openstack.storage.object.domain.SwiftObjectImpl; - import com.google.common.base.Function; +import org.openstack4j.openstack.storage.object.domain.SwiftObjectImpl; /** * Applies a container name specified through the function creation to a Swift Object - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ -public class ApplyContainerToObjectFunction implements Function{ +public class ApplyContainerToObjectFunction implements Function { String containerName; - + private ApplyContainerToObjectFunction(String containerName) { this.containerName = containerName; } - + public static ApplyContainerToObjectFunction create(String containerName) { return new ApplyContainerToObjectFunction(containerName); } - + @Override public SwiftObjectImpl apply(SwiftObjectImpl obj) { obj.setContainerName(containerName); diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MapWithoutMetaPrefixFunction.java b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MapWithoutMetaPrefixFunction.java index 87e6f5562..1be9f0229 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MapWithoutMetaPrefixFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MapWithoutMetaPrefixFunction.java @@ -1,26 +1,26 @@ package org.openstack4j.openstack.storage.object.functions; -import java.util.Map; - import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; +import java.util.Map; + /** * Transforms a Swift Metadata Map into a Map without the meta prefix as key values - * + * * @author Jeremy Unruh */ public class MapWithoutMetaPrefixFunction implements Function, Map> { public static final MapWithoutMetaPrefixFunction INSTANCE = new MapWithoutMetaPrefixFunction(); - + @Override public Map apply(Map input) { ImmutableMap.Builder metadata = ImmutableMap.builder(); for (String key : input.keySet()) { - if (key == null) { - continue; - } + if (key == null) { + continue; + } int idx = key.indexOf("-Meta-"); if (idx > -1) { metadata.put(key.substring(idx + 6), input.get(key)); @@ -31,6 +31,6 @@ public Map apply(Map input) { } return metadata.build(); } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MetadataToHeadersFunction.java b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MetadataToHeadersFunction.java index 8044d27ac..00e4c453d 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MetadataToHeadersFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/MetadataToHeadersFunction.java @@ -1,45 +1,45 @@ package org.openstack4j.openstack.storage.object.functions; -import java.util.Map; - import com.google.common.base.Function; import com.google.common.collect.Maps; +import java.util.Map; + /** * Transforms a MetaHeaderRequestWrapper which applies headers based on a prefix to the outbound * HttpRequest - * + * * @author Jeremy Unruh */ public class MetadataToHeadersFunction implements Function, Map> { private String prefix; - + private MetadataToHeadersFunction(String prefix) { this.prefix = prefix; } - + /** * Creates a new Metadata to Headers function - * + * * @param prefix the prefix used for headers * @return MetadataToHeadersFunction */ public static MetadataToHeadersFunction create(String prefix) { return new MetadataToHeadersFunction(prefix); } - + /** * Transforms metadata raw values into header form values - * - * @param metadata the map of metadata + * + * @param metadata the map of metadata * @return map of metadata in header format */ @Override public Map apply(Map metadata) { - + Map headers = Maps.newHashMap(); - + for (String key : metadata.keySet()) { String keyLower = key.toLowerCase(); String value = metadata.get(key); diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseAccountFunction.java b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseAccountFunction.java index e6bacc846..fd98fca06 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseAccountFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseAccountFunction.java @@ -1,35 +1,31 @@ package org.openstack4j.openstack.storage.object.functions; -import static org.openstack4j.model.storage.object.SwiftHeaders.ACCOUNT_BYTES_USED; -import static org.openstack4j.model.storage.object.SwiftHeaders.ACCOUNT_CONTAINER_COUNT; -import static org.openstack4j.model.storage.object.SwiftHeaders.ACCOUNT_OBJECT_COUNT; -import static org.openstack4j.model.storage.object.SwiftHeaders.ACCOUNT_TEMPORARY_URL_KEY; -import static org.openstack4j.openstack.internal.Parser.asLong; - +import com.google.common.base.Function; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.model.storage.object.SwiftAccount; import org.openstack4j.openstack.storage.object.domain.SwiftAccountImpl; -import com.google.common.base.Function; +import static org.openstack4j.model.storage.object.SwiftHeaders.*; +import static org.openstack4j.openstack.internal.Parser.asLong; /** * Parses an HttpResponse from an Account call into a SwiftAccount object - * + * * @author Jeremy Unruh */ -public class ParseAccountFunction implements Function{ +public class ParseAccountFunction implements Function { public static final ParseAccountFunction INSTANCE = new ParseAccountFunction(); - + @Override public SwiftAccount apply(HttpResponse res) { return SwiftAccountImpl.builder() - .bytesUsed(asLong(res.header(ACCOUNT_BYTES_USED), 0L)) - .containerCount((asLong(res.header(ACCOUNT_CONTAINER_COUNT), 0L))) - .objectCount((asLong(res.header(ACCOUNT_OBJECT_COUNT), 0L))) - .temporaryUrlKey(res.header(ACCOUNT_TEMPORARY_URL_KEY)) - .metadata(MapWithoutMetaPrefixFunction.INSTANCE.apply(res.headers())) - .build(); + .bytesUsed(asLong(res.header(ACCOUNT_BYTES_USED), 0L)) + .containerCount((asLong(res.header(ACCOUNT_CONTAINER_COUNT), 0L))) + .objectCount((asLong(res.header(ACCOUNT_OBJECT_COUNT), 0L))) + .temporaryUrlKey(res.header(ACCOUNT_TEMPORARY_URL_KEY)) + .metadata(MapWithoutMetaPrefixFunction.INSTANCE.apply(res.headers())) + .build(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseObjectFunction.java b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseObjectFunction.java index 51dc20920..6738806bd 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseObjectFunction.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/functions/ParseObjectFunction.java @@ -1,49 +1,45 @@ package org.openstack4j.openstack.storage.object.functions; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTENT_LENGTH; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTENT_TYPE; -import static org.openstack4j.model.storage.object.SwiftHeaders.ETAG; -import static org.openstack4j.model.storage.object.SwiftHeaders.LAST_MODIFIED; -import static org.openstack4j.openstack.internal.Parser.asLong; - +import com.google.common.base.Function; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.model.storage.object.SwiftObject; import org.openstack4j.model.storage.object.options.ObjectLocation; import org.openstack4j.openstack.internal.Parser; import org.openstack4j.openstack.storage.object.domain.SwiftObjectImpl; -import com.google.common.base.Function; +import static org.openstack4j.model.storage.object.SwiftHeaders.*; +import static org.openstack4j.openstack.internal.Parser.asLong; /** * Transforms an HttpResponse into a SwiftObject - * + * * @author Jeremy Unruh */ public class ParseObjectFunction implements Function { private ObjectLocation location; - + private ParseObjectFunction(ObjectLocation location) { this.location = location; } - + public static ParseObjectFunction create(ObjectLocation location) { return new ParseObjectFunction(location); } - - + + @Override public SwiftObject apply(HttpResponse resp) { return SwiftObjectImpl.builder() - .name(location.getObjectName()) - .containerName(location.getContainerName()) - .mimeType(resp.header(CONTENT_TYPE)) - .sizeBytes(asLong(resp.header(CONTENT_LENGTH))) - .eTag(resp.header(ETAG)) - .metadata(MapWithoutMetaPrefixFunction.INSTANCE.apply(resp.headers())) - .lastModified(Parser.toRFC822DateParse(resp.header(LAST_MODIFIED))) - .build(); + .name(location.getObjectName()) + .containerName(location.getContainerName()) + .mimeType(resp.header(CONTENT_TYPE)) + .sizeBytes(asLong(resp.header(CONTENT_LENGTH))) + .eTag(resp.header(ETAG)) + .metadata(MapWithoutMetaPrefixFunction.INSTANCE.apply(resp.headers())) + .lastModified(Parser.toRFC822DateParse(resp.header(LAST_MODIFIED))) + .build(); } - + } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java index 174a782fe..3426226c3 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java @@ -1,14 +1,14 @@ package org.openstack4j.openstack.storage.object.internal; -import static org.openstack4j.core.transport.HttpEntityHandler.closeQuietly; - import org.openstack4j.api.types.ServiceType; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.openstack.internal.BaseOpenStackService; +import static org.openstack4j.core.transport.HttpEntityHandler.closeQuietly; + /** * Base OpenStack Storage Service - * + * * @author Jeremy Unruh */ public class BaseObjectStorageService extends BaseOpenStackService { @@ -16,11 +16,11 @@ public class BaseObjectStorageService extends BaseOpenStackService { public BaseObjectStorageService() { super(ServiceType.OBJECT_STORAGE); } - + protected boolean isResponseSuccess(HttpResponse res, int status) { return isResponseSuccess(res, status, true); } - + protected boolean isResponseSuccess(HttpResponse res, int status, boolean closeResponse) { boolean result = res.getStatus() == status; if (closeResponse) { diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageAccountServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageAccountServiceImpl.java index efaf2f9eb..41e58e959 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageAccountServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageAccountServiceImpl.java @@ -1,20 +1,18 @@ package org.openstack4j.openstack.storage.object.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.model.storage.object.SwiftHeaders.ACCOUNT_METADATA_PREFIX; -import static org.openstack4j.model.storage.object.SwiftHeaders.ACCOUNT_REMOVE_METADATA_PREFIX; -import static org.openstack4j.model.storage.object.SwiftHeaders.ACCOUNT_TEMPORARY_URL_KEY; - -import java.util.Map; - import org.openstack4j.api.storage.ObjectStorageAccountService; import org.openstack4j.model.storage.object.SwiftAccount; import org.openstack4j.openstack.storage.object.functions.MetadataToHeadersFunction; import org.openstack4j.openstack.storage.object.functions.ParseAccountFunction; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.model.storage.object.SwiftHeaders.*; + /** * The Object Storage Account based services - * + * * @author Jeremy Unruh */ public class ObjectStorageAccountServiceImpl extends BaseObjectStorageService implements ObjectStorageAccountService { @@ -35,7 +33,7 @@ public boolean updateMetadata(Map metadata) { checkNotNull(metadata); return invokeMetadata(ACCOUNT_METADATA_PREFIX, metadata); } - + /** * {@inheritDoc} */ @@ -56,7 +54,7 @@ public boolean updateTemporaryUrlKey(String temporaryUrlKey) { private boolean invokeMetadata(String prefix, Map metadata) { return isResponseSuccess(post(Void.class) - .headers(MetadataToHeadersFunction.create(prefix).apply(metadata)) - .executeWithResponse(), 204); + .headers(MetadataToHeadersFunction.create(prefix).apply(metadata)) + .executeWithResponse(), 204); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageContainerServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageContainerServiceImpl.java index a7139f742..518eb3d39 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageContainerServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageContainerServiceImpl.java @@ -1,15 +1,5 @@ package org.openstack4j.openstack.storage.object.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_DIRECTORY; -import static org.openstack4j.core.transport.ClientConstants.URI_SEP; -import static org.openstack4j.core.transport.HttpEntityHandler.closeQuietly; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTAINER_METADATA_PREFIX; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTAINER_REMOVE_METADATA_PREFIX; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.Apis; import org.openstack4j.api.storage.ObjectStorageContainerService; import org.openstack4j.api.storage.ObjectStorageObjectService; @@ -24,9 +14,19 @@ import org.openstack4j.openstack.storage.object.functions.MapWithoutMetaPrefixFunction; import org.openstack4j.openstack.storage.object.functions.MetadataToHeadersFunction; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.ClientConstants.CONTENT_TYPE_DIRECTORY; +import static org.openstack4j.core.transport.ClientConstants.URI_SEP; +import static org.openstack4j.core.transport.HttpEntityHandler.closeQuietly; +import static org.openstack4j.model.storage.object.SwiftHeaders.CONTAINER_METADATA_PREFIX; +import static org.openstack4j.model.storage.object.SwiftHeaders.CONTAINER_REMOVE_METADATA_PREFIX; + /** * Provides access to the OpenStack Object Storage (Swift) Container API features. - * + * * @author Jeremy Unruh */ public class ObjectStorageContainerServiceImpl extends BaseObjectStorageService implements ObjectStorageContainerService { @@ -36,7 +36,7 @@ public class ObjectStorageContainerServiceImpl extends BaseObjectStorageService */ @Override public List list() { - return toList(get(SwiftContainerImpl[].class).param("format", "json").execute()); + return toList(get(SwiftContainerImpl[].class).param("format", "json").execute()); } /** @@ -46,10 +46,10 @@ public List list() { public List list(ContainerListOptions options) { if (options == null) return list(); - + return toList(get(SwiftContainerImpl[].class).param("format", "json").params(options.getOptions()).execute()); } - + /** * {@inheritDoc} */ @@ -66,7 +66,7 @@ public ActionResponse create(String name, CreateUpdateContainerOptions options) checkNotNull(name); return put(ActionResponse.class, URI_SEP, name).headers(options != null ? options.getOptions() : null).execute(); } - + /** * {@inheritDoc} */ @@ -74,8 +74,8 @@ public ActionResponse create(String name, CreateUpdateContainerOptions options) public String createPath(String containerName, String path) { checkNotNull(containerName); checkNotNull(path); - return Apis.get(ObjectStorageObjectService.class).put(containerName, path, null, - ObjectPutOptions.create().contentType(CONTENT_TYPE_DIRECTORY)); + return Apis.get(ObjectStorageObjectService.class).put(containerName, path, null, + ObjectPutOptions.create().contentType(CONTENT_TYPE_DIRECTORY)); } /** @@ -84,12 +84,12 @@ public String createPath(String containerName, String path) { @Override public ActionResponse update(String name, CreateUpdateContainerOptions options) { checkNotNull(name); - - return post(ActionResponse.class, URI_SEP, name) - .headers(options != null ? options.getOptions() : null) - .execute(); + + return post(ActionResponse.class, URI_SEP, name) + .headers(options != null ? options.getOptions() : null) + .execute(); } - + /** * {@inheritDoc} */ @@ -97,15 +97,14 @@ public ActionResponse update(String name, CreateUpdateContainerOptions options) public ActionResponse delete(String name) { checkNotNull(name); HttpResponse resp = delete(Void.class, URI_SEP, name).executeWithResponse(); - + try { if (resp.getStatus() == 409) return ActionResponse.actionFailed(String.format("Container %s is not empty", name), 409); - } - finally { + } finally { closeQuietly(resp); } - + return ToActionResponseFunction.INSTANCE.apply(resp); } @@ -116,15 +115,13 @@ public ActionResponse delete(String name) { public Map getMetadata(String name) { checkNotNull(name); HttpResponse resp = head(Void.class, URI_SEP, name).executeWithResponse(); - try - { + try { return MapWithoutMetaPrefixFunction.INSTANCE.apply(resp.headers()); - } - finally { + } finally { closeQuietly(resp); } } - + /** * {@inheritDoc} */ @@ -140,13 +137,13 @@ public boolean updateMetadata(String name, Map metadata) { public boolean deleteMetadata(String name, Map metadata) { return invokeMetadata(name, CONTAINER_REMOVE_METADATA_PREFIX, metadata); } - + private boolean invokeMetadata(String name, String prefix, Map metadata) { checkNotNull(name); checkNotNull(metadata); - + return isResponseSuccess(post(Void.class, URI_SEP, name) - .headers(MetadataToHeadersFunction.create(prefix).apply(metadata)) - .executeWithResponse(), 204); + .headers(MetadataToHeadersFunction.create(prefix).apply(metadata)) + .executeWithResponse(), 204); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java index 72a4e136a..94f4a5704 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java @@ -1,27 +1,17 @@ package org.openstack4j.openstack.storage.object.internal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.openstack4j.core.transport.HttpEntityHandler.closeQuietly; -import static org.openstack4j.model.storage.object.SwiftHeaders.CONTENT_LENGTH; -import static org.openstack4j.model.storage.object.SwiftHeaders.ETAG; -import static org.openstack4j.model.storage.object.SwiftHeaders.OBJECT_METADATA_PREFIX; -import static org.openstack4j.model.storage.object.SwiftHeaders.X_COPY_FROM; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - +import com.google.common.collect.Lists; import org.openstack4j.api.storage.ObjectStorageObjectService; import org.openstack4j.core.transport.HttpResponse; +import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.common.DLPayload; import org.openstack4j.model.common.Payload; import org.openstack4j.model.common.payloads.FilePayload; -import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.storage.block.options.DownloadOptions; import org.openstack4j.model.storage.object.SwiftObject; +import org.openstack4j.model.storage.object.options.ObjectDeleteOptions; import org.openstack4j.model.storage.object.options.ObjectListOptions; import org.openstack4j.model.storage.object.options.ObjectLocation; -import org.openstack4j.model.storage.object.options.ObjectDeleteOptions; import org.openstack4j.model.storage.object.options.ObjectPutOptions; import org.openstack4j.openstack.common.DLPayloadEntity; import org.openstack4j.openstack.common.functions.HeaderNameValuesToHeaderMap; @@ -32,12 +22,18 @@ import org.openstack4j.openstack.storage.object.functions.MetadataToHeadersFunction; import org.openstack4j.openstack.storage.object.functions.ParseObjectFunction; -import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.openstack4j.core.transport.HttpEntityHandler.closeQuietly; +import static org.openstack4j.model.storage.object.SwiftHeaders.*; /** * A service responsible for maintaining directory and file objects within containers for * an Object Service within OpenStack - * + * * @author Jeremy Unruh */ public class ObjectStorageObjectServiceImpl extends BaseObjectStorageService implements ObjectStorageObjectService { @@ -46,11 +42,11 @@ public class ObjectStorageObjectServiceImpl extends BaseObjectStorageService imp public List list(String containerName) { checkNotNull(containerName); List objs = get(SwiftObjects.class, uri("/%s", containerName)).param("format", "json").execute(); - + if (objs == null) { return Collections.emptyList(); } - + return Lists.transform(objs, ApplyContainerToObjectFunction.create(containerName)); } @@ -58,17 +54,17 @@ public List list(String containerName) { public List list(String containerName, ObjectListOptions options) { if (options == null) return list(containerName); - + checkNotNull(containerName); - + List objs = get(SwiftObjects.class, uri("/%s", containerName)).param("format", "json").params(options.getOptions()).execute(); if (objs == null) { return Collections.emptyList(); } return Lists.transform(objs, ApplyContainerToObjectFunction.create(containerName)); - + } - + /** * {@inheritDoc} */ @@ -77,18 +73,16 @@ public SwiftObject get(ObjectLocation location) { checkNotNull(location); HttpResponse resp = head(Void.class, location.getURI()).executeWithResponse(); - try - { + try { if (resp.getStatus() == 404) return null; - + return ParseObjectFunction.create(location).apply(resp); - } - finally { + } finally { closeQuietly(resp); } } - + /** * {@inheritDoc} */ @@ -117,23 +111,21 @@ public String put(String containerName, String name, Payload payload, ObjectP name = FilePayload.class.cast(payload).getRaw().getName(); else checkNotNull(name); - - + + if (options.getPath() != null && name.indexOf('/') == -1) name = options.getPath() + "/" + name; - + HttpResponse resp = put(Void.class, uri("/%s/%s", containerName, name)) - .entity(payload) - .headers(options.getOptions()) - .contentType(options.getContentType()) - .paramLists(options.getQueryParams()) - .executeWithResponse(); - try - { + .entity(payload) + .headers(options.getOptions()) + .contentType(options.getContentType()) + .paramLists(options.getQueryParams()) + .executeWithResponse(); + try { return resp.header(ETAG); - } - finally { - closeQuietly(resp); + } finally { + closeQuietly(resp); } } @@ -141,8 +133,8 @@ public String put(String containerName, String name, Payload payload, ObjectP public ActionResponse delete(String containerName, String name) { checkNotNull(containerName); checkNotNull(name); - - return delete(ObjectLocation.create(containerName, name)); + + return delete(ObjectLocation.create(containerName, name)); } @Override @@ -155,10 +147,10 @@ public ActionResponse delete(ObjectLocation location, ObjectDeleteOptions option checkNotNull(location); checkNotNull(options); return delete(ActionResponse.class, location.getURI()) - .paramLists(options.getQueryParams()) - .execute(); + .paramLists(options.getQueryParams()) + .execute(); } - + /** * {@inheritDoc} */ @@ -168,14 +160,12 @@ public String copy(ObjectLocation source, ObjectLocation dest) { checkNotNull(dest); HttpResponse resp = put(Void.class, dest.getURI()) - .header(X_COPY_FROM, source.getURI()) - .header(CONTENT_LENGTH, 0) - .executeWithResponse(); - try - { + .header(X_COPY_FROM, source.getURI()) + .header(CONTENT_LENGTH, 0) + .executeWithResponse(); + try { return resp.header(ETAG); - } - finally { + } finally { closeQuietly(resp); } } @@ -185,11 +175,9 @@ public Map getMetadata(ObjectLocation location) { checkNotNull(location); HttpResponse resp = head(Void.class, location.getURI()).executeWithResponse(); - try - { + try { return MapWithoutMetaPrefixFunction.INSTANCE.apply(resp.headers()); - } - finally { + } finally { closeQuietly(resp); } } @@ -209,8 +197,8 @@ public boolean updateMetadata(ObjectLocation location, Map metad //the successfull response state of updateMetadata is 202 instead of 204 //I test it by curl and this api return isResponseSuccess(post(Void.class, location.getURI()) - .headers(MetadataToHeadersFunction.create(OBJECT_METADATA_PREFIX).apply(metadata)) - .executeWithResponse(), 202); + .headers(MetadataToHeadersFunction.create(OBJECT_METADATA_PREFIX).apply(metadata)) + .executeWithResponse(), 202); } @Override @@ -223,7 +211,7 @@ public DLPayload download(String containerName, String name, DownloadOptions opt checkNotNull(containerName); checkNotNull(name); checkNotNull(options); - + return download(ObjectLocation.create(containerName, name), options); } @@ -231,11 +219,11 @@ public DLPayload download(String containerName, String name, DownloadOptions opt public DLPayload download(ObjectLocation location, DownloadOptions options) { checkNotNull(location); checkNotNull(options); - + return DLPayloadEntity.create( - get(Void.class, location.getURI()) - .headers(HeaderNameValuesToHeaderMap.INSTANCE.apply(options.getHeaders())) - .executeWithResponse() - ); + get(Void.class, location.getURI()) + .headers(HeaderNameValuesToHeaderMap.INSTANCE.apply(options.getHeaders())) + .executeWithResponse() + ); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageServiceImpl.java index 208093646..433a41d3d 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageServiceImpl.java @@ -8,7 +8,7 @@ /** * OpenStack Object Storage service implementation - * + * * @author Jeremy Unruh */ public class ObjectStorageServiceImpl implements ObjectStorageService { diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/builders/TackerBuilders.java b/core/src/main/java/org/openstack4j/openstack/tacker/builders/TackerBuilders.java index 3e5a70aad..2b21a9128 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/builders/TackerBuilders.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/builders/TackerBuilders.java @@ -1,43 +1,38 @@ package org.openstack4j.openstack.tacker.builders; -import org.openstack4j.model.tacker.builder.NfvBuilders; -import org.openstack4j.model.tacker.builder.VimBuilder; -import org.openstack4j.model.tacker.builder.VnfBuilder; -import org.openstack4j.model.tacker.builder.VnfUpdateBuilder; -import org.openstack4j.model.tacker.builder.VnfdBuilder; +import org.openstack4j.model.tacker.builder.*; import org.openstack4j.openstack.tacker.domain.TackerVim; import org.openstack4j.openstack.tacker.domain.TackerVnf; import org.openstack4j.openstack.tacker.domain.TackerVnfUpdate; import org.openstack4j.openstack.tacker.domain.TackerVnfd; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public class TackerBuilders implements NfvBuilders { - /** + /** * The builder to Create a vnf-d * * @return VnfdBuilder */ - @Override - public VnfdBuilder vnfd() { - return TackerVnfd.builder(); - } - - /** + @Override + public VnfdBuilder vnfd() { + return TackerVnfd.builder(); + } + + /** * The builder to Create a vnf-d * * @return VnfBuilder */ - @Override - public VnfBuilder vnf() { - return TackerVnf.builder(); - } - - /** + @Override + public VnfBuilder vnf() { + return TackerVnf.builder(); + } + + /** * The builder to update a vnf * * @return VnfUpdateBuilder @@ -46,9 +41,9 @@ public VnfUpdateBuilder vnfUpdate() { return TackerVnfUpdate.builder(); } - @Override - public VimBuilder vim() { - return TackerVim.builder(); - } + @Override + public VimBuilder vim() { + return TackerVim.builder(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/AuthCredentials.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/AuthCredentials.java index 61bfd94c7..e3c2b4042 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/AuthCredentials.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/AuthCredentials.java @@ -6,7 +6,6 @@ import com.google.common.base.MoreObjects; /** - * * @author Vishvesh Deshmukh * @date Aug 18, 2016 */ @@ -14,181 +13,181 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class AuthCredentials { - private String username; - - @JsonProperty("project_name") - private String projectName; - - @JsonProperty("user_id") - private String userId; - - @JsonProperty("user_domain_name") - private String userDomainName; - - @JsonProperty("project_id") - private String projectId; - - @JsonProperty("auth_url") - private String authUrl; - - private String password; - - @JsonProperty("project_domain_name") - private String projectDomainName; - - public static AuthCredentials create() { - return new AuthCredentials(); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("username", username).add("projectName", projectName) - .add("userId", userId).add("userDomainName", userDomainName).add("projectId", projectId) - .add("authUrl", authUrl).add("password", password).add("projectDomainName", projectDomainName) - .toString(); - } - - /** - * Username to Set - * - * @param username the username to set - * @return AuthCredentials - */ - public AuthCredentials username(String username) { - this.username = username; - return this; - } - - /** - * password to Set - * - * @param password the password to set - * @return AuthCredentials - */ - public AuthCredentials password(String password) { - this.password = password; - return this; - } - - /** - * projectName to Set - * - * @param projectName the projectName to set - * @return AuthCredentials - */ - public AuthCredentials projectName(String projectName) { - this.projectName = projectName; - return this; - } - - /** - * userId to Set - * - * @param userId the userId to set - * @return AuthCredentials - */ - public AuthCredentials userId(String userId) { - this.userId = userId; - return this; - } - - /** - * authUrl to Set - * - * @param authUrl the authUrl to set - * @return AuthCredentials - */ - public AuthCredentials authUrl(String authUrl) { - this.authUrl = authUrl; - return this; - } - - /** - * projectId to Set - * - * @param projectId the projectId to set - * @return AuthCredentials - */ - public AuthCredentials projectId(String projectId) { - this.projectId = projectId; - return this; - } - - /** - * projectDomainName to Set - * - * @param projectDomainName the projectDomainName to set - * @return AuthCredentials - */ - public AuthCredentials projectDomainName(String projectDomainName) { - this.projectDomainName = projectDomainName; - return this; - } - - /** - * userDomainName to Set - * - * @param userDomainName the userDomainName to set - * @return AuthCredentials - */ - public AuthCredentials userDomainName(String userDomainName) { - this.userDomainName = userDomainName; - return this; - } - - /** - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * @return the projectName - */ - public String getProjectName() { - return projectName; - } - - /** - * @return the userId - */ - public String getUserId() { - return userId; - } - - /** - * @return the userDomainName - */ - public String getUserDomainName() { - return userDomainName; - } - - /** - * @return the projectId - */ - public String getProjectId() { - return projectId; - } - - /** - * @return the authUrl - */ - public String getAuthUrl() { - return authUrl; - } - - /** - * @return the password - */ - public String getPassword() { - return password; - } - - /** - * @return the projectDomainName - */ - public String getProjectDomainName() { - return projectDomainName; - } + private String username; + + @JsonProperty("project_name") + private String projectName; + + @JsonProperty("user_id") + private String userId; + + @JsonProperty("user_domain_name") + private String userDomainName; + + @JsonProperty("project_id") + private String projectId; + + @JsonProperty("auth_url") + private String authUrl; + + private String password; + + @JsonProperty("project_domain_name") + private String projectDomainName; + + public static AuthCredentials create() { + return new AuthCredentials(); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("username", username).add("projectName", projectName) + .add("userId", userId).add("userDomainName", userDomainName).add("projectId", projectId) + .add("authUrl", authUrl).add("password", password).add("projectDomainName", projectDomainName) + .toString(); + } + + /** + * Username to Set + * + * @param username the username to set + * @return AuthCredentials + */ + public AuthCredentials username(String username) { + this.username = username; + return this; + } + + /** + * password to Set + * + * @param password the password to set + * @return AuthCredentials + */ + public AuthCredentials password(String password) { + this.password = password; + return this; + } + + /** + * projectName to Set + * + * @param projectName the projectName to set + * @return AuthCredentials + */ + public AuthCredentials projectName(String projectName) { + this.projectName = projectName; + return this; + } + + /** + * userId to Set + * + * @param userId the userId to set + * @return AuthCredentials + */ + public AuthCredentials userId(String userId) { + this.userId = userId; + return this; + } + + /** + * authUrl to Set + * + * @param authUrl the authUrl to set + * @return AuthCredentials + */ + public AuthCredentials authUrl(String authUrl) { + this.authUrl = authUrl; + return this; + } + + /** + * projectId to Set + * + * @param projectId the projectId to set + * @return AuthCredentials + */ + public AuthCredentials projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * projectDomainName to Set + * + * @param projectDomainName the projectDomainName to set + * @return AuthCredentials + */ + public AuthCredentials projectDomainName(String projectDomainName) { + this.projectDomainName = projectDomainName; + return this; + } + + /** + * userDomainName to Set + * + * @param userDomainName the userDomainName to set + * @return AuthCredentials + */ + public AuthCredentials userDomainName(String userDomainName) { + this.userDomainName = userDomainName; + return this; + } + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @return the projectName + */ + public String getProjectName() { + return projectName; + } + + /** + * @return the userId + */ + public String getUserId() { + return userId; + } + + /** + * @return the userDomainName + */ + public String getUserDomainName() { + return userDomainName; + } + + /** + * @return the projectId + */ + public String getProjectId() { + return projectId; + } + + /** + * @return the authUrl + */ + public String getAuthUrl() { + return authUrl; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * @return the projectDomainName + */ + public String getProjectDomainName() { + return projectDomainName; + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVim.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVim.java index 78d7267d5..7ea5c96fa 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVim.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVim.java @@ -1,18 +1,16 @@ package org.openstack4j.openstack.tacker.domain; -import java.util.List; - -import org.openstack4j.model.tacker.Vim; -import org.openstack4j.model.tacker.builder.VimBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.tacker.Vim; +import org.openstack4j.model.tacker.builder.VimBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ @@ -20,220 +18,221 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class TackerVim implements Vim { - private static final long serialVersionUID = 1L; - - private String id; - - private String name; - - @JsonProperty("tenant_id") - private String tenantId; - - private String description; - - private String type; - - private TackerVimStatus status; - - @JsonProperty("is_default") - private Boolean isDefault; - - @JsonProperty("auth_cred") - private AuthCredentials authCredentials; - - @JsonProperty("auth_url") - private String authUrl; - - @JsonProperty("placement_attr") - private VimPlacementAttribute placementAttribute; - - @JsonProperty("vim_project") - private VimProject vimProject; - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("id", id).add("name", name).add("tenantId", tenantId) - .add("description", description).add("type", type).add("status", status).add("isDefault", isDefault) - .add("authCredentials", authCredentials).add("authUrl", authUrl) - .add("placementAttribute", placementAttribute).add("vimProject", vimProject).toString(); - } - - /** - * Wrap this TackerVim to a builder - * @return VimBuilder - */ - @Override - public VimBuilder toBuilder() { - return new VimConcreteBuilder(this); - } - - /** - * @return VimBuilder - */ - public static VimBuilder builder() { - return new VimConcreteBuilder(); - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the tenantId - */ - public String getTenantId() { - return tenantId; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @return the status - */ - public TackerVimStatus getStatus() { - return status; - } - - /** - * @return the isDefault - */ - @Override - public Boolean isDefault() { - return null; - } - - /** - * @return the authCredentials - */ - public AuthCredentials getAuthCredentials() { - return authCredentials; - } - - /** - * @return the authUrl - */ - public String getAuthUrl() { - return authUrl; - } - - /** - * @return the placementAttribute - */ - public VimPlacementAttribute getPlacementAttribute() { - return placementAttribute; - } - - /** - * @return the vimProject - */ - public VimProject getVimProject() { - return vimProject; - } - - public static class TackerVims extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("vims") - List vims; - - @Override - public List value() { - return vims; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("vims", vims).toString(); - } - } - - public static class VimConcreteBuilder implements VimBuilder { - - TackerVim vim; - - @Override - public Vim build() { - return vim; - } - - public VimConcreteBuilder() { - this(new TackerVim()); - } - - public VimConcreteBuilder(TackerVim f) { - this.vim = f; - } - - @Override - public VimBuilder from(Vim in) { - this.vim = (TackerVim) in; - return this; - } - - @Override - public VimBuilder name(String name) { - vim.name = name; - return this; - } - - @Override - public VimBuilder description(String description) { - vim.description = description; - return this; - } - - @Override - public VimBuilder authUrl(String authUrl) { - vim.authUrl = authUrl; - return this; - } - - @Override - public VimBuilder vimProject(VimProject vimProject) { - vim.vimProject = vimProject; - return this; - } - - @Override - public VimBuilder isDefault(Boolean isDefault) { - vim.isDefault = isDefault; - return this; - } - - @Override - public VimBuilder authCredentials(AuthCredentials authCredentials) { - vim.authCredentials = authCredentials; - return this; - } - - @Override - public VimBuilder type(String type) { - vim.type = type; - return this; - } - } + private static final long serialVersionUID = 1L; + + private String id; + + private String name; + + @JsonProperty("tenant_id") + private String tenantId; + + private String description; + + private String type; + + private TackerVimStatus status; + + @JsonProperty("is_default") + private Boolean isDefault; + + @JsonProperty("auth_cred") + private AuthCredentials authCredentials; + + @JsonProperty("auth_url") + private String authUrl; + + @JsonProperty("placement_attr") + private VimPlacementAttribute placementAttribute; + + @JsonProperty("vim_project") + private VimProject vimProject; + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("id", id).add("name", name).add("tenantId", tenantId) + .add("description", description).add("type", type).add("status", status).add("isDefault", isDefault) + .add("authCredentials", authCredentials).add("authUrl", authUrl) + .add("placementAttribute", placementAttribute).add("vimProject", vimProject).toString(); + } + + /** + * Wrap this TackerVim to a builder + * + * @return VimBuilder + */ + @Override + public VimBuilder toBuilder() { + return new VimConcreteBuilder(this); + } + + /** + * @return VimBuilder + */ + public static VimBuilder builder() { + return new VimConcreteBuilder(); + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @return the status + */ + public TackerVimStatus getStatus() { + return status; + } + + /** + * @return the isDefault + */ + @Override + public Boolean isDefault() { + return null; + } + + /** + * @return the authCredentials + */ + public AuthCredentials getAuthCredentials() { + return authCredentials; + } + + /** + * @return the authUrl + */ + public String getAuthUrl() { + return authUrl; + } + + /** + * @return the placementAttribute + */ + public VimPlacementAttribute getPlacementAttribute() { + return placementAttribute; + } + + /** + * @return the vimProject + */ + public VimProject getVimProject() { + return vimProject; + } + + public static class TackerVims extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("vims") + List vims; + + @Override + public List value() { + return vims; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("vims", vims).toString(); + } + } + + public static class VimConcreteBuilder implements VimBuilder { + + TackerVim vim; + + @Override + public Vim build() { + return vim; + } + + public VimConcreteBuilder() { + this(new TackerVim()); + } + + public VimConcreteBuilder(TackerVim f) { + this.vim = f; + } + + @Override + public VimBuilder from(Vim in) { + this.vim = (TackerVim) in; + return this; + } + + @Override + public VimBuilder name(String name) { + vim.name = name; + return this; + } + + @Override + public VimBuilder description(String description) { + vim.description = description; + return this; + } + + @Override + public VimBuilder authUrl(String authUrl) { + vim.authUrl = authUrl; + return this; + } + + @Override + public VimBuilder vimProject(VimProject vimProject) { + vim.vimProject = vimProject; + return this; + } + + @Override + public VimBuilder isDefault(Boolean isDefault) { + vim.isDefault = isDefault; + return this; + } + + @Override + public VimBuilder authCredentials(AuthCredentials authCredentials) { + vim.authCredentials = authCredentials; + return this; + } + + @Override + public VimBuilder type(String type) { + vim.type = type; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVimStatus.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVimStatus.java index 7a6c08513..e1e5ff8bf 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVimStatus.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVimStatus.java @@ -4,29 +4,28 @@ /** *

The state of a Tacker (VIM) entity.

- * + * *

Indicates whether tacker vim resource is currently operational.

- * + * * @author Vishvesh Deshmukh * @date Aug 18, 2016 */ public enum TackerVimStatus { - REGISTERING, - REACHABLE, - UNREACHABLE, - PENDING, - ERROR, - UNRECOGNIZED; - - @JsonCreator - public static TackerVimStatus forValue(String value) { - if (value != null) - { - for (TackerVimStatus s : TackerVimStatus.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return TackerVimStatus.UNRECOGNIZED; - } + REGISTERING, + REACHABLE, + UNREACHABLE, + PENDING, + ERROR, + UNRECOGNIZED; + + @JsonCreator + public static TackerVimStatus forValue(String value) { + if (value != null) { + for (TackerVimStatus s : TackerVimStatus.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return TackerVimStatus.UNRECOGNIZED; + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnf.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnf.java index a9c4d1094..e26253a87 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnf.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnf.java @@ -1,18 +1,16 @@ package org.openstack4j.openstack.tacker.domain; -import java.util.List; - -import org.openstack4j.model.tacker.Vnf; -import org.openstack4j.model.tacker.builder.VnfBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.tacker.Vnf; +import org.openstack4j.model.tacker.builder.VnfBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ @@ -20,226 +18,227 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class TackerVnf implements Vnf { - private static final long serialVersionUID = 1L; - - private String id; - - private String name; - - @JsonProperty("tenant_id") - private String tenantId; - - private String description; - - private VnfAttributes attributes; - - private TackerVnfStatus status; - - @JsonProperty("mgmt_url") - private String managementUrl; - - @JsonProperty("vnfd_id") - private String vnfdId; - - @JsonProperty("error_reason") - private String errorReason; - - @JsonProperty("vim_id") - private String vimId; - - @JsonProperty("instance_id") - private String instanceId; - - @JsonProperty("placement_attr") - private VnfPlacementAttribute placementAttribute; - - /** - * Wrap this TackerVnf to a builder - * @return VnfBuilder - */ - @Override - public VnfBuilder toBuilder() { - return new VnfConcreteBuilder(this); - } - - /** - * @return VnfBuilder - */ - public static VnfBuilder builder() { - return new VnfConcreteBuilder(); - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the tenantId - */ - public String getTenantId() { - return tenantId; - } - - /** - * @return the status - */ - public TackerVnfStatus getStatus() { - return status; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @return the attributes - */ - public VnfAttributes getAttributes() { - return attributes; - } - - /** - * @return the managementUrl - */ - public String getManagementUrl() { - return managementUrl; - } - - /** - * @return the vnfdId - */ - public String getVnfdId() { - return vnfdId; - } - - /** - * @return the errorReason - */ - public String getErrorReason() { - return errorReason; - } - - /** - * @return the vimId - */ - public String getVimId() { - return vimId; - } - - /** - * @return the instanceId - */ - public String getInstanceId() { - return instanceId; - } - - /** - * @return the placementAttribute - */ - public VnfPlacementAttribute getPlacementAttribute() { - return placementAttribute; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("id", id).add("name", name).add("tenantId", tenantId) - .add("description", description).add("attributes", attributes).add("status", status) - .add("managementUrl", managementUrl).add("vnfdId", vnfdId).add("errorReason", errorReason) - .add("vimId", vimId).add("instanceId", instanceId).add("placementAttribute", placementAttribute) - .toString(); - } - - public static class TackerVnfs extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("vnfs") - List vnfs; - - @Override - public List value() { - return vnfs; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("vnfs", vnfs).toString(); - } - } - - public static class VnfConcreteBuilder implements VnfBuilder { - - TackerVnf vnf; - - @Override - public Vnf build() { - return vnf; - } - - public VnfConcreteBuilder() { - this(new TackerVnf()); - } - - public VnfConcreteBuilder(TackerVnf f) { - this.vnf = f; - } - - @Override - public VnfBuilder from(Vnf in) { - this.vnf = (TackerVnf) in; - return this; - } - - @Override - public VnfBuilder tenantId(String tenantId) { - vnf.tenantId = tenantId; - return this; - } - - @Override - public VnfBuilder name(String name) { - vnf.name = name; - return this; - } - - @Override - public VnfBuilder description(String description) { - vnf.description = description; - return this; - } - - @Override - public VnfBuilder attributes(VnfAttributes attributes) { - vnf.attributes = attributes; - return this; - } - - @Override - public VnfBuilder vnfdId(String vnfdId) { - vnf.vnfdId = vnfdId; - return this; - } - - @Override - public VnfBuilder vimId(String vimId) { - vnf.vimId = vimId; - return this; - } - - } + private static final long serialVersionUID = 1L; + + private String id; + + private String name; + + @JsonProperty("tenant_id") + private String tenantId; + + private String description; + + private VnfAttributes attributes; + + private TackerVnfStatus status; + + @JsonProperty("mgmt_url") + private String managementUrl; + + @JsonProperty("vnfd_id") + private String vnfdId; + + @JsonProperty("error_reason") + private String errorReason; + + @JsonProperty("vim_id") + private String vimId; + + @JsonProperty("instance_id") + private String instanceId; + + @JsonProperty("placement_attr") + private VnfPlacementAttribute placementAttribute; + + /** + * Wrap this TackerVnf to a builder + * + * @return VnfBuilder + */ + @Override + public VnfBuilder toBuilder() { + return new VnfConcreteBuilder(this); + } + + /** + * @return VnfBuilder + */ + public static VnfBuilder builder() { + return new VnfConcreteBuilder(); + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @return the status + */ + public TackerVnfStatus getStatus() { + return status; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the attributes + */ + public VnfAttributes getAttributes() { + return attributes; + } + + /** + * @return the managementUrl + */ + public String getManagementUrl() { + return managementUrl; + } + + /** + * @return the vnfdId + */ + public String getVnfdId() { + return vnfdId; + } + + /** + * @return the errorReason + */ + public String getErrorReason() { + return errorReason; + } + + /** + * @return the vimId + */ + public String getVimId() { + return vimId; + } + + /** + * @return the instanceId + */ + public String getInstanceId() { + return instanceId; + } + + /** + * @return the placementAttribute + */ + public VnfPlacementAttribute getPlacementAttribute() { + return placementAttribute; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("id", id).add("name", name).add("tenantId", tenantId) + .add("description", description).add("attributes", attributes).add("status", status) + .add("managementUrl", managementUrl).add("vnfdId", vnfdId).add("errorReason", errorReason) + .add("vimId", vimId).add("instanceId", instanceId).add("placementAttribute", placementAttribute) + .toString(); + } + + public static class TackerVnfs extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("vnfs") + List vnfs; + + @Override + public List value() { + return vnfs; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("vnfs", vnfs).toString(); + } + } + + public static class VnfConcreteBuilder implements VnfBuilder { + + TackerVnf vnf; + + @Override + public Vnf build() { + return vnf; + } + + public VnfConcreteBuilder() { + this(new TackerVnf()); + } + + public VnfConcreteBuilder(TackerVnf f) { + this.vnf = f; + } + + @Override + public VnfBuilder from(Vnf in) { + this.vnf = (TackerVnf) in; + return this; + } + + @Override + public VnfBuilder tenantId(String tenantId) { + vnf.tenantId = tenantId; + return this; + } + + @Override + public VnfBuilder name(String name) { + vnf.name = name; + return this; + } + + @Override + public VnfBuilder description(String description) { + vnf.description = description; + return this; + } + + @Override + public VnfBuilder attributes(VnfAttributes attributes) { + vnf.attributes = attributes; + return this; + } + + @Override + public VnfBuilder vnfdId(String vnfdId) { + vnf.vnfdId = vnfdId; + return this; + } + + @Override + public VnfBuilder vimId(String vimId) { + vnf.vimId = vimId; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfStatus.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfStatus.java index eec0214e5..65d7765d7 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfStatus.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfStatus.java @@ -4,35 +4,34 @@ /** *

The state of a Tacker (VNF/NFV) entity.

- * + * *

Indicates whether tacker nfv resource is currently operational.

- * + * * @author Vishvesh Deshmukh * @date Aug 16, 2016 */ public enum TackerVnfStatus { - ACTIVE, - INACTIVE, - DEAD, - DOWN, - BUILD, - ERROR, - PENDING_CREATE, - PENDING_UPDATE, - PENDING_DELETE, - PENDING_SCALE_IN, - PENDING_SCALE_OUT, - UNRECOGNIZED; - - @JsonCreator - public static TackerVnfStatus forValue(String value) { - if (value != null) - { - for (TackerVnfStatus s : TackerVnfStatus.values()) { - if (s.name().equalsIgnoreCase(value)) - return s; - } - } - return TackerVnfStatus.UNRECOGNIZED; - } + ACTIVE, + INACTIVE, + DEAD, + DOWN, + BUILD, + ERROR, + PENDING_CREATE, + PENDING_UPDATE, + PENDING_DELETE, + PENDING_SCALE_IN, + PENDING_SCALE_OUT, + UNRECOGNIZED; + + @JsonCreator + public static TackerVnfStatus forValue(String value) { + if (value != null) { + for (TackerVnfStatus s : TackerVnfStatus.values()) { + if (s.name().equalsIgnoreCase(value)) + return s; + } + } + return TackerVnfStatus.UNRECOGNIZED; + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfUpdate.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfUpdate.java index 80fd2ea19..df5e92e86 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfUpdate.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfUpdate.java @@ -1,11 +1,10 @@ package org.openstack4j.openstack.tacker.domain; -import org.openstack4j.model.tacker.VnfUpdate; -import org.openstack4j.model.tacker.builder.VnfUpdateBuilder; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.tacker.VnfUpdate; +import org.openstack4j.model.tacker.builder.VnfUpdateBuilder; /** * An entity used to update Tacker Vnf. @@ -17,62 +16,63 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class TackerVnfUpdate implements VnfUpdate { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private VnfUpdateAttributes attributes; + private VnfUpdateAttributes attributes; - /** - * Wrap this VnfUpdate to a builder - * @return VnfUpdateBuilder - */ - @Override - public VnfUpdateBuilder toBuilder() { - return new VnfUpdateConcreteBuilder(this); - } + /** + * Wrap this VnfUpdate to a builder + * + * @return VnfUpdateBuilder + */ + @Override + public VnfUpdateBuilder toBuilder() { + return new VnfUpdateConcreteBuilder(this); + } - /** - * @return VnfUpdateBuilder - */ - public static VnfUpdateBuilder builder() { - return new VnfUpdateConcreteBuilder(); - } + /** + * @return VnfUpdateBuilder + */ + public static VnfUpdateBuilder builder() { + return new VnfUpdateConcreteBuilder(); + } - @Override - public VnfUpdateAttributes getAttributes() { - return attributes; - } + @Override + public VnfUpdateAttributes getAttributes() { + return attributes; + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("attributes", attributes).toString(); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("attributes", attributes).toString(); + } - public static class VnfUpdateConcreteBuilder implements VnfUpdateBuilder { - TackerVnfUpdate f; + public static class VnfUpdateConcreteBuilder implements VnfUpdateBuilder { + TackerVnfUpdate f; - @Override - public TackerVnfUpdate build() { - return f; - } + @Override + public TackerVnfUpdate build() { + return f; + } - public VnfUpdateConcreteBuilder() { - this(new TackerVnfUpdate()); - } + public VnfUpdateConcreteBuilder() { + this(new TackerVnfUpdate()); + } - public VnfUpdateConcreteBuilder(TackerVnfUpdate f) { - this.f = f; - } + public VnfUpdateConcreteBuilder(TackerVnfUpdate f) { + this.f = f; + } - @Override - public VnfUpdateBuilder from(VnfUpdate in) { - this.f = (TackerVnfUpdate) in; - return this; - } + @Override + public VnfUpdateBuilder from(VnfUpdate in) { + this.f = (TackerVnfUpdate) in; + return this; + } - @Override - public VnfUpdateBuilder attributes(VnfUpdateAttributes attributes) { - f.attributes = attributes; - return this; - } - } + @Override + public VnfUpdateBuilder attributes(VnfUpdateAttributes attributes) { + f.attributes = attributes; + return this; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfd.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfd.java index b4dfce220..3b655d6cd 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfd.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/TackerVnfd.java @@ -1,18 +1,16 @@ package org.openstack4j.openstack.tacker.domain; -import java.util.List; - -import org.openstack4j.model.tacker.Vnfd; -import org.openstack4j.model.tacker.builder.VnfdBuilder; -import org.openstack4j.openstack.common.ListResult; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import org.openstack4j.model.tacker.Vnfd; +import org.openstack4j.model.tacker.builder.VnfdBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ @@ -20,194 +18,195 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class TackerVnfd implements Vnfd { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private String id; + private String id; - private String name; + private String name; - @JsonProperty("tenant_id") - private String tenantId; + @JsonProperty("tenant_id") + private String tenantId; - private String description; + private String description; - @JsonProperty("mgmt_driver") + @JsonProperty("mgmt_driver") private String managementDriver; - @JsonProperty("infra_driver") + @JsonProperty("infra_driver") private String infrastructureDriver; - private VnfdAttributes attributes; - - @JsonProperty("service_types") - private List serviceTypes; - - /** - * Wrap this TackerVnfd to a builder - * @return VnfdBuilder - */ - @Override - public VnfdBuilder toBuilder() { - return new VnfdConcreteBuilder(this); - } - - /** - * @return VnfdBuilder - */ - public static VnfdBuilder builder() { - return new VnfdConcreteBuilder(); - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the tenantId - */ - public String getTenantId() { - return tenantId; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @return the managementDriver - */ - public String getManagementDriver() { - return managementDriver; - } - - /** - * @return the infrastructureDriver - */ - public String getInfrastructureDriver() { - return infrastructureDriver; - } - - /** - * @return the attributes - */ - public VnfdAttributes getAttributes() { - return attributes; - } - - /** - * @return the serviceTypes - */ - public List getServiceTypes() { - return serviceTypes; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name) - .add("tenantId", tenantId).add("description", description) - .add("serviceTypes", serviceTypes).add("attributes", attributes) - .add("managementDriver", managementDriver).add("infrastructureDriver", infrastructureDriver) - .toString(); - } - - public static class TackerVnfds extends ListResult { - - private static final long serialVersionUID = 1L; - - @JsonProperty("vnfds") - List vnfds; - - @Override - public List value() { - return vnfds; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("vnfds", vnfds).toString(); - } - } - - public static class VnfdConcreteBuilder implements VnfdBuilder { - - TackerVnfd vnfd; - - @Override - public Vnfd build() { - return vnfd; - } - - public VnfdConcreteBuilder() { - this(new TackerVnfd()); - } - - public VnfdConcreteBuilder(TackerVnfd f) { - this.vnfd = f; - } - - @Override - public VnfdBuilder from(Vnfd in) { - this.vnfd = (TackerVnfd) in; - return this; - } - - @Override - public VnfdBuilder tenantId(String tenantId) { - vnfd.tenantId = tenantId; - return this; - } - - @Override - public VnfdBuilder name(String name) { - vnfd.name = name; - return this; - } - - @Override - public VnfdBuilder description(String description) { - vnfd.description = description; - return this; - } - - @Override - public VnfdBuilder managementDriver(String managementDriver) { - vnfd.managementDriver = managementDriver; - return this; - } - - @Override - public VnfdBuilder infrastructureDriver(String infrastructureDriver) { - vnfd.infrastructureDriver = infrastructureDriver; - return this; - } - - @Override - public VnfdBuilder attributes(VnfdAttributes attributes) { - vnfd.attributes = attributes; - return this; - } - - @Override - public VnfdBuilder serviceTypes(List serviceTypes) { - vnfd.serviceTypes = serviceTypes; - return this; - } - - } + private VnfdAttributes attributes; + + @JsonProperty("service_types") + private List serviceTypes; + + /** + * Wrap this TackerVnfd to a builder + * + * @return VnfdBuilder + */ + @Override + public VnfdBuilder toBuilder() { + return new VnfdConcreteBuilder(this); + } + + /** + * @return VnfdBuilder + */ + public static VnfdBuilder builder() { + return new VnfdConcreteBuilder(); + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the managementDriver + */ + public String getManagementDriver() { + return managementDriver; + } + + /** + * @return the infrastructureDriver + */ + public String getInfrastructureDriver() { + return infrastructureDriver; + } + + /** + * @return the attributes + */ + public VnfdAttributes getAttributes() { + return attributes; + } + + /** + * @return the serviceTypes + */ + public List getServiceTypes() { + return serviceTypes; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name) + .add("tenantId", tenantId).add("description", description) + .add("serviceTypes", serviceTypes).add("attributes", attributes) + .add("managementDriver", managementDriver).add("infrastructureDriver", infrastructureDriver) + .toString(); + } + + public static class TackerVnfds extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("vnfds") + List vnfds; + + @Override + public List value() { + return vnfds; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("vnfds", vnfds).toString(); + } + } + + public static class VnfdConcreteBuilder implements VnfdBuilder { + + TackerVnfd vnfd; + + @Override + public Vnfd build() { + return vnfd; + } + + public VnfdConcreteBuilder() { + this(new TackerVnfd()); + } + + public VnfdConcreteBuilder(TackerVnfd f) { + this.vnfd = f; + } + + @Override + public VnfdBuilder from(Vnfd in) { + this.vnfd = (TackerVnfd) in; + return this; + } + + @Override + public VnfdBuilder tenantId(String tenantId) { + vnfd.tenantId = tenantId; + return this; + } + + @Override + public VnfdBuilder name(String name) { + vnfd.name = name; + return this; + } + + @Override + public VnfdBuilder description(String description) { + vnfd.description = description; + return this; + } + + @Override + public VnfdBuilder managementDriver(String managementDriver) { + vnfd.managementDriver = managementDriver; + return this; + } + + @Override + public VnfdBuilder infrastructureDriver(String infrastructureDriver) { + vnfd.infrastructureDriver = infrastructureDriver; + return this; + } + + @Override + public VnfdBuilder attributes(VnfdAttributes attributes) { + vnfd.attributes = attributes; + return this; + } + + @Override + public VnfdBuilder serviceTypes(List serviceTypes) { + vnfd.serviceTypes = serviceTypes; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimPlacementAttribute.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimPlacementAttribute.java index f4182f763..5d00f439d 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimPlacementAttribute.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimPlacementAttribute.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.tacker.domain; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonRootName; import com.google.common.base.MoreObjects; +import java.util.List; + /** - * * @author Vishvesh Deshmukh * @date Aug 16, 2016 */ @@ -15,19 +14,19 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class VimPlacementAttribute { - private List regions; + private List regions; - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("regions", regions) - .toString(); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("regions", regions) + .toString(); + } - /** - * @return the regions - */ - public List getRegions() { - return regions; - } + /** + * @return the regions + */ + public List getRegions() { + return regions; + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimProject.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimProject.java index 0195ca980..786b7cf02 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimProject.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VimProject.java @@ -6,7 +6,6 @@ import com.google.common.base.MoreObjects; /** - * * @author Vishvesh Deshmukh * @date Aug 18, 2016 */ @@ -14,74 +13,74 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class VimProject { - private String id; + private String id; - private String name; + private String name; - @JsonProperty("project_domain_name") - private String projectDomainName; + @JsonProperty("project_domain_name") + private String projectDomainName; - public static VimProject create() { - return new VimProject(); - } + public static VimProject create() { + return new VimProject(); + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("id", id).add("name", name).add("projectDomainName", projectDomainName) - .toString(); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("id", id).add("name", name).add("projectDomainName", projectDomainName) + .toString(); + } - /** - * ID to Set - * - * @param id the id to set - * @return VimProject - */ - public VimProject id(String id) { - this.id = id; - return this; - } + /** + * ID to Set + * + * @param id the id to set + * @return VimProject + */ + public VimProject id(String id) { + this.id = id; + return this; + } - /** - * Project Name to Set - * - * @param name the name to set - * @return VimProject - */ - public VimProject name(String name) { - this.name = name; - return this; - } + /** + * Project Name to Set + * + * @param name the name to set + * @return VimProject + */ + public VimProject name(String name) { + this.name = name; + return this; + } - /** - * ProjectDomainName to Set - * - * @param projectDomainName the projectDomainName to set - * @return VimProject - */ - public VimProject projectDomainName(String projectDomainName) { - this.projectDomainName = projectDomainName; - return this; - } + /** + * ProjectDomainName to Set + * + * @param projectDomainName the projectDomainName to set + * @return VimProject + */ + public VimProject projectDomainName(String projectDomainName) { + this.projectDomainName = projectDomainName; + return this; + } - /** - * @return the id - */ - public String getId() { - return id; - } + /** + * @return the id + */ + public String getId() { + return id; + } - /** - * @return the name - */ - public String getName() { - return name; - } + /** + * @return the name + */ + public String getName() { + return name; + } - /** - * @return the projectDomainName - */ - public String getProjectDomainName() { - return projectDomainName; - } + /** + * @return the projectDomainName + */ + public String getProjectDomainName() { + return projectDomainName; + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfAttributes.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfAttributes.java index c24b3cc9f..ce81c15b4 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfAttributes.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfAttributes.java @@ -6,7 +6,6 @@ import com.google.common.base.MoreObjects; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ @@ -14,123 +13,123 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class VnfAttributes { - @JsonProperty("service_type") - private String serviceType; - - @JsonProperty("param_values") - private String paramValues; - - @JsonProperty("heat_template") - private String heatTemplate; - - @JsonProperty("monitoring_policy") - private String monitoringPolicy; - - @JsonProperty("failure_policy") - private String failurePolicy; - - public static VnfAttributes create() { - return new VnfAttributes(); - } - - /** - * serviceType to Set.. - * - * @param serviceType the serviceType to set - * @return VnfAttributes - */ - public VnfAttributes serviceType(String serviceType) { - this.serviceType = serviceType; - return this; - } - - /** - * paramValues to Set.. - * - * @param paramValues the paramValues to set - * @return VnfAttributes - */ - public VnfAttributes paramValues(String paramValues) { - this.paramValues = paramValues; - return this; - } - - /** - * heatTemplate to Set.. - * - * @param heatTemplate the heatTemplate to set - * @return VnfAttributes - */ - public VnfAttributes heatTemplate(String heatTemplate) { - this.heatTemplate = heatTemplate; - return this; - } - - /** - * monitoringPolicy to Set.. - * - * @param monitoringPolicy the monitoringPolicy to set - * @return VnfAttributes - */ - public VnfAttributes monitoringPolicy(String monitoringPolicy) { - this.monitoringPolicy = monitoringPolicy; - return this; - } - - /** - * failurePolicy to Set.. - * - * @param failurePolicy the failurePolicy to set - * @return VnfAttributes - */ - public VnfAttributes failurePolicy(String failurePolicy) { - this.failurePolicy = failurePolicy; - return this; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("serviceType", serviceType) - .add("paramValues", paramValues) - .add("heatTemplate", heatTemplate) - .add("monitoringPolicy", monitoringPolicy) - .add("failurePolicy", failurePolicy) - .toString(); - } - - /** - * @return the serviceType - */ - public String getServiceType() { - return serviceType; - } - - /** - * @return the paramValues - */ - public String getParamValues() { - return paramValues; - } - - /** - * @return the heatTemplate - */ - public String getHeatTemplate() { - return heatTemplate; - } - - /** - * @return the monitoringPolicy - */ - public String getMonitoringPolicy() { - return monitoringPolicy; - } - - /** - * @return the failurePolicy - */ - public String getFailurePolicy() { - return failurePolicy; - } + @JsonProperty("service_type") + private String serviceType; + + @JsonProperty("param_values") + private String paramValues; + + @JsonProperty("heat_template") + private String heatTemplate; + + @JsonProperty("monitoring_policy") + private String monitoringPolicy; + + @JsonProperty("failure_policy") + private String failurePolicy; + + public static VnfAttributes create() { + return new VnfAttributes(); + } + + /** + * serviceType to Set.. + * + * @param serviceType the serviceType to set + * @return VnfAttributes + */ + public VnfAttributes serviceType(String serviceType) { + this.serviceType = serviceType; + return this; + } + + /** + * paramValues to Set.. + * + * @param paramValues the paramValues to set + * @return VnfAttributes + */ + public VnfAttributes paramValues(String paramValues) { + this.paramValues = paramValues; + return this; + } + + /** + * heatTemplate to Set.. + * + * @param heatTemplate the heatTemplate to set + * @return VnfAttributes + */ + public VnfAttributes heatTemplate(String heatTemplate) { + this.heatTemplate = heatTemplate; + return this; + } + + /** + * monitoringPolicy to Set.. + * + * @param monitoringPolicy the monitoringPolicy to set + * @return VnfAttributes + */ + public VnfAttributes monitoringPolicy(String monitoringPolicy) { + this.monitoringPolicy = monitoringPolicy; + return this; + } + + /** + * failurePolicy to Set.. + * + * @param failurePolicy the failurePolicy to set + * @return VnfAttributes + */ + public VnfAttributes failurePolicy(String failurePolicy) { + this.failurePolicy = failurePolicy; + return this; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("serviceType", serviceType) + .add("paramValues", paramValues) + .add("heatTemplate", heatTemplate) + .add("monitoringPolicy", monitoringPolicy) + .add("failurePolicy", failurePolicy) + .toString(); + } + + /** + * @return the serviceType + */ + public String getServiceType() { + return serviceType; + } + + /** + * @return the paramValues + */ + public String getParamValues() { + return paramValues; + } + + /** + * @return the heatTemplate + */ + public String getHeatTemplate() { + return heatTemplate; + } + + /** + * @return the monitoringPolicy + */ + public String getMonitoringPolicy() { + return monitoringPolicy; + } + + /** + * @return the failurePolicy + */ + public String getFailurePolicy() { + return failurePolicy; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfPlacementAttribute.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfPlacementAttribute.java index 37ddeb333..104880ee9 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfPlacementAttribute.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfPlacementAttribute.java @@ -6,7 +6,6 @@ import com.google.common.base.MoreObjects; /** - * * @author Vishvesh Deshmukh * @date Aug 16, 2016 */ @@ -14,20 +13,20 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class VnfPlacementAttribute { - @JsonProperty("vim_name") - private String vimName; + @JsonProperty("vim_name") + private String vimName; - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("vimName", vimName) - .toString(); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("vimName", vimName) + .toString(); + } - /** - * @return the vimName - */ - public String getVimName() { - return vimName; - } + /** + * @return the vimName + */ + public String getVimName() { + return vimName; + } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfUpdateAttributes.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfUpdateAttributes.java index 84e5e4236..ef686b84a 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfUpdateAttributes.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfUpdateAttributes.java @@ -5,7 +5,6 @@ import com.google.common.base.MoreObjects; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ @@ -13,34 +12,34 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class VnfUpdateAttributes { - private String config; + private String config; - public static VnfUpdateAttributes create() { - return new VnfUpdateAttributes(); - } + public static VnfUpdateAttributes create() { + return new VnfUpdateAttributes(); + } - /** - * User config file or data.. - * - * @param config - * @return VnfUpdateAttributes - */ - public VnfUpdateAttributes config(String config) { - this.config = config; - return this; - } + /** + * User config file or data.. + * + * @param config + * @return VnfUpdateAttributes + */ + public VnfUpdateAttributes config(String config) { + this.config = config; + return this; + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("config", config) - .toString(); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("config", config) + .toString(); + } - /** - * @return the config - */ - public String getConfig() { - return config; - } + /** + * @return the config + */ + public String getConfig() { + return config; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdAttributes.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdAttributes.java index a7f6d55c0..efd0142ef 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdAttributes.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdAttributes.java @@ -5,7 +5,6 @@ import com.google.common.base.MoreObjects; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ @@ -13,34 +12,34 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class VnfdAttributes { - private String vnfd; + private String vnfd; - public static VnfdAttributes create() { - return new VnfdAttributes(); - } + public static VnfdAttributes create() { + return new VnfdAttributes(); + } - /** - * VNFD Template to Set.. - * - * @param vnfd the vnfd template to set - * @return VnfdAttributes - */ - public VnfdAttributes vnfd(String vnfd) { - this.vnfd = vnfd; - return this; - } + /** + * VNFD Template to Set.. + * + * @param vnfd the vnfd template to set + * @return VnfdAttributes + */ + public VnfdAttributes vnfd(String vnfd) { + this.vnfd = vnfd; + return this; + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("vnfd", vnfd) - .toString(); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("vnfd", vnfd) + .toString(); + } - /** - * @return the vnfd - */ - public String getVnfd() { - return vnfd; - } + /** + * @return the vnfd + */ + public String getVnfd() { + return vnfd; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdServiceTypes.java b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdServiceTypes.java index 2d23f2e20..bc2dc7ae9 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdServiceTypes.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/domain/VnfdServiceTypes.java @@ -6,7 +6,6 @@ import com.google.common.base.MoreObjects; /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ @@ -14,45 +13,45 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class VnfdServiceTypes { - private String id; - - @JsonProperty("service_type") - private String serviceType; - - public static VnfdServiceTypes create() { - return new VnfdServiceTypes(); - } - - /** - * Service Type to Set : Example serviceType : vnfd - * - * @param serviceType the serviceType to set - * @return VnfdServiceTypes - */ - public VnfdServiceTypes serviceType(String serviceType) { - this.serviceType = serviceType; - return this; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the serviceType - */ - public String getServiceType() { - return serviceType; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("serviceType", serviceType) - .toString(); - } + private String id; + + @JsonProperty("service_type") + private String serviceType; + + public static VnfdServiceTypes create() { + return new VnfdServiceTypes(); + } + + /** + * Service Type to Set : Example serviceType : vnfd + * + * @param serviceType the serviceType to set + * @return VnfdServiceTypes + */ + public VnfdServiceTypes serviceType(String serviceType) { + this.serviceType = serviceType; + return this; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the serviceType + */ + public String getServiceType() { + return serviceType; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("serviceType", serviceType) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/internal/BaseTackerServices.java b/core/src/main/java/org/openstack4j/openstack/tacker/internal/BaseTackerServices.java index 4aa6a4f17..b26c692f6 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/internal/BaseTackerServices.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/internal/BaseTackerServices.java @@ -6,12 +6,12 @@ /** * Base Tacker Operations Implementation is responsible for insuring the proper endpoint is used for all extending operation APIs - * + * * @author Vishvesh Deshmukh */ public class BaseTackerServices extends BaseOpenStackService { - protected BaseTackerServices() { - super(ServiceType.TACKER, EnforceVersionToURL.instance("/v1.0")); - } + protected BaseTackerServices() { + super(ServiceType.TACKER, EnforceVersionToURL.instance("/v1.0")); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/internal/VimServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/tacker/internal/VimServiceImpl.java index 788cf748a..97bf70795 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/internal/VimServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/internal/VimServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.tacker.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.tacker.VimService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -14,64 +9,68 @@ import org.openstack4j.openstack.tacker.domain.TackerVim; import org.openstack4j.openstack.tacker.domain.TackerVim.TackerVims; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** - * * @author Vishvesh Deshmukh * @date Aug 18, 2016 */ public class VimServiceImpl extends BaseTackerServices implements VimService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(TackerVims.class, uri("/vims")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(TackerVims.class, uri("/vims")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(TackerVims.class, uri("/vims")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(TackerVims.class, uri("/vims")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public TackerVim show(String vimId) { - checkNotNull(vimId); - return get(TackerVim.class, uri("/vims/%s", vimId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public TackerVim show(String vimId) { + checkNotNull(vimId); + return get(TackerVim.class, uri("/vims/%s", vimId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String vimId) { - checkNotNull(vimId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/vims/%s", vimId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String vimId) { + checkNotNull(vimId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/vims/%s", vimId)).executeWithResponse()); + } - /** - * {@inheritDoc} - */ - @Override - public Vim register(Vim vim) { - return post(TackerVim.class, uri("/vims")).entity(vim).execute(ExecutionOptions.create(PropagateOnStatus.on(500))); - } + /** + * {@inheritDoc} + */ + @Override + public Vim register(Vim vim) { + return post(TackerVim.class, uri("/vims")).entity(vim).execute(ExecutionOptions.create(PropagateOnStatus.on(500))); + } - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ /*@Override public Vim update(String vimId, VimUpdate vimUpdate) { checkNotNull(vimId); diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfServiceImpl.java index aa1b662aa..e29dce285 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.tacker.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.tacker.VnfService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -15,68 +10,72 @@ import org.openstack4j.openstack.tacker.domain.TackerVnf; import org.openstack4j.openstack.tacker.domain.TackerVnf.TackerVnfs; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public class VnfServiceImpl extends BaseTackerServices implements VnfService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(TackerVnfs.class, uri("/vnfs")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(TackerVnfs.class, uri("/vnfs")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(TackerVnfs.class, uri("/vnfs")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(TackerVnfs.class, uri("/vnfs")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public TackerVnf get(String vnfId) { - checkNotNull(vnfId); - return get(TackerVnf.class, uri("/vnfs/%s", vnfId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public TackerVnf get(String vnfId) { + checkNotNull(vnfId); + return get(TackerVnf.class, uri("/vnfs/%s", vnfId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String vnfId) { - checkNotNull(vnfId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/vnfs/%s", vnfId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String vnfId) { + checkNotNull(vnfId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/vnfs/%s", vnfId)).executeWithResponse()); + } - /** - * {@inheritDoc} - */ - @Override - public Vnf create(Vnf vnf) { - return post(TackerVnf.class, uri("/vnfs")).entity(vnf).execute(ExecutionOptions.create(PropagateOnStatus.on(500))); - } + /** + * {@inheritDoc} + */ + @Override + public Vnf create(Vnf vnf) { + return post(TackerVnf.class, uri("/vnfs")).entity(vnf).execute(ExecutionOptions.create(PropagateOnStatus.on(500))); + } - /** - * {@inheritDoc} - */ - @Override - public Vnf update(String vnfId, VnfUpdate vnfUpdate) { - checkNotNull(vnfId); + /** + * {@inheritDoc} + */ + @Override + public Vnf update(String vnfId, VnfUpdate vnfUpdate) { + checkNotNull(vnfId); checkNotNull(vnfUpdate); return put(TackerVnf.class, uri("/vnfs/%s", vnfId)).entity(vnfUpdate).execute(); - } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfdServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfdServiceImpl.java index 9e6afd63e..ea28d2651 100644 --- a/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfdServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/tacker/internal/VnfdServiceImpl.java @@ -1,10 +1,5 @@ package org.openstack4j.openstack.tacker.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; -import java.util.Map; - import org.openstack4j.api.tacker.VnfdService; import org.openstack4j.core.transport.ExecutionOptions; import org.openstack4j.core.transport.propagation.PropagateOnStatus; @@ -14,55 +9,59 @@ import org.openstack4j.openstack.tacker.domain.TackerVnfd; import org.openstack4j.openstack.tacker.domain.TackerVnfd.TackerVnfds; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + /** - * * @author Vishvesh Deshmukh * @date Aug 11, 2016 */ public class VnfdServiceImpl extends BaseTackerServices implements VnfdService { - /** - * {@inheritDoc} - */ - @Override - public List list() { - return get(TackerVnfds.class, uri("/vnfds")).execute().getList(); - } + /** + * {@inheritDoc} + */ + @Override + public List list() { + return get(TackerVnfds.class, uri("/vnfds")).execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public List list(Map filteringParams) { - Invocation req = get(TackerVnfds.class, uri("/vnfds")); - if (filteringParams != null) { + /** + * {@inheritDoc} + */ + @Override + public List list(Map filteringParams) { + Invocation req = get(TackerVnfds.class, uri("/vnfds")); + if (filteringParams != null) { for (Map.Entry entry : filteringParams.entrySet()) { - req = req.param(entry.getKey(), entry.getValue()); + req = req.param(entry.getKey(), entry.getValue()); } } - return req.execute().getList(); - } + return req.execute().getList(); + } - /** - * {@inheritDoc} - */ - @Override - public TackerVnfd get(String vnfdId) { - checkNotNull(vnfdId); - return get(TackerVnfd.class, uri("/vnfds/%s", vnfdId)).execute(); - } + /** + * {@inheritDoc} + */ + @Override + public TackerVnfd get(String vnfdId) { + checkNotNull(vnfdId); + return get(TackerVnfd.class, uri("/vnfds/%s", vnfdId)).execute(); + } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String vnfdId) { - checkNotNull(vnfdId); - return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/vnfds/%s", vnfdId)).executeWithResponse()); - } + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String vnfdId) { + checkNotNull(vnfdId); + return ToActionResponseFunction.INSTANCE.apply(delete(Void.class, uri("/vnfds/%s", vnfdId)).executeWithResponse()); + } - @Override - public Vnfd create(Vnfd vnfd) { - return post(TackerVnfd.class, uri("/vnfds")).entity(vnfd).execute(ExecutionOptions.create(PropagateOnStatus.on(500))); - } + @Override + public Vnfd create(Vnfd vnfd) { + return post(TackerVnfd.class, uri("/vnfds")).entity(vnfd).execute(ExecutionOptions.create(PropagateOnStatus.on(500))); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/builder/CeilometerBuilders.java b/core/src/main/java/org/openstack4j/openstack/telemetry/builder/CeilometerBuilders.java index a0c7ba948..ca731d92a 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/builder/CeilometerBuilders.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/builder/CeilometerBuilders.java @@ -1,8 +1,9 @@ package org.openstack4j.openstack.telemetry.builder; -import org.openstack4j.model.telemetry.builder.*; -import org.openstack4j.openstack.telemetry.domain.*; +import org.openstack4j.model.telemetry.builder.AlarmBuilder; +import org.openstack4j.model.telemetry.builder.TelemetryBuilders; +import org.openstack4j.openstack.telemetry.domain.CeilometerAlarm; /** * The Ceilometer V3 Builders diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeiloMeterSample.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeiloMeterSample.java index 171836a22..22c0951b8 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeiloMeterSample.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeiloMeterSample.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.telemetry.domain; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.telemetry.Meter.Type; import org.openstack4j.model.telemetry.Sample; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.Map; /** * A single measurement for sample. @@ -197,7 +196,7 @@ public String getMeter() { @Override public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("meter", meter).add("type", type).add("unit", unit).add("volume", volume).add("timestamp", timestamp) - .add("source", source).add("project", projectId).add("user", userId).add("resource", resourceId).addValue("\n").add("metadata", metadata) - .add("recorded_at", recordedAt).toString(); + .add("source", source).add("project", projectId).add("user", userId).add("resource", resourceId).addValue("\n").add("metadata", metadata) + .add("recorded_at", recordedAt).toString(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java index 3160d66a4..019f19ce5 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java @@ -16,866 +16,866 @@ */ public class CeilometerAlarm implements Alarm { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("project_id") - private String projectId; + @JsonProperty("project_id") + private String projectId; - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ - @JsonProperty("name") - private String name; + @JsonProperty("name") + private String name; - @JsonProperty("type") - private Type type; + @JsonProperty("type") + private Type type; - @JsonProperty("user_id") - private String userId; + @JsonProperty("user_id") + private String userId; - @JsonProperty("alarm_actions") - private List alarmActions; + @JsonProperty("alarm_actions") + private List alarmActions; - @JsonProperty("alarm_id") - private String alarmId; + @JsonProperty("alarm_id") + private String alarmId; - @JsonProperty("description") - private String description; + @JsonProperty("description") + private String description; - @JsonProperty("enabled") - private boolean isEnabled; + @JsonProperty("enabled") + private boolean isEnabled; - @JsonProperty("insufficient_data_actions") - private List insufficientDataActions; + @JsonProperty("insufficient_data_actions") + private List insufficientDataActions; - @JsonProperty("ok_actions") - private List okActions; + @JsonProperty("ok_actions") + private List okActions; - @JsonProperty("repeat_actions") - private boolean repeatActions; + @JsonProperty("repeat_actions") + private boolean repeatActions; - @JsonProperty("state") - private String state; + @JsonProperty("state") + private String state; - @JsonProperty("state_timestamp") - private String stateTimestamp; + @JsonProperty("state_timestamp") + private String stateTimestamp; - @JsonProperty("threshold_rule") - private CeilometerThresholdRule thresholdRule; + @JsonProperty("threshold_rule") + private CeilometerThresholdRule thresholdRule; - @JsonProperty("combination_rule") - private CeilometerCombinationRule combinationRule; + @JsonProperty("combination_rule") + private CeilometerCombinationRule combinationRule; - @JsonProperty("composite_rule") - private Map compositeRule; + @JsonProperty("composite_rule") + private Map compositeRule; - @JsonProperty("gnocchi_resources_threshold_rule") - private CeilometerGnocchiResourcesThresholdRule gnocchiResourcesThresholdRule; + @JsonProperty("gnocchi_resources_threshold_rule") + private CeilometerGnocchiResourcesThresholdRule gnocchiResourcesThresholdRule; - @JsonProperty("gnocchi_aggregation_by_metrics_threshold_rule") - private CeilometerGnocchiAggregationByMetricsThresholdRule gnocchiAggregationByMetricsThresholdRule; + @JsonProperty("gnocchi_aggregation_by_metrics_threshold_rule") + private CeilometerGnocchiAggregationByMetricsThresholdRule gnocchiAggregationByMetricsThresholdRule; - @JsonProperty("gnocchi_aggregation_by_resources_threshold_rule") - private CeilometerGnocchiAggregationByResourcesThresholdRule gnocchiAggregationByResourcesThresholdRule; + @JsonProperty("gnocchi_aggregation_by_resources_threshold_rule") + private CeilometerGnocchiAggregationByResourcesThresholdRule gnocchiAggregationByResourcesThresholdRule; - @JsonProperty("timestamp") - private String timestamp; + @JsonProperty("timestamp") + private String timestamp; - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } - /** - * {@inheritDoc} - */ - @Override - public String getProjectId() { - return projectId; - } + /** + * {@inheritDoc} + */ + @Override + public String getProjectId() { + return projectId; + } - /** - * {@inheritDoc} - */ - @Override - public Type getType() { - return type; - } + /** + * {@inheritDoc} + */ + @Override + public Type getType() { + return type; + } - /** - * {@inheritDoc} - */ - @Override - public String getUserId() { - return userId; - } + /** + * {@inheritDoc} + */ + @Override + public String getUserId() { + return userId; + } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", alarmId).add("name", name).add("enabled", isEnabled) - .add("project_id", projectId).add("type", type) - .add("user_id", userId) - .toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", alarmId).add("name", name).add("enabled", isEnabled) + .add("project_id", projectId).add("type", type) + .add("user_id", userId) + .toString(); + } - @Override - public List getAlarmActions() { - return alarmActions; + @Override + public List getAlarmActions() { + return alarmActions; - } + } - @Override - public String getAlarmId() { - return alarmId; - } + @Override + public String getAlarmId() { + return alarmId; + } - @Override - public String getDescription() { - return description; - } + @Override + public String getDescription() { + return description; + } - @Override - public boolean isEnabled() { - return isEnabled; - } + @Override + public boolean isEnabled() { + return isEnabled; + } - @Override - public void isEnabled(boolean newValue) { - isEnabled = newValue; - } + @Override + public void isEnabled(boolean newValue) { + isEnabled = newValue; + } - @Override - public List getInsufficientDataActions() { - return insufficientDataActions; - } + @Override + public List getInsufficientDataActions() { + return insufficientDataActions; + } - @Override - public List getOkActions() { - return okActions; - } + @Override + public List getOkActions() { + return okActions; + } - @Override - public boolean getRepeatActions() { - return repeatActions; - } + @Override + public boolean getRepeatActions() { + return repeatActions; + } - @Override - public String getState() { - return state; - } + @Override + public String getState() { + return state; + } - @Override - public String getStateTimestamp() { - return stateTimestamp; - } + @Override + public String getStateTimestamp() { + return stateTimestamp; + } - @Override - public ThresholdRule getThresholdRule() { - return thresholdRule; - } + @Override + public ThresholdRule getThresholdRule() { + return thresholdRule; + } + + @Override + public CombinationRule getCombinationRule() { + return combinationRule; + } - @Override - public CombinationRule getCombinationRule() { - return combinationRule; - } + @Override + public Map getCompositeRule() { + return compositeRule; + } - @Override - public Map getCompositeRule() { - return compositeRule; - } + @Override + public GnocchiResourcesThresholdRule getGnocchiResourcesThresholdRule() { + return gnocchiResourcesThresholdRule; + } - @Override - public GnocchiResourcesThresholdRule getGnocchiResourcesThresholdRule() { - return gnocchiResourcesThresholdRule; - } + @Override + public GnocchiAggregationByMetricsThresholdRule getGnocchiAggregationByMetricsThresholdRule() { + return gnocchiAggregationByMetricsThresholdRule; + } - @Override - public GnocchiAggregationByMetricsThresholdRule getGnocchiAggregationByMetricsThresholdRule() { - return gnocchiAggregationByMetricsThresholdRule; - } + @Override + public GnocchiAggregationByResourcesThresholdRule getGnocchiAggregationByResourcesThresholdRule() { + return gnocchiAggregationByResourcesThresholdRule; + } - @Override - public GnocchiAggregationByResourcesThresholdRule getGnocchiAggregationByResourcesThresholdRule() { - return gnocchiAggregationByResourcesThresholdRule; - } + @Override + public String getTimestamp() { + return timestamp; + } - @Override - public String getTimestamp() { - return timestamp; - } + public static class CeilometerCombinationRule implements CombinationRule { - public static class CeilometerCombinationRule implements CombinationRule { + @JsonProperty("alarm_ids") + List alarmIds; - @JsonProperty("alarm_ids") - List alarmIds; + @JsonProperty("operator") + Operator operator; - @JsonProperty("operator") - Operator operator; + @Override + public List getAlarmIds() { + return alarmIds; + } - @Override - public List getAlarmIds() { - return alarmIds; - } + @Override + public Operator getOperator() { + return operator; + } - @Override - public Operator getOperator() { - return operator; - } + @Override + public void setAlarmIds(List alarmIds) { + this.alarmIds = alarmIds; + } - @Override - public void setAlarmIds(List alarmIds) { - this.alarmIds = alarmIds; - } + @Override + public void setOperator(Operator operator) { + this.operator = operator; + } - @Override - public void setOperator(Operator operator) { - this.operator = operator; - } + } - } + public static class CeilometerThresholdRule implements ThresholdRule { + @JsonProperty("meter_name") + String meterName; - public static class CeilometerThresholdRule implements ThresholdRule { + @JsonProperty("evaluation_periods") + int evaluationPeriods; - @JsonProperty("meter_name") - String meterName; + @JsonProperty("statistic") + Statistic statistic; - @JsonProperty("evaluation_periods") - int evaluationPeriods; + @JsonProperty("period") + int period; - @JsonProperty("statistic") - Statistic statistic; + @JsonProperty("threshold") + float threshold; - @JsonProperty("period") - int period; + @JsonProperty("query") + List query; - @JsonProperty("threshold") - float threshold; + @JsonProperty("comparison_operator") + ComparisonOperator comparisonOperator; - @JsonProperty("query") - List query; + @JsonProperty("exclude_outliers") + boolean excludeOutliers; - @JsonProperty("comparison_operator") - ComparisonOperator comparisonOperator; + @Override + public String getMeterName() { + return meterName; + } - @JsonProperty("exclude_outliers") - boolean excludeOutliers; - - @Override - public String getMeterName() { - return meterName; - } - - @Override - public int getEvaluationPeriods() { - return evaluationPeriods; - } - - @Override - public Statistic getStatistic() { - return statistic; - } - - @Override - public int getPeriod() { - return period; - } - - @Override - public float getThreshold() { - return threshold; - } - - @Override - public List getQuery() { - return query; - } - - @Override - public ComparisonOperator getComparisonOperator() { - return comparisonOperator; - } - - @Override - public boolean getExcludeOutliers() { - return excludeOutliers; - } - - @Override - public void setMeterName(String meterName) { - this.meterName = meterName; - } - - @Override - public void setEvaluationPeriods(int evaluationPeriod) { - this.evaluationPeriods = evaluationPeriod; - } - - @Override - public void setStatistic(Statistic statistic) { - this.statistic = statistic; - } - - @Override - public void setPeriod(int period) { - this.period = period; - } - - @Override - public void setThreshold(float threshold) { - this.threshold = threshold; - } - - @Override - public void setQuery(List query) { - this.query = query; - } - - @Override - public void setComparisonOperator(ComparisonOperator comparisonOperator) { - this.comparisonOperator = comparisonOperator; - } - - @Override - public void setExcludeOutliers(boolean excludeOutliers) { - this.excludeOutliers = excludeOutliers; - } - } - - public static class CeilometerQuery implements Query { - public CeilometerQuery(){} - - @JsonProperty("field") - String field; - - @JsonProperty("value") - String value; - - @JsonProperty("op") - ComparisonOperator op; - - @Override - public String getField() { - return field; - } - - @Override - public String getValue() { - return value; - } - - @Override - public ComparisonOperator getOp() { - return op; - } - - @Override - public void setField(String field) { - this.field = field; - } - - @Override - public void setValue(String value) { - this.value = value; - } - - @Override - public void setOp(ComparisonOperator comparisonOperator) { - this.op = comparisonOperator; - } - } - - public static class CeilometerGnocchiResourcesThresholdRule implements GnocchiResourcesThresholdRule { - @JsonProperty("metric") - String metric; - @JsonProperty("comparison_operator") - ComparisonOperator comparisonOperator; - @JsonProperty("aggregation_method") - AggregationMethod aggregationMethod; - @JsonProperty("evaluation_periods") - int evaluationPeriods; - @JsonProperty("granularity") - long granularity; - @JsonProperty("resource_type") - String resourceType; - @JsonProperty("resource_id") - String resourceId; - @JsonProperty("threshold") - float threshold; - - @Override - public String getMetric() { - return metric; - } - - @Override - public String getResourceId() { - return resourceId; - } - - @Override - public String getResourceType() { - return resourceType; - } - - @Override - public ComparisonOperator getComparisonOperator() { - return comparisonOperator; - } - - @Override - public AggregationMethod getAggregationMethod() { - return aggregationMethod; - } - - @Override - public int getEvaluationPeriods() { - return evaluationPeriods; - } - - @Override - public float getThreshold() { - return threshold; - } - - @Override - public long getGranularity() { - return granularity; - } - - @Override - public void setMetric(String metric) { - this.metric=metric; - } - - @Override - public void setResourceId(String resourceId) { - this.resourceId=resourceId; - } - - @Override - public void setResourceType(String resourceType) { - this.resourceType=resourceType; - } - - @Override - public void setComparisonOperator(ComparisonOperator comparisonOperator) { - this.comparisonOperator=comparisonOperator; - } - - @Override - public void setAggregationMethod(AggregationMethod aggregationMethod) { - this.aggregationMethod=aggregationMethod; - } - - @Override - public void setEvaluationPeriods(int evaluationPeriod) { - this.evaluationPeriods=evaluationPeriod; - } - - @Override - public void setThreshold(float threshold) { - this.threshold=threshold; - } - - @Override - public void setGranularity(long granularity) { - this.granularity=granularity; - } - } - - public static class CeilometerGnocchiAggregationByMetricsThresholdRule implements GnocchiAggregationByMetricsThresholdRule { - @JsonProperty("metrics") - List metrics; - @JsonProperty("comparison_operator") - ComparisonOperator comparisonOperator; - @JsonProperty("aggregation_method") - AggregationMethod aggregationMethod; - @JsonProperty("threshold") - float threshold; - @JsonProperty("evaluation_periods") - int evaluationPeriods; - @JsonProperty("granularity") - long granularity; - - @Override - public List getMetrics() { - return metrics; - } - - @Override - public ComparisonOperator getComparisonOperator() { - return comparisonOperator; - } - - @Override - public AggregationMethod getAggregationMethod() { - return aggregationMethod; - } - - @Override - public float getThreshold() { - return threshold; - } - - @Override - public int getEvaluationPeriods() { - return evaluationPeriods; - } - - @Override - public long getGranularity() { - return granularity; - } - - @Override - public void setMetrics(List metrics) { - this.metrics=metrics; - } - - @Override - public void setComparisonOperator(ComparisonOperator comparisonOperator) { - this.comparisonOperator=comparisonOperator; - } - - @Override - public void setAggregationMethod(AggregationMethod aggregationMethod) { - this.aggregationMethod=aggregationMethod; - } - - @Override - public void setThreshold(float threshold) { - this.threshold=threshold; - } - - @Override - public void setEvaluationPeriods(int evaluationPeriod) { - this.evaluationPeriods=evaluationPeriod; - } - - @Override - public void setGranularity(long granularity) { - this.granularity=granularity; - } - } - - public static class CeilometerGnocchiAggregationByResourcesThresholdRule implements GnocchiAggregationByResourcesThresholdRule { - @JsonProperty("metric") - String metric; - @JsonProperty("resource_type") - String resourceType; - @JsonProperty("comparison_operator") - ComparisonOperator comparisonOperator; - @JsonProperty("aggregation_method") - AggregationMethod aggregationMethod; - @JsonProperty("evaluation_periods") - int evaluationPeriods; - @JsonProperty("threshold") - float threshold; - @JsonProperty("granularity") - long granularity; - @JsonProperty("query") - CeilometerQuery query; - - @Override - public String getMetric() { - return metric; - } - - @Override - public String getResourceType() { - return resourceType; - } - - @Override - public ComparisonOperator getComparisonOperator() { - return comparisonOperator; - } - - @Override - public AggregationMethod getAggregationMethod() { - return aggregationMethod; - } - - @Override - public int getEvaluationPeriods() { - return evaluationPeriods; - } - - @Override - public float getThreshold() { - return threshold; - } - - @Override - public long getGranularity() { - return granularity; - } - - @Override - public Query getQuery() { - return query; - } - - @Override - public void setMetric(String metric) { - this.metric=metric; - } - - @Override - public void setResourceType(String resourceType) { - this.resourceType=resourceType; - } - - @Override - public void setComparisonOperator(ComparisonOperator comparisonOperator) { - this.comparisonOperator=comparisonOperator; - } - - @Override - public void setAggregationMethod(AggregationMethod aggregationMethod) { - this.aggregationMethod=aggregationMethod; - } - - @Override - public void setEvaluationPeriods(int evaluationPeriod) { - this.evaluationPeriods=evaluationPeriod; - } - - @Override - public void setThreshold(float threshold) { - this.threshold=threshold; - } - - @Override - public void setGranularity(long granularity) { - this.granularity=granularity; - } - - @Override - public void setQuery(CeilometerQuery query) { - this.query=query; - } - } - - public static AlarmBuilder builder() { - return new AlarmConcreteBuilder(); - } - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) { - this.name = name; - } - - /** - * {@inheritDoc} - */ - @Override - public void setType(Type type) { - this.type = type; - } - - @Override - public void setUserId(String userId) { - this.userId = userId; - } - - @Override - public void setAlarmActions(List alarmActions) { - this.alarmActions = alarmActions; - - } - - @Override - public void setDescription(String description) { - this.description = description; - } - - @Override - public void setInsufficientDataActions(List insufficientDataActions) { - this.insufficientDataActions = insufficientDataActions; - } - - @Override - public void setOkActions(List okActions) { - this.okActions = okActions; - } - - @Override - public void setRepeateActions(Boolean repeatActions) { - this.repeatActions = repeatActions; - } - - @Override - public String getId() { - return this.alarmId; - } - - - @Override - public void setId(String id) { - this.alarmId = id; - } - - @Override - public void setThresholdRule(CeilometerThresholdRule tr) { - this.thresholdRule = (CeilometerThresholdRule) tr; - } - - @Override - public void setGnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThresholdRule) { - this.gnocchiAggregationByResourcesThresholdRule=ceilometerGnocchiAggregationByResourcesThresholdRule; - } - - @Override - public void setGnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThresholdRule) { - this.gnocchiAggregationByMetricsThresholdRule=ceilometerGnocchiAggregationByMetricsThresholdRule; - } - - @Override - public void setGnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThresholdRule) { - this.gnocchiResourcesThresholdRule=ceilometerGnocchiResourcesThresholdRule; - } - - @Override - public AlarmBuilder toBuilder() { - return new AlarmConcreteBuilder(this); - } - - public static class AlarmConcreteBuilder extends BasicResourceBuilder implements AlarmBuilder { - - private CeilometerAlarm m; - - AlarmConcreteBuilder() { - this(new CeilometerAlarm()); - } - - AlarmConcreteBuilder(CeilometerAlarm m) { - this.m = m; - } - - @Override - public Alarm build() { - return m; - } - - @Override - public AlarmBuilder from(Alarm in) { - this.m = (CeilometerAlarm) in; - return this; - } - - @Override - public AlarmBuilder okActions(List okActions) { - this.m.okActions = okActions; - return this; - } - - @Override - public AlarmBuilder insufficientDataActions(List insufficientDataActions) { - this.m.insufficientDataActions = insufficientDataActions; - return this; - } - - @Override - protected Alarm reference() { - return m; - } - - @Override - public AlarmBuilder type(Type type) { - this.m.type = type; - return this; - } - - @Override - public AlarmBuilder thresholeRule(CeilometerThresholdRule tr) { - this.m.thresholdRule = tr; - return this; - } - - @Override - public AlarmBuilder repeatActions(boolean repeatActions) { - m.repeatActions = repeatActions; - return this; - } - - @Override - public AlarmBuilder description(String description) { - m.description = description; - return this; - } - - @Override - public AlarmBuilder alarmActions(List alarmActions) { - this.m.alarmActions = alarmActions; - return this; - } - - @Override - public AlarmBuilder isEnabled(boolean isEnabled) { - this.m.isEnabled = isEnabled; - return this; - } - - @Override - public AlarmBuilder combinationRule(CeilometerCombinationRule ce) { - this.m.combinationRule = ce; - return this; - } - - @Override - public AlarmBuilder compositeRule(Map cr) { - this.m.compositeRule=cr; - return this; - } - - @Override - public AlarmBuilder gnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThresholdRule) { - this.m.gnocchiResourcesThresholdRule=ceilometerGnocchiResourcesThresholdRule; - return this; - } - - @Override - public AlarmBuilder gnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThresholdRule) { - this.m.gnocchiAggregationByMetricsThresholdRule=ceilometerGnocchiAggregationByMetricsThresholdRule; - return this; - } - - @Override - public AlarmBuilder gnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThresholdRule) { - this.m.gnocchiAggregationByResourcesThresholdRule=ceilometerGnocchiAggregationByResourcesThresholdRule; - return this; - } - - } + @Override + public int getEvaluationPeriods() { + return evaluationPeriods; + } + + @Override + public Statistic getStatistic() { + return statistic; + } + + @Override + public int getPeriod() { + return period; + } + + @Override + public float getThreshold() { + return threshold; + } + + @Override + public List getQuery() { + return query; + } + + @Override + public ComparisonOperator getComparisonOperator() { + return comparisonOperator; + } + + @Override + public boolean getExcludeOutliers() { + return excludeOutliers; + } + + @Override + public void setMeterName(String meterName) { + this.meterName = meterName; + } + + @Override + public void setEvaluationPeriods(int evaluationPeriod) { + this.evaluationPeriods = evaluationPeriod; + } + + @Override + public void setStatistic(Statistic statistic) { + this.statistic = statistic; + } + + @Override + public void setPeriod(int period) { + this.period = period; + } + + @Override + public void setThreshold(float threshold) { + this.threshold = threshold; + } + + @Override + public void setQuery(List query) { + this.query = query; + } + + @Override + public void setComparisonOperator(ComparisonOperator comparisonOperator) { + this.comparisonOperator = comparisonOperator; + } + + @Override + public void setExcludeOutliers(boolean excludeOutliers) { + this.excludeOutliers = excludeOutliers; + } + } + + public static class CeilometerQuery implements Query { + public CeilometerQuery() { + } + + @JsonProperty("field") + String field; + + @JsonProperty("value") + String value; + + @JsonProperty("op") + ComparisonOperator op; + + @Override + public String getField() { + return field; + } + + @Override + public String getValue() { + return value; + } + + @Override + public ComparisonOperator getOp() { + return op; + } + + @Override + public void setField(String field) { + this.field = field; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public void setOp(ComparisonOperator comparisonOperator) { + this.op = comparisonOperator; + } + } + + public static class CeilometerGnocchiResourcesThresholdRule implements GnocchiResourcesThresholdRule { + @JsonProperty("metric") + String metric; + @JsonProperty("comparison_operator") + ComparisonOperator comparisonOperator; + @JsonProperty("aggregation_method") + AggregationMethod aggregationMethod; + @JsonProperty("evaluation_periods") + int evaluationPeriods; + @JsonProperty("granularity") + long granularity; + @JsonProperty("resource_type") + String resourceType; + @JsonProperty("resource_id") + String resourceId; + @JsonProperty("threshold") + float threshold; + + @Override + public String getMetric() { + return metric; + } + + @Override + public String getResourceId() { + return resourceId; + } + + @Override + public String getResourceType() { + return resourceType; + } + + @Override + public ComparisonOperator getComparisonOperator() { + return comparisonOperator; + } + + @Override + public AggregationMethod getAggregationMethod() { + return aggregationMethod; + } + + @Override + public int getEvaluationPeriods() { + return evaluationPeriods; + } + + @Override + public float getThreshold() { + return threshold; + } + + @Override + public long getGranularity() { + return granularity; + } + + @Override + public void setMetric(String metric) { + this.metric = metric; + } + + @Override + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + @Override + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + @Override + public void setComparisonOperator(ComparisonOperator comparisonOperator) { + this.comparisonOperator = comparisonOperator; + } + + @Override + public void setAggregationMethod(AggregationMethod aggregationMethod) { + this.aggregationMethod = aggregationMethod; + } + + @Override + public void setEvaluationPeriods(int evaluationPeriod) { + this.evaluationPeriods = evaluationPeriod; + } + + @Override + public void setThreshold(float threshold) { + this.threshold = threshold; + } + + @Override + public void setGranularity(long granularity) { + this.granularity = granularity; + } + } + + public static class CeilometerGnocchiAggregationByMetricsThresholdRule implements GnocchiAggregationByMetricsThresholdRule { + @JsonProperty("metrics") + List metrics; + @JsonProperty("comparison_operator") + ComparisonOperator comparisonOperator; + @JsonProperty("aggregation_method") + AggregationMethod aggregationMethod; + @JsonProperty("threshold") + float threshold; + @JsonProperty("evaluation_periods") + int evaluationPeriods; + @JsonProperty("granularity") + long granularity; + + @Override + public List getMetrics() { + return metrics; + } + + @Override + public ComparisonOperator getComparisonOperator() { + return comparisonOperator; + } + + @Override + public AggregationMethod getAggregationMethod() { + return aggregationMethod; + } + + @Override + public float getThreshold() { + return threshold; + } + + @Override + public int getEvaluationPeriods() { + return evaluationPeriods; + } + + @Override + public long getGranularity() { + return granularity; + } + + @Override + public void setMetrics(List metrics) { + this.metrics = metrics; + } + + @Override + public void setComparisonOperator(ComparisonOperator comparisonOperator) { + this.comparisonOperator = comparisonOperator; + } + + @Override + public void setAggregationMethod(AggregationMethod aggregationMethod) { + this.aggregationMethod = aggregationMethod; + } + + @Override + public void setThreshold(float threshold) { + this.threshold = threshold; + } + + @Override + public void setEvaluationPeriods(int evaluationPeriod) { + this.evaluationPeriods = evaluationPeriod; + } + + @Override + public void setGranularity(long granularity) { + this.granularity = granularity; + } + } + + public static class CeilometerGnocchiAggregationByResourcesThresholdRule implements GnocchiAggregationByResourcesThresholdRule { + @JsonProperty("metric") + String metric; + @JsonProperty("resource_type") + String resourceType; + @JsonProperty("comparison_operator") + ComparisonOperator comparisonOperator; + @JsonProperty("aggregation_method") + AggregationMethod aggregationMethod; + @JsonProperty("evaluation_periods") + int evaluationPeriods; + @JsonProperty("threshold") + float threshold; + @JsonProperty("granularity") + long granularity; + @JsonProperty("query") + CeilometerQuery query; + + @Override + public String getMetric() { + return metric; + } + + @Override + public String getResourceType() { + return resourceType; + } + + @Override + public ComparisonOperator getComparisonOperator() { + return comparisonOperator; + } + + @Override + public AggregationMethod getAggregationMethod() { + return aggregationMethod; + } + + @Override + public int getEvaluationPeriods() { + return evaluationPeriods; + } + + @Override + public float getThreshold() { + return threshold; + } + + @Override + public long getGranularity() { + return granularity; + } + + @Override + public Query getQuery() { + return query; + } + + @Override + public void setMetric(String metric) { + this.metric = metric; + } + + @Override + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + @Override + public void setComparisonOperator(ComparisonOperator comparisonOperator) { + this.comparisonOperator = comparisonOperator; + } + + @Override + public void setAggregationMethod(AggregationMethod aggregationMethod) { + this.aggregationMethod = aggregationMethod; + } + + @Override + public void setEvaluationPeriods(int evaluationPeriod) { + this.evaluationPeriods = evaluationPeriod; + } + + @Override + public void setThreshold(float threshold) { + this.threshold = threshold; + } + + @Override + public void setGranularity(long granularity) { + this.granularity = granularity; + } + + @Override + public void setQuery(CeilometerQuery query) { + this.query = query; + } + } + + public static AlarmBuilder builder() { + return new AlarmConcreteBuilder(); + } + + /** + * {@inheritDoc} + */ + @Override + public void setName(String name) { + this.name = name; + } + + /** + * {@inheritDoc} + */ + @Override + public void setType(Type type) { + this.type = type; + } + + @Override + public void setUserId(String userId) { + this.userId = userId; + } + + @Override + public void setAlarmActions(List alarmActions) { + this.alarmActions = alarmActions; + + } + + @Override + public void setDescription(String description) { + this.description = description; + } + + @Override + public void setInsufficientDataActions(List insufficientDataActions) { + this.insufficientDataActions = insufficientDataActions; + } + + @Override + public void setOkActions(List okActions) { + this.okActions = okActions; + } + + @Override + public void setRepeateActions(Boolean repeatActions) { + this.repeatActions = repeatActions; + } + + @Override + public String getId() { + return this.alarmId; + } + + + @Override + public void setId(String id) { + this.alarmId = id; + } + + @Override + public void setThresholdRule(CeilometerThresholdRule tr) { + this.thresholdRule = (CeilometerThresholdRule) tr; + } + + @Override + public void setGnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThresholdRule) { + this.gnocchiAggregationByResourcesThresholdRule = ceilometerGnocchiAggregationByResourcesThresholdRule; + } + + @Override + public void setGnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThresholdRule) { + this.gnocchiAggregationByMetricsThresholdRule = ceilometerGnocchiAggregationByMetricsThresholdRule; + } + + @Override + public void setGnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThresholdRule) { + this.gnocchiResourcesThresholdRule = ceilometerGnocchiResourcesThresholdRule; + } + + @Override + public AlarmBuilder toBuilder() { + return new AlarmConcreteBuilder(this); + } + + public static class AlarmConcreteBuilder extends BasicResourceBuilder implements AlarmBuilder { + + private CeilometerAlarm m; + + AlarmConcreteBuilder() { + this(new CeilometerAlarm()); + } + + AlarmConcreteBuilder(CeilometerAlarm m) { + this.m = m; + } + + @Override + public Alarm build() { + return m; + } + + @Override + public AlarmBuilder from(Alarm in) { + this.m = (CeilometerAlarm) in; + return this; + } + + @Override + public AlarmBuilder okActions(List okActions) { + this.m.okActions = okActions; + return this; + } + + @Override + public AlarmBuilder insufficientDataActions(List insufficientDataActions) { + this.m.insufficientDataActions = insufficientDataActions; + return this; + } + + @Override + protected Alarm reference() { + return m; + } + + @Override + public AlarmBuilder type(Type type) { + this.m.type = type; + return this; + } + + @Override + public AlarmBuilder thresholeRule(CeilometerThresholdRule tr) { + this.m.thresholdRule = tr; + return this; + } + + @Override + public AlarmBuilder repeatActions(boolean repeatActions) { + m.repeatActions = repeatActions; + return this; + } + + @Override + public AlarmBuilder description(String description) { + m.description = description; + return this; + } + + @Override + public AlarmBuilder alarmActions(List alarmActions) { + this.m.alarmActions = alarmActions; + return this; + } + + @Override + public AlarmBuilder isEnabled(boolean isEnabled) { + this.m.isEnabled = isEnabled; + return this; + } + + @Override + public AlarmBuilder combinationRule(CeilometerCombinationRule ce) { + this.m.combinationRule = ce; + return this; + } + + @Override + public AlarmBuilder compositeRule(Map cr) { + this.m.compositeRule = cr; + return this; + } + + @Override + public AlarmBuilder gnocchiResourcesThresholdRule(CeilometerGnocchiResourcesThresholdRule ceilometerGnocchiResourcesThresholdRule) { + this.m.gnocchiResourcesThresholdRule = ceilometerGnocchiResourcesThresholdRule; + return this; + } + + @Override + public AlarmBuilder gnocchiAggregationByMetricsThresholdRule(CeilometerGnocchiAggregationByMetricsThresholdRule ceilometerGnocchiAggregationByMetricsThresholdRule) { + this.m.gnocchiAggregationByMetricsThresholdRule = ceilometerGnocchiAggregationByMetricsThresholdRule; + return this; + } + + @Override + public AlarmBuilder gnocchiAggregationByResourcesThresholdRule(CeilometerGnocchiAggregationByResourcesThresholdRule ceilometerGnocchiAggregationByResourcesThresholdRule) { + this.m.gnocchiAggregationByResourcesThresholdRule = ceilometerGnocchiAggregationByResourcesThresholdRule; + return this; + } + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerCapabilities.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerCapabilities.java index fbec1a5bc..324a7e787 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerCapabilities.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerCapabilities.java @@ -1,12 +1,12 @@ package org.openstack4j.openstack.telemetry.domain; -import java.util.Map; - import org.openstack4j.model.telemetry.Capabilities; +import java.util.Map; + /** * A single Representation for capabilities. - * + * * @author Shital Patil */ diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerEvent.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerEvent.java index 87d8b9514..de1184e3a 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerEvent.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerEvent.java @@ -13,13 +13,13 @@ * * @author Miroslav Lacina */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class CeilometerEvent implements Event { private static final long serialVersionUID = 1L; - @JsonProperty("event_type") - private String eventType; + @JsonProperty("event_type") + private String eventType; @JsonProperty("generated") private String generated; @JsonProperty("message_id") diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeter.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeter.java index 0016da325..b9d02c6bb 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeter.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeter.java @@ -1,9 +1,8 @@ package org.openstack4j.openstack.telemetry.domain; -import org.openstack4j.model.telemetry.Meter; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.telemetry.Meter; /** * A Meter is a category of Measurement @@ -12,89 +11,89 @@ */ public class CeilometerMeter implements Meter { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @JsonProperty("meter_id") - private String id; - private String name; - @JsonProperty("resource_id") - private String resourceId; - @JsonProperty("project_id") - private String projectId; - private Type type; - private String unit; + @JsonProperty("meter_id") + private String id; + private String name; + @JsonProperty("resource_id") + private String resourceId; + @JsonProperty("project_id") + private String projectId; + private Type type; + private String unit; - private String source; + private String source; - @JsonProperty("user_id") - private String userId; + @JsonProperty("user_id") + private String userId; - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id; - } + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return id; + } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return name; - } + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return name; + } - /** - * {@inheritDoc} - */ - @Override - public String getResourceId() { - return resourceId; - } + /** + * {@inheritDoc} + */ + @Override + public String getResourceId() { + return resourceId; + } - /** - * {@inheritDoc} - */ - @Override - public String getProjectId() { - return projectId; - } + /** + * {@inheritDoc} + */ + @Override + public String getProjectId() { + return projectId; + } - /** - * {@inheritDoc} - */ - @Override - public Type getType() { - return type; - } + /** + * {@inheritDoc} + */ + @Override + public Type getType() { + return type; + } - /** - * {@inheritDoc} - */ - @Override - public String getUnit() { - return unit; - } + /** + * {@inheritDoc} + */ + @Override + public String getUnit() { + return unit; + } - /** - * {@inheritDoc} - */ - @Override - public String getUserId() { - return userId; - } + /** + * {@inheritDoc} + */ + @Override + public String getUserId() { + return userId; + } - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("id", id).add("name", name).add("resource_id", resourceId) - .add("project_id", projectId).add("type", type).add("unit", unit) - .add("user_id", userId) - .add("source", source) - .toString(); - } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("id", id).add("name", name).add("resource_id", resourceId) + .add("project_id", projectId).add("type", type).add("unit", unit) + .add("user_id", userId) + .add("source", source) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeterSample.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeterSample.java index 26e11b6d9..8cf03c99b 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeterSample.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerMeterSample.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.telemetry.domain; -import java.util.Map; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; import org.openstack4j.model.telemetry.Meter.Type; import org.openstack4j.model.telemetry.MeterSample; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; +import java.util.Map; /** * A single measurement for a given meter and resource. @@ -15,212 +14,212 @@ */ public class CeilometerMeterSample implements MeterSample { - private static final long serialVersionUID = 1L; - - @JsonProperty("counter_name") - private String counterName; - - @JsonProperty("counter_type") - private Type counterType; - - @JsonProperty("counter_unit") - private String counterUnit; - - @JsonProperty("counter_volume") - private Float counterVolume; - - private String source; - - @JsonProperty("project_id") - private String projectId; - - @JsonProperty("user_id") - private String userId; - - @JsonProperty("resource_id") - private String resourceId; - - private String timestamp; - - @JsonProperty("message_id") - private String messageId; - - @JsonProperty("resource_metadata") - private Map metadata; - - @JsonProperty("recorded_at") - private String recordedAt; - - - /** - * {@inheritDoc} - */ - @Override - public String getCounterName() { - return counterName; - } - - /** - * {@inheritDoc} - */ - @Override - public Type getCounterType() { - return counterType; - } - - /** - * {@inheritDoc} - */ - @Override - public String getCounterUnit() { - return counterUnit; - } - - /** - * {@inheritDoc} - */ - @Override - public Float getCounterVolume() { - return counterVolume; - } - - /** - * {@inheritDoc} - */ - @Override - public String getSource() { - return source; - } - - /** - * {@inheritDoc} - */ - @Override - public String getProjectId() { - return projectId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUserId() { - return userId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getRecordedAt() { - return recordedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public String getResourceId() { - return resourceId; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTimestamp() { - return timestamp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getMessageId() { - return messageId; - } - - /** - * {@inheritDoc} - */ - @Override - public Map getMetadata() { - return metadata; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("name", counterName).add("type", counterType).add("unit", counterUnit) - .add("volume", counterVolume).add("timestamp", timestamp).add("source", source) - .add("project", projectId).add("user", userId).add("resource", resourceId) - .add("message", messageId).addValue("\n").add("metadata", metadata) - .add("recorded_at", recordedAt) - .toString(); - } - - @Override - public void setCounterName(String counterName) { - this.counterName = counterName; - - } - - @Override - public void setCounterType(Type meterType) { - this.counterType = meterType; - } - - @Override - public void setCounterUnit(String counterUnit) { - this.counterUnit = counterUnit; - } - - @Override - public void setCounterVolume(Float counterVolume) { - this.counterVolume = counterVolume; - } - - @Override - public void setSource(String source) { - this.source = source; - } - - @Override - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - @Override - public void setUserId(String userId) { - this.userId = userId; - } - - @Override - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - @Override - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; - } - - @Override - public void setRecordedAt(String recordedAt) { - this.recordedAt = recordedAt; - } - - @Override - public void setMessageId(String messageId) { - this.messageId = messageId; - - } - - @Override - public void setMetadata(Map metadata) { - this.metadata = metadata; - } + private static final long serialVersionUID = 1L; + + @JsonProperty("counter_name") + private String counterName; + + @JsonProperty("counter_type") + private Type counterType; + + @JsonProperty("counter_unit") + private String counterUnit; + + @JsonProperty("counter_volume") + private Float counterVolume; + + private String source; + + @JsonProperty("project_id") + private String projectId; + + @JsonProperty("user_id") + private String userId; + + @JsonProperty("resource_id") + private String resourceId; + + private String timestamp; + + @JsonProperty("message_id") + private String messageId; + + @JsonProperty("resource_metadata") + private Map metadata; + + @JsonProperty("recorded_at") + private String recordedAt; + + + /** + * {@inheritDoc} + */ + @Override + public String getCounterName() { + return counterName; + } + + /** + * {@inheritDoc} + */ + @Override + public Type getCounterType() { + return counterType; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCounterUnit() { + return counterUnit; + } + + /** + * {@inheritDoc} + */ + @Override + public Float getCounterVolume() { + return counterVolume; + } + + /** + * {@inheritDoc} + */ + @Override + public String getSource() { + return source; + } + + /** + * {@inheritDoc} + */ + @Override + public String getProjectId() { + return projectId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUserId() { + return userId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getRecordedAt() { + return recordedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public String getResourceId() { + return resourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public String getTimestamp() { + return timestamp; + } + + /** + * {@inheritDoc} + */ + @Override + public String getMessageId() { + return messageId; + } + + /** + * {@inheritDoc} + */ + @Override + public Map getMetadata() { + return metadata; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("name", counterName).add("type", counterType).add("unit", counterUnit) + .add("volume", counterVolume).add("timestamp", timestamp).add("source", source) + .add("project", projectId).add("user", userId).add("resource", resourceId) + .add("message", messageId).addValue("\n").add("metadata", metadata) + .add("recorded_at", recordedAt) + .toString(); + } + + @Override + public void setCounterName(String counterName) { + this.counterName = counterName; + + } + + @Override + public void setCounterType(Type meterType) { + this.counterType = meterType; + } + + @Override + public void setCounterUnit(String counterUnit) { + this.counterUnit = counterUnit; + } + + @Override + public void setCounterVolume(Float counterVolume) { + this.counterVolume = counterVolume; + } + + @Override + public void setSource(String source) { + this.source = source; + } + + @Override + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + @Override + public void setUserId(String userId) { + this.userId = userId; + } + + @Override + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + @Override + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + @Override + public void setRecordedAt(String recordedAt) { + this.recordedAt = recordedAt; + } + + @Override + public void setMessageId(String messageId) { + this.messageId = messageId; + + } + + @Override + public void setMetadata(Map metadata) { + this.metadata = metadata; + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerResource.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerResource.java index 346698bb1..adcb7d5c2 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerResource.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerResource.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.telemetry.domain; -import java.util.Date; -import java.util.Map; - -import org.openstack4j.model.telemetry.Resource; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; +import org.openstack4j.model.telemetry.Resource; + +import java.util.Date; +import java.util.Map; /** * A single measurement for resource. diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerStatistics.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerStatistics.java index 235a6e267..84a11aae9 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerStatistics.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerStatistics.java @@ -1,13 +1,12 @@ package org.openstack4j.openstack.telemetry.domain; -import java.util.Date; - -import org.openstack4j.model.telemetry.Statistics; -import org.openstack4j.openstack.common.TelemetryDateDeserializer; - import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.common.base.MoreObjects; +import org.openstack4j.model.telemetry.Statistics; +import org.openstack4j.openstack.common.TelemetryDateDeserializer; + +import java.util.Date; /** * Computed Statistics for a Query against a Meter @@ -16,158 +15,158 @@ */ public class CeilometerStatistics implements Statistics { - private static final long serialVersionUID = 1L; - - private Double avg; - - private Integer count; - - private Double duration; - - @JsonDeserialize(using = TelemetryDateDeserializer.class) - @JsonProperty("duration_start") - private Date durationStart; - - @JsonDeserialize(using = TelemetryDateDeserializer.class) - @JsonProperty("duration_end") - private Date durationEnd; - - private Double max; - - private Double min; - - private Integer period; - - @JsonDeserialize(using = TelemetryDateDeserializer.class) - @JsonProperty("period_start") - private Date periodStart; - - @JsonDeserialize(using = TelemetryDateDeserializer.class) - @JsonProperty("period_end") - private Date periodEnd; - - private Double sum; - - private String unit; - - private String groupby; - - /** - * {@inheritDoc} - */ - @Override - public Double getAvg() { - return avg; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getCount() { - return count; - } - - /** - * {@inheritDoc} - */ - @Override - public Double getDuration() { - return duration; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getDurationStart() { - return durationStart; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getDurationEnd() { - return durationEnd; - } - - /** - * {@inheritDoc} - */ - @Override - public Double getMax() { - return max; - } - - /** - * {@inheritDoc} - */ - @Override - public Double getMin() { - return min; - } - - /** - * {@inheritDoc} - */ - @Override - public Double getSum() { - return sum; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer getPeriod() { - return period; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getPeriodStart() { - return periodStart; - } - - /** - * {@inheritDoc} - */ - @Override - public Date getPeriodEnd() { - return periodEnd; - } - - /** - * {@inheritDoc} - */ - @Override - public String getUnit() { - return unit; - } - - /** - * {@inheritDoc} - */ - @Override - public String getGroupBy() { - return groupby; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return MoreObjects.toStringHelper(this).omitNullValues() - .add("avg", avg).add("count", count).add("duration", duration) - .add("durationStart", durationStart).add("durationEnd", durationEnd) - .add("min", min).add("max", max).add("sum", sum).add("period", period) - .add("periodStart", periodStart).add("periodEnd", periodEnd).add("unit", unit) - .add("groupby", groupby) - .toString(); - } + private static final long serialVersionUID = 1L; + + private Double avg; + + private Integer count; + + private Double duration; + + @JsonDeserialize(using = TelemetryDateDeserializer.class) + @JsonProperty("duration_start") + private Date durationStart; + + @JsonDeserialize(using = TelemetryDateDeserializer.class) + @JsonProperty("duration_end") + private Date durationEnd; + + private Double max; + + private Double min; + + private Integer period; + + @JsonDeserialize(using = TelemetryDateDeserializer.class) + @JsonProperty("period_start") + private Date periodStart; + + @JsonDeserialize(using = TelemetryDateDeserializer.class) + @JsonProperty("period_end") + private Date periodEnd; + + private Double sum; + + private String unit; + + private String groupby; + + /** + * {@inheritDoc} + */ + @Override + public Double getAvg() { + return avg; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getCount() { + return count; + } + + /** + * {@inheritDoc} + */ + @Override + public Double getDuration() { + return duration; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getDurationStart() { + return durationStart; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getDurationEnd() { + return durationEnd; + } + + /** + * {@inheritDoc} + */ + @Override + public Double getMax() { + return max; + } + + /** + * {@inheritDoc} + */ + @Override + public Double getMin() { + return min; + } + + /** + * {@inheritDoc} + */ + @Override + public Double getSum() { + return sum; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer getPeriod() { + return period; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getPeriodStart() { + return periodStart; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getPeriodEnd() { + return periodEnd; + } + + /** + * {@inheritDoc} + */ + @Override + public String getUnit() { + return unit; + } + + /** + * {@inheritDoc} + */ + @Override + public String getGroupBy() { + return groupby; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("avg", avg).add("count", count).add("duration", duration) + .add("durationStart", durationStart).add("durationEnd", durationEnd) + .add("min", min).add("max", max).add("sum", sum).add("period", period) + .add("periodStart", periodStart).add("periodEnd", periodEnd).add("unit", unit) + .add("groupby", groupby) + .toString(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmAodhServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmAodhServiceImpl.java index 726b43cb5..6d85834f9 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmAodhServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmAodhServiceImpl.java @@ -11,52 +11,52 @@ public class AlarmAodhServiceImpl extends BaseTelemetryAodhServices implements AlarmAodhService { - - /** - * {@inheritDoc} - */ - @Override - public List list() { - CeilometerAlarm[] alarms = get(CeilometerAlarm[].class, uri("/alarms")).execute(); - return wrapList(alarms); - } - - /** - * {@inheritDoc} - */ - @Override - public Alarm getById(String alarmId){ - checkNotNull(alarmId); + + /** + * {@inheritDoc} + */ + @Override + public List list() { + CeilometerAlarm[] alarms = get(CeilometerAlarm[].class, uri("/alarms")).execute(); + return wrapList(alarms); + } + + /** + * {@inheritDoc} + */ + @Override + public Alarm getById(String alarmId) { + checkNotNull(alarmId); return get(CeilometerAlarm.class, uri("/alarms/%s", alarmId)).execute(); - - } - - /** - * {@inheritDoc} - */ - @Override - public void update(String alarmId, Alarm alarm){ - checkNotNull(alarmId); - checkNotNull(alarm); - - put(CeilometerAlarm.class, uri("/alarms/%s", alarmId)).entity(alarm).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Alarm create(Alarm alarm) { - checkNotNull(alarm); - return post(CeilometerAlarm.class, uri("/alarms")).entity((alarm)).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String alarmId) { - checkNotNull(alarmId); - return deleteWithResponse(uri("/alarms/%s", alarmId)).execute(); - } + + } + + /** + * {@inheritDoc} + */ + @Override + public void update(String alarmId, Alarm alarm) { + checkNotNull(alarmId); + checkNotNull(alarm); + + put(CeilometerAlarm.class, uri("/alarms/%s", alarmId)).entity(alarm).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Alarm create(Alarm alarm) { + checkNotNull(alarm); + return post(CeilometerAlarm.class, uri("/alarms")).entity((alarm)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String alarmId) { + checkNotNull(alarmId); + return deleteWithResponse(uri("/alarms/%s", alarmId)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmServiceImpl.java index ba1378019..b459e4e77 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/AlarmServiceImpl.java @@ -1,66 +1,66 @@ package org.openstack4j.openstack.telemetry.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.telemetry.AlarmService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.telemetry.Alarm; import org.openstack4j.openstack.telemetry.domain.CeilometerAlarm; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Provides Measurements against Meters within an OpenStack deployment - * + * * @author Massimiliano Romano */ public class AlarmServiceImpl extends BaseTelemetryServices implements AlarmService { - - /** - * {@inheritDoc} - */ - @Override - public List list() { - CeilometerAlarm[] alarms = get(CeilometerAlarm[].class, uri("/alarms")).execute(); - return wrapList(alarms); - } - /** - * {@inheritDoc} - */ - @Override - public Alarm getById(String alarmId){ - checkNotNull(alarmId); + /** + * {@inheritDoc} + */ + @Override + public List list() { + CeilometerAlarm[] alarms = get(CeilometerAlarm[].class, uri("/alarms")).execute(); + return wrapList(alarms); + } + + /** + * {@inheritDoc} + */ + @Override + public Alarm getById(String alarmId) { + checkNotNull(alarmId); return get(CeilometerAlarm.class, uri("/alarms/%s", alarmId)).execute(); - - } - - /** - * {@inheritDoc} - */ - @Override - public void update(String alarmId, Alarm alarm){ - checkNotNull(alarmId); - checkNotNull(alarm); - - put(CeilometerAlarm.class, uri("/alarms/%s", alarmId)).entity(alarm).execute(); - } - - /** - * {@inheritDoc} - */ - @Override - public Alarm create(Alarm alarm) { - checkNotNull(alarm); - return post(CeilometerAlarm.class, uri("/alarms")).entity((alarm)).execute(); - } - /** - * {@inheritDoc} - */ - @Override - public ActionResponse delete(String alarmId) { - checkNotNull(alarmId); - return deleteWithResponse(uri("/alarms/%s", alarmId)).execute(); - } + } + + /** + * {@inheritDoc} + */ + @Override + public void update(String alarmId, Alarm alarm) { + checkNotNull(alarmId); + checkNotNull(alarm); + + put(CeilometerAlarm.class, uri("/alarms/%s", alarmId)).entity(alarm).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public Alarm create(Alarm alarm) { + checkNotNull(alarm); + return post(CeilometerAlarm.class, uri("/alarms")).entity((alarm)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String alarmId) { + checkNotNull(alarmId); + return deleteWithResponse(uri("/alarms/%s", alarmId)).execute(); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryAodhServices.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryAodhServices.java index a9417e766..09b33b8d9 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryAodhServices.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryAodhServices.java @@ -1,6 +1,5 @@ package org.openstack4j.openstack.telemetry.internal; -import com.google.common.base.Function; import com.google.common.collect.Lists; import org.openstack4j.api.types.ServiceType; import org.openstack4j.openstack.common.functions.EnforceVersionToURL; @@ -11,14 +10,14 @@ public class BaseTelemetryAodhServices extends BaseOpenStackService { - protected BaseTelemetryAodhServices() { - super(ServiceType.TELEMETRY_AODH, EnforceVersionToURL.instance("/v2")); - } - - protected List wrapList(T[] type) { - if (type != null) - return Lists.newArrayList(type); - return Collections.emptyList(); - - } + protected BaseTelemetryAodhServices() { + super(ServiceType.TELEMETRY_AODH, EnforceVersionToURL.instance("/v2")); + } + + protected List wrapList(T[] type) { + if (type != null) + return Lists.newArrayList(type); + return Collections.emptyList(); + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryServices.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryServices.java index 699614824..438408d79 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryServices.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/BaseTelemetryServices.java @@ -1,44 +1,43 @@ package org.openstack4j.openstack.telemetry.internal; -import java.util.Collections; -import java.util.List; - +import com.google.common.base.Function; +import com.google.common.collect.Lists; import org.openstack4j.api.types.ServiceType; import org.openstack4j.openstack.internal.BaseOpenStackService; -import com.google.common.base.Function; -import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.List; /** * Base class for Telemetry services - * + * * @author Jeremy Unruh */ public class BaseTelemetryServices extends BaseOpenStackService { - protected BaseTelemetryServices() { - super(ServiceType.TELEMETRY, EndpointFunction.instance); - } - - /** - * Sometimes the endpoint does not contain the API version which is required. This insures that - */ - private static class EndpointFunction implements Function { - - static final EndpointFunction instance = new EndpointFunction(); - - @Override - public String apply(String input) { - if (input == null || input.contains("/v")) - return input; - return input.concat(input.endsWith("/") ? "v2" : "/v2"); - } - } - - protected List wrapList(T[] type) { - if (type != null) - return Lists.newArrayList(type); - return Collections.emptyList(); - - } + protected BaseTelemetryServices() { + super(ServiceType.TELEMETRY, EndpointFunction.instance); + } + + /** + * Sometimes the endpoint does not contain the API version which is required. This insures that + */ + private static class EndpointFunction implements Function { + + static final EndpointFunction instance = new EndpointFunction(); + + @Override + public String apply(String input) { + if (input == null || input.contains("/v")) + return input; + return input.concat(input.endsWith("/") ? "v2" : "/v2"); + } + } + + protected List wrapList(T[] type) { + if (type != null) + return Lists.newArrayList(type); + return Collections.emptyList(); + + } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/CapabilitiesServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/CapabilitiesServiceImpl.java index f963a24f0..252c23b57 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/CapabilitiesServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/CapabilitiesServiceImpl.java @@ -6,7 +6,7 @@ /** * Provides Measurements for Telemetry capabilities within an OpenStack deployment - * + * * @author Shital Patil */ public class CapabilitiesServiceImpl extends BaseTelemetryServices implements CapabilitiesService { diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/MeterServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/MeterServiceImpl.java index a6d45fc01..c17e56411 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/MeterServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/MeterServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.telemetry.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.telemetry.MeterService; import org.openstack4j.model.telemetry.Meter; import org.openstack4j.model.telemetry.MeterSample; @@ -15,9 +11,13 @@ import org.openstack4j.openstack.telemetry.domain.CeilometerMeterSample; import org.openstack4j.openstack.telemetry.domain.CeilometerStatistics; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Provides Measurements against Meters within an OpenStack deployment - * + * * @author Jeremy Unruh */ public class MeterServiceImpl extends BaseTelemetryServices implements MeterService { @@ -25,7 +25,7 @@ public class MeterServiceImpl extends BaseTelemetryServices implements MeterServ private static final String FIELD = "q.field"; private static final String OPER = "q.op"; private static final String VALUE = "q.value"; - private static final String LIMIT = "limit"; + private static final String LIMIT = "limit"; /** * {@inheritDoc} @@ -55,8 +55,8 @@ public List samples(String meterName, SampleCriteria crit checkNotNull(meterName); checkNotNull(criteria); Invocation invocation = get(CeilometerMeterSample[].class, uri("/meters/%s", meterName)); - if(criteria.getLimit() > 0){ - invocation.param(LIMIT, criteria.getLimit()); + if (criteria.getLimit() > 0) { + invocation.param(LIMIT, criteria.getLimit()); } if (!criteria.getCriteriaParams().isEmpty()) { for (NameOpValue c : criteria.getCriteriaParams()) { @@ -93,9 +93,9 @@ public List statistics(String meterName, SampleCriteria cr checkNotNull(meterName); checkNotNull(criteria); Invocation invocation = get(CeilometerStatistics[].class, uri("/meters/%s/statistics", meterName)) - .param(period > 0, "period", period); - if(criteria.getLimit() > 0){ - invocation.param(LIMIT, criteria.getLimit()); + .param(period > 0, "period", period); + if (criteria.getLimit() > 0) { + invocation.param(LIMIT, criteria.getLimit()); } if (!criteria.getCriteriaParams().isEmpty()) { for (NameOpValue c : criteria.getCriteriaParams()) { @@ -110,7 +110,7 @@ public List statistics(String meterName, SampleCriteria cr @Override public void putSamples(List sampleList, String meterName) { - ListEntity listEntity= new ListEntity(sampleList); - post(Void.class,uri("/meters/%s",meterName)).entity(listEntity).execute(); + ListEntity listEntity = new ListEntity(sampleList); + post(Void.class, uri("/meters/%s", meterName)).entity(listEntity).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/ResourceServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/ResourceServiceImpl.java index 1975869f6..f74635e7d 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/ResourceServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/ResourceServiceImpl.java @@ -1,16 +1,16 @@ package org.openstack4j.openstack.telemetry.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.telemetry.ResourceService; import org.openstack4j.model.telemetry.Resource; import org.openstack4j.openstack.telemetry.domain.CeilometerResource; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Provides Measurements for Telemetry resources within an OpenStack deployment - * + * * @author Shital Patil */ public class ResourceServiceImpl extends BaseTelemetryServices implements ResourceService { diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/SampleServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/SampleServiceImpl.java index 9bdb54975..cbd4045a8 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/SampleServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/SampleServiceImpl.java @@ -1,17 +1,17 @@ package org.openstack4j.openstack.telemetry.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.telemetry.SampleService; import org.openstack4j.model.telemetry.Sample; import org.openstack4j.model.telemetry.SampleCriteria; import org.openstack4j.openstack.telemetry.domain.CeiloMeterSample; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * Provides Measurements for Samples within an OpenStack deployment - * + * * @author Shital Patil */ @@ -37,10 +37,10 @@ public List list() { public List list(SampleCriteria criteria) { checkNotNull(criteria); Invocation invocation = get(CeiloMeterSample[].class, uri("/samples")); - if(criteria.getLimit() > 0){ + if (criteria.getLimit() > 0) { invocation.param("limit", criteria.getLimit()); } - + for (SampleCriteria.NameOpValue c : criteria.getCriteriaParams()) { invocation.param(FIELD, c.getField()); invocation.param(OPER, c.getOperator().getQueryValue()); diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryAodhServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryAodhServiceImpl.java index 70f1ec522..c4d800728 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryAodhServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryAodhServiceImpl.java @@ -4,7 +4,6 @@ import org.openstack4j.api.telemetry.*; /** - * * @author zhangjianweibj */ public class TelemetryAodhServiceImpl implements TelemetryAodhService { diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryServiceImpl.java index c3e595549..572b59f27 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/internal/TelemetryServiceImpl.java @@ -1,17 +1,11 @@ package org.openstack4j.openstack.telemetry.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.telemetry.AlarmService; -import org.openstack4j.api.telemetry.CapabilitiesService; -import org.openstack4j.api.telemetry.EventService; -import org.openstack4j.api.telemetry.MeterService; -import org.openstack4j.api.telemetry.ResourceService; -import org.openstack4j.api.telemetry.SampleService; -import org.openstack4j.api.telemetry.TelemetryService; +import org.openstack4j.api.telemetry.*; /** * Telemetry allows collection of Alarms and Measurements - * + * * @author Jeremy Unruh */ public class TelemetryServiceImpl implements TelemetryService { diff --git a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabase.java b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabase.java index 32fe5c9dc..665fe3832 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabase.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabase.java @@ -93,7 +93,7 @@ public Database build() { @Override public DatabaseBuilder from(Database in) { - this.database = (TroveDatabase)in; + this.database = (TroveDatabase) in; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabaseUser.java b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabaseUser.java index 13f9c0192..fe96666c2 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabaseUser.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatabaseUser.java @@ -87,7 +87,7 @@ public DatabaseUser build() { @Override public DatabaseUserBuilder from(DatabaseUser in) { - this.databaseUser = (TroveDatabaseUser)in; + this.databaseUser = (TroveDatabaseUser) in; return this; } diff --git a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatastore.java b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatastore.java index c402e007b..c0bdf7595 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatastore.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveDatastore.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.trove.domain; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.trove.Datastore; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.List; /** * Model implementation for Datastore diff --git a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstance.java b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstance.java index 51b7fbf6c..5ea893be7 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstance.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstance.java @@ -1,14 +1,13 @@ package org.openstack4j.openstack.trove.domain; -import java.util.Date; -import java.util.List; - +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.trove.Flavor; import org.openstack4j.model.trove.Instance; import org.openstack4j.openstack.common.ListResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; +import java.util.Date; +import java.util.List; /** * Model implementation for Database instance @@ -47,9 +46,7 @@ public class Volume { private Integer size; /** - * - * @return - * The type + * @return The type */ public String getType() { @@ -57,9 +54,7 @@ public String getType() { } /** - * - * @return - * The size + * @return The size */ public int getSize() { @@ -82,9 +77,13 @@ public class InstanceDatastore { private String version; - public String getType() { return type; } + public String getType() { + return type; + } - public String getVersion() { return version; } + public String getVersion() { + return version; + } @Override public String toString() { @@ -127,7 +126,9 @@ public String getHostname() { } @Override - public List getIp() { return ip; } + public List getIp() { + return ip; + } @Override public String getId() { @@ -148,7 +149,9 @@ public Volume getVolume() { return volume; } - public InstanceDatastore getDatastore() { return datastore; } + public InstanceDatastore getDatastore() { + return datastore; + } @Override public String getDatastoreType() { diff --git a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstanceCreate.java b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstanceCreate.java index ffda08ba1..c6c45599e 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstanceCreate.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/domain/TroveInstanceCreate.java @@ -1,12 +1,11 @@ package org.openstack4j.openstack.trove.domain; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import org.openstack4j.model.trove.Datastore; import org.openstack4j.model.trove.InstanceCreate; import org.openstack4j.model.trove.builder.InstanceCreateBuilder; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; - /** * Model implementation for Database instance creation * @@ -28,18 +27,14 @@ public class TroveInstanceCreate implements InstanceCreate { private Datastore datastore; /** - * - * @param volume - * The volume + * @param volume The volume */ public void setVolume(Volume volume) { this.volume = volume; } /** - * - * @param flavorRef - * The flavorRef + * @param flavorRef The flavorRef */ @Override public void setFlavor(String flavorRef) { @@ -47,9 +42,7 @@ public void setFlavor(String flavorRef) { } /** - * - * @param name - * The name + * @param name The name */ @Override public void setName(String name) { @@ -57,7 +50,6 @@ public void setName(String name) { } /** - * * @param volumeType */ @Override @@ -66,7 +58,6 @@ public void setVolumetype(String volumeType) { } /** - * * @param size */ @Override @@ -90,9 +81,7 @@ public class Volume { private Integer size; /** - * - * @return - * The type + * @return The type */ public String getType() { @@ -100,9 +89,7 @@ public String getType() { } /** - * - * @param type - * The type + * @param type The type */ public void setType(String type) { @@ -110,9 +97,7 @@ public void setType(String type) { } /** - * - * @param size - * The size + * @param size The size */ public int getSize() { @@ -120,9 +105,7 @@ public int getSize() { } /** - * - * @param size - * The size + * @param size The size */ public void setSize(Integer size) { diff --git a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatabaseServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatabaseServiceImpl.java index 9be3282f6..c5a1b8e9d 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatabaseServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatabaseServiceImpl.java @@ -21,7 +21,7 @@ public class DBDatabaseServiceImpl extends BaseTroveServices implements Database */ @Override public List list(String instanceId) { - return get(Databases.class, uri("/instances/%s/databases",instanceId)).execute().getList(); + return get(Databases.class, uri("/instances/%s/databases", instanceId)).execute().getList(); } /** @@ -31,7 +31,7 @@ public List list(String instanceId) { public ActionResponse create(String instanceId, Databases databases) { checkNotNull(instanceId); checkNotNull(databases); - return post(ActionResponse.class,uri("/instances/%s/databases", instanceId)).entity(databases).execute(); + return post(ActionResponse.class, uri("/instances/%s/databases", instanceId)).entity(databases).execute(); } /** @@ -41,7 +41,7 @@ public ActionResponse create(String instanceId, Databases databases) { public ActionResponse delete(String instanceId, String dbName) { checkNotNull(instanceId); checkNotNull(dbName); - return deleteWithResponse(uri("/instances/%s/databases/%s",instanceId,dbName)).execute(); + return deleteWithResponse(uri("/instances/%s/databases/%s", instanceId, dbName)).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatastoreServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatastoreServiceImpl.java index ec9c41187..6f3aac65b 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatastoreServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBDatastoreServiceImpl.java @@ -29,12 +29,12 @@ public Datastore get(String id) { @Override public List listDatastoreVersions(String datasoreId) { - return get(Versions.class, uri("/datastores/%s/versions",datasoreId)).execute().getList(); + return get(Versions.class, uri("/datastores/%s/versions", datasoreId)).execute().getList(); } @Override public DatastoreVersion getDatastoreVersion(String datastoreId, String versionId) { - return get(TroveDatastoreVersion.class, uri("/datastores/%s/versions/%s",datastoreId,versionId)).execute(); + return get(TroveDatastoreVersion.class, uri("/datastores/%s/versions/%s", datastoreId, versionId)).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBInstanceServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBInstanceServiceImpl.java index de08ca099..90bdb0cb4 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBInstanceServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBInstanceServiceImpl.java @@ -1,9 +1,5 @@ package org.openstack4j.openstack.trove.internal; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - import org.openstack4j.api.trove.InstanceService; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.trove.Instance; @@ -11,6 +7,10 @@ import org.openstack4j.openstack.trove.domain.TroveInstance; import org.openstack4j.openstack.trove.domain.TroveInstance.DBInstances; +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * InstanceService API Implementation * diff --git a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBUserServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBUserServiceImpl.java index 11ef49215..a6931aa6e 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/internal/DBUserServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/internal/DBUserServiceImpl.java @@ -23,7 +23,7 @@ public class DBUserServiceImpl extends BaseTroveServices implements UserService */ @Override public List list(String instanceId) { - return get(DatabaseUsers.class, uri("/instances/%s/users",instanceId)).execute().getList(); + return get(DatabaseUsers.class, uri("/instances/%s/users", instanceId)).execute().getList(); } /** @@ -31,7 +31,7 @@ public List list(String instanceId) { */ @Override public List listUserDatabases(String instanceId, String userName) { - return get(Databases.class, uri("/instances/%s/users/%s/databases",instanceId,userName)).execute().getList(); + return get(Databases.class, uri("/instances/%s/users/%s/databases", instanceId, userName)).execute().getList(); } /** @@ -39,7 +39,7 @@ public List listUserDatabases(String instanceId, String user */ @Override public ActionResponse create(String instanceId, DatabaseUsers databaseUsers) { - return post(ActionResponse.class, uri("/instances/%s/users",instanceId)).entity(databaseUsers).execute(); + return post(ActionResponse.class, uri("/instances/%s/users", instanceId)).entity(databaseUsers).execute(); } /** @@ -49,7 +49,7 @@ public ActionResponse create(String instanceId, DatabaseUsers databaseUsers) { public ActionResponse delete(String instanceId, String userName) { checkNotNull(instanceId); checkNotNull(userName); - return deleteWithResponse(uri("/instances/%s/users/%s",instanceId,userName)).execute(); + return deleteWithResponse(uri("/instances/%s/users/%s", instanceId, userName)).execute(); } /** @@ -60,7 +60,7 @@ public ActionResponse grantUserDBAccess(String instanceId, String userName, Data checkNotNull(instanceId); checkNotNull(userName); checkNotNull(databases); - return put(ActionResponse.class, uri("/instances/%s/users/%s/databases",instanceId,userName)).entity(databases).execute(); + return put(ActionResponse.class, uri("/instances/%s/users/%s/databases", instanceId, userName)).entity(databases).execute(); } /** @@ -71,7 +71,7 @@ public ActionResponse revokeUserDBAccess(String instanceId, String userName, Str checkNotNull(instanceId); checkNotNull(userName); checkNotNull(dbName); - return deleteWithResponse(uri("/instances/%s/users/%s/databases/%s",instanceId,userName,dbName)).execute(); + return deleteWithResponse(uri("/instances/%s/users/%s/databases/%s", instanceId, userName, dbName)).execute(); } } diff --git a/core/src/main/java/org/openstack4j/openstack/trove/internal/TroveServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/trove/internal/TroveServiceImpl.java index 8ff26c2a2..fc3c32510 100644 --- a/core/src/main/java/org/openstack4j/openstack/trove/internal/TroveServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/trove/internal/TroveServiceImpl.java @@ -1,12 +1,7 @@ package org.openstack4j.openstack.trove.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.trove.InstanceFlavorService; -import org.openstack4j.api.trove.DatabaseService; -import org.openstack4j.api.trove.DatastoreService; -import org.openstack4j.api.trove.InstanceService; -import org.openstack4j.api.trove.TroveService; -import org.openstack4j.api.trove.UserService; +import org.openstack4j.api.trove.*; /** * Trove API Implementation diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionDefinition.java b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionDefinition.java index 6fa3ab552..e2ef0370f 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionDefinition.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionDefinition.java @@ -10,69 +10,69 @@ /** * Mistral action definition. - * + * * @author Renat Akhmerov */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class MistralActionDefinition extends BaseDefinition implements ActionDefinition { - private static final long serialVersionUID = 1L; - - private String input; - - public static MistralActionDefinitionBuilder builder() { - return new MistralActionDefinitionBuilder(); - } - - @Override - public MistralActionDefinitionBuilder toBuilder() { - return new MistralActionDefinitionBuilder(this); - } - - @Override - public String getInput() { - return input; - } - - /** - * Mistral action definition builder. - * - * @author Renat Akhmerov - */ - public static class MistralActionDefinitionBuilder extends - BaseDefinitionBuilder - implements ActionDefinitionBuilder { - - MistralActionDefinitionBuilder() { - this(new MistralActionDefinition()); - } - - MistralActionDefinitionBuilder(MistralActionDefinition model) { - super(model); - } - - @Override - public MistralActionDefinitionBuilder from(MistralActionDefinition in) { - return null; - } - - @Override - public MistralActionDefinitionBuilder input(String input) { + private static final long serialVersionUID = 1L; + + private String input; + + public static MistralActionDefinitionBuilder builder() { + return new MistralActionDefinitionBuilder(); + } + + @Override + public MistralActionDefinitionBuilder toBuilder() { + return new MistralActionDefinitionBuilder(this); + } + + @Override + public String getInput() { + return input; + } + + /** + * Mistral action definition builder. + * + * @author Renat Akhmerov + */ + public static class MistralActionDefinitionBuilder extends + BaseDefinitionBuilder + implements ActionDefinitionBuilder { + + MistralActionDefinitionBuilder() { + this(new MistralActionDefinition()); + } + + MistralActionDefinitionBuilder(MistralActionDefinition model) { + super(model); + } + + @Override + public MistralActionDefinitionBuilder from(MistralActionDefinition in) { + return null; + } + + @Override + public MistralActionDefinitionBuilder input(String input) { this.model.input = input; - return this; - } - } + return this; + } + } - public static class MistralActionDefinitions extends ListResult { - private static final long serialVersionUID = 1L; + public static class MistralActionDefinitions extends ListResult { + private static final long serialVersionUID = 1L; - @JsonProperty("actions") - private List list; + @JsonProperty("actions") + private List list; - @Override - protected List value() { - return this.list; - } - } + @Override + protected List value() { + return this.list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionExecution.java b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionExecution.java index d53a15a80..7f0894996 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionExecution.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralActionExecution.java @@ -12,101 +12,101 @@ /** * Mistral action execution. - * + * * @author Renat Akhmerov */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class MistralActionExecution extends BaseExecution implements ActionExecution { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private String name; + private String name; - private String type; + private String type; - @JsonProperty("task_name") - private String taskName; + @JsonProperty("task_name") + private String taskName; - @JsonProperty("task_execution_id") - private String taskExecId; + @JsonProperty("task_execution_id") + private String taskExecId; - private Map input; + private Map input; - private Map output; + private Map output; - private Boolean accepted; + private Boolean accepted; - public static MistralActionExecutionBuilder builder() { - return new MistralActionExecutionBuilder(); - } - - @Override - public MistralActionExecutionBuilder toBuilder() { - return new MistralActionExecutionBuilder(this); - } + public static MistralActionExecutionBuilder builder() { + return new MistralActionExecutionBuilder(); + } - @Override - public String getName() { - return name; - } + @Override + public MistralActionExecutionBuilder toBuilder() { + return new MistralActionExecutionBuilder(this); + } - @Override - public String getTaskName() { - return taskName; - } + @Override + public String getName() { + return name; + } - @Override - public String getTaskExecutionId() { - return taskExecId; - } + @Override + public String getTaskName() { + return taskName; + } + @Override + public String getTaskExecutionId() { + return taskExecId; + } - @Override - public Boolean isAccepted() { - return accepted; - } - @Override - public Map getInput() { - return input; - } + @Override + public Boolean isAccepted() { + return accepted; + } - @Override - public Map getOutput() { - return output; - } + @Override + public Map getInput() { + return input; + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("createdAt", createdAt) - .add("updatedAt", updatedAt) - .add("id", id) - .add("name", name) - .toString(); - } + @Override + public Map getOutput() { + return output; + } - /** - * Mistral task execution builder. - * - * @author Renat Akhmerov - */ - public static class MistralActionExecutionBuilder extends - BaseExecutionBuilder - implements ActionExecutionBuilder { + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("createdAt", createdAt) + .add("updatedAt", updatedAt) + .add("id", id) + .add("name", name) + .toString(); + } - public MistralActionExecutionBuilder() { - this(new MistralActionExecution()); - } + /** + * Mistral task execution builder. + * + * @author Renat Akhmerov + */ + public static class MistralActionExecutionBuilder extends + BaseExecutionBuilder + implements ActionExecutionBuilder { + + public MistralActionExecutionBuilder() { + this(new MistralActionExecution()); + } public MistralActionExecutionBuilder(MistralActionExecution model) { - super(model); - } + super(model); + } - @Override - public MistralActionExecutionBuilder from(MistralActionExecution in) { - return null; - } + @Override + public MistralActionExecutionBuilder from(MistralActionExecution in) { + return null; + } @Override public MistralActionExecutionBuilder name(String name) { @@ -151,15 +151,15 @@ public MistralActionExecutionBuilder output(Map output) { } } - public static class MistralActionExecutions extends ListResult { - private static final long serialVersionUID = 1L; + public static class MistralActionExecutions extends ListResult { + private static final long serialVersionUID = 1L; - @JsonProperty("action_executions") - private List list; + @JsonProperty("action_executions") + private List list; - @Override - protected List value() { - return this.list; - } - } + @Override + protected List value() { + return this.list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralTaskExecution.java b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralTaskExecution.java index fac59cf25..09bbb6dd2 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralTaskExecution.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralTaskExecution.java @@ -12,128 +12,128 @@ /** * Mistral task execution. - * + * * @author Renat Akhmerov */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class MistralTaskExecution extends BaseExecution implements TaskExecution { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private String name; + private String name; - private String type; + private String type; - @JsonProperty("workflow_id") - private String wfDefId; + @JsonProperty("workflow_id") + private String wfDefId; - @JsonProperty("workflow_execution_id") - private String wfExecId; + @JsonProperty("workflow_execution_id") + private String wfExecId; - private Map published; + private Map published; - @JsonProperty("runtime_context") - private Map runtimeContext; + @JsonProperty("runtime_context") + private Map runtimeContext; - private Object result; + private Object result; - private Boolean processed; + private Boolean processed; - private Boolean reset; + private Boolean reset; - private Map env; + private Map env; - public static MistralTaskExecutionBuilder builder() { - return new MistralTaskExecutionBuilder(); - } - - @Override - public MistralTaskExecutionBuilder toBuilder() { - return new MistralTaskExecutionBuilder(this); - } + public static MistralTaskExecutionBuilder builder() { + return new MistralTaskExecutionBuilder(); + } - @Override - public String getName() { - return name; - } + @Override + public MistralTaskExecutionBuilder toBuilder() { + return new MistralTaskExecutionBuilder(this); + } - @Override - public String getType() { - return type; - } + @Override + public String getName() { + return name; + } - @Override - public String getWorkflowDefinitionId() { - return wfDefId; - } + @Override + public String getType() { + return type; + } - @Override - public String getWorkflowExecutionId() { - return wfExecId; - } + @Override + public String getWorkflowDefinitionId() { + return wfDefId; + } - @Override - public Map getRuntimeContext() { - return runtimeContext; - } + @Override + public String getWorkflowExecutionId() { + return wfExecId; + } - @Override - public Object getResult() { - return result; - } + @Override + public Map getRuntimeContext() { + return runtimeContext; + } - @Override - public Map getPublished() { - return published; - } + @Override + public Object getResult() { + return result; + } - @Override - public Boolean isProcessed() { - return processed; - } + @Override + public Map getPublished() { + return published; + } - @Override - public Boolean isReset() { - return reset; - } + @Override + public Boolean isProcessed() { + return processed; + } - @Override - public Map getEnvironment() { - return env; - } + @Override + public Boolean isReset() { + return reset; + } - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("createdAt", createdAt) - .add("updatedAt", updatedAt) - .add("id", id) - .add("name", name) - .toString(); - } + @Override + public Map getEnvironment() { + return env; + } - /** - * Mistral task execution builder. - * - * @author Renat Akhmerov - */ - public static class MistralTaskExecutionBuilder extends - BaseExecutionBuilder - implements TaskExecutionBuilder { - - public MistralTaskExecutionBuilder() { - this(new MistralTaskExecution()); - } + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("createdAt", createdAt) + .add("updatedAt", updatedAt) + .add("id", id) + .add("name", name) + .toString(); + } + + /** + * Mistral task execution builder. + * + * @author Renat Akhmerov + */ + public static class MistralTaskExecutionBuilder extends + BaseExecutionBuilder + implements TaskExecutionBuilder { + + public MistralTaskExecutionBuilder() { + this(new MistralTaskExecution()); + } public MistralTaskExecutionBuilder(MistralTaskExecution model) { - super(model); - } + super(model); + } - @Override - public MistralTaskExecutionBuilder from(MistralTaskExecution in) { - return null; - } + @Override + public MistralTaskExecutionBuilder from(MistralTaskExecution in) { + return null; + } @Override public MistralTaskExecutionBuilder type(String type) { @@ -144,70 +144,70 @@ public MistralTaskExecutionBuilder type(String type) { @Override public MistralTaskExecutionBuilder workflowDefinitionId(String wfDefId) { - this.model.wfDefId = wfDefId; + this.model.wfDefId = wfDefId; return this; } @Override public MistralTaskExecutionBuilder workflowExecutionId(String wfExecId) { - this.model.wfExecId = wfExecId; + this.model.wfExecId = wfExecId; return this; } @Override public MistralTaskExecutionBuilder runtimeContext(Map runtimeContext) { - this.model.runtimeContext = runtimeContext; + this.model.runtimeContext = runtimeContext; return this; } @Override public MistralTaskExecutionBuilder result(Object result) { - this.model.result = result; + this.model.result = result; return this; } @Override public MistralTaskExecutionBuilder published(Map published) { - this.model.published = published; + this.model.published = published; return this; } @Override public MistralTaskExecutionBuilder processed(Boolean processed) { - this.model.processed = processed; + this.model.processed = processed; return this; } @Override public MistralTaskExecutionBuilder reset(Boolean reset) { - this.model.reset = reset; + this.model.reset = reset; return this; } @Override public MistralTaskExecutionBuilder environment(Map env) { - this.model.env = env; + this.model.env = env; return this; } } - public static class MistralTaskExecutions extends ListResult { - private static final long serialVersionUID = 1L; + public static class MistralTaskExecutions extends ListResult { + private static final long serialVersionUID = 1L; - @JsonProperty("tasks") - private List list; + @JsonProperty("tasks") + private List list; - @Override - protected List value() { - return this.list; - } - } + @Override + protected List value() { + return this.list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkbookDefinition.java b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkbookDefinition.java index caa4aafa1..1be4e9bf5 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkbookDefinition.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkbookDefinition.java @@ -10,55 +10,55 @@ /** * Mistral workbook definition. - * + * * @author Renat Akhmerov */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class MistralWorkbookDefinition extends BaseDefinition implements WorkbookDefinition { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public static MistralWorkbookDefinitionBuilder builder() { - return new MistralWorkbookDefinitionBuilder(); - } - - @Override - public MistralWorkbookDefinitionBuilder toBuilder() { - return new MistralWorkbookDefinitionBuilder(this); - } + public static MistralWorkbookDefinitionBuilder builder() { + return new MistralWorkbookDefinitionBuilder(); + } - /** - * Mistral workbook definition builder. - * - * @author Renat Akhmerov - */ - public static class MistralWorkbookDefinitionBuilder extends - BaseDefinitionBuilder - implements WorkbookDefinitionBuilder { + @Override + public MistralWorkbookDefinitionBuilder toBuilder() { + return new MistralWorkbookDefinitionBuilder(this); + } - MistralWorkbookDefinitionBuilder() { - this(new MistralWorkbookDefinition()); - } + /** + * Mistral workbook definition builder. + * + * @author Renat Akhmerov + */ + public static class MistralWorkbookDefinitionBuilder extends + BaseDefinitionBuilder + implements WorkbookDefinitionBuilder { - MistralWorkbookDefinitionBuilder(MistralWorkbookDefinition model) { - super(model); - } + MistralWorkbookDefinitionBuilder() { + this(new MistralWorkbookDefinition()); + } - @Override - public MistralWorkbookDefinitionBuilder from(MistralWorkbookDefinition in) { - return null; - } - } + MistralWorkbookDefinitionBuilder(MistralWorkbookDefinition model) { + super(model); + } - public static class MistralWorkbookDefinitions extends ListResult { - private static final long serialVersionUID = 1L; + @Override + public MistralWorkbookDefinitionBuilder from(MistralWorkbookDefinition in) { + return null; + } + } - @JsonProperty("workbooks") - private List list; + public static class MistralWorkbookDefinitions extends ListResult { + private static final long serialVersionUID = 1L; - @Override - protected List value() { - return this.list; - } - } + @JsonProperty("workbooks") + private List list; + + @Override + protected List value() { + return this.list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowDefinition.java b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowDefinition.java index b9d0fd629..5f2435f71 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowDefinition.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowDefinition.java @@ -1,6 +1,7 @@ package org.openstack4j.openstack.workflow.domain; -import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import org.openstack4j.model.workflow.WorkflowDefinition; import org.openstack4j.model.workflow.builder.WorkflowDefinitionBuilder; import org.openstack4j.openstack.common.ListResult; @@ -9,69 +10,69 @@ /** * Mistral workflow definition. - * + * * @author Renat Akhmerov */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class MistralWorkflowDefinition extends BaseDefinition implements WorkflowDefinition { - private static final long serialVersionUID = 1L; - - private String input; - - public static MistralWorkflowDefinitionBuilder builder() { - return new MistralWorkflowDefinitionBuilder(); - } - - @Override - public MistralWorkflowDefinitionBuilder toBuilder() { - return new MistralWorkflowDefinitionBuilder(this); - } - - @Override - public String getInput() { - return input; - } - - /** - * Mistral workflow definition builder. - * - * @author Renat Akhmerov - */ - public static class MistralWorkflowDefinitionBuilder extends - BaseDefinitionBuilder - implements WorkflowDefinitionBuilder { - - MistralWorkflowDefinitionBuilder() { - this(new MistralWorkflowDefinition()); - } - - MistralWorkflowDefinitionBuilder(MistralWorkflowDefinition model) { - super(model); - } - - @Override - public MistralWorkflowDefinitionBuilder from(MistralWorkflowDefinition in) { - return null; - } - - @Override - public MistralWorkflowDefinitionBuilder input(String input) { + private static final long serialVersionUID = 1L; + + private String input; + + public static MistralWorkflowDefinitionBuilder builder() { + return new MistralWorkflowDefinitionBuilder(); + } + + @Override + public MistralWorkflowDefinitionBuilder toBuilder() { + return new MistralWorkflowDefinitionBuilder(this); + } + + @Override + public String getInput() { + return input; + } + + /** + * Mistral workflow definition builder. + * + * @author Renat Akhmerov + */ + public static class MistralWorkflowDefinitionBuilder extends + BaseDefinitionBuilder + implements WorkflowDefinitionBuilder { + + MistralWorkflowDefinitionBuilder() { + this(new MistralWorkflowDefinition()); + } + + MistralWorkflowDefinitionBuilder(MistralWorkflowDefinition model) { + super(model); + } + + @Override + public MistralWorkflowDefinitionBuilder from(MistralWorkflowDefinition in) { + return null; + } + + @Override + public MistralWorkflowDefinitionBuilder input(String input) { this.model.input = input; - return this; - } - } + return this; + } + } - public static class MistralWorkflowDefinitions extends ListResult { - private static final long serialVersionUID = 1L; + public static class MistralWorkflowDefinitions extends ListResult { + private static final long serialVersionUID = 1L; - @JsonProperty("workflows") - private List list; + @JsonProperty("workflows") + private List list; - @Override - protected List value() { - return this.list; - } - } + @Override + protected List value() { + return this.list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowExecution.java b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowExecution.java index 99e89ee7e..5030474ba 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowExecution.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/domain/MistralWorkflowExecution.java @@ -12,52 +12,52 @@ /** * Mistral workflow execution. - * + * * @author Renat Akhmerov */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class MistralWorkflowExecution extends BaseExecution implements WorkflowExecution { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; @JsonProperty("params") - private Map parameters; + private Map parameters; - @JsonProperty("input") - private Map input; + @JsonProperty("input") + private Map input; - private Map output; + private Map output; - private String taskExecutionId; + private String taskExecutionId; - public static MistralWorkflowExecutionBuilder builder() { - return new MistralWorkflowExecutionBuilder(); - } - - @Override - public MistralWorkflowExecutionBuilder toBuilder() { - return new MistralWorkflowExecutionBuilder(this); - } + public static MistralWorkflowExecutionBuilder builder() { + return new MistralWorkflowExecutionBuilder(); + } - @Override - public Map getParameters() { - return parameters; - } + @Override + public MistralWorkflowExecutionBuilder toBuilder() { + return new MistralWorkflowExecutionBuilder(this); + } - @Override - public Map getInput() { - return input; - } + @Override + public Map getParameters() { + return parameters; + } @Override - public Map getOutput() { - return output; - } + public Map getInput() { + return input; + } - @Override - public String getTaskExecutionId() { - return taskExecutionId; - } + @Override + public Map getOutput() { + return output; + } + + @Override + public String getTaskExecutionId() { + return taskExecutionId; + } @Override public String toString() { @@ -70,65 +70,65 @@ public String toString() { } /** - * Mistral workflow execution builder. - * - * @author Renat Akhmerov - */ - public static class MistralWorkflowExecutionBuilder extends - BaseExecutionBuilder - implements WorkflowExecutionBuilder { - - public MistralWorkflowExecutionBuilder() { - this(new MistralWorkflowExecution()); - } + * Mistral workflow execution builder. + * + * @author Renat Akhmerov + */ + public static class MistralWorkflowExecutionBuilder extends + BaseExecutionBuilder + implements WorkflowExecutionBuilder { + + public MistralWorkflowExecutionBuilder() { + this(new MistralWorkflowExecution()); + } public MistralWorkflowExecutionBuilder(MistralWorkflowExecution model) { - super(model); - } + super(model); + } - @Override - public MistralWorkflowExecutionBuilder from(MistralWorkflowExecution in) { - return null; - } + @Override + public MistralWorkflowExecutionBuilder from(MistralWorkflowExecution in) { + return null; + } - @Override - public MistralWorkflowExecutionBuilder parameters(Map parameters) { + @Override + public MistralWorkflowExecutionBuilder parameters(Map parameters) { this.model.parameters = parameters; - return this; - } + return this; + } - @Override - public MistralWorkflowExecutionBuilder input(Map input) { - this.model.input = input; + @Override + public MistralWorkflowExecutionBuilder input(Map input) { + this.model.input = input; - return this; - } + return this; + } - @Override - public MistralWorkflowExecutionBuilder output(Map output) { - this.model.output = output; + @Override + public MistralWorkflowExecutionBuilder output(Map output) { + this.model.output = output; - return this; - } + return this; + } - @Override - public MistralWorkflowExecutionBuilder taskExecutionId(String taskExecutionId) { - this.model.taskExecutionId = taskExecutionId; + @Override + public MistralWorkflowExecutionBuilder taskExecutionId(String taskExecutionId) { + this.model.taskExecutionId = taskExecutionId; - return this; - } - } + return this; + } + } - public static class MistralWorkflowExecutions extends ListResult { - private static final long serialVersionUID = 1L; + public static class MistralWorkflowExecutions extends ListResult { + private static final long serialVersionUID = 1L; - @JsonProperty("executions") - private List list; + @JsonProperty("executions") + private List list; - @Override - protected List value() { - return this.list; - } - } + @Override + protected List value() { + return this.list; + } + } } diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/internal/CronTriggerServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/workflow/internal/CronTriggerServiceImpl.java index c69774e5b..abf7d151c 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/internal/CronTriggerServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/internal/CronTriggerServiceImpl.java @@ -10,7 +10,7 @@ import static com.google.common.base.Preconditions.checkNotNull; - + /** * Cron trigger service implementation. * diff --git a/core/src/main/java/org/openstack4j/openstack/workflow/internal/WorkflowServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/workflow/internal/WorkflowServiceImpl.java index b20b6ca98..54c0ad08c 100644 --- a/core/src/main/java/org/openstack4j/openstack/workflow/internal/WorkflowServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/workflow/internal/WorkflowServiceImpl.java @@ -1,9 +1,7 @@ package org.openstack4j.openstack.workflow.internal; import org.openstack4j.api.Apis; -import org.openstack4j.api.trove.*; import org.openstack4j.api.workflow.*; -import org.openstack4j.openstack.trove.internal.BaseTroveServices; /** * Trove API Implementation diff --git a/core/src/test/java/org/openstack4j/test/common/EndpointVersionTest.java b/core/src/test/java/org/openstack4j/test/common/EndpointVersionTest.java index d89719490..2fb9f4b94 100644 --- a/core/src/test/java/org/openstack4j/test/common/EndpointVersionTest.java +++ b/core/src/test/java/org/openstack4j/test/common/EndpointVersionTest.java @@ -1,23 +1,23 @@ package org.openstack4j.test.common; -import static org.testng.Assert.assertTrue; - import org.openstack4j.openstack.common.functions.EnforceVersionToURL; import org.testng.annotations.Test; +import static org.testng.Assert.assertTrue; + /** * Tests API Endpoint version enforcement - * + * * @author Jeremy Unruh */ -@Test(suiteName="Endpoint Version Tests") +@Test(suiteName = "Endpoint Version Tests") public class EndpointVersionTest { - private static String[] ENDPOINTS = new String[] { - "https://v1.testme.com:8888", - "http://10.2.2.2:2323/v2", - "http://1.1.1.2:1234", - "https://2.2.3.4:2222/v2.0" + private static String[] ENDPOINTS = new String[]{ + "https://v1.testme.com:8888", + "http://10.2.2.2:2323/v2", + "http://1.1.1.2:1234", + "https://2.2.3.4:2222/v2.0" }; @Test @@ -27,7 +27,7 @@ public void endpointVersionOneTest() { assertTrue(func.apply(ep).endsWith("/v1")); } } - + @Test public void endpointVersionTwoTest() { EnforceVersionToURL func = EnforceVersionToURL.instance("/v2"); @@ -35,7 +35,7 @@ public void endpointVersionTwoTest() { assertTrue(func.apply(ep).endsWith("/v2")); } } - + public void endpointVersionTwoDotTest() { EnforceVersionToURL func = EnforceVersionToURL.instance("/v2.0"); for (String ep : ENDPOINTS) { diff --git a/core/src/test/java/org/openstack4j/test/common/HeaderNameValuesToHeaderMapTest.java b/core/src/test/java/org/openstack4j/test/common/HeaderNameValuesToHeaderMapTest.java index 54452369a..1cf0e4b71 100644 --- a/core/src/test/java/org/openstack4j/test/common/HeaderNameValuesToHeaderMapTest.java +++ b/core/src/test/java/org/openstack4j/test/common/HeaderNameValuesToHeaderMapTest.java @@ -1,21 +1,19 @@ package org.openstack4j.test.common; -import static org.testng.Assert.assertTrue; - -import java.util.List; -import java.util.Map; - +import com.google.common.collect.Lists; import org.openstack4j.model.common.header.HeaderNameValue; import org.openstack4j.openstack.common.functions.HeaderNameValuesToHeaderMap; import org.testng.annotations.Test; -import com.google.common.collect.Lists; +import java.util.List; +import java.util.Map; + +import static org.testng.Assert.assertTrue; /** * Tests HeaderNameValue based transformation - * - * @author Jeremy Unruh * + * @author Jeremy Unruh */ public class HeaderNameValuesToHeaderMapTest { @@ -25,7 +23,7 @@ public class HeaderNameValuesToHeaderMapTest { new HeaderNameValue("Test 3", "Value 3"), new HeaderNameValue("Test 4", "Value 4") ); - + @Test public void keyTest() { Map map = HeaderNameValuesToHeaderMap.INSTANCE.apply(VALUES); @@ -33,7 +31,7 @@ public void keyTest() { assertTrue(map.containsKey(hnv.getName())); } } - + @Test public void valueTest() { Map map = HeaderNameValuesToHeaderMap.INSTANCE.apply(VALUES); @@ -41,5 +39,5 @@ public void valueTest() { assertTrue(map.containsValue(hnv.getValue())); } } - + } diff --git a/core/src/test/java/org/openstack4j/test/common/MicroVersionTest.java b/core/src/test/java/org/openstack4j/test/common/MicroVersionTest.java index b6db6e874..18ede9cfe 100644 --- a/core/src/test/java/org/openstack4j/test/common/MicroVersionTest.java +++ b/core/src/test/java/org/openstack4j/test/common/MicroVersionTest.java @@ -9,7 +9,7 @@ public class MicroVersionTest { @DataProvider public static Object[][] invalidMicroVersions() { - return new Object[][] { + return new Object[][]{ {"1.2.3"}, {"1,0"}, {"1"}, @@ -29,8 +29,7 @@ public void createInvalidFromString(String v) { try { new MicroVersion(v); fail("Expected IllegalArgumentException"); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { assertEquals(e.getMessage(), "Invalid version pattern " + v + ", should be 'X.Y' (Major.Minor)"); } } diff --git a/core/src/test/java/org/openstack4j/test/core/transport/ConfigTest.java b/core/src/test/java/org/openstack4j/test/core/transport/ConfigTest.java index 88be72308..2c04d51d2 100644 --- a/core/src/test/java/org/openstack4j/test/core/transport/ConfigTest.java +++ b/core/src/test/java/org/openstack4j/test/core/transport/ConfigTest.java @@ -1,57 +1,56 @@ package org.openstack4j.test.core.transport; -import java.security.SecureRandom; +import org.openstack4j.core.transport.Config; +import org.testng.Assert; +import org.testng.annotations.Test; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; - -import org.openstack4j.core.transport.Config; -import org.testng.Assert; -import org.testng.annotations.Test; +import java.security.SecureRandom; public class ConfigTest { - @Test - public void testUnequalConfigSsl() { - Config firstConfig = Config.newConfig(); - try { - SSLContext firstSslContext = SSLContext.getInstance("SSL"); - - firstSslContext.init(null, new TrustManager[] { null }, new SecureRandom()); - firstConfig.withSSLContext(firstSslContext); - }catch(Exception e) { - e.printStackTrace(); - } - - Config secondConfig = Config.newConfig(); - try { - SSLContext secondSslContext = SSLContext.getInstance("SSL"); - - secondSslContext.init(null, new TrustManager[] { null }, new SecureRandom()); - secondConfig.withSSLContext(secondSslContext); - }catch(Exception e) { - e.printStackTrace(); - } - - Assert.assertNotEquals(firstConfig, secondConfig); - } - - @Test - public void testUnequalConfigHostnameVerifier() { - Config firstConfig = Config.newConfig(); - firstConfig.withHostnameVerifier(new HostnameVerifier() { - - @Override - public boolean verify(String hostname, SSLSession session) { - // TODO Auto-generated method stub - return false; - } - }); - - Config secondConfig = Config.newConfig(); - - Assert.assertNotEquals(firstConfig, secondConfig); - } + @Test + public void testUnequalConfigSsl() { + Config firstConfig = Config.newConfig(); + try { + SSLContext firstSslContext = SSLContext.getInstance("SSL"); + + firstSslContext.init(null, new TrustManager[]{null}, new SecureRandom()); + firstConfig.withSSLContext(firstSslContext); + } catch (Exception e) { + e.printStackTrace(); + } + + Config secondConfig = Config.newConfig(); + try { + SSLContext secondSslContext = SSLContext.getInstance("SSL"); + + secondSslContext.init(null, new TrustManager[]{null}, new SecureRandom()); + secondConfig.withSSLContext(secondSslContext); + } catch (Exception e) { + e.printStackTrace(); + } + + Assert.assertNotEquals(firstConfig, secondConfig); + } + + @Test + public void testUnequalConfigHostnameVerifier() { + Config firstConfig = Config.newConfig(); + firstConfig.withHostnameVerifier(new HostnameVerifier() { + + @Override + public boolean verify(String hostname, SSLSession session) { + // TODO Auto-generated method stub + return false; + } + }); + + Config secondConfig = Config.newConfig(); + + Assert.assertNotEquals(firstConfig, secondConfig); + } } diff --git a/distribution/pom.xml b/distribution/pom.xml index 0c3c8893b..fd5778570 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -1,84 +1,85 @@ - - - org.pacesys - openstack4j-parent - 3.2.1-SNAPSHOT - - 4.0.0 - openstack4j - OpenStack4j Distribution - OpenStack Java API - http://github.com/ContainX/openstack4j/ - jar + + + org.pacesys + openstack4j-parent + 3.2.1-SNAPSHOT + + 4.0.0 + openstack4j + OpenStack4j Distribution + OpenStack Java API + http://github.com/ContainX/openstack4j/ + jar - - - org.pacesys - openstack4j-core - ${project.version} - - - org.pacesys.openstack4j.connectors - openstack4j-resteasy - ${project.version} - - + + + org.pacesys + openstack4j-core + ${project.version} + + + org.pacesys.openstack4j.connectors + openstack4j-resteasy + ${project.version} + + - - openstack4j - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9.1 - - - attach-javadocs - - jar - - - -Xdoclint:none - - - - - - org.apache.maven.plugins - maven-shade-plugin - 1.3.3 - - - withdeps-shade - package - - shade - - - true - true - withdeps - true - - - - mainartifact-shade - package - - shade - - - false - true - - - org.pacesys:* - - - - - - - - + + openstack4j + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + -Xdoclint:none + + + + + + org.apache.maven.plugins + maven-shade-plugin + 1.3.3 + + + withdeps-shade + package + + shade + + + true + true + withdeps + true + + + + mainartifact-shade + package + + shade + + + false + true + + + org.pacesys:* + + + + + + + + diff --git a/distribution/settings.xml b/distribution/settings.xml index f704b0314..beccdba9b 100644 --- a/distribution/settings.xml +++ b/distribution/settings.xml @@ -3,12 +3,12 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> - - - - sonatype-nexus-snapshots - ${env.SONATYPE_USERNAME} - ${env.SONATYPE_PASSWORD} - - + + + + sonatype-nexus-snapshots + ${env.SONATYPE_USERNAME} + ${env.SONATYPE_PASSWORD} + + diff --git a/src/main/resources/features.xml b/src/main/resources/features.xml index 2fd307580..7cdb1d889 100644 --- a/src/main/resources/features.xml +++ b/src/main/resources/features.xml @@ -1,130 +1,131 @@ - - openstack4j-httpclient - openstack4j-plugin-log4j - - - - - openstack4j-core - openstack4j-connector-httpclient - - - - - mvn:org.apache.aries/org.apache.aries.util/1.1.0 - - mvn:org.ow2.asm/asm-debug-all/4.1 - mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.0.0 - - - - mvn:org.apache.aries/org.apache.aries.util/1.1.0 - - mvn:org.ow2.asm/asm-debug-all/5.0.3 - mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.0.1 - - - - - - spi-fly - - mvn:com.google.guava/guava/17.0 - - mvn:com.fasterxml.jackson.core/jackson-databind/2.4.1.3 - mvn:com.fasterxml.jackson.core/jackson-annotations/2.4.0 - mvn:com.fasterxml.jackson.core/jackson-core/2.4.1.1 - - mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.4.1 - mvn:org.yaml/snakeyaml/1.14 - - wrap:mvn:com.google.code.findbugs/jsr305/2.0.0 - - mvn:org.pacesys/openstack4j-core/${project.version} - - - - - wrap:mvn:commons-logging/commons-logging/1.1.3 - - wrap:mvn:org.apache.httpcomponents/httpclient/4.3.1$overwrite=merge&Export-Package=!org,!org.apache,!org.apache.http,* - wrap:mvn:org.apache.httpcomponents/httpcore/4.3$overwrite=merge&Export-Package=!org,!org.apache,* - - mvn:org.pacesys.openstack4j.connectors/openstack4j-httpclient/${project.version} - - - - - mvn:log4j/log4j/1.2.17 - mvn:org.pacesys.openstack4j.plugins/openstack4j-log4j/${project.version} - + + openstack4j-httpclient + openstack4j-plugin-log4j + + + + + openstack4j-core + openstack4j-connector-httpclient + + + + + mvn:org.apache.aries/org.apache.aries.util/1.1.0 + + mvn:org.ow2.asm/asm-debug-all/4.1 + mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.0.0 + + + + mvn:org.apache.aries/org.apache.aries.util/1.1.0 + + mvn:org.ow2.asm/asm-debug-all/5.0.3 + mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.0.1 + + + + + + spi-fly + + mvn:com.google.guava/guava/17.0 + + mvn:com.fasterxml.jackson.core/jackson-databind/2.4.1.3 + mvn:com.fasterxml.jackson.core/jackson-annotations/2.4.0 + mvn:com.fasterxml.jackson.core/jackson-core/2.4.1.1 + + mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.4.1 + mvn:org.yaml/snakeyaml/1.14 + + wrap:mvn:com.google.code.findbugs/jsr305/2.0.0 + + mvn:org.pacesys/openstack4j-core/${project.version} + + + + + wrap:mvn:commons-logging/commons-logging/1.1.3 + + wrap:mvn:org.apache.httpcomponents/httpclient/4.3.1$overwrite=merge&Export-Package=!org,!org.apache,!org.apache.http,* + wrap:mvn:org.apache.httpcomponents/httpcore/4.3$overwrite=merge&Export-Package=!org,!org.apache,* + + mvn:org.pacesys.openstack4j.connectors/openstack4j-httpclient/${project.version} + + + + + + mvn:log4j/log4j/1.2.17 + mvn:org.pacesys.openstack4j.plugins/openstack4j-log4j/${project.version} + From 7e8def243bdf0d03fd87e333f6c0056dc95ecc25 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Sun, 1 Nov 2020 22:56:04 +0800 Subject: [PATCH 2/9] upd plus version - 4.0.0-SNAPSHOT (dev) --- README.md | 2 +- connectors/README.md | 10 +++++----- connectors/http-connector/pom.xml | 2 +- connectors/httpclient/pom.xml | 2 +- connectors/jersey2/pom.xml | 2 +- connectors/okhttp/pom.xml | 2 +- connectors/pom.xml | 2 +- connectors/resteasy/pom.xml | 2 +- core-integration-test/it-httpclient/pom.xml | 2 +- core-integration-test/it-jersey2/pom.xml | 2 +- core-integration-test/it-okhttp/pom.xml | 2 +- core-integration-test/it-resteasy/pom.xml | 2 +- core-integration-test/pom.xml | 2 +- core-test/pom.xml | 2 +- core/pom.xml | 2 +- distribution/pom.xml | 2 +- pom.xml | 2 +- 17 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 6313f5904..865145f11 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ See notes above about connectors (same rules apply) to development branches. org.pacesys openstack4j - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT ``` diff --git a/connectors/README.md b/connectors/README.md index 5bd19e37d..e9ff30244 100644 --- a/connectors/README.md +++ b/connectors/README.md @@ -11,7 +11,7 @@ Instead of depending on the normal "openstack4j" artifactId, change the dependen org.pacesys openstack4j-core - 2.0.0-SNAPSHOT + 4.0.0-SNAPSHOT ``` @@ -22,7 +22,7 @@ Now choose a connector by adding the applicable dependency below: org.pacesys.openstack4j.connectors openstack4j-jersey2 - 2.0.0-SNAPSHOT + 4.0.0-SNAPSHOT ``` @@ -31,7 +31,7 @@ Now choose a connector by adding the applicable dependency below: org.pacesys.openstack4j.connectors openstack4j-resteasy - 2.0.0-SNAPSHOT + 4.0.0-SNAPSHOT ``` @@ -40,7 +40,7 @@ Now choose a connector by adding the applicable dependency below: org.pacesys.openstack4j.connectors openstack4j-httpclient - 2.0.0-SNAPSHOT + 4.0.0-SNAPSHOT ``` @@ -49,7 +49,7 @@ Now choose a connector by adding the applicable dependency below: org.pacesys.openstack4j.connectors openstack4j-okhttp - 2.0.0-SNAPSHOT + 4.0.0-SNAPSHOT ``` diff --git a/connectors/http-connector/pom.xml b/connectors/http-connector/pom.xml index dfe5dca46..72a82786f 100644 --- a/connectors/http-connector/pom.xml +++ b/connectors/http-connector/pom.xml @@ -5,7 +5,7 @@ org.pacesys.openstack4j.connectors openstack4j-connectors - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT OpenStack4j HttpURL Connector openstack4j-http-connector diff --git a/connectors/httpclient/pom.xml b/connectors/httpclient/pom.xml index 943c0c614..7303712a5 100644 --- a/connectors/httpclient/pom.xml +++ b/connectors/httpclient/pom.xml @@ -3,7 +3,7 @@ org.pacesys.openstack4j.connectors openstack4j-connectors - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j-httpclient diff --git a/connectors/jersey2/pom.xml b/connectors/jersey2/pom.xml index 8bca35bd2..1269507dd 100644 --- a/connectors/jersey2/pom.xml +++ b/connectors/jersey2/pom.xml @@ -3,7 +3,7 @@ org.pacesys.openstack4j.connectors openstack4j-connectors - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j-jersey2 diff --git a/connectors/okhttp/pom.xml b/connectors/okhttp/pom.xml index c1d1ac11a..f134ad0b8 100644 --- a/connectors/okhttp/pom.xml +++ b/connectors/okhttp/pom.xml @@ -3,7 +3,7 @@ org.pacesys.openstack4j.connectors openstack4j-connectors - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j-okhttp diff --git a/connectors/pom.xml b/connectors/pom.xml index ae10b599d..20a104937 100644 --- a/connectors/pom.xml +++ b/connectors/pom.xml @@ -3,7 +3,7 @@ org.pacesys openstack4j-parent - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 org.pacesys.openstack4j.connectors diff --git a/connectors/resteasy/pom.xml b/connectors/resteasy/pom.xml index 012fea2ec..1b8316174 100644 --- a/connectors/resteasy/pom.xml +++ b/connectors/resteasy/pom.xml @@ -3,7 +3,7 @@ org.pacesys.openstack4j.connectors openstack4j-connectors - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j-resteasy diff --git a/core-integration-test/it-httpclient/pom.xml b/core-integration-test/it-httpclient/pom.xml index 29d408ecc..5b873de72 100644 --- a/core-integration-test/it-httpclient/pom.xml +++ b/core-integration-test/it-httpclient/pom.xml @@ -4,7 +4,7 @@ org.pacesys openstack4j-core-integration-test - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT it-httpclient OpenStack4j IntegrationTest Apache HttpClient diff --git a/core-integration-test/it-jersey2/pom.xml b/core-integration-test/it-jersey2/pom.xml index 83b966e55..6a0a28856 100644 --- a/core-integration-test/it-jersey2/pom.xml +++ b/core-integration-test/it-jersey2/pom.xml @@ -4,7 +4,7 @@ org.pacesys openstack4j-core-integration-test - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT it-jersey2 OpenStack4j IntegrationTest Jersey2 Connector diff --git a/core-integration-test/it-okhttp/pom.xml b/core-integration-test/it-okhttp/pom.xml index 6fb1142a9..1b96c326e 100644 --- a/core-integration-test/it-okhttp/pom.xml +++ b/core-integration-test/it-okhttp/pom.xml @@ -4,7 +4,7 @@ org.pacesys openstack4j-core-integration-test - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT it-okhttp OpenStack4j IntegrationTest OKHttp Connector diff --git a/core-integration-test/it-resteasy/pom.xml b/core-integration-test/it-resteasy/pom.xml index d7964c114..b305ee0b1 100644 --- a/core-integration-test/it-resteasy/pom.xml +++ b/core-integration-test/it-resteasy/pom.xml @@ -4,7 +4,7 @@ org.pacesys openstack4j-core-integration-test - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT it-resteasy OpenStack4j IntegrationTest RestEasy Connector diff --git a/core-integration-test/pom.xml b/core-integration-test/pom.xml index 83338c189..1aab116ca 100644 --- a/core-integration-test/pom.xml +++ b/core-integration-test/pom.xml @@ -3,7 +3,7 @@ org.pacesys openstack4j-parent - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j-core-integration-test diff --git a/core-test/pom.xml b/core-test/pom.xml index fb9ce40ba..727b34c6a 100644 --- a/core-test/pom.xml +++ b/core-test/pom.xml @@ -3,7 +3,7 @@ org.pacesys openstack4j-parent - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j-core-test diff --git a/core/pom.xml b/core/pom.xml index db0c4f2b7..7101e18c9 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -3,7 +3,7 @@ org.pacesys openstack4j-parent - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j-core diff --git a/distribution/pom.xml b/distribution/pom.xml index fd5778570..15eb8cadd 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -3,7 +3,7 @@ org.pacesys openstack4j-parent - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT 4.0.0 openstack4j diff --git a/pom.xml b/pom.xml index bae1efc64..187e69b9d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ 4.0.0 org.pacesys openstack4j-parent - 3.2.1-SNAPSHOT + 4.0.0-SNAPSHOT OpenStack4j Parent OpenStack Java API http://github.com/ContainX/openstack4j/ From 406222223160deee967c6a92ceff2a68605e7c9f Mon Sep 17 00:00:00 2001 From: wushaohan Date: Sat, 7 Nov 2020 21:47:03 +0800 Subject: [PATCH 3/9] add time field for network/subnet/port --- .../resources/network/network-external.json | 4 ++- .../src/main/resources/network/network.json | 4 ++- .../main/resources/network/port_external.json | 4 ++- .../resources/network/ports_external.json | 8 +++-- .../main/resources/network/subnet_ipv6.json | 4 +-- .../openstack4j/model/common/TimeEntity.java | 26 ++++++++++++++ .../openstack4j/model/network/Network.java | 3 +- .../org/openstack4j/model/network/Port.java | 3 +- .../org/openstack4j/model/network/Subnet.java | 3 +- .../networking/domain/NeutronNetwork.java | 28 +++++++++++++-- .../networking/domain/NeutronPort.java | 23 ++++++++++-- .../networking/domain/NeutronSubnet.java | 35 +++++++++++++++---- 12 files changed, 124 insertions(+), 21 deletions(-) create mode 100644 core/src/main/java/org/openstack4j/model/common/TimeEntity.java diff --git a/core-test/src/main/resources/network/network-external.json b/core-test/src/main/resources/network/network-external.json index c1514986c..a5a31a084 100644 --- a/core-test/src/main/resources/network/network-external.json +++ b/core-test/src/main/resources/network/network-external.json @@ -20,6 +20,8 @@ "router:external": true, "shared": false, "port_security_enabled": true, - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c" + "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", + "created_at": "2020-10-30T22:16:01Z", + "updated_at": "2020-10-30T22:16:01Z" } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/network.json b/core-test/src/main/resources/network/network.json index edefd31d1..0778be11d 100644 --- a/core-test/src/main/resources/network/network.json +++ b/core-test/src/main/resources/network/network.json @@ -19,6 +19,8 @@ ], "shared": false, "port_security_enabled": true, - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c" + "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", + "created_at": "2020-10-30T22:16:01Z", + "updated_at": "2020-10-30T22:16:01Z" } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/port_external.json b/core-test/src/main/resources/network/port_external.json index a110bf540..0e81a7549 100644 --- a/core-test/src/main/resources/network/port_external.json +++ b/core-test/src/main/resources/network/port_external.json @@ -13,6 +13,8 @@ }, "binding:vnic_type": "baremetal", "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "device_owner": "baremetal:none" + "device_owner": "baremetal:none", + "created_at": "2020-10-30T22:16:01Z", + "updated_at": "2020-10-30T22:16:01Z" } } \ No newline at end of file diff --git a/core-test/src/main/resources/network/ports_external.json b/core-test/src/main/resources/network/ports_external.json index 90ef43e3d..ec7e78541 100644 --- a/core-test/src/main/resources/network/ports_external.json +++ b/core-test/src/main/resources/network/ports_external.json @@ -22,7 +22,9 @@ "f0ac4394-7e4a-4409-9701-ba8be283dbc3" ], "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" + "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", + "created_at": "2020-10-30T22:16:01Z", + "updated_at": "2020-10-30T22:16:01Z" }, { "admin_state_up": false, @@ -46,7 +48,9 @@ "f0ac4394-7e4a-4409-9701-ba8be283dbc3" ], "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" + "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", + "created_at": "2020-10-30T22:16:01Z", + "updated_at": "2020-10-30T22:16:01Z" } ] } \ No newline at end of file diff --git a/core-test/src/main/resources/network/subnet_ipv6.json b/core-test/src/main/resources/network/subnet_ipv6.json index 93ead69df..4688f3121 100644 --- a/core-test/src/main/resources/network/subnet_ipv6.json +++ b/core-test/src/main/resources/network/subnet_ipv6.json @@ -18,13 +18,13 @@ "gateway_ip": "2620:0:2d0:200::1", "cidr": "2620:0:2d0:200::/64", "id": "3b80198d-4f7b-4f77-9ef5-774d54e17126", - "created_at": "2016-10-10T14:35:47Z", "description": "", "ipv6_address_mode": "dhcpv6-stateful", "ipv6_ra_mode": "dhcpv6-stateful", "revision_number": 2, "service_types": [], "subnetpool_id": null, - "updated_at": "2016-10-10T14:35:47Z" + "created_at": "2020-10-30T22:16:01Z", + "updated_at": "2020-10-30T22:16:01Z" } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/common/TimeEntity.java b/core/src/main/java/org/openstack4j/model/common/TimeEntity.java new file mode 100644 index 000000000..8be3e182a --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/common/TimeEntity.java @@ -0,0 +1,26 @@ +package org.openstack4j.model.common; + +import java.util.Date; + +/** + * A simple entity which supports time data + * + * @author bboyHan + */ +public interface TimeEntity { + + /** + * created time + * + * @return created time + */ + Date getCreatedTime(); + + /** + * updated time + * + * @return updated time + */ + Date getUpdatedTime(); + +} diff --git a/core/src/main/java/org/openstack4j/model/network/Network.java b/core/src/main/java/org/openstack4j/model/network/Network.java index 92693c393..4c821c8ea 100644 --- a/core/src/main/java/org/openstack4j/model/network/Network.java +++ b/core/src/main/java/org/openstack4j/model/network/Network.java @@ -2,6 +2,7 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; +import org.openstack4j.model.common.TimeEntity; import org.openstack4j.model.network.builder.NetworkBuilder; import java.util.List; @@ -11,7 +12,7 @@ * * @author Jeremy Unruh */ -public interface Network extends Resource, Buildable { +public interface Network extends Resource, TimeEntity, Buildable { /** * @return the status of the network diff --git a/core/src/main/java/org/openstack4j/model/network/Port.java b/core/src/main/java/org/openstack4j/model/network/Port.java index 696c28e61..496539b74 100644 --- a/core/src/main/java/org/openstack4j/model/network/Port.java +++ b/core/src/main/java/org/openstack4j/model/network/Port.java @@ -2,6 +2,7 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; +import org.openstack4j.model.common.TimeEntity; import org.openstack4j.model.network.builder.PortBuilder; import java.util.List; @@ -13,7 +14,7 @@ * * @author Jeremy Unruh */ -public interface Port extends Resource, Buildable { +public interface Port extends Resource, TimeEntity, Buildable { /** * @return the current state of the port diff --git a/core/src/main/java/org/openstack4j/model/network/Subnet.java b/core/src/main/java/org/openstack4j/model/network/Subnet.java index 4850878f5..db5e7dc55 100644 --- a/core/src/main/java/org/openstack4j/model/network/Subnet.java +++ b/core/src/main/java/org/openstack4j/model/network/Subnet.java @@ -2,6 +2,7 @@ import org.openstack4j.common.Buildable; import org.openstack4j.model.common.Resource; +import org.openstack4j.model.common.TimeEntity; import org.openstack4j.model.network.builder.SubnetBuilder; import java.util.List; @@ -11,7 +12,7 @@ * * @author Jeremy Unruh */ -public interface Subnet extends Resource, Buildable { +public interface Subnet extends Resource, TimeEntity, Buildable { /** * @return true if DHCP is enabled for this subnet, false if not. diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java index 0328d85ce..f4dff1042 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java @@ -13,6 +13,7 @@ import org.openstack4j.openstack.common.ListResult; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -49,7 +50,9 @@ public class NeutronNetwork implements Network { @JsonProperty("availability_zones") private List availabilityZones; @JsonProperty("created_at") - private String createdTime; + private Date createdTime; + @JsonProperty("updated_at") + private Date updatedTime; /** * The maximum transmission unit (MTU) value to address fragmentation. Minimum value is 68 for IPv4, and 1280 for IPv6. @@ -222,6 +225,21 @@ public List getAvailabilityZones() { return availabilityZones; } + /** + * {@inheritDoc} + */ + @Override + public Date getCreatedTime() { + return createdTime; + } + + /** + * {@inheritDoc} + */ + @Override + public Date getUpdatedTime() { + return updatedTime; + } /** * {@inheritDoc} @@ -233,6 +251,7 @@ public String toString() { .add("adminStateUp", adminStateUp).add("tenantId", tenantId).add("provider:network_type", networkType).add("router:external", routerExternal) .add("id", id).add("shared", shared).add("provider:segmentation_id", providerSegID) .add("mtu", mtu).add("availabilityZoneHints", availabilityZoneHints).add("availabilityZones", availabilityZones) + .add("created_at", createdTime).add("updated_at", updatedTime) .toString(); } @@ -243,7 +262,8 @@ public String toString() { public int hashCode() { return java.util.Objects.hash(name, status, subnets, providerPhyNet, adminStateUp, tenantId, networkType, - routerExternal, id, shared, providerSegID, availabilityZoneHints, availabilityZones); + routerExternal, id, shared, providerSegID, availabilityZoneHints, availabilityZones, + createdTime, updatedTime); } /** @@ -269,7 +289,9 @@ public boolean equals(Object obj) { java.util.Objects.equals(shared, that.shared) && java.util.Objects.equals(providerSegID, that.providerSegID) && java.util.Objects.equals(availabilityZoneHints, that.availabilityZoneHints) && - java.util.Objects.equals(availabilityZones, that.availabilityZones)) { + java.util.Objects.equals(availabilityZones, that.availabilityZones) && + java.util.Objects.equals(createdTime, that.createdTime) && + java.util.Objects.equals(updatedTime, that.updatedTime)) { return true; } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java index 1d56342f1..e56bb0476 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java @@ -78,6 +78,12 @@ public class NeutronPort implements Port { @JsonProperty("binding:profile") private Map profile; + @JsonProperty("created_at") + private Date createdTime; + + @JsonProperty("updated_at") + private Date updatedTime; + public static PortBuilder builder() { return new PortConcreteBuilder(); } @@ -223,6 +229,16 @@ public Map getProfile() { return profile; } + @Override + public Date getCreatedTime() { + return createdTime; + } + + @Override + public Date getUpdatedTime() { + return updatedTime; + } + /** * {@inheritDoc} */ @@ -288,6 +304,7 @@ public String toString() { .add("allowed_address_pairs", allowedAddressPairs).add("port_security_enabled ", portSecurityEnabled) .add("binding:host_id", hostId).add("binding:vif_type", vifType).add("binding:vif_details", vifDetails) .add("binding:vnic_type", vNicType).add("binding:profile", profile) + .add("created_at", createdTime).add("updated_at", updatedTime) .toString(); } @@ -299,7 +316,7 @@ public int hashCode() { return java.util.Objects.hash(id, name, adminStateUp, deviceId, deviceOwner, fixedIps, macAddress, networkId, tenantId, securityGroups, allowedAddressPairs, portSecurityEnabled, hostId, - vifType, vifDetails, vNicType, profile); + vifType, vifDetails, vNicType, profile, createdTime, updatedTime); } /** @@ -329,7 +346,9 @@ public boolean equals(Object obj) { java.util.Objects.equals(vifType, that.vifType) && java.util.Objects.equals(vifDetails, that.vifDetails) && java.util.Objects.equals(vNicType, that.vNicType) && - java.util.Objects.equals(profile, that.profile)) { + java.util.Objects.equals(profile, that.profile) && + java.util.Objects.equals(createdTime, that.createdTime) && + java.util.Objects.equals(updatedTime, that.updatedTime)) { return true; } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java index ece254625..4d8dab62f 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java @@ -10,6 +10,7 @@ import org.openstack4j.model.network.builder.SubnetBuilder; import org.openstack4j.openstack.common.ListResult; +import java.util.Date; import java.util.List; /** @@ -46,13 +47,17 @@ public class NeutronSubnet implements Subnet { private Ipv6AddressMode ipv6AddressMode; @JsonProperty("ipv6_ra_mode") private Ipv6RaMode ipv6RaMode; + @JsonProperty("created_at") + private Date createdTime; + @JsonProperty("updated_at") + private Date updatedTime; public NeutronSubnet() { } public NeutronSubnet(String id, String name, boolean enableDHCP, String networkId, String tenantId, List dnsNames, List pools, List hostRoutes, IPVersionType ipVersion, - String gateway, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode) { + String gateway, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode, Date createdTime, Date updatedTime) { this.id = id; this.name = name; this.enableDHCP = enableDHCP; @@ -66,6 +71,8 @@ public NeutronSubnet(String id, String name, boolean enableDHCP, String networkI this.cidr = cidr; this.ipv6AddressMode = ipv6AddressMode; this.ipv6RaMode = ipv6RaMode; + this.createdTime = createdTime; + this.updatedTime = updatedTime; } public static SubnetBuilder builder() { @@ -207,6 +214,16 @@ public Ipv6RaMode getIpv6RaMode() { return ipv6RaMode; } + @Override + public Date getCreatedTime() { + return createdTime; + } + + @Override + public Date getUpdatedTime() { + return updatedTime; + } + /** * {@inheritDoc} */ @@ -217,6 +234,7 @@ public String toString() { .add("tenant_id", tenantId).add("dns_nameservers", dnsNames).add("allocation_pools", pools) .add("host_routes", hostRoutes).add("ip_version", ipVersion).add("gateway_ip", gateway).add("cidr", cidr) .add("ipv6AddressMode", ipv6AddressMode).add("ipv6RaMode", ipv6RaMode) + .add("created_at", createdTime).add("updated_at", updatedTime) .toString(); } @@ -227,7 +245,7 @@ public String toString() { public int hashCode() { return java.util.Objects.hash(id, name, enableDHCP, networkId, tenantId, dnsNames, pools, hostRoutes, ipVersion, gateway, - cidr, ipv6AddressMode, ipv6RaMode); + cidr, ipv6AddressMode, ipv6RaMode, createdTime, updatedTime); } /** @@ -253,7 +271,9 @@ public boolean equals(Object obj) { java.util.Objects.equals(gateway, that.gateway) && java.util.Objects.equals(cidr, that.cidr) && java.util.Objects.equals(ipv6AddressMode, that.ipv6AddressMode) && - java.util.Objects.equals(ipv6RaMode, that.ipv6RaMode)) { + java.util.Objects.equals(ipv6RaMode, that.ipv6RaMode) && + java.util.Objects.equals(createdTime, that.createdTime) && + java.util.Objects.equals(updatedTime, that.updatedTime)) { return true; } } @@ -270,8 +290,10 @@ public static class NeutronSubnetNoGateway extends NeutronSubnet { public NeutronSubnetNoGateway(String id, String name, boolean enableDHCP, String networkId, String tenantId, List dnsNames, List pools, List hostRoutes, - IPVersionType ipVersion, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode) { - super(id, name, enableDHCP, networkId, tenantId, dnsNames, pools, hostRoutes, ipVersion, null, cidr, ipv6AddressMode, ipv6RaMode); + IPVersionType ipVersion, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode, + Date createdTime, Date updatedTime) { + super(id, name, enableDHCP, networkId, tenantId, dnsNames, pools, hostRoutes, ipVersion, null, + cidr, ipv6AddressMode, ipv6RaMode, createdTime, updatedTime); this.gateway = null; } } @@ -368,7 +390,8 @@ public SubnetBuilder ipv6RaMode(Ipv6RaMode ipv6RaMode) { public Subnet build() { if (isNoGateway) { return new NeutronSubnetNoGateway(m.id, m.name, m.enableDHCP, m.networkId, - m.tenantId, m.dnsNames, m.pools, m.hostRoutes, m.ipVersion, m.cidr, m.ipv6AddressMode, m.ipv6RaMode); + m.tenantId, m.dnsNames, m.pools, m.hostRoutes, m.ipVersion, m.cidr, + m.ipv6AddressMode, m.ipv6RaMode, m.createdTime, m.updatedTime); } return m; } From 06413336950c84c28636ce43f86794d97118381f Mon Sep 17 00:00:00 2001 From: wushaohan Date: Sat, 7 Nov 2020 22:20:00 +0800 Subject: [PATCH 4/9] add (Neutron) resource tags operation. --- .../api/network/NeutronTagTests.java | 79 +++++++++++++++++ .../src/main/resources/network/tags.json | 3 + .../api/networking/NetworkingService.java | 5 ++ .../networking/NeutronResourceTagService.java | 67 +++++++++++++++ .../openstack4j/model/network/Resource.java | 36 ++++++++ .../internal/BaseOpenStackService.java | 8 ++ .../networking/domain/NeutronResourceTag.java | 38 +++++++++ .../internal/NetworkingServiceImpl.java | 7 ++ .../NeutronResourceTagServiceImpl.java | 84 +++++++++++++++++++ .../provider/DefaultAPIProvider.java | 1 + 10 files changed, 328 insertions(+) create mode 100644 core-test/src/main/java/org/openstack4j/api/network/NeutronTagTests.java create mode 100644 core-test/src/main/resources/network/tags.json create mode 100644 core/src/main/java/org/openstack4j/api/networking/NeutronResourceTagService.java create mode 100644 core/src/main/java/org/openstack4j/model/network/Resource.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronResourceTag.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/internal/NeutronResourceTagServiceImpl.java diff --git a/core-test/src/main/java/org/openstack4j/api/network/NeutronTagTests.java b/core-test/src/main/java/org/openstack4j/api/network/NeutronTagTests.java new file mode 100644 index 000000000..1b166e7df --- /dev/null +++ b/core-test/src/main/java/org/openstack4j/api/network/NeutronTagTests.java @@ -0,0 +1,79 @@ +package org.openstack4j.api.network; + +import org.openstack4j.api.AbstractTest; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.Resource; +import org.openstack4j.openstack.networking.domain.NeutronResourceTag; +import org.testng.annotations.Test; + +import java.util.List; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +/** + * Test cases for (Neutron) Resource Tag based Services + * + * @author bboyHan + */ +@Test(suiteName="NeutronTagTests") +public class NeutronTagTests extends AbstractTest { + + private static final String JSON_SECURITY_GROUP_TAGS = "/network/tags.json"; + + @Test + public void listTags() throws Exception { + respondWith(JSON_SECURITY_GROUP_TAGS); + NeutronResourceTag sgTags = osv3().networking().resourceTags().list(Resource.NETWORK, "1"); + List tags = sgTags.getTags(); + assertEquals(2, tags.size()); + assertEquals("tag1", tags.get(0)); + } + + @Test + public void replaceTags() { + String jsonResponse = "{\"tags\": [\"newTag1\", \"newTag2\"]}"; + respondWith(200, jsonResponse); + NeutronResourceTag sgTags = new NeutronResourceTag(); + sgTags.addTag("newTag1"); + sgTags.addTag("newTag2"); + NeutronResourceTag newTags = osv3().networking().resourceTags().replace(Resource.NETWORK, "1", sgTags); + + assertEquals(sgTags.getTags(), newTags.getTags()); + } + + @Test + public void deleteAllTags() { + respondWith(204); + ActionResponse delete = osv3().networking().resourceTags().deleteAll(Resource.NETWORK, "1"); + System.out.println(delete.getCode()); + assertTrue(delete.isSuccess()); + } + + @Test + public void checkTag() { + respondWith(204); + ActionResponse check = osv3().networking().resourceTags().check(Resource.NETWORK, "1", "tag1"); + assertTrue(check.isSuccess()); + } + + @Test + public void addTag() { + respondWith(204); + ActionResponse check = osv3().networking().resourceTags().addSingle(Resource.NETWORK, "1", "tag"); + assertTrue(check.isSuccess()); + } + + @Test + public void deleteTag() { + respondWith(204); + ActionResponse delete = osv3().networking().resourceTags().delete(Resource.NETWORK, "1", "tag1"); + assertTrue(delete.isSuccess()); + } + + @Override + protected Service service() { + return Service.NETWORK; + } + +} diff --git a/core-test/src/main/resources/network/tags.json b/core-test/src/main/resources/network/tags.json new file mode 100644 index 000000000..0103db685 --- /dev/null +++ b/core-test/src/main/resources/network/tags.json @@ -0,0 +1,3 @@ +{ + "tags": ["tag1", "tag2"] +} \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java index 9d4fb9e50..37fd49ef0 100644 --- a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java +++ b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java @@ -76,4 +76,9 @@ public interface NetworkingService extends RestService { * @return the Availability Zone Service API */ AvailabilityZoneService availabilityzone(); + + /** + * @return the (Neutron) Resource Tag Service API + */ + NeutronResourceTagService resourceTags(); } diff --git a/core/src/main/java/org/openstack4j/api/networking/NeutronResourceTagService.java b/core/src/main/java/org/openstack4j/api/networking/NeutronResourceTagService.java new file mode 100644 index 000000000..17d20140a --- /dev/null +++ b/core/src/main/java/org/openstack4j/api/networking/NeutronResourceTagService.java @@ -0,0 +1,67 @@ +package org.openstack4j.api.networking; + +import org.openstack4j.common.RestService; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.Resource; +import org.openstack4j.openstack.networking.domain.NeutronResourceTag; + +/** + * @author bboyHan + */ +public interface NeutronResourceTagService extends RestService { + + /** + * Confirms a given tag is set on the resource. + * + * @param resource resource type + * @param resourceId resource id + * @param tag tag + * @return the ActionResponse + */ + ActionResponse check(Resource resource, String resourceId, String tag); + + /** + * Obtains the (Neutron) resource tags for a resource. + * + * @param resource resource type + * @param resourceId resource id + * @return the NeutronResourceTag + */ + NeutronResourceTag list(Resource resource, String resourceId); + + /** + * Add tag to the resource. + * + * @param resourceId resource id + * @param tag tag + * @return the ActionResponse + */ + ActionResponse addSingle(Resource resource, String resourceId, String tag); + + /** + * reset all tags from the resource + * + * @param resourceId resource id + * @param tags tags + * @return the NeutronResourceTag + */ + NeutronResourceTag replace(Resource resource, String resourceId, NeutronResourceTag tags); + + /** + * Delete tag from the resource. + * + * @param resourceId resource id + * @param tag tag + * @return the ActionResponse + */ + ActionResponse delete(Resource resource, String resourceId, String tag); + + /** + * Remove all tags from the resource + * + * @param resourceId resource id + * @return the ActionResponse + */ + ActionResponse deleteAll(Resource resource, String resourceId); + +} diff --git a/core/src/main/java/org/openstack4j/model/network/Resource.java b/core/src/main/java/org/openstack4j/model/network/Resource.java new file mode 100644 index 000000000..28ed0d5d3 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/Resource.java @@ -0,0 +1,36 @@ +package org.openstack4j.model.network; + +/** + * The resource of Neutron + * + * @author bboyHan + */ +public enum Resource { + + SECURITY_GROUP("security-groups"), + NETWORK("networks"), + SUBNET("subnets"), + PORT("ports"), + ROUTER("routers"), + SUBNET_POOL("subnetpools"), + FLOATING_IP("floatingips"), + QOS_POLICY("policies"), + TRUNK("trunks"); + + private final String value; + + Resource(String value) { + this.value = value; + } + + public static String forValue(Resource resource) { + if (resource != null) { + for (Resource s : Resource.values()) { + if (s.name().equalsIgnoreCase(resource.name())) + return s.value; + } + } + return null; + } + +} diff --git a/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java b/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java index 782536bb3..6eb1a1bb2 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java @@ -48,6 +48,10 @@ protected Invocation get(Class returnType, String... path) { return builder(returnType, path, HttpMethod.GET); } + protected Invocation getWithResponse(String... path) { + return builder(ActionResponse.class, path, HttpMethod.GET); + } + protected Invocation post(Class returnType, String... path) { return builder(returnType, path, HttpMethod.POST); } @@ -60,6 +64,10 @@ protected Invocation put(Class returnType, String... path) { return builder(returnType, path, HttpMethod.PUT); } + protected Invocation putWithResponse(String... path) { + return builder(ActionResponse.class, path, HttpMethod.PUT); + } + protected Invocation patch(Class returnType, String... path) { return builder(returnType, path, HttpMethod.PATCH); } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronResourceTag.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronResourceTag.java new file mode 100644 index 000000000..1c893ee82 --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronResourceTag.java @@ -0,0 +1,38 @@ +package org.openstack4j.openstack.networking.domain; + +import com.google.common.base.MoreObjects; +import org.openstack4j.model.ModelEntity; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Neutron Resource Tags Entity + * + * @author bboyHan + */ +public class NeutronResourceTag implements ModelEntity { + + private static final long serialVersionUID = 1L; + + private List tags = new ArrayList<>(); + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public void addTag(String... tags) { + this.tags.addAll(Arrays.asList(tags)); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues().add("tags", tags).toString(); + } + +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java index e83ad56d2..79818ff4b 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java @@ -115,4 +115,11 @@ public AvailabilityZoneService availabilityzone() { return Apis.get(AvailabilityZoneService.class); } + /** + * {@inheritDoc} + */ + @Override + public NeutronResourceTagService resourceTags() { + return Apis.get(NeutronResourceTagService.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/NeutronResourceTagServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/NeutronResourceTagServiceImpl.java new file mode 100644 index 000000000..f1af1aabf --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/NeutronResourceTagServiceImpl.java @@ -0,0 +1,84 @@ +package org.openstack4j.openstack.networking.internal; + +import org.openstack4j.api.networking.NeutronResourceTagService; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.Resource; +import org.openstack4j.openstack.networking.domain.NeutronResourceTag; + +import static com.google.common.base.Preconditions.checkNotNull; + +/** + * Allows users to set (Neutron) Resource tags on their resources. + * + * @author bboyHan + */ +public class NeutronResourceTagServiceImpl extends BaseNetworkingServices implements NeutronResourceTagService { + + @Override + public ActionResponse check(Resource resource, String resourceId, String tag) { + checkNotNull(resourceId); + checkNotNull(tag); + checkNotNull(resource); + String resourceType = checkNotNull(Resource.forValue(resource)); + return getWithResponse(uri("/%s/%s/tags/%s", resourceType ,resourceId, tag)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public NeutronResourceTag list(Resource resource, String securityGroupId) { + checkNotNull(securityGroupId); + checkNotNull(resource); + String resourceType = checkNotNull(Resource.forValue(resource)); + return get(NeutronResourceTag.class, uri("/%s/%s/tags", resourceType, securityGroupId)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse addSingle(Resource resource, String securityGroupId, String tag) { + checkNotNull(securityGroupId); + checkNotNull(tag); + checkNotNull(resource); + String resourceType = checkNotNull(Resource.forValue(resource)); + return putWithResponse(uri("/%s/%s/tags/%s", resourceType, securityGroupId, tag)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public NeutronResourceTag replace(Resource resource, String securityGroupId, NeutronResourceTag tags) { + checkNotNull(securityGroupId); + checkNotNull(tags); + checkNotNull(resource); + String resourceType = checkNotNull(Resource.forValue(resource)); + return put(NeutronResourceTag.class, uri("/%s/%s/tags", resourceType, securityGroupId)).entity(tags).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(Resource resource, String securityGroupId, String tag) { + checkNotNull(securityGroupId); + checkNotNull(tag); + checkNotNull(resource); + String resourceType = checkNotNull(Resource.forValue(resource)); + return deleteWithResponse(uri("/%s/%s/tags/%s", resourceType, securityGroupId, tag)).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse deleteAll(Resource resource, String securityGroupId) { + checkNotNull(securityGroupId); + checkNotNull(resource); + String resourceType = checkNotNull(Resource.forValue(resource)); + return deleteWithResponse(uri("/%s/%s/tags", resourceType, securityGroupId)).execute(); + } + +} diff --git a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java index 4c0668550..d5eb2273c 100644 --- a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java +++ b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java @@ -282,6 +282,7 @@ public void initialize() { bind(ActionExecutionService.class, ActionExecutionServiceImpl.class); bind(WorkflowEnvironmentService.class, WorkflowEnvironmentServiceImpl.class); bind(CronTriggerService.class, CronTriggerServiceImpl.class); + bind(NeutronResourceTagService.class, NeutronResourceTagServiceImpl.class); } /** From 6b78461898a60e21c834d64fea1cc0a631892fc1 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Sat, 7 Nov 2020 23:25:13 +0800 Subject: [PATCH 5/9] add (Neutron) network-ip-availabilities api --- .../network/NetworkIPAvailabilityTests.java | 53 +++++++ .../network/network_ip_availabilities.json | 56 +++++++ .../network/network_ip_availability.json | 28 ++++ .../api/networking/NetworkingService.java | 5 + .../ext/NetworkIPAvailabilityService.java | 29 ++++ .../model/common/BaseListOptions.java | 52 +++++++ .../model/network/NetworkIPAvailability.java | 25 +++ .../model/network/SubnetIpAvailability.java | 21 +++ .../options/NetIpAvailListOptions.java | 42 +++++ .../ext/NeutronNetworkIPAvailability.java | 145 ++++++++++++++++++ .../ext/NeutronSubnetIpAvailability.java | 67 ++++++++ .../internal/NetworkingServiceImpl.java | 8 + .../ext/NetworkIPAvailabilityServiceImpl.java | 54 +++++++ .../provider/DefaultAPIProvider.java | 1 + 14 files changed, 586 insertions(+) create mode 100644 core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java create mode 100644 core-test/src/main/resources/network/network_ip_availabilities.json create mode 100644 core-test/src/main/resources/network/network_ip_availability.json create mode 100644 core/src/main/java/org/openstack4j/api/networking/ext/NetworkIPAvailabilityService.java create mode 100644 core/src/main/java/org/openstack4j/model/common/BaseListOptions.java create mode 100644 core/src/main/java/org/openstack4j/model/network/NetworkIPAvailability.java create mode 100644 core/src/main/java/org/openstack4j/model/network/SubnetIpAvailability.java create mode 100644 core/src/main/java/org/openstack4j/model/network/options/NetIpAvailListOptions.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronNetworkIPAvailability.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSubnetIpAvailability.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetworkIPAvailabilityServiceImpl.java diff --git a/core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java b/core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java new file mode 100644 index 000000000..579e1bda1 --- /dev/null +++ b/core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java @@ -0,0 +1,53 @@ +package org.openstack4j.api.network; + +import org.openstack4j.api.AbstractTest; +import org.openstack4j.model.network.NetworkIPAvailability; +import org.openstack4j.model.network.options.NetIpAvailListOptions; +import org.testng.annotations.Test; + +import java.util.List; + +import static org.testng.Assert.assertEquals; + +/** + * Test cases for Network IP availabilities based Services + * + * @author bboyHan + */ +@Test(suiteName = "NetworkIPAvailabilityTests") +public class NetworkIPAvailabilityTests extends AbstractTest { + + private static final String NETWORK_IP_AVAILABILITY_JSON = "/network/network_ip_availability.json"; + private static final String NETWORK_IP_AVAILABILITIES_JSON = "/network/network_ip_availabilities.json"; + + @Test + public void get() throws Exception { + respondWith(NETWORK_IP_AVAILABILITY_JSON); + NetworkIPAvailability networkIPAvailability = osv3().networking().networkIPAvailability().get("networkId"); + server.takeRequest(); + assertEquals("6801d9c8-20e6-4b27-945d-62499f00002e", networkIPAvailability.getNetworkId()); + } + + @Test + public void list() throws Exception { + respondWith(NETWORK_IP_AVAILABILITIES_JSON); + List networkIPAvailabilities = osv3().networking().networkIPAvailability().list(); + server.takeRequest(); + assertEquals(2, networkIPAvailabilities.size()); + } + + @Test + public void listByOptions() throws Exception { + respondWith(NETWORK_IP_AVAILABILITIES_JSON); + NetIpAvailListOptions options = NetIpAvailListOptions.create().networkId("networkId"); + List networkIPAvailabilities = osv3().networking().networkIPAvailability().list(); + server.takeRequest(); + assertEquals(2, networkIPAvailabilities.size()); + } + + @Override + protected Service service() { + return Service.NETWORK; + } + +} diff --git a/core-test/src/main/resources/network/network_ip_availabilities.json b/core-test/src/main/resources/network/network_ip_availabilities.json new file mode 100644 index 000000000..fcf99496d --- /dev/null +++ b/core-test/src/main/resources/network/network_ip_availabilities.json @@ -0,0 +1,56 @@ +{ + "network_ip_availabilities": [ + { + "network_id": "4cf895c9-c3d1-489e-b02e-59b5c8976809", + "network_name": "public", + "subnet_ip_availability": [ + { + "cidr": "2001:db8::/64", + "ip_version": 6, + "subnet_id": "ca3f46c4-c6ff-4272-9be4-0466f84c6077", + "subnet_name": "ipv6-public-subnet", + "total_ips": 18446744073709552000, + "used_ips": 1 + }, + { + "cidr": "172.24.4.0/24", + "ip_version": 4, + "subnet_id": "cc02efc1-9d47-46bd-bab6-760919c836b5", + "subnet_name": "public-subnet", + "total_ips": 253, + "used_ips": 1 + } + ], + "project_id": "1a02cc95f1734fcc9d3c753818f03002", + "tenant_id": "1a02cc95f1734fcc9d3c753818f03002", + "total_ips": 253, + "used_ips": 2 + }, + { + "network_id": "6801d9c8-20e6-4b27-945d-62499f00002e", + "network_name": "private", + "subnet_ip_availability": [ + { + "cidr": "10.0.0.0/24", + "ip_version": 4, + "subnet_id": "44e70d00-80a2-4fb1-ab59-6190595ceb61", + "subnet_name": "private-subnet", + "total_ips": 253, + "used_ips": 2 + }, + { + "ip_version": 6, + "cidr": "fdbf:ac66:9be8::/64", + "subnet_id": "a90623df-00e1-4902-a675-40674385d74c", + "subnet_name": "ipv6-private-subnet", + "total_ips": 18446744073709552000, + "used_ips": 2 + } + ], + "project_id": "d56d3b8dd6894a508cf41b96b522328c", + "tenant_id": "d56d3b8dd6894a508cf41b96b522328c", + "total_ips": 18446744073709552000, + "used_ips": 4 + } + ] +} \ No newline at end of file diff --git a/core-test/src/main/resources/network/network_ip_availability.json b/core-test/src/main/resources/network/network_ip_availability.json new file mode 100644 index 000000000..634bb28c8 --- /dev/null +++ b/core-test/src/main/resources/network/network_ip_availability.json @@ -0,0 +1,28 @@ +{ + "network_ip_availability": { + "used_ips": 4, + "subnet_ip_availability": [ + { + "used_ips": 2, + "subnet_id": "44e70d00-80a2-4fb1-ab59-6190595ceb61", + "subnet_name": "private-subnet", + "ip_version": 4, + "cidr": "10.0.0.0/24", + "total_ips": 253 + }, + { + "used_ips": 2, + "subnet_id": "a90623df-00e1-4902-a675-40674385d74c", + "subnet_name": "ipv6-private-subnet", + "ip_version": 6, + "cidr": "fdbf:ac66:9be8::/64", + "total_ips": 18446744073709552000 + } + ], + "network_id": "6801d9c8-20e6-4b27-945d-62499f00002e", + "project_id": "d56d3b8dd6894a508cf41b96b522328c", + "tenant_id": "d56d3b8dd6894a508cf41b96b522328c", + "total_ips": 18446744073709552000, + "network_name": "private" + } +} \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java index 37fd49ef0..726653696 100644 --- a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java +++ b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java @@ -81,4 +81,9 @@ public interface NetworkingService extends RestService { * @return the (Neutron) Resource Tag Service API */ NeutronResourceTagService resourceTags(); + + /** + * @return the Network IP Availability Service API + */ + NetworkIPAvailabilityService networkIPAvailability(); } diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/NetworkIPAvailabilityService.java b/core/src/main/java/org/openstack4j/api/networking/ext/NetworkIPAvailabilityService.java new file mode 100644 index 000000000..1dec9527d --- /dev/null +++ b/core/src/main/java/org/openstack4j/api/networking/ext/NetworkIPAvailabilityService.java @@ -0,0 +1,29 @@ +package org.openstack4j.api.networking.ext; + +import org.openstack4j.common.RestService; +import org.openstack4j.model.network.NetworkIPAvailability; +import org.openstack4j.model.network.SubnetIpAvailability; +import org.openstack4j.model.network.options.NetIpAvailListOptions; + +import java.util.List; + +/** + * Networking (Neutron) ip-availabilities Extension API + * + * @author bboyHan + */ +public interface NetworkIPAvailabilityService extends RestService { + + List list(); + + List list(NetIpAvailListOptions options); + + NetworkIPAvailability get(String networkId); + + /** + * extension about subnet + * + * @param subnetId subnet id + */ + SubnetIpAvailability getSubnetIpAvail(String subnetId); +} diff --git a/core/src/main/java/org/openstack4j/model/common/BaseListOptions.java b/core/src/main/java/org/openstack4j/model/common/BaseListOptions.java new file mode 100644 index 000000000..c021d39c0 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/common/BaseListOptions.java @@ -0,0 +1,52 @@ +package org.openstack4j.model.common; + +import com.google.common.collect.Maps; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkNotNull; + +/** + * Base Filter class for building Filter Request options + * + * @author bboyHan + */ +public class BaseListOptions { + + /** + * filter the values (Prototype) + */ + protected Map> repeatableQueryParams = Maps.newHashMap(); + + /** + *filter the values (Singleton) + */ + protected Map singleQueryParams = Maps.newHashMap(); + + protected void filter(String key, Object value) { + checkNotNull(key); + + if (value != null) { + List list; + if (repeatableQueryParams.containsKey(key)) { + list = repeatableQueryParams.get(key); + } else { + list = new ArrayList<>(); + } + list.add(value); + repeatableQueryParams.put(key, list); + + singleQueryParams.put(key, value); + } + } + + public Map> getRepeatableOptions() { + return repeatableQueryParams; + } + + public Map getSingleOptions() { + return singleQueryParams; + } +} diff --git a/core/src/main/java/org/openstack4j/model/network/NetworkIPAvailability.java b/core/src/main/java/org/openstack4j/model/network/NetworkIPAvailability.java new file mode 100644 index 000000000..60ca93acb --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/NetworkIPAvailability.java @@ -0,0 +1,25 @@ +package org.openstack4j.model.network; + +import org.openstack4j.model.ModelEntity; + +import java.util.List; + +/** + * @author bboyHan + */ +public interface NetworkIPAvailability extends ModelEntity { + + String getNetworkId(); + + String getNetworkName(); + + String getTenantId(); + + String getProjectId(); + + String getTotalIps(); + + String getUsedIps(); + + List getSubnetIpAvailabilities(); +} diff --git a/core/src/main/java/org/openstack4j/model/network/SubnetIpAvailability.java b/core/src/main/java/org/openstack4j/model/network/SubnetIpAvailability.java new file mode 100644 index 000000000..f68960ef6 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/SubnetIpAvailability.java @@ -0,0 +1,21 @@ +package org.openstack4j.model.network; + +import org.openstack4j.model.ModelEntity; + +/** + * @author bboyHan + */ +public interface SubnetIpAvailability extends ModelEntity { + + String getUsedIps(); + + String getSubnetId(); + + String getSubnetName(); + + IPVersionType getIpVersion(); + + String getCidr(); + + String getTotalIps(); +} diff --git a/core/src/main/java/org/openstack4j/model/network/options/NetIpAvailListOptions.java b/core/src/main/java/org/openstack4j/model/network/options/NetIpAvailListOptions.java new file mode 100644 index 000000000..089472d5c --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/options/NetIpAvailListOptions.java @@ -0,0 +1,42 @@ +package org.openstack4j.model.network.options; + +import org.openstack4j.model.common.BaseListOptions; +import org.openstack4j.model.network.IPVersionType; + +/** + * @author bboyHan + */ +public class NetIpAvailListOptions extends BaseListOptions { + + private NetIpAvailListOptions() { + } + + public static NetIpAvailListOptions create() { + return new NetIpAvailListOptions(); + } + + public NetIpAvailListOptions networkId(String networkId) { + return add("network_id", networkId); + } + + public NetIpAvailListOptions networkName(String networkName) { + return add("network_name", networkName); + } + + public NetIpAvailListOptions tenantId(String tenantId) { + return add("tenant_id", tenantId); + } + + public NetIpAvailListOptions projectId(String projectId) { + return add("project_id", projectId); + } + + public NetIpAvailListOptions ipVersion(IPVersionType ipVersionType) { + return add("ip_version", String.valueOf(ipVersionType.getVersion())); + } + + public NetIpAvailListOptions add(String key, String value) { + filter(key, value); + return this; + } +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronNetworkIPAvailability.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronNetworkIPAvailability.java new file mode 100644 index 000000000..5826e9dcc --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronNetworkIPAvailability.java @@ -0,0 +1,145 @@ +package org.openstack4j.openstack.networking.domain.ext; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.google.common.base.MoreObjects; +import org.openstack4j.model.network.NetworkIPAvailability; +import org.openstack4j.openstack.common.ListEntity; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; + +/** + * An OpenStack (Neutron) network ip availabilities + * + * @author bboyHan + */ +@JsonRootName("network_ip_availability") +public class NeutronNetworkIPAvailability implements NetworkIPAvailability { + + private static final long serialVersionUID = 1L; + + @JsonProperty("network_id") + private String networkId; + @JsonProperty("network_name") + private String networkName; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("project_id") + private String projectId; + @JsonProperty("total_ips") + private String totalIps; + @JsonProperty("used_ips") + private String usedIps; + @JsonProperty("subnet_ip_availability") + private List subnetIpAvailabilities; + + public NeutronNetworkIPAvailability() { + } + + public NeutronNetworkIPAvailability(String networkId, String networkName, String tenantId, + String projectId, String totalIps, String usedIps, + List subnetIpAvailabilities) { + this.networkId = networkId; + this.networkName = networkName; + this.tenantId = tenantId; + this.projectId = projectId; + this.totalIps = totalIps; + this.usedIps = usedIps; + this.subnetIpAvailabilities = subnetIpAvailabilities; + } + + @Override + public String getNetworkId() { + return networkId; + } + + @Override + public String getNetworkName() { + return networkName; + } + + @Override + public String getTenantId() { + return tenantId; + } + + @Override + public String getProjectId() { + return projectId; + } + + @Override + public String getTotalIps() { + return totalIps; + } + + @Override + public String getUsedIps() { + return usedIps; + } + + @Override + public List getSubnetIpAvailabilities() { + return subnetIpAvailabilities; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("networkId", networkId) + .add("networkName", networkName) + .add("tenantId", tenantId) + .add("projectId", projectId) + .add("totalIps", totalIps) + .add("usedIps", usedIps) + .add("tenantId", tenantId) + .add("subnetIpAvailabilities", subnetIpAvailabilities) + .toString(); + } + + @SuppressWarnings("unchecked") + public static NeutronNetworkIPAvailability fromNeutronNetIpAvailability(NetworkIPAvailability networkIPAvailability) { + NeutronNetworkIPAvailability n = new NeutronNetworkIPAvailability(); + n.networkId = networkIPAvailability.getNetworkId(); + n.networkName = networkIPAvailability.getNetworkName(); + n.tenantId = networkIPAvailability.getTenantId(); + n.projectId = networkIPAvailability.getProjectId(); + n.totalIps = networkIPAvailability.getTotalIps(); + n.usedIps = networkIPAvailability.getUsedIps(); + n.subnetIpAvailabilities = (List) networkIPAvailability.getSubnetIpAvailabilities(); + return n; + } + + public static class NetworkIPAvailabilities extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("network_ip_availabilities") + private List netIpAvailabilities; + + public NetworkIPAvailabilities() { + netIpAvailabilities = new ListEntity<>(); + } + + @Override + public List value() { + return netIpAvailabilities; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).omitNullValues() + .add("netIpAvailabilities", netIpAvailabilities).toString(); + } + + @SuppressWarnings("unchecked") + public static NetworkIPAvailabilities fromNetsIpAvailabilities(List netsIpAvailabilities) { + NetworkIPAvailabilities n = new NetworkIPAvailabilities(); + for (NetworkIPAvailability networkIPAvailability : netsIpAvailabilities) { + n.netIpAvailabilities.add(NeutronNetworkIPAvailability.fromNeutronNetIpAvailability(networkIPAvailability)); + } + return n; + } + } +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSubnetIpAvailability.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSubnetIpAvailability.java new file mode 100644 index 000000000..daa7f9a8a --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/NeutronSubnetIpAvailability.java @@ -0,0 +1,67 @@ +package org.openstack4j.openstack.networking.domain.ext; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.openstack4j.model.network.IPVersionType; +import org.openstack4j.model.network.SubnetIpAvailability; + +/** + * @author bboyHan + */ +public class NeutronSubnetIpAvailability implements SubnetIpAvailability { + + @JsonProperty("used_ips") + private String usedIps; + @JsonProperty("subnet_id") + private String subnetId; + @JsonProperty("subnet_name") + private String subnetName; + @JsonProperty("ip_version") + private IPVersionType ipVersion; + private String cidr; + @JsonProperty("total_ips") + private String totalIps; + + public NeutronSubnetIpAvailability() { + } + + public NeutronSubnetIpAvailability(String usedIps, String subnetId, + String subnetName, IPVersionType ipVersion, + String cidr, String totalIps) { + this.usedIps = usedIps; + this.subnetId = subnetId; + this.subnetName = subnetName; + this.ipVersion = ipVersion; + this.cidr = cidr; + this.totalIps = totalIps; + } + + @Override + public String getUsedIps() { + return usedIps; + } + + @Override + public String getSubnetId() { + return subnetId; + } + + @Override + public String getSubnetName() { + return subnetName; + } + + @Override + public IPVersionType getIpVersion() { + return ipVersion; + } + + @Override + public String getCidr() { + return cidr; + } + + @Override + public String getTotalIps() { + return totalIps; + } +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java index 79818ff4b..8fb0cf680 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java @@ -122,4 +122,12 @@ public AvailabilityZoneService availabilityzone() { public NeutronResourceTagService resourceTags() { return Apis.get(NeutronResourceTagService.class); } + + /** + * {@inheritDoc} + */ + @Override + public NetworkIPAvailabilityService networkIPAvailability() { + return Apis.get(NetworkIPAvailabilityService.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetworkIPAvailabilityServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetworkIPAvailabilityServiceImpl.java new file mode 100644 index 000000000..b70b0e628 --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetworkIPAvailabilityServiceImpl.java @@ -0,0 +1,54 @@ +package org.openstack4j.openstack.networking.internal.ext; + +import org.openstack4j.api.Apis; +import org.openstack4j.api.networking.ext.NetworkIPAvailabilityService; +import org.openstack4j.model.network.NetworkIPAvailability; +import org.openstack4j.model.network.SubnetIpAvailability; +import org.openstack4j.model.network.options.NetIpAvailListOptions; +import org.openstack4j.openstack.networking.domain.ext.NeutronNetworkIPAvailability; +import org.openstack4j.openstack.networking.domain.ext.NeutronNetworkIPAvailability.NetworkIPAvailabilities; +import org.openstack4j.openstack.networking.domain.ext.NeutronSubnetIpAvailability; +import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + +/** + * @author bboyHan + */ +public class NetworkIPAvailabilityServiceImpl extends BaseNetworkingServices implements NetworkIPAvailabilityService { + + @Override + public List list() { + return get(NetworkIPAvailabilities.class, uri("/network-ip-availabilities")).execute().getList(); + } + + @Override + public List list(NetIpAvailListOptions options) { + if (options == null) + return list(); + + return get(NetworkIPAvailabilities.class, uri("/network-ip-availabilities")).paramLists(options.getRepeatableOptions()) + .execute().getList(); + } + + @Override + public NetworkIPAvailability get(String networkId) { + checkNotNull(networkId); + return get(NeutronNetworkIPAvailability.class, uri("/network-ip-availabilities/%s", networkId)).execute(); + } + + @Override + @SuppressWarnings("unchecked") + public SubnetIpAvailability getSubnetIpAvail(String subnetId) { + String networkId = Apis.getNetworkingServices().subnet().get(subnetId).getNetworkId(); + List subnetIpAvailabilities = (List) get(networkId).getSubnetIpAvailabilities(); + for (NeutronSubnetIpAvailability subnetIpAvailability : subnetIpAvailabilities) { + if (subnetIpAvailability.getSubnetId().equalsIgnoreCase(subnetId)) { + return subnetIpAvailability; + } + } + return null; + } +} diff --git a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java index d5eb2273c..bae66b52d 100644 --- a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java +++ b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java @@ -283,6 +283,7 @@ public void initialize() { bind(WorkflowEnvironmentService.class, WorkflowEnvironmentServiceImpl.class); bind(CronTriggerService.class, CronTriggerServiceImpl.class); bind(NeutronResourceTagService.class, NeutronResourceTagServiceImpl.class); + bind(NetworkIPAvailabilityService.class, NetworkIPAvailabilityServiceImpl.class); } /** From 2724fb5847a442cea0bd63b5b65cf8c8b181972d Mon Sep 17 00:00:00 2001 From: wushaohan Date: Sun, 8 Nov 2020 00:27:34 +0800 Subject: [PATCH 6/9] 1. Obj.class -> (Bean) obj; 2.remove 'public' (field)interface / 'private' (construct) enum; --- .../executors/ApacheHttpClientEngine.java | 2 +- .../network/NetworkIPAvailabilityTests.java | 2 +- .../java/org/openstack4j/api/OSClient.java | 4 +- .../api/client/IOSClientBuilder.java | 4 +- .../openstack4j/api/compute/HostService.java | 2 +- .../api/exceptions/StatusCode.java | 2 +- .../openstack4j/api/heat/StackService.java | 2 +- .../org/openstack4j/common/Buildable.java | 2 +- .../openstack4j/core/transport/Config.java | 9 +-- .../openstack4j/core/transport/ProxyHost.java | 7 +- .../internal/OSBadBooleanDeserializer.java | 2 +- .../model/artifact/ArtifactUpdate.java | 6 +- .../openstack4j/model/artifact/Artifacts.java | 4 +- .../openstack4j/model/artifact/Template.java | 14 ++-- .../model/compute/HostResource.java | 10 +-- .../model/compute/HostResourceBody.java | 2 +- .../model/compute/InterfaceAttachment.java | 2 +- .../openstack4j/model/compute/RateLimit.java | 2 +- .../model/compute/SecGroupExtension.java | 6 +- .../org/openstack4j/model/compute/Server.java | 2 +- .../model/compute/SimpleTenantUsage.java | 2 +- .../openstack4j/model/compute/VNCConsole.java | 4 +- .../model/compute/actions/BackupOptions.java | 2 +- .../compute/actions/EvacuateOptions.java | 2 +- .../compute/actions/LiveMigrateOptions.java | 2 +- .../model/compute/actions/RebuildOptions.java | 2 +- .../compute/builder/ComputeBuilders.java | 10 +-- .../model/compute/ext/AvailabilityZone.java | 4 +- .../model/compute/ext/DomainEntry.java | 2 +- .../model/compute/ext/Hypervisor.java | 6 +- .../model/compute/ext/Migration.java | 2 +- .../model/compute/ext/Service.java | 4 +- .../model/dns/v2/builder/DNSV2Builders.java | 4 +- .../openstack4j/model/gbp/IPVersionType.java | 2 +- .../openstack4j/model/gbp/PolicyAction.java | 2 +- .../model/heat/SoftwareConfig.java | 4 +- .../heat/builder/OrchestrationBuilders.java | 10 +-- .../openstack4j/model/identity/v2/Access.java | 4 +- .../v2/builder/IdentityV2Builders.java | 12 ++-- .../model/identity/v3/Authentication.java | 16 ++--- .../v3/builder/IdentityV3Builders.java | 20 +++--- .../org/openstack4j/model/image/Image.java | 2 +- .../org/openstack4j/model/image/v2/Image.java | 4 +- .../openstack4j/model/image/v2/Member.java | 2 +- .../org/openstack4j/model/image/v2/Task.java | 2 +- .../org/openstack4j/model/manila/Access.java | 2 +- .../openstack4j/model/manila/RateLimit.java | 2 +- .../builder/SharedFileSystemBuilders.java | 12 ++-- .../murano/v1/builder/AppCatalogBuilders.java | 2 +- .../org/openstack4j/model/network/Agent.java | 2 +- .../openstack4j/model/network/FloatingIP.java | 28 ++++---- .../model/network/IPVersionType.java | 2 +- .../model/network/Ipv6AddressMode.java | 2 +- .../openstack4j/model/network/Ipv6RaMode.java | 2 +- .../network/builder/NetworkBuilders.java | 72 +++++++++---------- .../model/network/ext/Firewall.java | 18 ++--- .../model/network/ext/FirewallPolicy.java | 18 ++--- .../network/ext/FirewallPolicyUpdate.java | 10 +-- .../model/network/ext/FirewallRule.java | 30 ++++---- .../model/network/ext/FirewallRuleUpdate.java | 24 +++---- .../model/network/ext/FirewallUpdate.java | 12 ++-- .../model/network/ext/HealthMonitor.java | 22 +++--- .../network/ext/HealthMonitorAssociate.java | 2 +- .../network/ext/HealthMonitorUpdate.java | 14 ++-- .../openstack4j/model/network/ext/LbPool.java | 26 +++---- .../model/network/ext/LbPoolStats.java | 8 +-- .../model/network/ext/LbPoolUpdate.java | 8 +-- .../model/network/ext/LbPoolV2Update.java | 10 +-- .../model/network/ext/ListenerV2Update.java | 10 +-- .../network/ext/LoadBalancerV2Stats.java | 8 +-- .../network/ext/LoadBalancerV2StatusTree.java | 2 +- .../network/ext/LoadBalancerV2Update.java | 6 +- .../openstack4j/model/network/ext/Member.java | 16 ++--- .../model/network/ext/MemberUpdate.java | 6 +- .../model/network/ext/MemberV2Update.java | 4 +- .../model/network/ext/SessionPersistence.java | 4 +- .../openstack4j/model/network/ext/Vip.java | 26 +++---- .../model/network/ext/VipUpdate.java | 12 ++-- .../network/ext/builder/FirewallBuilder.java | 14 ++-- .../ext/builder/FirewallPolicyBuilder.java | 12 ++-- .../builder/FirewallPolicyUpdateBuilder.java | 10 +-- .../ext/builder/FirewallRuleBuilder.java | 24 +++---- .../builder/FirewallRuleUpdateBuilder.java | 24 +++---- .../ext/builder/FirewallUpdateBuilder.java | 12 ++-- .../HealthMonitorAssociateBuilder.java | 2 +- .../ext/builder/HealthMonitorBuilder.java | 18 ++--- .../builder/HealthMonitorUpdateBuilder.java | 14 ++-- .../network/ext/builder/LbPoolBuilder.java | 16 ++--- .../ext/builder/LbPoolUpdateBuilder.java | 8 +-- .../ext/builder/LbPoolV2UpdateBuilder.java | 8 +-- .../builder/LoadBalancerV2UpdateBuilder.java | 6 +- .../network/ext/builder/MemberBuilder.java | 12 ++-- .../ext/builder/MemberUpdateBuilder.java | 6 +- .../ext/builder/MemberV2UpdateBuilder.java | 4 +- .../builder/SessionPersistenceBuilder.java | 4 +- .../ext/status/HealthMonitorV2Status.java | 6 +- .../network/ext/status/LbPoolV2Status.java | 12 ++-- .../network/ext/status/ListenerV2Status.java | 10 +-- .../ext/status/LoadBalancerV2Status.java | 10 +-- .../network/ext/status/MemberV2Status.java | 10 +-- .../model/octavia/LbPoolV2Update.java | 10 +-- .../model/octavia/ListenerV2Update.java | 10 +-- .../model/octavia/LoadBalancerV2Stats.java | 8 +-- .../octavia/LoadBalancerV2StatusTree.java | 2 +- .../model/octavia/LoadBalancerV2Update.java | 6 +- .../model/octavia/MemberV2Update.java | 4 +- .../model/octavia/SessionPersistence.java | 4 +- .../builder/LbPoolV2UpdateBuilder.java | 8 +-- .../builder/LoadBalancerV2UpdateBuilder.java | 6 +- .../builder/MemberV2UpdateBuilder.java | 4 +- .../builder/SessionPersistenceBuilder.java | 4 +- .../octavia/status/HealthMonitorV2Status.java | 6 +- .../model/octavia/status/LbPoolV2Status.java | 12 ++-- .../octavia/status/ListenerV2Status.java | 10 +-- .../octavia/status/LoadBalancerV2Status.java | 10 +-- .../model/octavia/status/MemberV2Status.java | 10 +-- .../builder/DataProcessingBuilders.java | 20 +++--- .../model/storage/block/BlockLimits.java | 2 +- .../model/storage/block/Volume.java | 4 +- .../model/storage/block/VolumeBackup.java | 2 +- .../block/builder/StorageBuilders.java | 8 +-- .../model/storage/block/ext/Service.java | 4 +- .../tacker/builder/VnfUpdateBuilder.java | 2 +- .../openstack4j/model/telemetry/Alarm.java | 36 +++++----- .../model/telemetry/EventCriteria.java | 2 +- .../openstack4j/model/telemetry/Meter.java | 2 +- .../model/telemetry/SampleCriteria.java | 4 +- .../telemetry/builder/TelemetryBuilders.java | 2 +- .../org/openstack4j/model/workflow/Scope.java | 2 +- .../org/openstack4j/model/workflow/State.java | 2 +- .../openstack4j/openstack/common/Auth.java | 2 +- .../common/TelemetryDateDeserializer.java | 2 +- .../dns/v2/domain/DesignateNameserver.java | 2 +- .../dns/v2/domain/DesignateRecordset.java | 2 +- .../dns/v2/domain/DesignateZone.java | 2 +- .../openstack/heat/utils/Environment.java | 8 +-- .../openstack/heat/utils/Template.java | 14 ++-- .../internal/DefaultEndpointURLResolver.java | 7 +- .../identity/v2/domain/KeystoneEndpoint.java | 2 +- .../v2/domain/KeystoneServiceEndpoint.java | 2 +- .../identity/v2/domain/KeystoneTenant.java | 2 +- .../identity/v3/domain/KeystoneEndpoint.java | 2 +- .../identity/v3/domain/KeystoneGroup.java | 2 +- .../identity/v3/domain/KeystonePolicy.java | 2 +- .../identity/v3/domain/KeystoneProject.java | 2 +- .../identity/v3/domain/KeystoneRegion.java | 2 +- .../identity/v3/domain/KeystoneUser.java | 2 +- .../image/v2/domain/GlanceImage.java | 5 +- .../openstack/internal/OSAuthenticator.java | 4 +- .../domain/NeutronAvailabilityZone.java | 6 +- .../networking/domain/NeutronFloatingIP.java | 6 +- .../networking/domain/NeutronNetwork.java | 6 +- .../networking/domain/NeutronPool.java | 6 +- .../networking/domain/NeutronPort.java | 40 +++++------ .../networking/domain/NeutronRouter.java | 6 +- .../domain/NeutronRouterInterface.java | 6 +- .../domain/NeutronSecurityGroup.java | 6 +- .../domain/NeutronSecurityGroupRule.java | 6 +- .../networking/domain/NeutronSubnet.java | 6 +- .../ext/AbstractNeutronFirewallPolicy.java | 4 +- .../networking/domain/ext/HttpMethod.java | 2 +- .../internal/SenlinWebHookServiceImpl.java | 2 +- .../block/domain/AvailabilityZone.java | 2 +- .../ObjectStorageObjectServiceImpl.java | 2 +- .../telemetry/domain/CeilometerAlarm.java | 2 +- 165 files changed, 609 insertions(+), 647 deletions(-) diff --git a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java index e310b7f11..c1580d380 100644 --- a/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java +++ b/connectors/resteasy/src/main/java/org/openstack4j/connectors/resteasy/executors/ApacheHttpClientEngine.java @@ -64,7 +64,7 @@ public static ApacheHttpClientEngine create(Config config) { HttpHost proxy = new HttpHost(url.getHost(), config.getProxy().getPort(), url.getProtocol()); requestConfigBuilder.setProxy(proxy); } catch (MalformedURLException e) { - LOGGER.error("Invalid proxy Url :%s", config.getProxy(), e); + LOGGER.error("Invalid proxy Url : {}", config.getProxy(), e); } } diff --git a/core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java b/core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java index 579e1bda1..d3ff3be5f 100644 --- a/core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java +++ b/core-test/src/main/java/org/openstack4j/api/network/NetworkIPAvailabilityTests.java @@ -40,7 +40,7 @@ public void list() throws Exception { public void listByOptions() throws Exception { respondWith(NETWORK_IP_AVAILABILITIES_JSON); NetIpAvailListOptions options = NetIpAvailListOptions.create().networkId("networkId"); - List networkIPAvailabilities = osv3().networking().networkIPAvailability().list(); + List networkIPAvailabilities = osv3().networking().networkIPAvailability().list(options); server.takeRequest(); assertEquals(2, networkIPAvailabilities.size()); } diff --git a/core/src/main/java/org/openstack4j/api/OSClient.java b/core/src/main/java/org/openstack4j/api/OSClient.java index b257cd2f0..d07bf5cca 100644 --- a/core/src/main/java/org/openstack4j/api/OSClient.java +++ b/core/src/main/java/org/openstack4j/api/OSClient.java @@ -281,7 +281,7 @@ public interface OSClient> { /** * OpenStack4j Client which authenticates against version V2 */ - public interface OSClientV2 extends OSClient { + interface OSClientV2 extends OSClient { /** * Returns the Identity V2 Access object assigned during authentication @@ -302,7 +302,7 @@ public interface OSClientV2 extends OSClient { /** * OpenStack4j Client which authenticates against version V3 */ - public interface OSClientV3 extends OSClient { + interface OSClientV3 extends OSClient { /** diff --git a/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java b/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java index 8830f01f4..e88ccf8d4 100644 --- a/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java +++ b/core/src/main/java/org/openstack4j/api/client/IOSClientBuilder.java @@ -91,7 +91,7 @@ public interface IOSClientBuilder> { /** * OpenStack4j Client builder which authenticates against version V3 */ - public interface V2 extends IOSClientBuilder { + interface V2 extends IOSClientBuilder { /** * The tenant/project to authenticate as @@ -134,7 +134,7 @@ public interface V2 extends IOSClientBuilder { /** * OpenStack4j Client builder which authenticates against version V3 */ - public interface V3 extends IOSClientBuilder { + interface V3 extends IOSClientBuilder { /** * The authentication credentials and default scoped domain diff --git a/core/src/main/java/org/openstack4j/api/compute/HostService.java b/core/src/main/java/org/openstack4j/api/compute/HostService.java index a17467757..483874166 100644 --- a/core/src/main/java/org/openstack4j/api/compute/HostService.java +++ b/core/src/main/java/org/openstack4j/api/compute/HostService.java @@ -19,7 +19,7 @@ public interface HostService extends RestService { * @param hostName * @return the Resource of the Host specified */ - public List hostDescribe(String hostName); + List hostDescribe(String hostName); /** * List all host that the current tenant has access to diff --git a/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java b/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java index fad2f88c3..7bccbb80a 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/StatusCode.java @@ -115,7 +115,7 @@ public enum StatusCode { CODE_UNKNOWN(0); private final int code; - private StatusCode(int code) { + StatusCode(int code) { this.code = code; } diff --git a/core/src/main/java/org/openstack4j/api/heat/StackService.java b/core/src/main/java/org/openstack4j/api/heat/StackService.java index b61f3f388..f878510bf 100644 --- a/core/src/main/java/org/openstack4j/api/heat/StackService.java +++ b/core/src/main/java/org/openstack4j/api/heat/StackService.java @@ -71,7 +71,7 @@ Stack create(String name, String template, Map parameters, * @param filteringParams The parameters used to filter the stacks returned. * @return the list of {@link Stack} objects. */ - public List list(Map filteringParams); + List list(Map filteringParams); /** * returns details of a {@link Stack}. diff --git a/core/src/main/java/org/openstack4j/common/Buildable.java b/core/src/main/java/org/openstack4j/common/Buildable.java index 8a4cfbd55..a52484ef4 100644 --- a/core/src/main/java/org/openstack4j/common/Buildable.java +++ b/core/src/main/java/org/openstack4j/common/Buildable.java @@ -17,7 +17,7 @@ public interface Buildable { * @param The ouput IModelEntity type * @author Jeremy Unruh */ - public interface Builder, M extends Buildable> { + interface Builder, M extends Buildable> { /** * Creates and return the Model Entity M diff --git a/core/src/main/java/org/openstack4j/core/transport/Config.java b/core/src/main/java/org/openstack4j/core/transport/Config.java index f11a8bca7..a216361f3 100644 --- a/core/src/main/java/org/openstack4j/core/transport/Config.java +++ b/core/src/main/java/org/openstack4j/core/transport/Config.java @@ -278,14 +278,9 @@ public boolean equals(Object obj) { return false; } if (hostNameVerifier == null) { - if (other.getHostNameVerifier() != null) { - return false; - } - } else if (!hostNameVerifier.equals(other.getHostNameVerifier())) { - return false; - } + return other.getHostNameVerifier() == null; + } else return hostNameVerifier.equals(other.getHostNameVerifier()); - return true; } } diff --git a/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java b/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java index 47d1d86fe..1c8e8c700 100644 --- a/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java +++ b/core/src/main/java/org/openstack4j/core/transport/ProxyHost.java @@ -109,11 +109,8 @@ public boolean equals(Object obj) { if (port != other.port) return false; if (username == null) { - if (other.username != null) - return false; - } else if (!username.equals(other.username)) - return false; - return true; + return other.username == null; + } else return username.equals(other.username); } diff --git a/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java b/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java index 5318ea063..a3ed3bb75 100644 --- a/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java +++ b/core/src/main/java/org/openstack4j/core/transport/internal/OSBadBooleanDeserializer.java @@ -22,7 +22,7 @@ public class OSBadBooleanDeserializer extends JsonDeserializer { * {@inheritDoc} */ @Override - public Boolean deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public Boolean deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { JsonToken t = jp.getCurrentToken(); if (t == JsonToken.VALUE_TRUE) { return Boolean.TRUE; diff --git a/core/src/main/java/org/openstack4j/model/artifact/ArtifactUpdate.java b/core/src/main/java/org/openstack4j/model/artifact/ArtifactUpdate.java index 5a2681acf..894a537fe 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/ArtifactUpdate.java +++ b/core/src/main/java/org/openstack4j/model/artifact/ArtifactUpdate.java @@ -11,9 +11,9 @@ */ public interface ArtifactUpdate extends ModelEntity, Buildable { - public String getOp(); + String getOp(); - public String getPath(); + String getPath(); - public String getValue(); + String getValue(); } diff --git a/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java b/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java index 1c73b5e43..6762a11e9 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java +++ b/core/src/main/java/org/openstack4j/model/artifact/Artifacts.java @@ -11,8 +11,8 @@ public interface Artifacts extends ModelEntity { ArtifactType artifactType = ArtifactType.ALL; - public String getSchema(); + String getSchema(); - public String getFirst(); + String getFirst(); } diff --git a/core/src/main/java/org/openstack4j/model/artifact/Template.java b/core/src/main/java/org/openstack4j/model/artifact/Template.java index 209b76d88..b62e51775 100644 --- a/core/src/main/java/org/openstack4j/model/artifact/Template.java +++ b/core/src/main/java/org/openstack4j/model/artifact/Template.java @@ -9,17 +9,17 @@ */ public interface Template extends ModelEntity { - public String getMd5(); + String getMd5(); - public String getSha256(); + String getSha256(); - public String getContentType(); + String getContentType(); - public Boolean getExternal(); + Boolean getExternal(); - public String getUrl(); + String getUrl(); - public String getSha1(); + String getSha1(); - public String getStatus(); + String getStatus(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/HostResource.java b/core/src/main/java/org/openstack4j/model/compute/HostResource.java index ad50cca5f..b0602912d 100644 --- a/core/src/main/java/org/openstack4j/model/compute/HostResource.java +++ b/core/src/main/java/org/openstack4j/model/compute/HostResource.java @@ -11,27 +11,27 @@ public interface HostResource extends ModelEntity { /** * @return the number of CPUs of the compute host */ - public int getCpu(); + int getCpu(); /** * @return the size of Disk the compute host has, in GB */ - public int getDiskInGb(); + int getDiskInGb(); /** * @return the Hostname of the compute host */ - public String getHost(); + String getHost(); /** * @return the size of Memory of the compute host has, in MB */ - public int getMemoryInMb(); + int getMemoryInMb(); /** * @return the project id (or special name like total, used_now, used_max) */ - public String getProject(); + String getProject(); /** diff --git a/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java b/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java index 5b553f918..8d8ac4145 100644 --- a/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java +++ b/core/src/main/java/org/openstack4j/model/compute/HostResourceBody.java @@ -10,6 +10,6 @@ public interface HostResourceBody { /** * @return the Host Resource contained in the unamed body */ - public HostResource getHostResource(); + HostResource getHostResource(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java b/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java index 9e6db5ef8..e6cb0c2d8 100644 --- a/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java +++ b/core/src/main/java/org/openstack4j/model/compute/InterfaceAttachment.java @@ -46,7 +46,7 @@ public interface InterfaceAttachment extends ModelEntity { */ PortState getPortState(); - public interface FixedIp extends ModelEntity { + interface FixedIp extends ModelEntity { /** * @return the IpAddress diff --git a/core/src/main/java/org/openstack4j/model/compute/RateLimit.java b/core/src/main/java/org/openstack4j/model/compute/RateLimit.java index 65e4e9cf1..96624a12d 100644 --- a/core/src/main/java/org/openstack4j/model/compute/RateLimit.java +++ b/core/src/main/java/org/openstack4j/model/compute/RateLimit.java @@ -26,7 +26,7 @@ public interface RateLimit extends ModelEntity { List getLimit(); - public interface LimitEntry { + interface LimitEntry { /** * @return the nextAvailable date/time diff --git a/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java b/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java index 0d217e892..ddc9eed40 100644 --- a/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java +++ b/core/src/main/java/org/openstack4j/model/compute/SecGroupExtension.java @@ -17,7 +17,7 @@ public interface SecGroupExtension extends ModelEntity { /** * Security Group Rule */ - public interface Rule extends ModelEntity, Buildable { + interface Rule extends ModelEntity, Buildable { /** * @return the IPProtocol for this rule @@ -64,7 +64,7 @@ public interface Rule extends ModelEntity, Buildable { /** * Rule Group */ - public interface Group { + interface Group { /** * @return the name of the group @@ -82,7 +82,7 @@ public interface Group { /** * Rule IP Range */ - public interface IpRange { + interface IpRange { /** * Gets the CIDR address range diff --git a/core/src/main/java/org/openstack4j/model/compute/Server.java b/core/src/main/java/org/openstack4j/model/compute/Server.java index d22a411a0..bffa7cb2e 100644 --- a/core/src/main/java/org/openstack4j/model/compute/Server.java +++ b/core/src/main/java/org/openstack4j/model/compute/Server.java @@ -20,7 +20,7 @@ public interface Server extends ModelEntity { * Servers contain a status attribute that can be used as an indication of the current server * state. Servers with an ACTIVE status are available for use. */ - public enum Status { + enum Status { /** * The server is active */ diff --git a/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java b/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java index 5374e9557..80b6cdef4 100644 --- a/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java +++ b/core/src/main/java/org/openstack4j/model/compute/SimpleTenantUsage.java @@ -56,7 +56,7 @@ public interface SimpleTenantUsage extends ModelEntity { List getServerUsages(); - public interface ServerUsage extends Serializable { + interface ServerUsage extends Serializable { /** * @return the instance id of the server diff --git a/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java b/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java index 7a3bdb909..2519a79ae 100644 --- a/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java +++ b/core/src/main/java/org/openstack4j/model/compute/VNCConsole.java @@ -14,7 +14,7 @@ public interface VNCConsole extends ModelEntity { /** * The OpenStack VNC Console Type */ - public enum Type { + enum Type { NOVNC("novnc"), XVPVNC("xvpvnc"), SPICE("spice-html5"), @@ -22,7 +22,7 @@ public enum Type { private final String value; - private Type(String value) { + Type(String value) { this.value = value; } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java index 951c4f7ca..51d2904f4 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/BackupOptions.java @@ -15,7 +15,7 @@ private enum Option implements OptionEnum { ROTATION("rotation"); private final String param; - private Option(String param) { + Option(String param) { this.param = param; } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java index 5acea6561..a3a6a97ee 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/EvacuateOptions.java @@ -11,7 +11,7 @@ private enum Option implements OptionEnum { ON_SHARED_STORAGE("onSharedStorage"); private final String param; - private Option(String param) { + Option(String param) { this.param = param; } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java index 1017db675..5b742596c 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/LiveMigrateOptions.java @@ -13,7 +13,7 @@ private enum Option implements OptionEnum { DISK_OVER_COMMIT("disk_over_commit"); private final String param; - private Option(String param) { + Option(String param) { this.param = param; } diff --git a/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java b/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java index a0e4f3457..55137d922 100644 --- a/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java +++ b/core/src/main/java/org/openstack4j/model/compute/actions/RebuildOptions.java @@ -14,7 +14,7 @@ private enum Option implements OptionEnum { ADMIN_PASS("adminPass"); private final String param; - private Option(String param) { + Option(String param) { this.param = param; } diff --git a/core/src/main/java/org/openstack4j/model/compute/builder/ComputeBuilders.java b/core/src/main/java/org/openstack4j/model/compute/builder/ComputeBuilders.java index 46e3e3510..8613f994e 100644 --- a/core/src/main/java/org/openstack4j/model/compute/builder/ComputeBuilders.java +++ b/core/src/main/java/org/openstack4j/model/compute/builder/ComputeBuilders.java @@ -10,34 +10,34 @@ public interface ComputeBuilders { * * @return the server create builder */ - public ServerCreateBuilder server(); + ServerCreateBuilder server(); /** * The builder to create a Block Device Mapping * * @return the block device mapping builder */ - public BlockDeviceMappingBuilder blockDeviceMapping(); + BlockDeviceMappingBuilder blockDeviceMapping(); /** * The builder to create a Flavor. * * @return the flavor builder */ - public FlavorBuilder flavor(); + FlavorBuilder flavor(); /** * The builder to create a Compute/Nova Floating IP * * @return the floating ip builder */ - public FloatingIPBuilder floatingIP(); + FloatingIPBuilder floatingIP(); /** * This builder which creates a QuotaSet for updates * * @return the QuotaSet update builder */ - public QuotaSetUpdateBuilder quotaSet(); + QuotaSetUpdateBuilder quotaSet(); } diff --git a/core/src/main/java/org/openstack4j/model/compute/ext/AvailabilityZone.java b/core/src/main/java/org/openstack4j/model/compute/ext/AvailabilityZone.java index fdf1809a2..1980abc6b 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ext/AvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/model/compute/ext/AvailabilityZone.java @@ -28,7 +28,7 @@ public interface AvailabilityZone extends ModelEntity { String getZoneName(); - public interface ZoneState extends ModelEntity { + interface ZoneState extends ModelEntity { /** * @return the state of zone @@ -36,7 +36,7 @@ public interface ZoneState extends ModelEntity { boolean getAvailable(); } - public interface NovaService extends ModelEntity { + interface NovaService extends ModelEntity { /** * @return whether the service is available */ diff --git a/core/src/main/java/org/openstack4j/model/compute/ext/DomainEntry.java b/core/src/main/java/org/openstack4j/model/compute/ext/DomainEntry.java index 2f2edc5b9..16dba0938 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ext/DomainEntry.java +++ b/core/src/main/java/org/openstack4j/model/compute/ext/DomainEntry.java @@ -11,7 +11,7 @@ */ public interface DomainEntry extends ModelEntity { - public enum Scope { + enum Scope { PUBLIC, PRIVATE; diff --git a/core/src/main/java/org/openstack4j/model/compute/ext/Hypervisor.java b/core/src/main/java/org/openstack4j/model/compute/ext/Hypervisor.java index e2ab82f46..fffc1a058 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ext/Hypervisor.java +++ b/core/src/main/java/org/openstack4j/model/compute/ext/Hypervisor.java @@ -155,7 +155,7 @@ public interface Hypervisor extends ModelEntity { /** * The Hypervisor Services Detail */ - public interface Service extends ModelEntity { + interface Service extends ModelEntity { /** * Gets the host. @@ -173,7 +173,7 @@ public interface Service extends ModelEntity { } - public interface CPUInfo extends ModelEntity { + interface CPUInfo extends ModelEntity { /** * @return cpu vendor @@ -202,7 +202,7 @@ public interface CPUInfo extends ModelEntity { CPUTopology getTopology(); } - public interface CPUTopology extends ModelEntity { + interface CPUTopology extends ModelEntity { /** * @return core count diff --git a/core/src/main/java/org/openstack4j/model/compute/ext/Migration.java b/core/src/main/java/org/openstack4j/model/compute/ext/Migration.java index ef6fba029..692e5b214 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ext/Migration.java +++ b/core/src/main/java/org/openstack4j/model/compute/ext/Migration.java @@ -12,7 +12,7 @@ */ public interface Migration extends ModelEntity { - public enum Status { + enum Status { MIGRATING, ERROR, DONE; diff --git a/core/src/main/java/org/openstack4j/model/compute/ext/Service.java b/core/src/main/java/org/openstack4j/model/compute/ext/Service.java index 7162ec12f..f05b04e64 100644 --- a/core/src/main/java/org/openstack4j/model/compute/ext/Service.java +++ b/core/src/main/java/org/openstack4j/model/compute/ext/Service.java @@ -14,7 +14,7 @@ public interface Service extends ModelEntity { /** * The status of a Nova service entity */ - public enum Status { + enum Status { DISABLED, ENABLED, UNRECOGNIZED; @JsonCreator @@ -33,7 +33,7 @@ public static Status forValue(String value) { /** * The state of a Nova service entity */ - public enum State { + enum State { DOWN, UNRECOGNIZED, UP; @JsonCreator diff --git a/core/src/main/java/org/openstack4j/model/dns/v2/builder/DNSV2Builders.java b/core/src/main/java/org/openstack4j/model/dns/v2/builder/DNSV2Builders.java index 476a9e02a..50688cd80 100644 --- a/core/src/main/java/org/openstack4j/model/dns/v2/builder/DNSV2Builders.java +++ b/core/src/main/java/org/openstack4j/model/dns/v2/builder/DNSV2Builders.java @@ -11,13 +11,13 @@ public interface DNSV2Builders { * * @return the zone builder */ - public ZoneBuilder zone(); + ZoneBuilder zone(); /** * The builder to create a Recordset. * * @return the recordset builder */ - public RecordsetBuilder recordset(); + RecordsetBuilder recordset(); } diff --git a/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java b/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java index cf3bc5d04..243da1127 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java +++ b/core/src/main/java/org/openstack4j/model/gbp/IPVersionType.java @@ -13,7 +13,7 @@ public enum IPVersionType { V6(6); private final int version; - private IPVersionType(int version) { + IPVersionType(int version) { this.version = version; } diff --git a/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java b/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java index 36bd175ff..d6518f785 100644 --- a/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java +++ b/core/src/main/java/org/openstack4j/model/gbp/PolicyAction.java @@ -13,7 +13,7 @@ */ public interface PolicyAction extends Buildable, Resource { - public enum PolicyActionProtocol { + enum PolicyActionProtocol { ALLOW, REDIRECT, COPY, diff --git a/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java b/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java index d195a2c37..4bb9fef3a 100644 --- a/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java +++ b/core/src/main/java/org/openstack4j/model/heat/SoftwareConfig.java @@ -62,7 +62,7 @@ public interface SoftwareConfig extends ModelEntity, Buildable getOptions(); - public interface Input { + interface Input { /** * @return the name of this input @@ -85,7 +85,7 @@ public interface Input { String getType(); } - public interface Output { + interface Output { /** * @return the name of this output diff --git a/core/src/main/java/org/openstack4j/model/heat/builder/OrchestrationBuilders.java b/core/src/main/java/org/openstack4j/model/heat/builder/OrchestrationBuilders.java index f8acc4463..3eef36a2a 100644 --- a/core/src/main/java/org/openstack4j/model/heat/builder/OrchestrationBuilders.java +++ b/core/src/main/java/org/openstack4j/model/heat/builder/OrchestrationBuilders.java @@ -10,34 +10,34 @@ public interface OrchestrationBuilders { * * @return the TemplateBuilder */ - public TemplateBuilder template(); + TemplateBuilder template(); /** * The builder to create a StackCreate * * @return the StackCreate builder */ - public StackCreateBuilder stack(); + StackCreateBuilder stack(); /** * The builder to create a SoftwareConfig * * @return the software config builder */ - public SoftwareConfigBuilder softwareConfig(); + SoftwareConfigBuilder softwareConfig(); /** * The builder to create a StackUpdate * * @return the StackUpdate builder */ - public StackUpdateBuilder stackUpdate(); + StackUpdateBuilder stackUpdate(); /** * The builder to create a resource health update * * @return */ - public ResourceHealthBuilder resourceHealth(); + ResourceHealthBuilder resourceHealth(); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/Access.java b/core/src/main/java/org/openstack4j/model/identity/v2/Access.java index 1c11140d9..034c7adc8 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/Access.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/Access.java @@ -61,7 +61,7 @@ public interface Access extends ModelEntity { */ AuthVersion getVersion(); - public interface UserDetails { + interface UserDetails { String getId(); String getName(); @@ -75,7 +75,7 @@ public interface UserDetails { List getRolesLinks(); } - public interface Service { + interface Service { String getType(); String getName(); diff --git a/core/src/main/java/org/openstack4j/model/identity/v2/builder/IdentityV2Builders.java b/core/src/main/java/org/openstack4j/model/identity/v2/builder/IdentityV2Builders.java index 81db903ae..a3eb7cfbd 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v2/builder/IdentityV2Builders.java +++ b/core/src/main/java/org/openstack4j/model/identity/v2/builder/IdentityV2Builders.java @@ -10,41 +10,41 @@ public interface IdentityV2Builders { * * @return the endpoint builder */ - public EndpointBuilder endpoint(); + EndpointBuilder endpoint(); /** * The builder to create a Role. * * @return the role builder */ - public RoleBuilder role(); + RoleBuilder role(); /** * The builder to create a service. * * @return the service builder */ - public ServiceBuilder service(); + ServiceBuilder service(); /** * The builder to create a Service Endpoint. * * @return the service endpoint builder */ - public ServiceEndpointBuilder serviceEndpoint(); + ServiceEndpointBuilder serviceEndpoint(); /** * The builder to create a tenant * * @return the tenant builder */ - public TenantBuilder tenant(); + TenantBuilder tenant(); /** * The builder to create a user * * @return the user builder */ - public UserBuilder user(); + UserBuilder user(); } diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java b/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java index 323226cda..41697f1fc 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/Authentication.java @@ -11,7 +11,7 @@ public interface Authentication extends ModelEntity { Scope getScope(); - public interface Identity { + interface Identity { Password getPassword(); @@ -19,22 +19,22 @@ public interface Identity { List getMethods(); - public interface Password { + interface Password { User getUser(); - public interface User extends ResourceEntity { + interface User extends ResourceEntity { Domain getDomain(); String getPassword(); - public interface Domain extends ResourceEntity { + interface Domain extends ResourceEntity { } } } - public interface Token { + interface Token { String getId(); @@ -42,18 +42,18 @@ public interface Token { } - public interface Scope { + interface Scope { Project getProject(); Domain getDomain(); - public interface Project extends ResourceEntity { + interface Project extends ResourceEntity { Domain getDomain(); } - public interface Domain extends ResourceEntity { + interface Domain extends ResourceEntity { } } diff --git a/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java b/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java index fce6639ab..867edd1e7 100644 --- a/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java +++ b/core/src/main/java/org/openstack4j/model/identity/v3/builder/IdentityV3Builders.java @@ -10,69 +10,69 @@ public interface IdentityV3Builders { * * @return the credential builder */ - public CredentialBuilder credential(); + CredentialBuilder credential(); /** * The builder to create a Domain. * * @return the domain builder */ - public DomainBuilder domain(); + DomainBuilder domain(); /** * The builder to create a Endpoint. * * @return the endpoint builder */ - public EndpointBuilder endpoint(); + EndpointBuilder endpoint(); /** * The builder to create a Group. * * @return the group builder */ - public GroupBuilder group(); + GroupBuilder group(); /** * The builder to create a Policy. * * @return the policy builder */ - public PolicyBuilder policy(); + PolicyBuilder policy(); /** * The builder to create a Project. * * @return the project builder */ - public ProjectBuilder project(); + ProjectBuilder project(); /** * The builder to create a Region. * * @return the region builder */ - public RegionBuilder region(); + RegionBuilder region(); /** * The builder to create a Role. * * @return the role builder */ - public RoleBuilder role(); + RoleBuilder role(); /** * The builder to create a Service. * * @return the service builder */ - public ServiceBuilder service(); + ServiceBuilder service(); /** * The builder to create a User. * * @return the user builder */ - public UserBuilder user(); + UserBuilder user(); } diff --git a/core/src/main/java/org/openstack4j/model/image/Image.java b/core/src/main/java/org/openstack4j/model/image/Image.java index d8445cceb..588488251 100644 --- a/core/src/main/java/org/openstack4j/model/image/Image.java +++ b/core/src/main/java/org/openstack4j/model/image/Image.java @@ -18,7 +18,7 @@ */ public interface Image extends BasicResource, Buildable { - public enum Status { + enum Status { UNRECOGNIZED, ACTIVE, SAVING, QUEUED, KILLED, PENDING_DELETE, DELETED; @JsonCreator diff --git a/core/src/main/java/org/openstack4j/model/image/v2/Image.java b/core/src/main/java/org/openstack4j/model/image/v2/Image.java index 48ff4bd1c..df80b0f24 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/Image.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/Image.java @@ -18,7 +18,7 @@ */ public interface Image extends BasicResource, Buildable { - public enum ImageStatus { + enum ImageStatus { /** * Image status is not one of the documented options. * http://docs.openstack.org/developer/glance/statuses.html @@ -80,7 +80,7 @@ public String value() { } } - public enum ImageVisibility { + enum ImageVisibility { PUBLIC, PRIVATE, UNKNOWN; diff --git a/core/src/main/java/org/openstack4j/model/image/v2/Member.java b/core/src/main/java/org/openstack4j/model/image/v2/Member.java index 2eb0ec5a1..e7007e112 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/Member.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/Member.java @@ -16,7 +16,7 @@ @JsonDeserialize(as = GlanceMember.class) public interface Member extends ModelEntity { - public enum MemberStatus { + enum MemberStatus { /** * Indicates to owner that image has not been updated. */ diff --git a/core/src/main/java/org/openstack4j/model/image/v2/Task.java b/core/src/main/java/org/openstack4j/model/image/v2/Task.java index a2f38d31f..33fd436f7 100644 --- a/core/src/main/java/org/openstack4j/model/image/v2/Task.java +++ b/core/src/main/java/org/openstack4j/model/image/v2/Task.java @@ -18,7 +18,7 @@ */ public interface Task extends ModelEntity, Buildable { - public enum TaskStatus { + enum TaskStatus { /** * The task identifier has been reserved for a task in the Glance. * No processing has begun on it yet. diff --git a/core/src/main/java/org/openstack4j/model/manila/Access.java b/core/src/main/java/org/openstack4j/model/manila/Access.java index e6b14cbd1..e7ccc6ecf 100644 --- a/core/src/main/java/org/openstack4j/model/manila/Access.java +++ b/core/src/main/java/org/openstack4j/model/manila/Access.java @@ -24,7 +24,7 @@ public String value() { } } - public enum Type { + enum Type { IP, CERT, USER; @JsonCreator diff --git a/core/src/main/java/org/openstack4j/model/manila/RateLimit.java b/core/src/main/java/org/openstack4j/model/manila/RateLimit.java index 7944bca99..ecf2de75c 100644 --- a/core/src/main/java/org/openstack4j/model/manila/RateLimit.java +++ b/core/src/main/java/org/openstack4j/model/manila/RateLimit.java @@ -14,7 +14,7 @@ */ public interface RateLimit { enum TimeIntervalUnit { - SECOND, MINUTE, HOUR, DAY; + SECOND, MINUTE, HOUR, DAY } /** diff --git a/core/src/main/java/org/openstack4j/model/manila/builder/SharedFileSystemBuilders.java b/core/src/main/java/org/openstack4j/model/manila/builder/SharedFileSystemBuilders.java index 932480ab1..3859b86ee 100644 --- a/core/src/main/java/org/openstack4j/model/manila/builder/SharedFileSystemBuilders.java +++ b/core/src/main/java/org/openstack4j/model/manila/builder/SharedFileSystemBuilders.java @@ -10,41 +10,41 @@ public interface SharedFileSystemBuilders { * * @return the security service builder */ - public SecurityServiceCreateBuilder securityService(); + SecurityServiceCreateBuilder securityService(); /** * The builder which creates manila share networks. * * @return the share network builder */ - public ShareNetworkCreateBuilder shareNetwork(); + ShareNetworkCreateBuilder shareNetwork(); /** * The builder which creates manila shares. * * @return the share builder */ - public ShareCreateBuilder share(); + ShareCreateBuilder share(); /** * The builder which creates share types. * * @return the shae type builder */ - public ShareTypeCreateBuilder shareType(); + ShareTypeCreateBuilder shareType(); /** * The builder which creates manila share snapshots. * * @return the share builder */ - public ShareSnapshotCreateBuilder shareSnapshot(); + ShareSnapshotCreateBuilder shareSnapshot(); /** * The builder which creates manila share manages * * @return the share manage builder */ - public ShareManageBuilder shareManage(); + ShareManageBuilder shareManage(); } diff --git a/core/src/main/java/org/openstack4j/model/murano/v1/builder/AppCatalogBuilders.java b/core/src/main/java/org/openstack4j/model/murano/v1/builder/AppCatalogBuilders.java index f95508e71..89ce72d90 100644 --- a/core/src/main/java/org/openstack4j/model/murano/v1/builder/AppCatalogBuilders.java +++ b/core/src/main/java/org/openstack4j/model/murano/v1/builder/AppCatalogBuilders.java @@ -9,5 +9,5 @@ public interface AppCatalogBuilders { * * @return the environment builder */ - public EnvironmentBuilder environment(); + EnvironmentBuilder environment(); } diff --git a/core/src/main/java/org/openstack4j/model/network/Agent.java b/core/src/main/java/org/openstack4j/model/network/Agent.java index 6246b67c8..e4a8861fb 100644 --- a/core/src/main/java/org/openstack4j/model/network/Agent.java +++ b/core/src/main/java/org/openstack4j/model/network/Agent.java @@ -16,7 +16,7 @@ public interface Agent extends ModelEntity, Buildable { /** * neutron agent type */ - public enum Type { + enum Type { DHCP("DHCP agent"), L3("L3 agent"), OPEN_VSWITCH("Open vSwitch agent"), METADATA("Metadata agent"), UNRECOGNIZED( ""); diff --git a/core/src/main/java/org/openstack4j/model/network/FloatingIP.java b/core/src/main/java/org/openstack4j/model/network/FloatingIP.java index a3bc333b9..d163b423c 100755 --- a/core/src/main/java/org/openstack4j/model/network/FloatingIP.java +++ b/core/src/main/java/org/openstack4j/model/network/FloatingIP.java @@ -16,97 +16,97 @@ public interface FloatingIP extends ModelEntity { * * @return the id */ - public abstract String getId(); + String getId(); /** * Gets the router id. * * @return the router id */ - public abstract String getRouterId(); + String getRouterId(); /** * Gets the tenant id. * * @return the tenant id */ - public abstract String getTenantId(); + String getTenantId(); /** * Gets the floating network id. * * @return the floating network id */ - public abstract String getFloatingNetworkId(); + String getFloatingNetworkId(); /** * Gets the floating ip address. * * @return the floating ip address */ - public abstract String getFloatingIpAddress(); + String getFloatingIpAddress(); /** * Gets the fixed ip address. * * @return the fixed ip address */ - public abstract String getFixedIpAddress(); + String getFixedIpAddress(); /** * Gets the port id. * * @return the port id */ - public abstract String getPortId(); + String getPortId(); /** * Sets the id. * * @param id the new id */ - public abstract void setId(String id); + void setId(String id); /** * Sets the router id. * * @param routerId the new router id */ - public abstract void setRouterId(String routerId); + void setRouterId(String routerId); /** * Sets the tenant id. * * @param tenantId the new tenant id */ - public abstract void setTenantId(String tenantId); + void setTenantId(String tenantId); /** * Sets the floating network id. * * @param floatingNetworkId the new floating network id */ - public abstract void setFloatingNetworkId(String floatingNetworkId); + void setFloatingNetworkId(String floatingNetworkId); /** * Sets the floating ip address. * * @param floatingIpAddress the new floating ip address */ - public abstract void setFloatingIpAddress(String floatingIpAddress); + void setFloatingIpAddress(String floatingIpAddress); /** * Sets the fixed ip address. * * @param fixedIpAddress the new fixed ip address */ - public abstract void setFixedIpAddress(String fixedIpAddress); + void setFixedIpAddress(String fixedIpAddress); /** * Sets the port id. * * @param portId the new port id */ - public abstract void setPortId(String portId); + void setPortId(String portId); } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/network/IPVersionType.java b/core/src/main/java/org/openstack4j/model/network/IPVersionType.java index 484025780..e7ea078d2 100644 --- a/core/src/main/java/org/openstack4j/model/network/IPVersionType.java +++ b/core/src/main/java/org/openstack4j/model/network/IPVersionType.java @@ -14,7 +14,7 @@ public enum IPVersionType { V6(6); private final int version; - private IPVersionType(int version) { + IPVersionType(int version) { this.version = version; } diff --git a/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java b/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java index af84ced94..dbedd6d98 100644 --- a/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java +++ b/core/src/main/java/org/openstack4j/model/network/Ipv6AddressMode.java @@ -16,7 +16,7 @@ public enum Ipv6AddressMode { private final String ipv6AddressMode; - private Ipv6AddressMode(String ipv6AddressMode) { + Ipv6AddressMode(String ipv6AddressMode) { this.ipv6AddressMode = ipv6AddressMode; } diff --git a/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java b/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java index ebdef7fe8..396857b13 100644 --- a/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java +++ b/core/src/main/java/org/openstack4j/model/network/Ipv6RaMode.java @@ -15,7 +15,7 @@ public enum Ipv6RaMode { private final String ipv6RaMode; - private Ipv6RaMode(String ipv6RaMode) { + Ipv6RaMode(String ipv6RaMode) { this.ipv6RaMode = ipv6RaMode; } diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java b/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java index 8f07f1ed3..ea5d12340 100644 --- a/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetworkBuilders.java @@ -12,245 +12,245 @@ public interface NetworkBuilders { * * @return the network builder */ - public NetworkBuilder network(); + NetworkBuilder network(); /** * The builder to update a network * * @return the NetworkUpdateBuilder */ - public NetworkUpdateBuilder networkUpdate(); + NetworkUpdateBuilder networkUpdate(); - public ExtraDhcpOptBuilder extraDhcpOpt(); + ExtraDhcpOptBuilder extraDhcpOpt(); /** * The builder to create a Subnet * * @return the subnet builder */ - public SubnetBuilder subnet(); + SubnetBuilder subnet(); /** * The builder to create a Port * * @return the port builder */ - public PortBuilder port(); + PortBuilder port(); /** * The builder to create a Router * * @return the router builder */ - public RouterBuilder router(); + RouterBuilder router(); /** * The builder to create a Neutron Security Group * * @return the security group builder */ - public NetSecurityGroupBuilder securityGroup(); + NetSecurityGroupBuilder securityGroup(); /** * The builder to create a Neutron Security Group Rule * * @return the security group builder */ - public NetSecurityGroupRuleBuilder securityGroupRule(); + NetSecurityGroupRuleBuilder securityGroupRule(); /** * The builder to create a Neutron Floating IP Address * * @return the floating ip builder */ - public NetFloatingIPBuilder netFloatingIP(); + NetFloatingIPBuilder netFloatingIP(); /** * The builder to create NetQuota entities * * @return the NetQuota builder */ - public NetQuotaBuilder netQuota(); + NetQuotaBuilder netQuota(); /** * The builder to create a lb member * * @return the Member Builder */ - public MemberBuilder member(); + MemberBuilder member(); /** * The builder to update a lb member * * @return the MemberUpdate Builder */ - public MemberUpdateBuilder memberUpdate(); + MemberUpdateBuilder memberUpdate(); /** * The builder to create and update a sessionPersistence * * @return SessionPersistenceBuilder */ - public SessionPersistenceBuilder sessionPersistence(); + SessionPersistenceBuilder sessionPersistence(); /** * The builder to create a vip. * * @return VipBuilder the vip builder */ - public VipBuilder vip(); + VipBuilder vip(); /** * The builder to update a vip. * * @return VipUpdateBuilder */ - public VipUpdateBuilder vipUpdate(); + VipUpdateBuilder vipUpdate(); /** * The builder to create a healthMonitor * * @return HealthMonitorBuilder */ - public HealthMonitorBuilder healthMonitor(); + HealthMonitorBuilder healthMonitor(); /** * The builder to update a healthMonitor * * @return HealthMonitorUpdateBuilder */ - public HealthMonitorUpdateBuilder healthMonitorUpdate(); + HealthMonitorUpdateBuilder healthMonitorUpdate(); /** * The builder to create a firewall * * @return FirewallBuilder */ - public FirewallBuilder firewall(); + FirewallBuilder firewall(); /** * The builder to update a healthMonitor * * @return FirewallUpdateBuilder */ - public FirewallUpdateBuilder firewallUpdate(); + FirewallUpdateBuilder firewallUpdate(); /** * The builder to create a firewallRule * * @return FirewallRuleBuilder */ - public FirewallRuleBuilder firewallRule(); + FirewallRuleBuilder firewallRule(); /** * The builder to update a firewallRule * * @return FirewallUpdateBuilder */ - public FirewallRuleUpdateBuilder firewallRuleUpdate(); + FirewallRuleUpdateBuilder firewallRuleUpdate(); /** * The builder to create a firewallPolicy * * @return FirewallPolicyBuilder */ - public FirewallPolicyBuilder firewallPolicy(); + FirewallPolicyBuilder firewallPolicy(); /** * The builder to update a firewallPolicy * * @return FirewallPolicyUpdateBuilder */ - public FirewallPolicyUpdateBuilder firewallPolicyUpdate(); + FirewallPolicyUpdateBuilder firewallPolicyUpdate(); /** * The builder to create a lbPool * * @return LbPoolBuilder */ - public LbPoolBuilder lbPool(); + LbPoolBuilder lbPool(); /** * The builder to update a lbPool * * @return LbPoolUpdateBuilder */ - public LbPoolUpdateBuilder lbPoolUpdate(); + LbPoolUpdateBuilder lbPoolUpdate(); /** * The builder to create a lbPool * * @return HealthMonitorAssociateBuilder */ - public HealthMonitorAssociateBuilder lbPoolAssociateHealthMonitor(); + HealthMonitorAssociateBuilder lbPoolAssociateHealthMonitor(); /** * The builder to create a lb v2 member * * @return the Member Builder v2 */ - public MemberV2Builder memberV2(); + MemberV2Builder memberV2(); /** * The builder to update a lbaas v2 member * * @return MemberV2UpdateBuilder */ - public MemberV2UpdateBuilder memberV2Update(); + MemberV2UpdateBuilder memberV2Update(); /** * The builder to create a v2 loadbalancer. * * @return LoadBalancerV2Builder the loadbalancer v2 builder */ - public LoadBalancerV2Builder lbV2(); + LoadBalancerV2Builder lbV2(); /** * The builder to update a lbaas v2 loadbalancer * * @return LoadBalancerV2UpdateBuilder */ - public LoadBalancerV2UpdateBuilder loadBalancerV2Update(); + LoadBalancerV2UpdateBuilder loadBalancerV2Update(); /** * The builder to create a v2 lbPool * * @return LbPoolV2Builder */ - public LbPoolV2Builder lbPoolV2(); + LbPoolV2Builder lbPoolV2(); /** * The builder to update a lbaas v2 lbPool * * @return LbPoolV2UpdateBuilder */ - public LbPoolV2UpdateBuilder lbPoolV2Update(); + LbPoolV2UpdateBuilder lbPoolV2Update(); /** * The builder to createa v2 lbaas listener * * @return ListenerV2Builder */ - public ListenerV2Builder listenerV2(); + ListenerV2Builder listenerV2(); /** * The builder to update a lbaas v2 lbaas listener * * @return ListenerV2UpdateBuilder */ - public ListenerV2UpdateBuilder listenerV2Update(); + ListenerV2UpdateBuilder listenerV2Update(); /** * The builder to create a v2 healthMonitor * * @return HealthMonitorV2Builder */ - public HealthMonitorV2Builder healthMonitorV2(); + HealthMonitorV2Builder healthMonitorV2(); /** * The builder to update a lbaas v2 health monitor * * @return HealthMonitorV2UpdateBuilder */ - public HealthMonitorV2UpdateBuilder healthMonitorV2Update(); + HealthMonitorV2UpdateBuilder healthMonitorV2Update(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java b/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java index 13a49df1d..1375df23b 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/Firewall.java @@ -18,51 +18,51 @@ public interface Firewall extends ModelEntity, Buildable { /** * @return id : Unique identifier for the firewall. */ - public String getId(); + String getId(); /** * @return name : Human readable name for the firewall (255 characters limit). Does not have to be unique. */ - public String getName(); + String getName(); /** * @return tenantId : Owner of the Firewall. Only an administrative user can * specify a tenant ID other than its own. */ - public String getTenantId(); + String getTenantId(); /** * @return description : Human readable description for the firewall (1024 characters limit). */ - public String getDescription(); + String getDescription(); /** * @return adminstateup : The administrative state of the firewall, * which is up (true) or down (false). */ - public Boolean isAdminStateUp(); + Boolean isAdminStateUp(); /** * @return shared : When set to True makes this firewall rule visible to tenants other * than its owner, and can be used in firewall policies not owned by its tenant. */ - public Boolean isShared(); + Boolean isShared(); /** * @return status The status of the health monitor. Indicates whether the * health monitor is operational. * @see NeutronFirewall.FirewallStatus */ - public NeutronFirewall.FirewallStatus getStatus(); + NeutronFirewall.FirewallStatus getStatus(); /** * @return policyid : The firewall policy uuid that this firewall is associated with. * This firewall will implement the rules contained in the firewall policy represented by this uuid. */ - public String getPolicy(); + String getPolicy(); /** * @return routerIds : A list of UUIDs for routers that are associated with the firewall. */ - public List getRouterIds(); + List getRouterIds(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java index 70af34cc9..28299636e 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicy.java @@ -21,29 +21,29 @@ public interface FirewallPolicy extends ModelEntity, Buildable getFirewallRuleIds(); + List getFirewallRuleIds(); /** * @return firewallList(UUID)List : This is a list of Firewalls associated with Firewall Policy. * This is returned when a firewall rule is added or removed from a firewall policy. */ - public List getFirewallList(); + List getFirewallList(); /** * @return neutronFirewallRulesList : This is an ordered list of firewall rules (by uuid). * The firewall applies the rules in the order in which they appear in this list. * @see FirewallRule */ - public List getNeutronFirewallRules(); + List getNeutronFirewallRules(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java index b9925dcb9..2034922ad 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallPolicyUpdate.java @@ -21,18 +21,18 @@ public interface FirewallPolicyUpdate extends ModelEntity, Buildable getFirewallRuleIds(); + List getFirewallRuleIds(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java index 373cb41b5..857fc3a66 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRule.java @@ -18,23 +18,23 @@ public interface FirewallRule extends ModelEntity, Buildableread-only attribute which gets populated with the uuid of the firewall policy when this @@ -42,64 +42,64 @@ public interface FirewallRule extends ModelEntity, Buildablenull if the rule is not * associated with any firewall policy. */ - public String getPolicy(); + String getPolicy(); /** * @return shared : When set to True makes this firewall rule visible to tenants other than its owner, * and can be used in firewall policies not owned by its tenant. */ - public Boolean isShared(); + Boolean isShared(); /** * @return protocol : IP Protocol : Possible values are ICMP/TCP/UDP/NONE(ANY). * @see NeutronFirewallRule.IPProtocol */ - public NeutronFirewallRule.IPProtocol getProtocol(); + NeutronFirewallRule.IPProtocol getProtocol(); /** * @return ipVersion : IP Protocol Version : Possible values are 4/6. * @see IPVersionType */ - public IPVersionType getIpVersion(); + IPVersionType getIpVersion(); /** * @return sourceIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. */ - public String getSourceIpAddress(); + String getSourceIpAddress(); /** * @return destinationIpAddress or CIDR : Valid IP address (v4 or v6), or CIDR. */ - public String getDestinationIpAddress(); + String getDestinationIpAddress(); /** * @return sourcePort : Valid port number (integer or string), or port range in the format of a ':' separated range). * In the case of port range, both ends of the range are included. */ - public String getSourcePort(); + String getSourcePort(); /** * @return destinationPort : Valid port number (integer or string), or port range in the format of a ':' separated range). * In the case of port range, both ends of the range are included. */ - public String getDestinationPort(); + String getDestinationPort(); /** * @return position : This is a read-only attribute that gets assigned to this rule when the rule is associated with a firewall policy. * It indicates the position of this rule in that firewall policy. This position number starts at 1. * The position can be null if the firewall rule is not associated with any policy. */ - public Integer getPosition(); + Integer getPosition(); /** * @return action : Action to be performed on the traffic matching the rule (allow, deny). * @see NeutronFirewallRule.FirewallRuleAction */ - public NeutronFirewallRule.FirewallRuleAction getAction(); + NeutronFirewallRule.FirewallRuleAction getAction(); /** * @return enabled : When set to False will disable this rule in the firewall policy. Facilitates selectively turning off * rules without having to disassociate the rule from the firewall policy. */ - public Boolean isEnabled(); + Boolean isEnabled(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java index 83ac323f6..6fb9c1e24 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/FirewallRuleUpdate.java @@ -19,68 +19,68 @@ public interface FirewallRuleUpdate extends ModelEntity, Buildable { /** * @return id. The unique ID for the pool. */ - public String getId(); + String getId(); /** * @return tenantId. * Owner of the pool. Only an administrative user can specify a tenant ID other than its own. */ - public String getTenantId(); + String getTenantId(); /** * @return vip Id. */ - public String getVipId(); + String getVipId(); /** * @return Pool name. Does not have to be unique. */ - public String getName(); + String getName(); /** * @return Description for the pool. */ - public String getDescription(); + String getDescription(); /** * @return subnetId The ID of the subnet on which to allocate the VIP address. */ - public String getSubnetId(); + String getSubnetId(); /** * @return The protocol of the pool, which is TCP, HTTP, or HTTPS. */ - public Protocol getProtocol(); + Protocol getProtocol(); /** * @return loadbalance provider,such as haproxy */ - public String getProvider(); + String getProvider(); /** * @return The load-balancer algorithm, which is round-robin, least-connections, and so on. This value, which must be supported, is dependent on the load-balancer provider. Round-robin must be supported. */ - public LbMethod getLbMethod(); + LbMethod getLbMethod(); /** * @return List of members that belong to the pool. */ - public List getMembers(); + List getMembers(); /** * @return List of health monitors that associated to the pool. */ - public List getHealthMonitors(); + List getHealthMonitors(); /** * @return The administrative state of the lb pool, which is up (true) or * down (false). */ - public boolean isAdminStateUp(); + boolean isAdminStateUp(); /** * @return status The status of the lb pool. Indicates whether the lb pool is * operational. */ - public String getStatus(); + String getStatus(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java index 8bdf8793f..df9017875 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolStats.java @@ -6,20 +6,20 @@ public interface LbPoolStats extends ModelEntity { /** * @return The inbound bytes of the loadbalancer. */ - public Long getBytesIn(); + Long getBytesIn(); /** * @return The inbound bytes of the loadbalancer. */ - public Long getBytesOut(); + Long getBytesOut(); /** * @return The number of total connections of the loadbalancer. */ - public Integer getTotalConnections(); + Integer getTotalConnections(); /** * @return The number of active connections of the loadbalancer. */ - public Integer getActiveConnections(); + Integer getActiveConnections(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java index 4fbd782e7..5069d4312 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/LbPoolUpdate.java @@ -15,20 +15,20 @@ public interface LbPoolUpdate extends ModelEntity, Buildable { * @return status The status of the member. Indicates whether the member is * operational. */ - public String getStatus(); + String getStatus(); /** * @return address the IP address of a member */ - public String getAddress(); + String getAddress(); /** * @return The administrative state of the member, which is up (true) or * down (false). */ - public boolean isAdminStateUp(); + boolean isAdminStateUp(); /** * @return the id of a tenant. Owner of the member. */ - public String getTenantId(); + String getTenantId(); /** * @return the member identifier */ - public String getId(); + String getId(); /** * @return The port on which the application is hosted.such as 80 */ - public Integer getProtocolPort(); + Integer getProtocolPort(); /** * @return Weight of member.1~256 */ - public Integer getWeight(); + Integer getWeight(); /** * @return The Loadbalance pool identifier */ - public String getPoolId(); + String getPoolId(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java index 94f9ad809..009ed8760 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/MemberUpdate.java @@ -15,15 +15,15 @@ public interface MemberUpdate extends ModelEntity, Buildable { /** * @return The IP address of the VIP. */ - public String getAddress(); + String getAddress(); /** * @return The administrative state of the VIP. A valid value is true (UP) * or false (DOWN). */ - public boolean isAdminStateUp(); + boolean isAdminStateUp(); /** * @return connectionLimit.The maximum number of connections allowed for the * VIP. Default is -1, meaning no limit. */ - public Integer getConnectionLimit(); + Integer getConnectionLimit(); /** * @return Human-readable description for the VIP */ - public String getDescription(); + String getDescription(); /** * @return The unique ID for the VIP. */ - public String getId(); + String getId(); /** * @return Human-readable name for the VIP. Does not have to be unique. */ - public String getName(); + String getName(); /** * @return The ID of the pool with which the VIP is associated. */ - public String getPoolId(); + String getPoolId(); /** * @return The protocol of the VIP address. A valid value is TCP, HTTP, or * HTTPS. */ - public Protocol getProtocol(); + Protocol getProtocol(); /** * @return The port on which to listen to client traffic that is associated * with the VIP address. A valid value is from 1 to 65535. */ - public Integer getProtocolPort(); + Integer getProtocolPort(); /** * @return SessionPersistence.Session persistence parameters for the VIP. @@ -67,23 +67,23 @@ public interface Vip extends ModelEntity, Buildable { * response. To clear session persistence for the VIP, set the * session_persistence parameter to null in a VIP update request. */ - public SessionPersistence getSessionPersistence(); + SessionPersistence getSessionPersistence(); /** * @return status.The status of the VIP. Indicates whether the VIP is * operational. */ - public String getStatus(); + String getStatus(); /** * @return The ID of the subnet on which to allocate the VIP address. */ - public String getSubnetId(); + String getSubnetId(); /** * @return The Tenant Id.Owner of the VIP. */ - public String getTenantId(); + String getTenantId(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java b/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java index 9d665c49f..de0dd17d9 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/VipUpdate.java @@ -15,41 +15,41 @@ public interface VipUpdate extends ModelEntity, Buildable { * * @see Vip#isAdminStateUp() */ - public boolean isAdminStateUp(); + boolean isAdminStateUp(); /** * Optional * * @see Vip#getConnectionLimit() */ - public Integer getConnectionLimit(); + Integer getConnectionLimit(); /** * Optional * * @see Vip#getDescription() */ - public String getDescription(); + String getDescription(); /** * Optional * * @see Vip#getName() */ - public String getName(); + String getName(); /** * Optional * * @see Vip#getPoolId() */ - public String getPoolId(); + String getPoolId(); /** * Optional * * @see Vip#getSessionPersistence() */ - public SessionPersistence getSessionPersistence(); + SessionPersistence getSessionPersistence(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java index bb13d099f..789c152a3 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallBuilder.java @@ -17,26 +17,26 @@ public interface FirewallBuilder extends Builder { * specify a tenant ID other than its own. * @return FirewallBuilder */ - public FirewallBuilder tenantId(String tenantId); + FirewallBuilder tenantId(String tenantId); /** * @param name : Human readable name for the firewall (255 characters limit). Does not have to be unique. * @return FirewallBuilder */ - public FirewallBuilder name(String name); + FirewallBuilder name(String name); /** * @param description : Human readable description for the firewall (1024 characters limit). * @return FirewallBuilder */ - public FirewallBuilder description(String description); + FirewallBuilder description(String description); /** * @param adminstateup : The administrative state of the firewall, * which is up (true) or down (false). * @return FirewallBuilder */ - public FirewallBuilder adminStateUp(Boolean adminStateUp); + FirewallBuilder adminStateUp(Boolean adminStateUp); /** * shared : When set to True makes this firewall rule visible to tenants other @@ -44,18 +44,18 @@ public interface FirewallBuilder extends Builder { * * @return FirewallBuilder */ - public FirewallBuilder shared(Boolean shared); + FirewallBuilder shared(Boolean shared); /** * @param policyid : The firewall policy uuid that this firewall is associated with. * This firewall will implement the rules contained in the firewall policy represented by this uuid. * @return FirewallBuilder */ - public FirewallBuilder policy(String policyId); + FirewallBuilder policy(String policyId); /** * @param routerIds : A list of UUIDs for routers that are associated with the firewall. * @return FirewallBuilder */ - public FirewallBuilder routerIds(List routerIds); + FirewallBuilder routerIds(List routerIds); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java index 8144c7a28..1bfc40b66 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyBuilder.java @@ -16,27 +16,27 @@ public interface FirewallPolicyBuilder extends Builder ruleIdList); + FirewallPolicyBuilder firewallRules(List ruleIdList); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java index a5b942083..04ed52478 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallPolicyUpdateBuilder.java @@ -16,20 +16,20 @@ public interface FirewallPolicyUpdateBuilder extends Builder ruleIdList); + FirewallPolicyUpdateBuilder firewallRules(List ruleIdList); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java index 1256c3d6f..4b1b37698 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/FirewallRuleBuilder.java @@ -16,79 +16,79 @@ public interface FirewallRuleBuilder extends Builder { * tenant ID other than its own. * @return LbPoolBuilder */ - public LbPoolBuilder tenantId(String tenantId); + LbPoolBuilder tenantId(String tenantId); /** * @param protocol The protocol of the VIP address. A valid value is TCP, HTTP, * or HTTPS. * @return LbPoolBuilder */ - public LbPoolBuilder protocol(Protocol protocol); + LbPoolBuilder protocol(Protocol protocol); /** * @param name Pool name. Does not have to be unique. * @return LbPoolBuilder */ - public LbPoolBuilder name(String name); + LbPoolBuilder name(String name); /** * @param description Description for the pool. * @return LbPoolBuilder */ - public LbPoolBuilder description(String description); + LbPoolBuilder description(String description); /** * @param subnentId The ID of the subnet on which to allocate the VIP address. * @return LbPoolBuilder */ - public LbPoolBuilder subnetId(String subnentId); + LbPoolBuilder subnetId(String subnentId); /** * @param provider Loadbalance provider which openstack supports,such as haproxy * @return LbPoolBuilder */ - public LbPoolBuilder provider(String provider); + LbPoolBuilder provider(String provider); /** * @param lbMethod The load-balancer algorithm, which is round-robin, @@ -57,12 +57,12 @@ public interface LbPoolBuilder extends Builder { * robin must be supported. * @return LbPoolBuilder */ - public LbPoolBuilder lbMethod(LbMethod lbMethod); + LbPoolBuilder lbMethod(LbMethod lbMethod); /** * @param adminStateUp The administrative state of the lb pool, which is up (true) or * down (false). * @return LbPoolBuilder */ - public LbPoolBuilder adminStateUp(boolean adminStateUp); + LbPoolBuilder adminStateUp(boolean adminStateUp); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java index f9175ddb6..252907cab 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/LbPoolUpdateBuilder.java @@ -18,25 +18,25 @@ public interface LbPoolUpdateBuilder extends Builder { * tenant ID other than its own. * @return MemberBuilder */ - public MemberBuilder tenantId(String tenantId); + MemberBuilder tenantId(String tenantId); /** * @param adminStateUp The administrative state of the member, which is up (true) or * down (false). * @return MemberBuilder */ - public MemberBuilder adminStateUp(boolean adminStateUp); + MemberBuilder adminStateUp(boolean adminStateUp); /** * @param address The IP address of the member. * @return MemberBuilder */ - public MemberBuilder address(String address); + MemberBuilder address(String address); /** * @param protocolPort . The port on which the application is hosted..A valid value * is from 1 to 65535 * @return MemberBuilder */ - public MemberBuilder protocolPort(Integer protocolPort); + MemberBuilder protocolPort(Integer protocolPort); /** * @param weight Weight of member.from 1 to 256 * @return MemberBuilder */ - public MemberBuilder weight(Integer weight); + MemberBuilder weight(Integer weight); /** * @param lbPoolId the lb pool identifier * @return MemberBuilder */ - public MemberBuilder poolId(String lbPoolId); + MemberBuilder poolId(String lbPoolId); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java index 3380cec61..86330dba2 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/builder/MemberUpdateBuilder.java @@ -15,17 +15,17 @@ public interface MemberUpdateBuilder extends Builder getMemberStatuses(); + List getMemberStatuses(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java index ed473c46e..bb0371177 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/ListenerV2Status.java @@ -13,33 +13,33 @@ public interface ListenerV2Status extends ModelEntity { * * @return name */ - public String getName(); + String getName(); /** * The id of the listener * * @return id */ - public String getId(); + String getId(); /** * The operating status of the listener * * @return operating status */ - public String getOperatingStatus(); + String getOperatingStatus(); /** * The provisioning status of the listener * * @return provisioning status */ - public String getProvisioningStatus(); + String getProvisioningStatus(); /** * The statuses of the pools associated with this listener * * @return list of the status of the pools */ - public List getLbPoolV2Statuses(); + List getLbPoolV2Statuses(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java index 1651f9c60..8f1bf54d1 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/LoadBalancerV2Status.java @@ -18,33 +18,33 @@ public interface LoadBalancerV2Status extends ModelEntity { * * @return id */ - public String getId(); + String getId(); /** * The name of the loadbalancer * * @return name */ - public String getName(); + String getName(); /** * The operating status of the loadbalancer * * @return operating status */ - public String getOperatingStatus(); + String getOperatingStatus(); /** * The provisioning status of the loadbalancer * * @return provisioning status */ - public String getProvisioningStatus(); + String getProvisioningStatus(); /** * The listeners associated with the loadbalancer * * @return list of listener statuses */ - public List getListenerStatuses(); + List getListenerStatuses(); } diff --git a/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java b/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java index c55f775d3..39b82c447 100644 --- a/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java +++ b/core/src/main/java/org/openstack4j/model/network/ext/status/MemberV2Status.java @@ -16,33 +16,33 @@ public interface MemberV2Status extends ModelEntity { * * @return id */ - public String getId(); + String getId(); /** * The address of the memeber * * @return address */ - public String getAddress(); + String getAddress(); /** * The protocol port of the member * * @return protocol port */ - public Integer getProtocolPort(); + Integer getProtocolPort(); /** * The operating status of the member * * @return operating status */ - public String getOperatingStatus(); + String getOperatingStatus(); /** * The provisioning status of the member * * @return provisioning status */ - public String getProvisioningStatus(); + String getProvisioningStatus(); } diff --git a/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java b/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java index bf4e9f9b6..f7b1b61d2 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java +++ b/core/src/main/java/org/openstack4j/model/octavia/LbPoolV2Update.java @@ -14,29 +14,29 @@ public interface LbPoolV2Update extends ModelEntity, Buildable getMemberStatuses(); + List getMemberStatuses(); } diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java index d149d0db8..530ba85ee 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/ListenerV2Status.java @@ -13,33 +13,33 @@ public interface ListenerV2Status extends ModelEntity { * * @return name */ - public String getName(); + String getName(); /** * The id of the listener * * @return id */ - public String getId(); + String getId(); /** * The operating status of the listener * * @return operating status */ - public String getOperatingStatus(); + String getOperatingStatus(); /** * The provisioning status of the listener * * @return provisioning status */ - public String getProvisioningStatus(); + String getProvisioningStatus(); /** * The statuses of the pools associated with this listener * * @return list of the status of the pools */ - public List getLbPoolV2Statuses(); + List getLbPoolV2Statuses(); } diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java index 03c2df873..fbbac81fa 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/LoadBalancerV2Status.java @@ -18,33 +18,33 @@ public interface LoadBalancerV2Status extends ModelEntity { * * @return id */ - public String getId(); + String getId(); /** * The name of the loadbalancer * * @return name */ - public String getName(); + String getName(); /** * The operating status of the loadbalancer * * @return operating status */ - public String getOperatingStatus(); + String getOperatingStatus(); /** * The provisioning status of the loadbalancer * * @return provisioning status */ - public String getProvisioningStatus(); + String getProvisioningStatus(); /** * The listeners associated with the loadbalancer * * @return list of listener statuses */ - public List getListenerStatuses(); + List getListenerStatuses(); } diff --git a/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java b/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java index 36bbb6a1a..68c41825e 100644 --- a/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java +++ b/core/src/main/java/org/openstack4j/model/octavia/status/MemberV2Status.java @@ -16,33 +16,33 @@ public interface MemberV2Status extends ModelEntity { * * @return id */ - public String getId(); + String getId(); /** * The address of the memeber * * @return address */ - public String getAddress(); + String getAddress(); /** * The protocol port of the member * * @return protocol port */ - public Integer getProtocolPort(); + Integer getProtocolPort(); /** * The operating status of the member * * @return operating status */ - public String getOperatingStatus(); + String getOperatingStatus(); /** * The provisioning status of the member * * @return provisioning status */ - public String getProvisioningStatus(); + String getProvisioningStatus(); } diff --git a/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java b/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java index e7fda2aae..716074c41 100644 --- a/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java +++ b/core/src/main/java/org/openstack4j/model/sahara/builder/DataProcessingBuilders.java @@ -10,70 +10,70 @@ public interface DataProcessingBuilders { * * @return the cluster builder */ - public ClusterBuilder cluster(); + ClusterBuilder cluster(); /** * The builder to create a sahara cluster template * * @return the cluster template builder */ - public ClusterTemplateBuilder clusterTemplate(); + ClusterTemplateBuilder clusterTemplate(); /** * The builder to create a sahara node group * * @return the node group builder */ - public NodeGroupBuilder nodeGroup(); + NodeGroupBuilder nodeGroup(); /** * The builder to create a sahara node group template * * @return the node group template builder */ - public NodeGroupTemplateBuilder nodeGroupTemplate(); + NodeGroupTemplateBuilder nodeGroupTemplate(); /** * The builder to create a sahara service configuration * * @return the service configuration builder */ - public ServiceConfigBuilder serviceConfig(); + ServiceConfigBuilder serviceConfig(); /** * The builder which creates a sahara Data Source * * @return the data source builder */ - public DataSourceBuilder dataSource(); + DataSourceBuilder dataSource(); /** * The builder which creates a sahara Job Binary * * @return the job binary builder */ - public JobBinaryBuilder jobBinary(); + JobBinaryBuilder jobBinary(); /** * The builder which creates a sahara Job * * @return the job builder */ - public JobBuilder job(); + JobBuilder job(); /** * The builder which creates a job configuration for sahara job execution * * @return the job config builder */ - public JobConfigBuilder jobConfig(); + JobConfigBuilder jobConfig(); /** * The builder which creates a sahara job execution * * @return the job execution builder */ - public JobExecutionBuilder jobExecution(); + JobExecutionBuilder jobExecution(); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java b/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java index 0a230db68..2bbbde585 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/BlockLimits.java @@ -9,7 +9,7 @@ public interface BlockLimits { Absolute getAbsolute(); - public interface Absolute { + interface Absolute { /** * @return the total snapshots used diff --git a/core/src/main/java/org/openstack4j/model/storage/block/Volume.java b/core/src/main/java/org/openstack4j/model/storage/block/Volume.java index 50e82e208..274538f23 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/Volume.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/Volume.java @@ -24,7 +24,7 @@ public interface Volume extends ModelEntity, Buildable { /** * The current Volume Status */ - public enum Status { + enum Status { AVAILABLE, ATTACHING, BACKING_UP, CREATING, DELETING, DOWNLOADING, UPLOADING, ERROR, ERROR_DELETING, ERROR_RESTORING, IN_USE, RESTORING_BACKUP, DETACHING, UNRECOGNIZED; @JsonValue @@ -47,7 +47,7 @@ public static Status fromValue(String status) { } } - public enum MigrationStatus { + enum MigrationStatus { NONE, MIGRATING; @JsonValue diff --git a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java index b556c2be3..566b43ad6 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/VolumeBackup.java @@ -15,7 +15,7 @@ public interface VolumeBackup extends ModelEntity { * The volume backup Status */ - public enum Status { + enum Status { AVAILABLE, CREATING, DELETING, ERROR, ERROR_RESTORING, RESTORING, UNRECOGNIZED; @JsonValue diff --git a/core/src/main/java/org/openstack4j/model/storage/block/builder/StorageBuilders.java b/core/src/main/java/org/openstack4j/model/storage/block/builder/StorageBuilders.java index e1dee948c..a84307522 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/builder/StorageBuilders.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/builder/StorageBuilders.java @@ -11,27 +11,27 @@ public interface StorageBuilders { * * @return the block quota-set builder */ - public BlockQuotaSetBuilder blockQuotaSet(); + BlockQuotaSetBuilder blockQuotaSet(); /** * The builder to create a Block Volume * * @return the volume builder */ - public VolumeBuilder volume(); + VolumeBuilder volume(); /** * The builder to create a Block Volume Snapshot * * @return the snapshot builder */ - public VolumeSnapshotBuilder volumeSnapshot(); + VolumeSnapshotBuilder volumeSnapshot(); /** * The builder to create a volume backup * * @return the backup creation builder */ - public VolumeBackupCreateBuilder volumeBackupCreate(); + VolumeBackupCreateBuilder volumeBackupCreate(); } diff --git a/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java b/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java index 670d11e10..2415b8b1e 100644 --- a/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java +++ b/core/src/main/java/org/openstack4j/model/storage/block/ext/Service.java @@ -14,7 +14,7 @@ public interface Service extends ModelEntity { /** * The status of a Block storage service entity */ - public enum Status { + enum Status { DISABLED, ENABLED, UNRECOGNIZED; @JsonCreator @@ -33,7 +33,7 @@ public static Status forValue(String value) { /** * The state of a Block storage service entity */ - public enum State { + enum State { DOWN, UNRECOGNIZED, UP; @JsonCreator diff --git a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java index d845a7326..c7649d342 100644 --- a/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java +++ b/core/src/main/java/org/openstack4j/model/tacker/builder/VnfUpdateBuilder.java @@ -15,5 +15,5 @@ public interface VnfUpdateBuilder extends Builder { * @param attributes : VnfUpdateAttributes * @return VnfUpdateBuilder */ - public VnfUpdateBuilder attributes(VnfUpdateAttributes attributes); + VnfUpdateBuilder attributes(VnfUpdateAttributes attributes); } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java b/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java index a72c24a6c..1289fc2b3 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/Alarm.java @@ -75,7 +75,7 @@ public interface Alarm extends ModelEntity, BasicResource, Buildable getAlarmIds(); Operator getOperator(); @@ -201,7 +201,7 @@ public interface CombinationRule { void setOperator(Operator operator); } - public interface ThresholdRule { + interface ThresholdRule { String getMeterName(); int getEvaluationPeriods(); @@ -236,7 +236,7 @@ public interface ThresholdRule { } - public interface Query { + interface Query { String getField(); String getValue(); @@ -251,7 +251,7 @@ public interface Query { } //gnocchi_resources_threshold - public interface GnocchiResourcesThresholdRule { + interface GnocchiResourcesThresholdRule { String getMetric(); String getResourceId(); @@ -286,7 +286,7 @@ public interface GnocchiResourcesThresholdRule { } //gnocchi_aggregation_by_metrics_threshold - public interface GnocchiAggregationByMetricsThresholdRule { + interface GnocchiAggregationByMetricsThresholdRule { List getMetrics(); ComparisonOperator getComparisonOperator(); @@ -313,7 +313,7 @@ public interface GnocchiAggregationByMetricsThresholdRule { } //gnocchi_aggregation_by_resources_threshold - public interface GnocchiAggregationByResourcesThresholdRule { + interface GnocchiAggregationByResourcesThresholdRule { String getMetric(); String getResourceType(); @@ -348,11 +348,11 @@ public interface GnocchiAggregationByResourcesThresholdRule { } //event - public interface GnocchiEvent { + interface GnocchiEvent { } - public interface MetricOfResourceRule { + interface MetricOfResourceRule { String getMetric(); String getResourceId(); @@ -366,7 +366,7 @@ public interface MetricOfResourceRule { void setResourceType(String resourceType); } - public interface AggregationMetricByResourcesLookupRule { + interface AggregationMetricByResourcesLookupRule { String getMetric(); String getResourceType(); @@ -376,13 +376,13 @@ public interface AggregationMetricByResourcesLookupRule { void setResourceType(String resourceType); } - public interface AggregationMetricsByIdLookupRule { + interface AggregationMetricsByIdLookupRule { String getMetric(); void setMetric(String metric); } - public interface AlarmTimeConstraint { + interface AlarmTimeConstraint { String getDescription(); int getDuration(); @@ -404,7 +404,7 @@ public interface AlarmTimeConstraint { void setTimezone(String timezone); } - public interface AlarmChange { + interface AlarmChange { String getAlarmId(); String getDetail(); @@ -438,7 +438,7 @@ public interface AlarmChange { void setUserId(String userId); //The type of change - public enum ChangeType { + enum ChangeType { CREATION, RULE_CHANGE, STATE_TRANSITION, DELETION, UNRECOGNIZED; @JsonValue diff --git a/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java b/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java index 39cda7ee5..fea242ad8 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/EventCriteria.java @@ -146,7 +146,7 @@ public static class NameOpValue { this.field = field; this.operator = operator; if (value instanceof Date) - this.value = Parser.toISO8601DateFormat(Date.class.cast(value)); + this.value = Parser.toISO8601DateFormat((Date) value); else this.value = String.valueOf(value); } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/Meter.java b/core/src/main/java/org/openstack4j/model/telemetry/Meter.java index 96b1b5deb..84dda2ecf 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/Meter.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/Meter.java @@ -14,7 +14,7 @@ public interface Meter extends ModelEntity { /** * The Meter Type */ - public enum Type { + enum Type { GAUGE, DELTA, CUMULATIVE, UNRECOGNIZED; @JsonValue diff --git a/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java b/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java index d98b97f3e..37cf5f7ca 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/SampleCriteria.java @@ -39,7 +39,7 @@ public enum Oper { EQUALS("eq"); private final String queryValue; - private Oper(String queryValue) { + Oper(String queryValue) { this.queryValue = queryValue; } @@ -150,7 +150,7 @@ public static class NameOpValue { this.field = field; this.operator = operator; if (value instanceof Date) { - this.value = Parser.toISO8601DateFormat(Date.class.cast(value)); + this.value = Parser.toISO8601DateFormat((Date) value); } else { this.value = String.valueOf(value); } diff --git a/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java b/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java index d7779e9d1..1b28bea4e 100644 --- a/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java +++ b/core/src/main/java/org/openstack4j/model/telemetry/builder/TelemetryBuilders.java @@ -10,6 +10,6 @@ public interface TelemetryBuilders { * * @return the image builder */ - public AlarmBuilder alarm(); + AlarmBuilder alarm(); } diff --git a/core/src/main/java/org/openstack4j/model/workflow/Scope.java b/core/src/main/java/org/openstack4j/model/workflow/Scope.java index 829daff11..6db43a664 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/Scope.java +++ b/core/src/main/java/org/openstack4j/model/workflow/Scope.java @@ -16,5 +16,5 @@ public enum Scope { * Entities with this scope belong to one tenant. */ @JsonProperty("private") - PRIVATE; + PRIVATE } diff --git a/core/src/main/java/org/openstack4j/model/workflow/State.java b/core/src/main/java/org/openstack4j/model/workflow/State.java index f3f2a78f1..3177ba0ea 100644 --- a/core/src/main/java/org/openstack4j/model/workflow/State.java +++ b/core/src/main/java/org/openstack4j/model/workflow/State.java @@ -11,5 +11,5 @@ public enum State { PAUSED, SUCCESS, CANCELLED, - ERROR; + ERROR } diff --git a/core/src/main/java/org/openstack4j/openstack/common/Auth.java b/core/src/main/java/org/openstack4j/openstack/common/Auth.java index d89bb0e9d..487f9b815 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/Auth.java +++ b/core/src/main/java/org/openstack4j/openstack/common/Auth.java @@ -4,6 +4,6 @@ public interface Auth extends ModelEntity { - public enum Type {CREDENTIALS, TOKEN, RAX_APIKEY, TOKENLESS} + enum Type {CREDENTIALS, TOKEN, RAX_APIKEY, TOKENLESS} } diff --git a/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java b/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java index d414c9bf2..8b7440eef 100644 --- a/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java +++ b/core/src/main/java/org/openstack4j/openstack/common/TelemetryDateDeserializer.java @@ -33,7 +33,7 @@ public TelemetryDateDeserializer(Class vc) { @Override public Date deserialize(JsonParser jsonParser, DeserializationContext ctxt) - throws IOException, JsonProcessingException { + throws IOException { String date = jsonParser.getText(); SimpleDateFormat sdf = new SimpleDateFormat(MILLIS_DATE_FORMAT); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java index 10ac8218e..0d50c2deb 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateNameserver.java @@ -70,7 +70,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - DesignateNameserver that = DesignateNameserver.class.cast(obj); + DesignateNameserver that = (DesignateNameserver) obj; return Objects.equal(this.hostname, that.hostname) && Objects.equal(this.priority, that.priority); } diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java index 26d9f0010..c19b3db92 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateRecordset.java @@ -168,7 +168,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - DesignateRecordset that = DesignateRecordset.class.cast(obj); + DesignateRecordset that = (DesignateRecordset) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.projectId, that.projectId) && Objects.equal(this.name, that.name) diff --git a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java index d74e06693..b86513c46 100644 --- a/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java +++ b/core/src/main/java/org/openstack4j/openstack/dns/v2/domain/DesignateZone.java @@ -184,7 +184,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - DesignateZone that = DesignateZone.class.cast(obj); + DesignateZone that = (DesignateZone) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.poolId, that.poolId) && Objects.equal(this.projectId, that.projectId) diff --git a/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java b/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java index 5b3192253..6583c757a 100755 --- a/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/utils/Environment.java @@ -19,15 +19,15 @@ public class Environment { private Map files = new HashMap(); private URL baseUrl; - public Environment(URL environmentRes) throws JsonParseException, IOException, URISyntaxException { + public Environment(URL environmentRes) throws IOException, URISyntaxException { setEnvContent(Resources.toString(environmentRes, Charsets.UTF_8)); setBaseUrl(TemplateUtils.baseUrl(environmentRes.toString())); getFileContent(); } public Environment(String environmentLoc) - throws JsonParseException, MalformedURLException, - UnsupportedEncodingException, IOException, URISyntaxException { + throws + IOException, URISyntaxException { this(TemplateUtils.normaliseFilePathToUrl(environmentLoc)); } @@ -43,7 +43,7 @@ private Map getResourceRegistry() { * Processing the template files located in the resource_registry part in the environment file */ private void getFileContent() - throws JsonParseException, MalformedURLException, UnsupportedEncodingException, IOException, URISyntaxException { + throws IOException, URISyntaxException { Map rr = getResourceRegistry(); if (rr == null) return; if (rr.get("base_url") != null) setBaseUrl(new URL(rr.get("base_url"))); diff --git a/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java b/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java index dafb836a8..d5e9b7aee 100644 --- a/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java +++ b/core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java @@ -28,15 +28,15 @@ public class Template { private final static String GET_FILE = "get_file"; - public Template(URL templateRes) throws JsonParseException, IOException { + public Template(URL templateRes) throws IOException { setTplContent(Resources.toString(templateRes, Charsets.UTF_8)); baseUrl = TemplateUtils.baseUrl(templateRes.toString()); getFileContents(); } public Template(String templateLoc) - throws JsonParseException, MalformedURLException, - UnsupportedEncodingException, IOException, URISyntaxException { + throws + IOException, URISyntaxException { this(TemplateUtils.normaliseFilePathToUrl(templateLoc)); } @@ -56,7 +56,7 @@ private void getFileContents() { } } - private void resolveTemplateType(Map map) throws MalformedURLException, IOException { + private void resolveTemplateType(Map map) throws IOException { for (Object key : map.keySet()) { // Ignore if the key is not string. Actually not happening if (!(key instanceof String)) { @@ -144,11 +144,7 @@ private boolean isTemplate(String key, String value) { if (!key.equals("type")) { return false; } - if (value.endsWith(".yaml") || value.endsWith(".template")) { - return true; - } else { - return false; - } + return value.endsWith(".yaml") || value.endsWith(".template"); } public String getTplContent() { diff --git a/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java b/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java index 135c19997..9fb6c1645 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/internal/DefaultEndpointURLResolver.java @@ -235,11 +235,8 @@ public boolean equals(Object obj) { if (type != other.type) return false; if (uid == null) { - if (other.uid != null) - return false; - } else if (!uid.equals(other.uid)) - return false; - return true; + return other.uid == null; + } else return uid.equals(other.uid); } } diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java index 55c416d18..ac327b304 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneEndpoint.java @@ -130,7 +130,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneEndpoint that = KeystoneEndpoint.class.cast(obj); + KeystoneEndpoint that = (KeystoneEndpoint) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.versionId, that.versionId) && Objects.equal(this.region, that.region) && Objects.equal(this.publicURL, that.publicURL) && Objects.equal(this.internalURL, that.internalURL) && Objects.equal(this.adminURL, that.adminURL) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java index 859d0fc50..08d7b2b35 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneServiceEndpoint.java @@ -115,7 +115,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneServiceEndpoint that = KeystoneServiceEndpoint.class.cast(obj); + KeystoneServiceEndpoint that = (KeystoneServiceEndpoint) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.publicURL, that.publicURL) && Objects.equal(this.region, that.region) && Objects.equal(this.internalURL, that.internalURL) && Objects.equal(this.adminURL, that.adminURL) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java index ece60ed6f..8de94a793 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v2/domain/KeystoneTenant.java @@ -130,7 +130,7 @@ public int hashCode() { public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneTenant that = KeystoneTenant.class.cast(obj); + KeystoneTenant that = (KeystoneTenant) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.name, that.name) && Objects.equal(this.description, that.description); diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java index f6e407636..0faf0a37e 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneEndpoint.java @@ -189,7 +189,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneEndpoint that = KeystoneEndpoint.class.cast(obj); + KeystoneEndpoint that = (KeystoneEndpoint) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.type, that.type) && Objects.equal(this.name, that.name) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java index a5a3034ef..f0797057b 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneGroup.java @@ -112,7 +112,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneGroup that = KeystoneGroup.class.cast(obj); + KeystoneGroup that = (KeystoneGroup) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.domainId, that.domainId) && Objects.equal(this.description, that.description) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java index a7b1542b3..8b2959cd7 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystonePolicy.java @@ -119,7 +119,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystonePolicy that = KeystonePolicy.class.cast(obj); + KeystonePolicy that = (KeystonePolicy) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.type, that.type) && Objects.equal(this.projectId, that.projectId) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java index 4d41ed815..851d7a6a5 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneProject.java @@ -233,7 +233,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneProject that = KeystoneProject.class.cast(obj); + KeystoneProject that = (KeystoneProject) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.domain, that.domain) && Objects.equal(this.description, that.description) diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java index 154761988..308fd01c9 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneRegion.java @@ -73,7 +73,7 @@ public boolean equals(Object obj) { return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneRegion that = KeystoneRegion.class.cast(obj); + KeystoneRegion that = (KeystoneRegion) obj; return Objects.equal(this.id, that.id) && Objects.equal(this.description, that.description) && Objects.equal(this.parentRegionId, that.parentRegionId); diff --git a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java index e1fb79cc7..f652c7aab 100644 --- a/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java +++ b/core/src/main/java/org/openstack4j/openstack/identity/v3/domain/KeystoneUser.java @@ -163,7 +163,7 @@ public String toString() { public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; - KeystoneUser that = KeystoneUser.class.cast(obj); + KeystoneUser that = (KeystoneUser) obj; return Objects.equal(this.name, that.name) && Objects.equal(this.id, that.id) && Objects.equal(this.email, that.email) diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java index 816eb6e7f..b69db2f9c 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/GlanceImage.java @@ -25,8 +25,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class GlanceImage implements Image { - private static final Set RESERVED_KEYS = Sets.newHashSet(Arrays.asList(new String[]{ - "id", + private static final Set RESERVED_KEYS = Sets.newHashSet(Arrays.asList("id", "name", "tags", "status", @@ -52,7 +51,7 @@ public class GlanceImage implements Image { "os_version", "os_distro", "ramdisk_id", - "virtual_size"})); + "virtual_size")); private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java b/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java index 5b510e343..cf0ed6ce2 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/OSAuthenticator.java @@ -241,8 +241,6 @@ private static class SessionInfo { } private static boolean isEmpty(String str) { - if (str != null && str.length() > 0) - return false; - return true; + return str == null || str.length() <= 0; } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java index 16c9617c6..96f26e529 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronAvailabilityZone.java @@ -76,11 +76,9 @@ public boolean equals(Object obj) { if (obj instanceof NeutronAvailabilityZone) { NeutronAvailabilityZone that = (NeutronAvailabilityZone) obj; - if (java.util.Objects.equals(state, that.state) && + return java.util.Objects.equals(state, that.state) && java.util.Objects.equals(resource, that.resource) && - java.util.Objects.equals(name, that.name)) { - return true; - } + java.util.Objects.equals(name, that.name); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java index 026d247ee..b45f4838a 100755 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronFloatingIP.java @@ -211,16 +211,14 @@ public boolean equals(Object obj) { if (obj instanceof NeutronFloatingIP) { NeutronFloatingIP that = (NeutronFloatingIP) obj; - if (java.util.Objects.equals(id, that.id) && + return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(routerId, that.routerId) && java.util.Objects.equals(tenantId, that.tenantId) && java.util.Objects.equals(floatingNetworkId, that.floatingNetworkId) && java.util.Objects.equals(floatingIpAddress, that.floatingIpAddress) && java.util.Objects.equals(fixedIpAddress, that.fixedIpAddress) && java.util.Objects.equals(portId, that.portId) && - java.util.Objects.equals(status, that.status)) { - return true; - } + java.util.Objects.equals(status, that.status); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java index f4dff1042..c951d932e 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java @@ -277,7 +277,7 @@ public boolean equals(Object obj) { if (obj instanceof NeutronNetwork) { NeutronNetwork that = (NeutronNetwork) obj; - if (java.util.Objects.equals(name, that.name) && + return java.util.Objects.equals(name, that.name) && java.util.Objects.equals(status, that.status) && java.util.Objects.equals(subnets, that.subnets) && java.util.Objects.equals(providerPhyNet, that.providerPhyNet) && @@ -291,9 +291,7 @@ public boolean equals(Object obj) { java.util.Objects.equals(availabilityZoneHints, that.availabilityZoneHints) && java.util.Objects.equals(availabilityZones, that.availabilityZones) && java.util.Objects.equals(createdTime, that.createdTime) && - java.util.Objects.equals(updatedTime, that.updatedTime)) { - return true; - } + java.util.Objects.equals(updatedTime, that.updatedTime); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java index ab71c0830..8c1b46bcf 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPool.java @@ -66,10 +66,8 @@ public boolean equals(Object obj) { if (obj instanceof NeutronPool) { NeutronPool that = (NeutronPool) obj; - if (java.util.Objects.equals(start, that.start) && - java.util.Objects.equals(end, that.end)) { - return true; - } + return java.util.Objects.equals(start, that.start) && + java.util.Objects.equals(end, that.end); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java index e56bb0476..d4986bd16 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronPort.java @@ -330,27 +330,25 @@ public boolean equals(Object obj) { if (obj instanceof NeutronPort) { NeutronPort that = (NeutronPort) obj; - if (java.util.Objects.equals(id, that.id) && - java.util.Objects.equals(name, that.name) && - java.util.Objects.equals(adminStateUp, that.adminStateUp) && - java.util.Objects.equals(deviceId, that.deviceId) && - java.util.Objects.equals(deviceOwner, that.deviceOwner) && - java.util.Objects.equals(fixedIps, that.fixedIps) && - java.util.Objects.equals(macAddress, that.macAddress) && - java.util.Objects.equals(networkId, that.networkId) && - java.util.Objects.equals(tenantId, that.tenantId) && - java.util.Objects.equals(securityGroups, that.securityGroups) && - java.util.Objects.equals(allowedAddressPairs, that.allowedAddressPairs) && - java.util.Objects.equals(portSecurityEnabled, that.portSecurityEnabled) && - java.util.Objects.equals(hostId, that.hostId) && - java.util.Objects.equals(vifType, that.vifType) && - java.util.Objects.equals(vifDetails, that.vifDetails) && - java.util.Objects.equals(vNicType, that.vNicType) && - java.util.Objects.equals(profile, that.profile) && - java.util.Objects.equals(createdTime, that.createdTime) && - java.util.Objects.equals(updatedTime, that.updatedTime)) { - return true; - } + return Objects.equals(id, that.id) && + Objects.equals(name, that.name) && + Objects.equals(adminStateUp, that.adminStateUp) && + Objects.equals(deviceId, that.deviceId) && + Objects.equals(deviceOwner, that.deviceOwner) && + Objects.equals(fixedIps, that.fixedIps) && + Objects.equals(macAddress, that.macAddress) && + Objects.equals(networkId, that.networkId) && + Objects.equals(tenantId, that.tenantId) && + Objects.equals(securityGroups, that.securityGroups) && + Objects.equals(allowedAddressPairs, that.allowedAddressPairs) && + Objects.equals(portSecurityEnabled, that.portSecurityEnabled) && + Objects.equals(hostId, that.hostId) && + Objects.equals(vifType, that.vifType) && + Objects.equals(vifDetails, that.vifDetails) && + Objects.equals(vNicType, that.vNicType) && + Objects.equals(profile, that.profile) && + Objects.equals(createdTime, that.createdTime) && + Objects.equals(updatedTime, that.updatedTime); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java index a56669f75..a4198c366 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java @@ -177,15 +177,13 @@ public boolean equals(Object obj) { if (obj instanceof NeutronRouter) { NeutronRouter that = (NeutronRouter) obj; - if (java.util.Objects.equals(id, that.id) && + return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(name, that.name) && java.util.Objects.equals(status, that.status) && java.util.Objects.equals(tenantId, that.tenantId) && java.util.Objects.equals(adminStateUp, that.adminStateUp) && java.util.Objects.equals(externalGatewayInfo, that.externalGatewayInfo) && - java.util.Objects.equals(routes, that.routes)) { - return true; - } + java.util.Objects.equals(routes, that.routes); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java index 8d3b7b815..e1cded3a4 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouterInterface.java @@ -93,12 +93,10 @@ public boolean equals(Object obj) { if (obj instanceof NeutronRouterInterface) { NeutronRouterInterface that = (NeutronRouterInterface) obj; - if (java.util.Objects.equals(id, that.id) && + return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(subnetId, that.subnetId) && java.util.Objects.equals(portId, that.portId) && - java.util.Objects.equals(tenantId, that.tenantId)) { - return true; - } + java.util.Objects.equals(tenantId, that.tenantId); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java index a53ccd1f1..bf8f319af 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroup.java @@ -147,13 +147,11 @@ public boolean equals(Object obj) { if (obj instanceof NeutronSecurityGroup) { NeutronSecurityGroup that = (NeutronSecurityGroup) obj; - if (java.util.Objects.equals(id, that.id) && + return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(tenantId, that.tenantId) && java.util.Objects.equals(name, that.name) && java.util.Objects.equals(description, that.description) && - java.util.Objects.equals(rules, that.rules)) { - return true; - } + java.util.Objects.equals(rules, that.rules); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java index fe9b6ec4e..297005713 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSecurityGroupRule.java @@ -180,7 +180,7 @@ public boolean equals(Object obj) { if (obj instanceof NeutronSecurityGroupRule) { NeutronSecurityGroupRule that = (NeutronSecurityGroupRule) obj; - if (java.util.Objects.equals(id, that.id) && + return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(tenantId, that.tenantId) && java.util.Objects.equals(securityGroupId, that.securityGroupId) && java.util.Objects.equals(direction, that.direction) && @@ -189,9 +189,7 @@ public boolean equals(Object obj) { java.util.Objects.equals(portRangeMax, that.portRangeMax) && java.util.Objects.equals(protocol, that.protocol) && java.util.Objects.equals(remoteGroupId, that.remoteGroupId) && - java.util.Objects.equals(remoteIpPrefix, that.remoteIpPrefix)) { - return true; - } + java.util.Objects.equals(remoteIpPrefix, that.remoteIpPrefix); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java index 4d8dab62f..234739a78 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java @@ -259,7 +259,7 @@ public boolean equals(Object obj) { if (obj instanceof NeutronSubnet) { NeutronSubnet that = (NeutronSubnet) obj; - if (java.util.Objects.equals(id, that.id) && + return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(name, that.name) && java.util.Objects.equals(enableDHCP, that.enableDHCP) && java.util.Objects.equals(networkId, that.networkId) && @@ -273,9 +273,7 @@ public boolean equals(Object obj) { java.util.Objects.equals(ipv6AddressMode, that.ipv6AddressMode) && java.util.Objects.equals(ipv6RaMode, that.ipv6RaMode) && java.util.Objects.equals(createdTime, that.createdTime) && - java.util.Objects.equals(updatedTime, that.updatedTime)) { - return true; - } + java.util.Objects.equals(updatedTime, that.updatedTime); } return false; } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java index 2a376eaac..017669770 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/AbstractNeutronFirewallPolicy.java @@ -104,9 +104,9 @@ public List getFirewallRuleIds() { @JsonIgnore @Override public List getNeutronFirewallRules() { - neutronFirewallRules = new ArrayList(); + neutronFirewallRules = new ArrayList<>(); if (neutronFirewallRules == null && (firewallRules != null && firewallRules.size() > 0)) { - neutronFirewallRules = new ArrayList(); + neutronFirewallRules = new ArrayList<>(); for (String ruleId : firewallRules) { NeutronFirewallRule rule = (NeutronFirewallRule) Apis.getNetworkingServices(). firewalls().firewallrule().get(ruleId); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java index 1d79008ed..55c4ef205 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/ext/HttpMethod.java @@ -12,7 +12,7 @@ public enum HttpMethod { HEAD(0), GET(1), POST(2), PUT(2), PATCH(4), DELETE(5), OPTIONS(6), TRACE(7); int code; - private HttpMethod(int code) { + HttpMethod(int code) { this.code = code; } diff --git a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java index dc12dd90c..b604f671e 100644 --- a/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/senlin/internal/SenlinWebHookServiceImpl.java @@ -22,7 +22,7 @@ public ActionID action(String webHookUrl) { checkNotNull(webHookUrl); HttpRequest newReq = new HttpRequest(); newReq.toBuilder().methodPost().endpoint(webHookUrl).path(""); - newReq.builder(SenlinAction.class); + HttpRequest.builder(SenlinAction.class); return HttpExecutor.create().execute(newReq).getEntity(SenlinActionID.class); } } diff --git a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java index e3039bb81..016be14a3 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/block/domain/AvailabilityZone.java @@ -21,7 +21,7 @@ public interface AvailabilityZone extends ModelEntity { String getZoneName(); - public interface ZoneState extends ModelEntity { + interface ZoneState extends ModelEntity { /** * @return the state of zone diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java index 94f4a5704..fc1f01fb4 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/ObjectStorageObjectServiceImpl.java @@ -108,7 +108,7 @@ public String put(String containerName, String name, Payload payload, ObjectP checkNotNull(options); if (payload != null && FilePayload.class.isAssignableFrom(payload.getClass()) && name == null) - name = FilePayload.class.cast(payload).getRaw().getName(); + name = ((FilePayload) payload).getRaw().getName(); else checkNotNull(name); diff --git a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java index 019f19ce5..5b695ac16 100644 --- a/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java +++ b/core/src/main/java/org/openstack4j/openstack/telemetry/domain/CeilometerAlarm.java @@ -748,7 +748,7 @@ public void setId(String id) { @Override public void setThresholdRule(CeilometerThresholdRule tr) { - this.thresholdRule = (CeilometerThresholdRule) tr; + this.thresholdRule = tr; } @Override From cdf4325c05e62cde4a26050bba3041c5ebab872a Mon Sep 17 00:00:00 2001 From: wushaohan Date: Mon, 9 Nov 2020 22:03:37 +0800 Subject: [PATCH 7/9] replace some Deprecated method --- .../openstack4j/connectors/http/HttpResponseImpl.java | 9 +++++---- .../openstack4j/connectors/okhttp/HttpResponseImpl.java | 4 ++-- .../api/exceptions/ClientResponseException.java | 2 +- .../openstack4j/api/exceptions/ResponseException.java | 2 +- .../openstack/image/v2/domain/CachedGlanceImage.java | 4 ++-- .../openstack/internal/BaseOpenStackService.java | 6 +++--- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java index 2abc498c7..6c8b34dd6 100644 --- a/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java +++ b/connectors/http-connector/src/main/java/org/openstack4j/connectors/http/HttpResponseImpl.java @@ -104,9 +104,10 @@ public InputStream getInputStream() { */ public String header(String name) { if (name == null) return null; - for (String key : headers.keySet()) { + for (Map.Entry> kv : headers.entrySet()) { + String key = kv.getKey(); if (key != null && key.equalsIgnoreCase(name)) { - return headers.get(key).get(0); + return kv.getValue().get(0); } } return null; @@ -116,7 +117,7 @@ public String header(String name) { * @return the a Map of Header Name to Header Value */ public Map headers() { - Map retHeaders = new HashMap(); + Map retHeaders = new HashMap<>(); Set keys = headers.keySet(); @@ -139,7 +140,7 @@ public T readEntity(Class typeToReadAs) { } try { - return ObjectMapperSingleton.getContext(typeToReadAs).reader(typeToReadAs).readValue(data); + return ObjectMapperSingleton.getContext(typeToReadAs).readerFor(typeToReadAs).readValue(data); } catch (Exception e) { LOG.error(e.getMessage(), e); throw new ClientResponseException(e.getMessage(), 0, e); diff --git a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java index af7206828..9d5357a22 100644 --- a/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java +++ b/connectors/okhttp/src/main/java/org/openstack4j/connectors/okhttp/HttpResponseImpl.java @@ -103,7 +103,7 @@ public String header(String name) { * @return the a Map of Header Name to Header Value */ public Map headers() { - Map retHeaders = new HashMap(); + Map retHeaders = new HashMap<>(); Headers headers = response.headers(); for (String name : headers.names()) { @@ -115,7 +115,7 @@ public Map headers() { @Override public T readEntity(Class typeToReadAs) { try { - return ObjectMapperSingleton.getContext(typeToReadAs).reader(typeToReadAs).readValue(response.body().string()); + return ObjectMapperSingleton.getContext(typeToReadAs).readerFor(typeToReadAs).readValue(response.body().string()); } catch (Exception e) { LOG.error(e.getMessage(), e); throw new ClientResponseException(e.getMessage(), 0, e); diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java b/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java index 1d8e9783c..2471fe143 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ClientResponseException.java @@ -11,7 +11,7 @@ public class ClientResponseException extends ResponseException { private static final long serialVersionUID = 1L; - private StatusCode code; + private final StatusCode code; public ClientResponseException(String message, int status, Throwable cause) { super(message, status, cause); diff --git a/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java b/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java index 54574e322..1f7436153 100644 --- a/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java +++ b/core/src/main/java/org/openstack4j/api/exceptions/ResponseException.java @@ -11,7 +11,7 @@ public class ResponseException extends OS4JException { private static final long serialVersionUID = 7294957362769575271L; - protected int status; + protected final int status; public ResponseException(String message, int status) { super(message); diff --git a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/CachedGlanceImage.java b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/CachedGlanceImage.java index 7c3d50e73..a376874b8 100644 --- a/core/src/main/java/org/openstack4j/openstack/image/v2/domain/CachedGlanceImage.java +++ b/core/src/main/java/org/openstack4j/openstack/image/v2/domain/CachedGlanceImage.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.google.common.base.Objects; +import com.google.common.base.MoreObjects; import org.openstack4j.model.image.v2.CachedImage; import org.openstack4j.openstack.common.CustomEpochToDateDeserializer; import org.openstack4j.openstack.common.ListResult; @@ -62,7 +62,7 @@ public Long getSize() { */ @Override public String toString() { - return Objects.toStringHelper(this).omitNullValues() + return MoreObjects.toStringHelper(this).omitNullValues() .add("id", imageId).add("size", size).add("hits", hits).add("lastAccessed", lastAccessed) .add("lastModified", lastModified).addValue("\n") .toString(); diff --git a/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java b/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java index 6eb1a1bb2..db7663c83 100644 --- a/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java +++ b/core/src/main/java/org/openstack4j/openstack/internal/BaseOpenStackService.java @@ -102,7 +102,7 @@ private Invocation builder(Class returnType, String[] path, HttpMethod return builder(returnType, Joiner.on("").join(path), method); } - @SuppressWarnings("rawtypes") + @SuppressWarnings({"rawtypes","unchecked"}) private Invocation builder(Class returnType, String path, HttpMethod method) { OSClientSession ses = OSClientSession.getCurrent(); if (ses == null) { @@ -113,9 +113,9 @@ private Invocation builder(Class returnType, String path, HttpMethod m .method(method).path(path); Map headers = ses.getHeaders(); if (headers != null && headers.size() > 0) { - return new Invocation(req, serviceType, endpointFunc).headers(headers); + return new Invocation<>(req, serviceType, endpointFunc).headers(headers); } else { - return new Invocation(req, serviceType, endpointFunc); + return new Invocation<>(req, serviceType, endpointFunc); } } From 07eb3008bf19dbb2d413bc8f11bf8433a132aa90 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Mon, 9 Nov 2020 22:15:19 +0800 Subject: [PATCH 8/9] .travis.yml ++ dist: trusty --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9066be05b..9038f6ef9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,3 +36,4 @@ after_success: # infrastructure. This should prevent the buffer overflow from # https://github.com/travis-ci/travis-ci/issues/5227 sudo: false +dist: trusty \ No newline at end of file From 6a33d10c343404133143819f1c30fb8c4289c4ea Mon Sep 17 00:00:00 2001 From: wushaohan Date: Wed, 11 Nov 2020 09:21:25 +0800 Subject: [PATCH 9/9] add rest api link: https://docs.openstack.org/api-ref/network/v2/#qos-policies-qos --- .../api/network/NetQosPolicyTests.java | 58 ++++++ .../main/resources/network/qos_policies.json | 32 ++++ .../main/resources/network/qos_policy.json | 30 +++ .../api/networking/NetworkingService.java | 5 + .../networking/ext/NetQosPolicyService.java | 54 ++++++ .../model/network/NetQosPolicy.java | 51 +++++ .../model/network/NetQosPolicyUpdate.java | 35 ++++ .../network/builder/NetQosPolicyBuilder.java | 53 ++++++ .../builder/NetQosPolicyUpdateBuilder.java | 48 +++++ .../domain/NeutronNetQosPolicy.java | 175 ++++++++++++++++++ .../domain/NeutronNetQosPolicyUpdate.java | 138 ++++++++++++++ .../internal/NetworkingServiceImpl.java | 8 + .../internal/ext/NetQosPolicyServiceImpl.java | 60 ++++++ .../provider/DefaultAPIProvider.java | 1 + 14 files changed, 748 insertions(+) create mode 100644 core-test/src/main/java/org/openstack4j/api/network/NetQosPolicyTests.java create mode 100644 core-test/src/main/resources/network/qos_policies.json create mode 100644 core-test/src/main/resources/network/qos_policy.json create mode 100644 core/src/main/java/org/openstack4j/api/networking/ext/NetQosPolicyService.java create mode 100644 core/src/main/java/org/openstack4j/model/network/NetQosPolicy.java create mode 100644 core/src/main/java/org/openstack4j/model/network/NetQosPolicyUpdate.java create mode 100644 core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyBuilder.java create mode 100644 core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyUpdateBuilder.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicy.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicyUpdate.java create mode 100644 core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQosPolicyServiceImpl.java diff --git a/core-test/src/main/java/org/openstack4j/api/network/NetQosPolicyTests.java b/core-test/src/main/java/org/openstack4j/api/network/NetQosPolicyTests.java new file mode 100644 index 000000000..6828f8f98 --- /dev/null +++ b/core-test/src/main/java/org/openstack4j/api/network/NetQosPolicyTests.java @@ -0,0 +1,58 @@ +package org.openstack4j.api.network; + +import org.openstack4j.api.AbstractTest; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.NetQosPolicy; +import org.openstack4j.openstack.networking.domain.NeutronNetQosPolicy; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.util.List; + +import static org.testng.Assert.*; + +/** + * Test cases for (Neutron) qos policy extension based Services + * + * @author bboyHan + */ +@Test(suiteName = "Network/qosPolicy") +public class NetQosPolicyTests extends AbstractTest { + private static final String QOS_POLICY_JSON = "/network/qos_policy.json"; + private static final String QOS_POLICIES_JSON = "/network/qos_policies.json"; + + + public void list() throws IOException { + respondWith(QOS_POLICIES_JSON); + List netQosPolicies = osv3().networking().netQosPolicy().list(); + assertEquals(1, netQosPolicies.size()); + assertEquals("10Mbit", netQosPolicies.get(0).getName()); + assertFalse(netQosPolicies.get(0).isDefault()); + } + + public void get() throws IOException{ + respondWith(QOS_POLICY_JSON); + NetQosPolicy netQosPolicy = osv3().networking().netQosPolicy().get("networkId"); + assertEquals("8d4c70a21fed4aeba121a1a429ba0d04", netQosPolicy.getTenantId()); + assertEquals("10Mbit", netQosPolicy.getName()); + } + + public void delete() { + respondWith(204); + ActionResponse response = osv3().networking().netQosPolicy().delete("policyId"); + assertTrue(response.isSuccess()); + } + + public void create() throws IOException { + respondWith(QOS_POLICY_JSON); + NetQosPolicy qosPolicy = osv3().networking().netQosPolicy() + .create(NeutronNetQosPolicy.builder().name("name").build()); + assertEquals("8d4c70a21fed4aeba121a1a429ba0d04", qosPolicy.getTenantId()); + assertFalse(qosPolicy.isShared()); + } + + @Override + protected Service service() { + return Service.NETWORK; + } +} diff --git a/core-test/src/main/resources/network/qos_policies.json b/core-test/src/main/resources/network/qos_policies.json new file mode 100644 index 000000000..b23719e7b --- /dev/null +++ b/core-test/src/main/resources/network/qos_policies.json @@ -0,0 +1,32 @@ +{ + "policies": [ + { + "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", + "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", + "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", + "is_default": false, + "name": "10Mbit", + "description": "This policy limits the ports to 10Mbit max.", + "revision_number": 3, + "created_at": "2018-04-03T21:26:39Z", + "updated_at": "2018-04-03T21:26:39Z", + "shared": false, + "rules": [ + { + "max_kbps": 10000, + "type": "bandwidth_limit", + "id": "b1866696-032a-4228-857f-846075f63487", + "max_burst_kbps": 0, + "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4" + }, + { + "dscp_mark": 20, + "type": "dscp_marking", + "id": "d9c021d5-5433-4d7c-8bfa-69cca486aac8", + "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4" + } + ], + "tags": ["tag1,tag2"] + } + ] +} \ No newline at end of file diff --git a/core-test/src/main/resources/network/qos_policy.json b/core-test/src/main/resources/network/qos_policy.json new file mode 100644 index 000000000..4fc839abf --- /dev/null +++ b/core-test/src/main/resources/network/qos_policy.json @@ -0,0 +1,30 @@ +{ + "policy": { + "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", + "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", + "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", + "is_default": false, + "name": "10Mbit", + "description": "This policy limits the ports to 10Mbit max.", + "revision_number": 3, + "created_at": "2018-04-03T21:26:39Z", + "updated_at": "2018-04-03T21:26:39Z", + "shared": false, + "rules": [ + { + "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", + "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", + "max_kbps": 10000, + "max_burst_kbps": 0, + "type": "bandwidth_limit" + }, + { + "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", + "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", + "dscp_mark": 26, + "type": "dscp_marking" + } + ], + "tags": ["tag1,tag2"] + } +} \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java index 726653696..b6ca4c12d 100644 --- a/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java +++ b/core/src/main/java/org/openstack4j/api/networking/NetworkingService.java @@ -86,4 +86,9 @@ public interface NetworkingService extends RestService { * @return the Network IP Availability Service API */ NetworkIPAvailabilityService networkIPAvailability(); + + /** + * @return the Network Qos Policy Service API + */ + NetQosPolicyService netQosPolicy(); } diff --git a/core/src/main/java/org/openstack4j/api/networking/ext/NetQosPolicyService.java b/core/src/main/java/org/openstack4j/api/networking/ext/NetQosPolicyService.java new file mode 100644 index 000000000..285a7fcaf --- /dev/null +++ b/core/src/main/java/org/openstack4j/api/networking/ext/NetQosPolicyService.java @@ -0,0 +1,54 @@ +package org.openstack4j.api.networking.ext; + +import org.openstack4j.common.RestService; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.NetQosPolicy; +import org.openstack4j.model.network.NetQosPolicyUpdate; + +import java.util.List; + +/** + * Networking (Neutron) Qos Policy Extension API + * + * @author bboyHan + */ +public interface NetQosPolicyService extends RestService { + + /** + * Lists qos policies for tenants + * + * @return the list of qos policy + */ + List list(); + + /** + * Fetches the network qos policy for the specified tenant + * + * @param tenantId the tenant identifier + * @return the tenants quota + */ + NetQosPolicy get(String tenantId); + + /** + * Updates the network qos policy for the current tenant + * + * @param netQosPolicy the net qos policy to update + * @return the updated network qos policy + */ + NetQosPolicy update(NetQosPolicyUpdate netQosPolicy); + + /** + * Create the current network qos policy for the current tenant back to defaults + * + * @return NetQosPolicy the response object + */ + NetQosPolicy create(NetQosPolicy netQosPolicy); + + /** + * Delete the current network qos policy for the current tenant back to defaults + * + * @param policyId the net qos uuid + * @return the action response + */ + ActionResponse delete(String policyId); +} diff --git a/core/src/main/java/org/openstack4j/model/network/NetQosPolicy.java b/core/src/main/java/org/openstack4j/model/network/NetQosPolicy.java new file mode 100644 index 000000000..fe99374c7 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/NetQosPolicy.java @@ -0,0 +1,51 @@ +package org.openstack4j.model.network; + +import org.openstack4j.common.Buildable; +import org.openstack4j.model.ModelEntity; +import org.openstack4j.model.network.builder.NetQosPolicyBuilder; + +/** + * Network qos policy that are bound to a Tenant + * + * @author bboyHan + */ +public interface NetQosPolicy extends ModelEntity, Buildable { + + /** + * A human-readable description for the resource. Default is an empty string. + * + * @return Description + */ + String getDescription(); + + /** + * The ID of the project that owns the resource. + * Only administrative and users with advsvc role can specify a project ID other than their own. + * You cannot change this value through authorization policies. + * + * @return tenantId + */ + String getTenantId(); + + /** + * Set to true to share this policy with other projects. Default is false. + * + * @return true or false + */ + boolean isShared(); + + /** + * if True, the QoS policy is the default policy. + * + * @return true or false + */ + boolean isDefault(); + + /** + * human-readable name + * + * @return name + */ + String getName(); + +} diff --git a/core/src/main/java/org/openstack4j/model/network/NetQosPolicyUpdate.java b/core/src/main/java/org/openstack4j/model/network/NetQosPolicyUpdate.java new file mode 100644 index 000000000..fa7429cd5 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/NetQosPolicyUpdate.java @@ -0,0 +1,35 @@ +package org.openstack4j.model.network; + +import org.openstack4j.common.Buildable; +import org.openstack4j.model.common.BasicResource; +import org.openstack4j.model.network.builder.NetQosPolicyUpdateBuilder; + +/** + * Network qos policy for update that are bound to a Tenant + * + * @author bboyHan + */ +public interface NetQosPolicyUpdate extends BasicResource, Buildable { + + /** + * A human-readable description for the resource. Default is an empty string. + * + * @return Description + */ + String getDescription(); + + /** + * Set to true to share this policy with other projects. Default is false. + * + * @return true or false + */ + boolean isShared(); + + /** + * if True, the QoS policy is the default policy. + * + * @return true or false + */ + boolean isDefault(); + +} diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyBuilder.java new file mode 100644 index 000000000..950fcf167 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyBuilder.java @@ -0,0 +1,53 @@ +package org.openstack4j.model.network.builder; + +import org.openstack4j.common.Buildable.Builder; +import org.openstack4j.model.network.NetQosPolicy; + +/** + * A Builder which creates a NetQosPolicy entity + * + * @author bboyHan + */ +public interface NetQosPolicyBuilder extends Builder { + + /** + * See {@link NetQosPolicy#getDescription()} for details + * + * @param description qos description + * @return NetQosPolicyBuilder + */ + NetQosPolicyBuilder description(String description); + + /** + * See {@link NetQosPolicy#getTenantId()} for details + * + * @param tenantId tenantId + * @return NetQosPolicyBuilder + */ + NetQosPolicyBuilder tenantId(String tenantId); + + /** + * See {@link NetQosPolicy#isShared()} for details + * + * @param shared true or false + * @return NetQosPolicyBuilder + */ + NetQosPolicyBuilder shared(boolean shared); + + /** + * See {@link NetQosPolicy#isDefault()} for details + * + * @param isDefault if True, the QoS policy is the default policy. + * @return NetQosPolicyBuilder + */ + NetQosPolicyBuilder isDefault(boolean isDefault); + + /** + * See {@link NetQosPolicy#getName()} for details + * + * @param name human-readable name + * @return NetQosPolicyBuilder + */ + NetQosPolicyBuilder name(String name); + +} diff --git a/core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyUpdateBuilder.java b/core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyUpdateBuilder.java new file mode 100644 index 000000000..bbdb954b4 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/network/builder/NetQosPolicyUpdateBuilder.java @@ -0,0 +1,48 @@ +package org.openstack4j.model.network.builder; + +import org.openstack4j.common.Buildable.Builder; +import org.openstack4j.model.network.NetQosPolicy; +import org.openstack4j.model.network.NetQosPolicyUpdate; + +/** + * A Builder which creates a NetQosPolicy entity + * + * @author bboyHan + */ +public interface NetQosPolicyUpdateBuilder extends Builder { + + NetQosPolicyUpdateBuilder id(String id); + + /** + * See {@link NetQosPolicy#getDescription()} for details + * + * @param description qos description + * @return NetQosPolicyBuilder + */ + NetQosPolicyUpdateBuilder description(String description); + + /** + * See {@link NetQosPolicy#isShared()} for details + * + * @param shared true or false + * @return NetQosPolicyBuilder + */ + NetQosPolicyUpdateBuilder shared(boolean shared); + + /** + * See {@link NetQosPolicy#isDefault()} for details + * + * @param isDefault if True, the QoS policy is the default policy. + * @return NetQosPolicyBuilder + */ + NetQosPolicyUpdateBuilder isDefault(boolean isDefault); + + /** + * See {@link NetQosPolicy#getName()} for details + * + * @param name human-readable name + * @return NetQosPolicyBuilder + */ + NetQosPolicyUpdateBuilder name(String name); + +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicy.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicy.java new file mode 100644 index 000000000..ee16975c7 --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicy.java @@ -0,0 +1,175 @@ +package org.openstack4j.openstack.networking.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.network.NetQosPolicy; +import org.openstack4j.model.network.builder.NetQosPolicyBuilder; +import org.openstack4j.openstack.common.ListResult; + +import java.util.List; +import java.util.Map; + +import static com.google.common.base.MoreObjects.toStringHelper; + +/** + * Network qos policy that are bound to a Tenant + * + * @author bboyHan + */ +@JsonRootName("policy") +public class NeutronNetQosPolicy implements NetQosPolicy { + + private static final long serialVersionUID = 1L; + + @JsonProperty + private String description; + @JsonProperty("tenant_id") + private String tenantId; + @JsonProperty("project_id") + private String projectId; + @JsonProperty("revision_number") + private String revisionNumber; + @JsonProperty + private boolean shared; + @JsonProperty + private String id; + @JsonProperty("is_default") + private boolean isDefault; + @JsonProperty + private List> rules; + private String name; + @JsonProperty + private List tags; + + public static NetQosPolicyBuilder builder() { + return new NetQosPolicyConcreteBuilder(); + } + + @Override + public NetQosPolicyBuilder toBuilder() { + return new NetQosPolicyConcreteBuilder(this); + } + + @Override + public String getDescription() { + return description; + } + + @Override + public String getTenantId() { + return tenantId; + } + + public String getProjectId() { + return projectId; + } + + public String getRevisionNumber() { + return revisionNumber; + } + + @Override + public boolean isShared() { + return shared; + } + + public String getId() { + return id; + } + + @Override + public boolean isDefault() { + return isDefault; + } + + public List> getRules() { + return rules; + } + + @Override + public String getName() { + return name; + } + + public List getTags() { + return tags; + } + + @Override + public String toString() { + return toStringHelper(this) + .add("id", id).add("description", description).add("tenantId", tenantId).add("shared", shared) + .add("isDefault", isDefault).add("name", name).add("rules", rules) + .add("tags", tags) + .toString(); + } + + public static class NetQosPolicyConcreteBuilder implements NetQosPolicyBuilder { + + private NeutronNetQosPolicy model; + + public NetQosPolicyConcreteBuilder() { + model = new NeutronNetQosPolicy(); + } + + public NetQosPolicyConcreteBuilder(NeutronNetQosPolicy model) { + this.model = model; + } + + @Override + public NetQosPolicy build() { + return model; + } + + @Override + public NetQosPolicyBuilder from(NetQosPolicy in) { + model = (NeutronNetQosPolicy) in; + return this; + } + + @Override + public NetQosPolicyBuilder description(String description) { + model.description = description; + return this; + } + + @Override + public NetQosPolicyBuilder tenantId(String tenantId) { + model.tenantId = tenantId; + return this; + } + + @Override + public NetQosPolicyBuilder shared(boolean shared) { + model.shared = shared; + return this; + } + + @Override + public NetQosPolicyBuilder isDefault(boolean isDefault) { + model.isDefault = isDefault; + return this; + } + + @Override + public NetQosPolicyBuilder name(String name) { + model.name = name; + return this; + } + + } + + public static class NeutronNetQosPolicies extends ListResult { + + private static final long serialVersionUID = 1L; + + @JsonProperty("policies") + private List policies; + + @Override + protected List value() { + return policies; + } + } + +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicyUpdate.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicyUpdate.java new file mode 100644 index 000000000..ef1a51a08 --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetQosPolicyUpdate.java @@ -0,0 +1,138 @@ +package org.openstack4j.openstack.networking.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import org.openstack4j.model.network.NetQosPolicy; +import org.openstack4j.model.network.NetQosPolicyUpdate; +import org.openstack4j.model.network.builder.NetQosPolicyUpdateBuilder; + +import static com.google.common.base.MoreObjects.toStringHelper; + +/** + * Network qos that are bound to a Tenant + * + * @author bboyHan + */ +@JsonRootName("policy") +public class NeutronNetQosPolicyUpdate implements NetQosPolicyUpdate { + + private static final long serialVersionUID = 1L; + + @JsonProperty + private String description; + @JsonProperty + private boolean shared; + @JsonProperty + private String id; + @JsonProperty("is_default") + private boolean isDefault; + private String name; + + public static NetQosPolicyUpdateBuilder builder() { + return new NetQosPolicyUpdateConcreteBuilder(); + } + + @Override + public NetQosPolicyUpdateBuilder toBuilder() { + return new NetQosPolicyUpdateConcreteBuilder(this); + } + + @Override + public String getDescription() { + return description; + } + + @Override + public boolean isShared() { + return shared; + } + + @Override + public boolean isDefault() { + return isDefault; + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public String toString() { + return toStringHelper(this) + .add("id", id).add("description", description).add("shared", shared) + .add("isDefault", isDefault).add("name", name) + .toString(); + } + + public static class NetQosPolicyUpdateConcreteBuilder implements NetQosPolicyUpdateBuilder { + + private NeutronNetQosPolicyUpdate model; + + public NetQosPolicyUpdateConcreteBuilder() { + model = new NeutronNetQosPolicyUpdate(); + } + + public NetQosPolicyUpdateConcreteBuilder(NeutronNetQosPolicyUpdate model) { + this.model = model; + } + + @Override + public NetQosPolicyUpdate build() { + return model; + } + + @Override + public NetQosPolicyUpdateBuilder from(NetQosPolicyUpdate in) { + model = (NeutronNetQosPolicyUpdate) in; + return this; + } + + @Override + public NetQosPolicyUpdateBuilder id(String id) { + model.id = id; + return this; + } + + @Override + public NetQosPolicyUpdateBuilder description(String description) { + model.description = description; + return this; + } + + @Override + public NetQosPolicyUpdateBuilder shared(boolean shared) { + model.shared = shared; + return this; + } + + @Override + public NetQosPolicyUpdateBuilder isDefault(boolean isDefault) { + model.isDefault = isDefault; + return this; + } + + @Override + public NetQosPolicyUpdateBuilder name(String name) { + model.name = name; + return this; + } + + } + +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java index 8fb0cf680..2c7c7d09c 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkingServiceImpl.java @@ -130,4 +130,12 @@ public NeutronResourceTagService resourceTags() { public NetworkIPAvailabilityService networkIPAvailability() { return Apis.get(NetworkIPAvailabilityService.class); } + + /** + * {@inheritDoc} + */ + @Override + public NetQosPolicyService netQosPolicy() { + return Apis.get(NetQosPolicyService.class); + } } diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQosPolicyServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQosPolicyServiceImpl.java new file mode 100644 index 000000000..65b83e69b --- /dev/null +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/ext/NetQosPolicyServiceImpl.java @@ -0,0 +1,60 @@ +package org.openstack4j.openstack.networking.internal.ext; + +import org.openstack4j.api.networking.ext.NetQosPolicyService; +import org.openstack4j.model.common.ActionResponse; +import org.openstack4j.model.network.NetQosPolicy; +import org.openstack4j.model.network.NetQosPolicyUpdate; +import org.openstack4j.openstack.networking.domain.NeutronNetQosPolicy; +import org.openstack4j.openstack.networking.domain.NeutronNetQosPolicy.NeutronNetQosPolicies; +import org.openstack4j.openstack.networking.internal.BaseNetworkingServices; + +import java.util.List; + +import static com.google.common.base.Preconditions.checkNotNull; + +/** + * Networking (Neutron) Qos Policy Extension API + * + * @author bboyHan + */ +public class NetQosPolicyServiceImpl extends BaseNetworkingServices implements NetQosPolicyService { + + @Override + public List list() { + return get(NeutronNetQosPolicies.class, uri("/qos/policies")).execute().getList(); + } + + @Override + public NetQosPolicy get(String policyId) { + checkNotNull(policyId, "qos policyId must not be null"); + return get(NeutronNetQosPolicy.class, uri("/qos/policies/%s", policyId)).execute(); + } + + @Override + public NetQosPolicy update(NetQosPolicyUpdate update) { + checkNotNull(update, "netQosPolicy must not be null"); + checkNotNull(update.getId(), "netQosPolicy id must not be null"); + return put(NeutronNetQosPolicy.class, uri("/qos/policies/%s", getAndClearIdentifier(update))).entity(update).execute(); + } + + @Override + public NetQosPolicy create(NetQosPolicy netQosPolicy) { + checkNotNull(netQosPolicy, "netQosPolicy must not be null"); + return post(NeutronNetQosPolicy.class, uri("/qos/policies")).entity(netQosPolicy).execute(); + } + + /** + * {@inheritDoc} + */ + @Override + public ActionResponse delete(String policyId) { + checkNotNull(policyId); + return deleteWithResponse(uri("/qos/policies/%s", policyId)).execute(); + } + + private String getAndClearIdentifier(NetQosPolicyUpdate update) { + String id = update.getId(); + update.setId(null); + return id; + } +} diff --git a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java index bae66b52d..90d175753 100644 --- a/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java +++ b/core/src/main/java/org/openstack4j/openstack/provider/DefaultAPIProvider.java @@ -284,6 +284,7 @@ public void initialize() { bind(CronTriggerService.class, CronTriggerServiceImpl.class); bind(NeutronResourceTagService.class, NeutronResourceTagServiceImpl.class); bind(NetworkIPAvailabilityService.class, NetworkIPAvailabilityServiceImpl.class); + bind(NetQosPolicyService.class, NetQosPolicyServiceImpl.class); } /**