From 803dedb297023a8ceee17d73e7c9e16764f3b34a Mon Sep 17 00:00:00 2001 From: Darren Hague Date: Wed, 29 Apr 2015 12:27:16 +0100 Subject: [PATCH] Fixes #3084: Implement OpenStack Identity V3 API Fog::Identity::OpenStack.new() will return either a V2 API object or a V3 API object depending on the auth URL Fog::OpenStack::Core.authenticate switches on the auth URL to call the V2 or V3 authentication API --- Rakefile | 3 + fog.gemspec | 3 + lib/fog/openstack.rb | 2 +- lib/fog/openstack/baremetal.rb | 2 +- lib/fog/openstack/compute.rb | 8 +- lib/fog/openstack/core.rb | 49 +- lib/fog/openstack/identity.rb | 283 +--- lib/fog/openstack/identity_v2.rb | 264 ++++ lib/fog/openstack/identity_v3.rb | 249 +++ lib/fog/openstack/image.rb | 2 +- lib/fog/openstack/metering.rb | 2 +- .../models/identity/ec2_credential.rb | 44 - .../models/identity/ec2_credentials.rb | 53 - lib/fog/openstack/models/identity/role.rb | 50 - lib/fog/openstack/models/identity/roles.rb | 20 - lib/fog/openstack/models/identity/tenant.rb | 62 - lib/fog/openstack/models/identity/tenants.rb | 29 - lib/fog/openstack/models/identity/user.rb | 69 - lib/fog/openstack/models/identity/users.rb | 41 - .../models/identity_v2/ec2_credential.rb | 45 + .../models/identity_v2/ec2_credentials.rb | 55 + lib/fog/openstack/models/identity_v2/role.rb | 52 + lib/fog/openstack/models/identity_v2/roles.rb | 22 + .../openstack/models/identity_v2/tenant.rb | 64 + .../openstack/models/identity_v2/tenants.rb | 31 + lib/fog/openstack/models/identity_v2/user.rb | 71 + lib/fog/openstack/models/identity_v2/users.rb | 43 + .../openstack/models/identity_v3/domain.rb | 47 + .../openstack/models/identity_v3/domains.rb | 36 + .../openstack/models/identity_v3/endpoint.rb | 50 + .../openstack/models/identity_v3/endpoints.rb | 27 + lib/fog/openstack/models/identity_v3/group.rb | 96 ++ .../openstack/models/identity_v3/groups.rb | 31 + .../models/identity_v3/os_credential.rb | 73 + .../models/identity_v3/os_credentials.rb | 31 + .../openstack/models/identity_v3/policies.rb | 31 + .../openstack/models/identity_v3/policy.rb | 46 + .../openstack/models/identity_v3/project.rb | 98 ++ .../openstack/models/identity_v3/projects.rb | 31 + lib/fog/openstack/models/identity_v3/role.rb | 45 + .../models/identity_v3/role_assignment.rb | 22 + .../models/identity_v3/role_assignments.rb | 22 + lib/fog/openstack/models/identity_v3/roles.rb | 35 + .../openstack/models/identity_v3/service.rb | 47 + .../openstack/models/identity_v3/services.rb | 31 + lib/fog/openstack/models/identity_v3/token.rb | 26 + .../openstack/models/identity_v3/tokens.rb | 40 + lib/fog/openstack/models/identity_v3/user.rb | 87 ++ lib/fog/openstack/models/identity_v3/users.rb | 35 + lib/fog/openstack/network.rb | 10 +- lib/fog/openstack/orchestration.rb | 7 +- lib/fog/openstack/planning.rb | 2 +- .../requests/compute/create_security_group.rb | 2 +- .../requests/identity/add_user_to_tenant.rb | 34 - .../requests/identity/check_token.rb | 20 - .../identity/create_ec2_credential.rb | 57 - .../requests/identity/create_role.rb | 36 - .../requests/identity/create_tenant.rb | 32 - .../requests/identity/create_user.rb | 43 - .../requests/identity/create_user_role.rb | 24 - .../identity/delete_ec2_credential.rb | 42 - .../requests/identity/delete_role.rb | 28 - .../requests/identity/delete_tenant.rb | 31 - .../requests/identity/delete_user.rb | 28 - .../requests/identity/delete_user_role.rb | 23 - .../requests/identity/get_ec2_credential.rb | 48 - .../openstack/requests/identity/get_role.rb | 28 - .../openstack/requests/identity/get_tenant.rb | 31 - .../requests/identity/get_tenants_by_id.rb | 18 - .../requests/identity/get_tenants_by_name.rb | 18 - .../requests/identity/get_user_by_id.rb | 32 - .../requests/identity/get_user_by_name.rb | 27 - .../requests/identity/list_ec2_credentials.rb | 43 - .../identity/list_endpoints_for_token.rb | 18 - .../openstack/requests/identity/list_roles.rb | 31 - .../identity/list_roles_for_user_on_tenant.rb | 30 - .../requests/identity/list_tenants.rb | 45 - .../identity/list_user_global_roles.rb | 18 - .../openstack/requests/identity/list_users.rb | 33 - .../identity/remove_user_from_tenant.rb | 20 - .../openstack/requests/identity/set_tenant.rb | 19 - .../requests/identity/update_tenant.rb | 28 - .../requests/identity/update_user.rb | 32 - .../requests/identity/validate_token.rb | 20 - .../identity_v2/add_user_to_tenant.rb | 36 + .../requests/identity_v2/check_token.rb | 22 + .../identity_v2/create_ec2_credential.rb | 59 + .../requests/identity_v2/create_role.rb | 38 + .../requests/identity_v2/create_tenant.rb | 34 + .../requests/identity_v2/create_user.rb | 45 + .../requests/identity_v2/create_user_role.rb | 26 + .../identity_v2/delete_ec2_credential.rb | 43 + .../requests/identity_v2/delete_role.rb | 30 + .../requests/identity_v2/delete_tenant.rb | 33 + .../requests/identity_v2/delete_user.rb | 30 + .../requests/identity_v2/delete_user_role.rb | 25 + .../identity_v2/get_ec2_credential.rb | 50 + .../requests/identity_v2/get_role.rb | 30 + .../requests/identity_v2/get_tenant.rb | 33 + .../requests/identity_v2/get_tenants_by_id.rb | 20 + .../identity_v2/get_tenants_by_name.rb | 20 + .../requests/identity_v2/get_user_by_id.rb | 34 + .../requests/identity_v2/get_user_by_name.rb | 29 + .../identity_v2/list_ec2_credentials.rb | 45 + .../identity_v2/list_endpoints_for_token.rb | 20 + .../requests/identity_v2/list_roles.rb | 33 + .../list_roles_for_user_on_tenant.rb | 32 + .../requests/identity_v2/list_tenants.rb | 47 + .../identity_v2/list_user_global_roles.rb | 20 + .../requests/identity_v2/list_users.rb | 35 + .../identity_v2/remove_user_from_tenant.rb | 22 + .../requests/identity_v2/set_tenant.rb | 21 + .../requests/identity_v2/update_tenant.rb | 30 + .../requests/identity_v2/update_user.rb | 34 + .../requests/identity_v2/validate_token.rb | 22 + .../requests/identity_v3/add_user_to_group.rb | 20 + .../requests/identity_v3/auth_domains.rb | 29 + .../requests/identity_v3/auth_projects.rb | 29 + .../identity_v3/check_domain_group_role.rb | 20 + .../identity_v3/check_domain_user_role.rb | 20 + .../identity_v3/check_project_group_role.rb | 20 + .../identity_v3/check_project_user_role.rb | 20 + .../requests/identity_v3/create_domain.rb | 21 + .../requests/identity_v3/create_endpoint.rb | 21 + .../requests/identity_v3/create_group.rb | 21 + .../identity_v3/create_os_credential.rb | 21 + .../requests/identity_v3/create_policy.rb | 21 + .../requests/identity_v3/create_project.rb | 21 + .../requests/identity_v3/create_role.rb | 21 + .../requests/identity_v3/create_service.rb | 21 + .../requests/identity_v3/create_user.rb | 21 + .../requests/identity_v3/delete_domain.rb | 20 + .../requests/identity_v3/delete_endpoint.rb | 20 + .../requests/identity_v3/delete_group.rb | 20 + .../identity_v3/delete_os_credential.rb | 20 + .../requests/identity_v3/delete_policy.rb | 20 + .../requests/identity_v3/delete_project.rb | 20 + .../requests/identity_v3/delete_role.rb | 20 + .../requests/identity_v3/delete_service.rb | 20 + .../requests/identity_v3/delete_user.rb | 20 + .../requests/identity_v3/get_domain.rb | 23 + .../requests/identity_v3/get_endpoint.rb | 23 + .../requests/identity_v3/get_group.rb | 23 + .../requests/identity_v3/get_os_credential.rb | 23 + .../requests/identity_v3/get_policy.rb | 23 + .../requests/identity_v3/get_project.rb | 23 + .../requests/identity_v3/get_role.rb | 23 + .../requests/identity_v3/get_service.rb | 23 + .../requests/identity_v3/get_user.rb | 23 + .../identity_v3/grant_domain_group_role.rb | 20 + .../identity_v3/grant_domain_user_role.rb | 20 + .../identity_v3/grant_project_group_role.rb | 20 + .../identity_v3/grant_project_user_role.rb | 20 + .../requests/identity_v3/group_user_check.rb | 20 + .../identity_v3/list_domain_group_roles.rb | 23 + .../identity_v3/list_domain_user_roles.rb | 23 + .../requests/identity_v3/list_domains.rb | 31 + .../requests/identity_v3/list_endpoints.rb | 31 + .../requests/identity_v3/list_group_users.rb | 32 + .../requests/identity_v3/list_groups.rb | 42 + .../identity_v3/list_os_credentials.rb | 29 + .../requests/identity_v3/list_policies.rb | 28 + .../identity_v3/list_project_group_roles.rb | 23 + .../identity_v3/list_project_user_roles.rb | 23 + .../requests/identity_v3/list_projects.rb | 42 + .../identity_v3/list_role_assignments.rb | 35 + .../requests/identity_v3/list_roles.rb | 42 + .../requests/identity_v3/list_services.rb | 30 + .../requests/identity_v3/list_user_groups.rb | 23 + .../identity_v3/list_user_projects.rb | 23 + .../requests/identity_v3/list_users.rb | 32 + .../identity_v3/remove_user_from_group.rb | 20 + .../identity_v3/revoke_domain_group_role.rb | 20 + .../identity_v3/revoke_domain_user_role.rb | 20 + .../identity_v3/revoke_project_group_role.rb | 20 + .../identity_v3/revoke_project_user_role.rb | 20 + .../identity_v3/token_authenticate.rb | 21 + .../requests/identity_v3/token_check.rb | 21 + .../requests/identity_v3/token_revoke.rb | 21 + .../requests/identity_v3/token_validate.rb | 22 + .../requests/identity_v3/update_domain.rb | 21 + .../requests/identity_v3/update_endpoint.rb | 21 + .../requests/identity_v3/update_group.rb | 21 + .../identity_v3/update_os_credential.rb | 21 + .../requests/identity_v3/update_policy.rb | 21 + .../requests/identity_v3/update_project.rb | 21 + .../requests/identity_v3/update_role.rb | 21 + .../requests/identity_v3/update_service.rb | 21 + .../requests/identity_v3/update_user.rb | 21 + lib/fog/openstack/volume.rb | 2 +- spec/fog/openstack/identity_v3/authv3_a.yml | 61 + spec/fog/openstack/identity_v3/authv3_b.yml | 61 + spec/fog/openstack/identity_v3/authv3_c.yml | 61 + .../openstack/identity_v3/authv3_project.yml | 61 + .../openstack/identity_v3/authv3_token.yml | 151 ++ .../openstack/identity_v3/authv3_unscoped.yml | 334 ++++ .../identity_v3/idv2_unscoped_token_v3.yml | 467 ++++++ spec/fog/openstack/identity_v3/idv3.yml | 61 + .../openstack/identity_v3/idv3_credential.yml | 111 ++ .../identity_v3/idv3_credential_crud.yml | 528 +++++++ .../fog/openstack/identity_v3/idv3_domain.yml | 195 +++ .../identity_v3/idv3_domain_crud.yml | 686 ++++++++ .../idv3_domain_group_roles_mutation.yml | 906 +++++++++++ .../idv3_domain_roles_mutation.yml | 505 ++++++ .../openstack/identity_v3/idv3_endpoint.yml | 303 ++++ .../identity_v3/idv3_endpoints_crud.yml | 718 +++++++++ .../identity_v3/idv3_group_crud_mutation.yml | 975 ++++++++++++ .../fog/openstack/identity_v3/idv3_policy.yml | 147 ++ .../identity_v3/idv3_policy_crud.yml | 368 +++++ .../openstack/identity_v3/idv3_project.yml | 211 +++ .../identity_v3/idv3_project_crud.yml | 663 ++++++++ ...idv3_project_group_user_roles_mutation.yml | 1378 +++++++++++++++++ spec/fog/openstack/identity_v3/idv3_role.yml | 199 +++ .../openstack/identity_v3/idv3_role_crud.yml | 616 ++++++++ .../openstack/identity_v3/idv3_service.yml | 223 +++ .../identity_v3/idv3_services_crud.yml | 562 +++++++ spec/fog/openstack/identity_v3/idv3_token.yml | 240 +++ .../openstack/identity_v3/idv3_user_crud.yml | 572 +++++++ spec/fog/openstack/identity_v3/idv3_users.yml | 393 +++++ spec/fog/openstack/identity_v3_spec.rb | 929 +++++++++++ 220 files changed, 17373 insertions(+), 1595 deletions(-) create mode 100644 lib/fog/openstack/identity_v2.rb create mode 100644 lib/fog/openstack/identity_v3.rb delete mode 100644 lib/fog/openstack/models/identity/ec2_credential.rb delete mode 100644 lib/fog/openstack/models/identity/ec2_credentials.rb delete mode 100644 lib/fog/openstack/models/identity/role.rb delete mode 100644 lib/fog/openstack/models/identity/roles.rb delete mode 100644 lib/fog/openstack/models/identity/tenant.rb delete mode 100644 lib/fog/openstack/models/identity/tenants.rb delete mode 100644 lib/fog/openstack/models/identity/user.rb delete mode 100644 lib/fog/openstack/models/identity/users.rb create mode 100644 lib/fog/openstack/models/identity_v2/ec2_credential.rb create mode 100644 lib/fog/openstack/models/identity_v2/ec2_credentials.rb create mode 100644 lib/fog/openstack/models/identity_v2/role.rb create mode 100644 lib/fog/openstack/models/identity_v2/roles.rb create mode 100644 lib/fog/openstack/models/identity_v2/tenant.rb create mode 100644 lib/fog/openstack/models/identity_v2/tenants.rb create mode 100644 lib/fog/openstack/models/identity_v2/user.rb create mode 100644 lib/fog/openstack/models/identity_v2/users.rb create mode 100644 lib/fog/openstack/models/identity_v3/domain.rb create mode 100644 lib/fog/openstack/models/identity_v3/domains.rb create mode 100644 lib/fog/openstack/models/identity_v3/endpoint.rb create mode 100644 lib/fog/openstack/models/identity_v3/endpoints.rb create mode 100644 lib/fog/openstack/models/identity_v3/group.rb create mode 100644 lib/fog/openstack/models/identity_v3/groups.rb create mode 100644 lib/fog/openstack/models/identity_v3/os_credential.rb create mode 100644 lib/fog/openstack/models/identity_v3/os_credentials.rb create mode 100644 lib/fog/openstack/models/identity_v3/policies.rb create mode 100644 lib/fog/openstack/models/identity_v3/policy.rb create mode 100644 lib/fog/openstack/models/identity_v3/project.rb create mode 100644 lib/fog/openstack/models/identity_v3/projects.rb create mode 100644 lib/fog/openstack/models/identity_v3/role.rb create mode 100644 lib/fog/openstack/models/identity_v3/role_assignment.rb create mode 100644 lib/fog/openstack/models/identity_v3/role_assignments.rb create mode 100644 lib/fog/openstack/models/identity_v3/roles.rb create mode 100644 lib/fog/openstack/models/identity_v3/service.rb create mode 100644 lib/fog/openstack/models/identity_v3/services.rb create mode 100644 lib/fog/openstack/models/identity_v3/token.rb create mode 100644 lib/fog/openstack/models/identity_v3/tokens.rb create mode 100644 lib/fog/openstack/models/identity_v3/user.rb create mode 100644 lib/fog/openstack/models/identity_v3/users.rb delete mode 100644 lib/fog/openstack/requests/identity/add_user_to_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/check_token.rb delete mode 100644 lib/fog/openstack/requests/identity/create_ec2_credential.rb delete mode 100644 lib/fog/openstack/requests/identity/create_role.rb delete mode 100644 lib/fog/openstack/requests/identity/create_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/create_user.rb delete mode 100644 lib/fog/openstack/requests/identity/create_user_role.rb delete mode 100644 lib/fog/openstack/requests/identity/delete_ec2_credential.rb delete mode 100644 lib/fog/openstack/requests/identity/delete_role.rb delete mode 100644 lib/fog/openstack/requests/identity/delete_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/delete_user.rb delete mode 100644 lib/fog/openstack/requests/identity/delete_user_role.rb delete mode 100644 lib/fog/openstack/requests/identity/get_ec2_credential.rb delete mode 100644 lib/fog/openstack/requests/identity/get_role.rb delete mode 100644 lib/fog/openstack/requests/identity/get_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/get_tenants_by_id.rb delete mode 100644 lib/fog/openstack/requests/identity/get_tenants_by_name.rb delete mode 100644 lib/fog/openstack/requests/identity/get_user_by_id.rb delete mode 100644 lib/fog/openstack/requests/identity/get_user_by_name.rb delete mode 100644 lib/fog/openstack/requests/identity/list_ec2_credentials.rb delete mode 100644 lib/fog/openstack/requests/identity/list_endpoints_for_token.rb delete mode 100644 lib/fog/openstack/requests/identity/list_roles.rb delete mode 100644 lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/list_tenants.rb delete mode 100644 lib/fog/openstack/requests/identity/list_user_global_roles.rb delete mode 100644 lib/fog/openstack/requests/identity/list_users.rb delete mode 100644 lib/fog/openstack/requests/identity/remove_user_from_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/set_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/update_tenant.rb delete mode 100644 lib/fog/openstack/requests/identity/update_user.rb delete mode 100644 lib/fog/openstack/requests/identity/validate_token.rb create mode 100644 lib/fog/openstack/requests/identity_v2/add_user_to_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/check_token.rb create mode 100644 lib/fog/openstack/requests/identity_v2/create_ec2_credential.rb create mode 100644 lib/fog/openstack/requests/identity_v2/create_role.rb create mode 100644 lib/fog/openstack/requests/identity_v2/create_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/create_user.rb create mode 100644 lib/fog/openstack/requests/identity_v2/create_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v2/delete_ec2_credential.rb create mode 100644 lib/fog/openstack/requests/identity_v2/delete_role.rb create mode 100644 lib/fog/openstack/requests/identity_v2/delete_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/delete_user.rb create mode 100644 lib/fog/openstack/requests/identity_v2/delete_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v2/get_ec2_credential.rb create mode 100644 lib/fog/openstack/requests/identity_v2/get_role.rb create mode 100644 lib/fog/openstack/requests/identity_v2/get_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/get_tenants_by_id.rb create mode 100644 lib/fog/openstack/requests/identity_v2/get_tenants_by_name.rb create mode 100644 lib/fog/openstack/requests/identity_v2/get_user_by_id.rb create mode 100644 lib/fog/openstack/requests/identity_v2/get_user_by_name.rb create mode 100644 lib/fog/openstack/requests/identity_v2/list_ec2_credentials.rb create mode 100644 lib/fog/openstack/requests/identity_v2/list_endpoints_for_token.rb create mode 100644 lib/fog/openstack/requests/identity_v2/list_roles.rb create mode 100644 lib/fog/openstack/requests/identity_v2/list_roles_for_user_on_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/list_tenants.rb create mode 100644 lib/fog/openstack/requests/identity_v2/list_user_global_roles.rb create mode 100644 lib/fog/openstack/requests/identity_v2/list_users.rb create mode 100644 lib/fog/openstack/requests/identity_v2/remove_user_from_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/set_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/update_tenant.rb create mode 100644 lib/fog/openstack/requests/identity_v2/update_user.rb create mode 100644 lib/fog/openstack/requests/identity_v2/validate_token.rb create mode 100644 lib/fog/openstack/requests/identity_v3/add_user_to_group.rb create mode 100644 lib/fog/openstack/requests/identity_v3/auth_domains.rb create mode 100644 lib/fog/openstack/requests/identity_v3/auth_projects.rb create mode 100644 lib/fog/openstack/requests/identity_v3/check_domain_group_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/check_domain_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/check_project_group_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/check_project_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_domain.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_endpoint.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_group.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_os_credential.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_policy.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_project.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_service.rb create mode 100644 lib/fog/openstack/requests/identity_v3/create_user.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_domain.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_endpoint.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_group.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_os_credential.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_policy.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_project.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_service.rb create mode 100644 lib/fog/openstack/requests/identity_v3/delete_user.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_domain.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_endpoint.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_group.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_os_credential.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_policy.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_project.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_service.rb create mode 100644 lib/fog/openstack/requests/identity_v3/get_user.rb create mode 100644 lib/fog/openstack/requests/identity_v3/grant_domain_group_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/grant_domain_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/grant_project_group_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/grant_project_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/group_user_check.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_domain_group_roles.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_domain_user_roles.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_domains.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_endpoints.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_group_users.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_groups.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_os_credentials.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_policies.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_project_group_roles.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_project_user_roles.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_projects.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_role_assignments.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_roles.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_services.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_user_groups.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_user_projects.rb create mode 100644 lib/fog/openstack/requests/identity_v3/list_users.rb create mode 100644 lib/fog/openstack/requests/identity_v3/remove_user_from_group.rb create mode 100644 lib/fog/openstack/requests/identity_v3/revoke_domain_group_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/revoke_domain_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/revoke_project_group_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/revoke_project_user_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/token_authenticate.rb create mode 100644 lib/fog/openstack/requests/identity_v3/token_check.rb create mode 100644 lib/fog/openstack/requests/identity_v3/token_revoke.rb create mode 100644 lib/fog/openstack/requests/identity_v3/token_validate.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_domain.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_endpoint.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_group.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_os_credential.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_policy.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_project.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_role.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_service.rb create mode 100644 lib/fog/openstack/requests/identity_v3/update_user.rb create mode 100644 spec/fog/openstack/identity_v3/authv3_a.yml create mode 100644 spec/fog/openstack/identity_v3/authv3_b.yml create mode 100644 spec/fog/openstack/identity_v3/authv3_c.yml create mode 100644 spec/fog/openstack/identity_v3/authv3_project.yml create mode 100644 spec/fog/openstack/identity_v3/authv3_token.yml create mode 100644 spec/fog/openstack/identity_v3/authv3_unscoped.yml create mode 100644 spec/fog/openstack/identity_v3/idv2_unscoped_token_v3.yml create mode 100644 spec/fog/openstack/identity_v3/idv3.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_credential.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_credential_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_domain.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_domain_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_endpoint.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_policy.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_policy_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_project.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_project_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_role.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_role_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_service.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_services_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_token.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_user_crud.yml create mode 100644 spec/fog/openstack/identity_v3/idv3_users.yml create mode 100644 spec/fog/openstack/identity_v3_spec.rb diff --git a/Rakefile b/Rakefile index 2311736f6..94e771e21 100644 --- a/Rakefile +++ b/Rakefile @@ -78,6 +78,9 @@ namespace :test do task :openstack do sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/openstack") end + task :openstack_idv3 do + sh("export FOG_MOCK=#{mock} && bundle exec rspec spec/fog/openstack/identity_v3_spec.rb") + end task :cloudstack do sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/cloudstack") end diff --git a/fog.gemspec b/fog.gemspec index c7b7db81e..ac4ae0c5a 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -84,6 +84,9 @@ Gem::Specification.new do |s| s.add_development_dependency("simplecov") s.add_development_dependency("thor") s.add_development_dependency("yard") + s.add_development_dependency("rspec-core") + s.add_development_dependency("vcr") + s.add_development_dependency("webmock") s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {spec,tests}/*`.split("\n") diff --git a/lib/fog/openstack.rb b/lib/fog/openstack.rb index 1abb4ea07..f026c9ad0 100644 --- a/lib/fog/openstack.rb +++ b/lib/fog/openstack.rb @@ -1,5 +1,5 @@ require 'fog/openstack/compute' -require 'fog/openstack/identity' +require 'fog/openstack/identity_v2' require 'fog/openstack/image' require 'fog/openstack/metering' require 'fog/openstack/network' diff --git a/lib/fog/openstack/baremetal.rb b/lib/fog/openstack/baremetal.rb index cb488956b..5efe4f35f 100644 --- a/lib/fog/openstack/baremetal.rb +++ b/lib/fog/openstack/baremetal.rb @@ -337,7 +337,7 @@ module Fog :openstack_endpoint_type => @openstack_endpoint_type } - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/lib/fog/openstack/compute.rb b/lib/fog/openstack/compute.rb index 8ccc2971a..6d046f438 100644 --- a/lib/fog/openstack/compute.rb +++ b/lib/fog/openstack/compute.rb @@ -414,13 +414,7 @@ module Fog :openstack_endpoint_type => @openstack_endpoint_type } - if @openstack_auth_uri.path =~ /\/v2.0/ - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) - elsif @openstack_auth_uri.path =~ /\/v3/ - credentials = Fog::OpenStack.authenticate_v3(options, @connection_options) - else - credentials = Fog::OpenStack.authenticate_v1(options, @connection_options) - end + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/lib/fog/openstack/core.rb b/lib/fog/openstack/core.rb index 893ad0db7..249662981 100644 --- a/lib/fog/openstack/core.rb +++ b/lib/fog/openstack/core.rb @@ -177,10 +177,11 @@ module Fog def self.authenticate_v3(options, connection_options = {}) uri = options[:openstack_auth_uri] tenant_name = options[:openstack_tenant] + project_name = options[:openstack_project_name] service_type = options[:openstack_service_type] service_name = options[:openstack_service_name] identity_service_type = options[:openstack_identity_service_type] - endpoint_type = (options[:openstack_endpoint_type] || 'public').to_s + endpoint_type = map_endpoint_type(options[:openstack_endpoint_type] || 'publicURL') openstack_region = options[:openstack_region] body, token_headers = retrieve_tokens_v3(options, connection_options) @@ -190,6 +191,29 @@ module Fog options[:unscoped_token] = token_headers['X-Subject-Token'] unless service + unless project_name + request_body = { + :expects => [200], + :headers => {'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Auth-Token' => token_headers['X-Subject-Token']}, + :method => 'GET' + } + user_id = body['token']['user']['id'] + response = Fog::Core::Connection.new( + "#{uri.scheme}://#{uri.host}:#{uri.port}/v3/users/#{user_id}/projects", false, connection_options).request(request_body) + + projects_body = Fog::JSON.decode(response.body) + if projects_body['projects'].empty? + raise Fog::Errors::NotFound.new('No Project Found') + else + options[:openstack_project_name] = projects_body['projects'].first['name'] + options[:openstack_domain_name] = body['token']['user']['domain']['name'] + end + end + + tenant_name = options[:openstack_project_name] + unless tenant_name response = Fog::Core::Connection.new( "#{uri.scheme}://#{uri.host}:#{uri.port}/v3/projects", false, connection_options).request({ @@ -211,8 +235,6 @@ module Fog service = get_service(body, service_type, service_name) end - endpoint_type = 'public' - service['endpoints'] = service['endpoints'].select do |endpoint| endpoint['region'] == openstack_region && endpoint['interface'] == endpoint_type end if openstack_region @@ -238,13 +260,14 @@ module Fog admin = true if r["name"] == "admin" end - if service['endpoints'].count > 1 and not admin - regions = service["endpoints"].map{ |e| e['region'] }.uniq.join(',') - raise Fog::Errors::NotFound.new("Multiple regions available choose one of these '#{regions}'") + regions = service["endpoints"].map{ |e| e['region'] }.uniq + if regions.count > 1 and not admin + raise Fog::Errors::NotFound.new("Multiple regions available choose one of these '#{regions.join(',')}'") end identity_service = get_service(body, identity_service_type) if identity_service_type - tenant = body['token']['project']['name'] + tenant = body['token']['project']['name'] if body['token']['project'] + tenant = body['token']['user']['project']['name'] unless body['token']['project'] user = body['token']['user']['name'] management_url = service['endpoints'].find{|s| s["interface"][endpoint_type]}["url"] @@ -411,5 +434,17 @@ module Fog '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase end end + + def self.map_endpoint_type type + case type + when "publicURL" + "public" + when "internalURL" + "internal" + when "adminURL" + "admin" + end + + end end end diff --git a/lib/fog/openstack/identity.rb b/lib/fog/openstack/identity.rb index e1b7d8a62..5f7bef19d 100644 --- a/lib/fog/openstack/identity.rb +++ b/lib/fog/openstack/identity.rb @@ -3,269 +3,41 @@ require 'fog/openstack/core' module Fog module Identity class OpenStack < Fog::Service - requires :openstack_auth_url - recognizes :openstack_auth_token, :openstack_management_url, :persistent, - :openstack_service_type, :openstack_service_name, :openstack_tenant, - :openstack_api_key, :openstack_username, :openstack_current_user_id, - :current_user, :current_tenant, - :openstack_endpoint_type, :openstack_region - model_path 'fog/openstack/models/identity' - model :tenant - collection :tenants - model :user - collection :users - model :role - collection :roles - model :ec2_credential - collection :ec2_credentials - - request_path 'fog/openstack/requests/identity' - - request :check_token - request :validate_token - - request :list_tenants - request :create_tenant - request :get_tenant - request :get_tenants_by_id - request :get_tenants_by_name - request :update_tenant - request :delete_tenant - - request :list_users - request :create_user - request :update_user - request :delete_user - request :get_user_by_id - request :get_user_by_name - request :add_user_to_tenant - request :remove_user_from_tenant - - request :list_endpoints_for_token - request :list_roles_for_user_on_tenant - request :list_user_global_roles - - request :create_role - request :delete_role - request :delete_user_role - request :create_user_role - request :get_role - request :list_roles - - request :set_tenant - - request :create_ec2_credential - request :delete_ec2_credential - request :get_ec2_credential - request :list_ec2_credentials - - class Mock - attr_reader :auth_token - attr_reader :auth_token_expiration - attr_reader :current_user - attr_reader :current_tenant - attr_reader :unscoped_token - - def self.data - @users ||= {} - @roles ||= {} - @tenants ||= {} - @ec2_credentials ||= Hash.new { |hash, key| hash[key] = {} } - @user_tenant_membership ||= {} - - @data ||= Hash.new do |hash, key| - hash[key] = { - :users => @users, - :roles => @roles, - :tenants => @tenants, - :ec2_credentials => @ec2_credentials, - :user_tenant_membership => @user_tenant_membership - } - end - end - - def self.reset! - @data = nil - @users = nil - @roles = nil - @tenants = nil - @ec2_credentials = nil - end - - def initialize(options={}) - @openstack_username = options[:openstack_username] || 'admin' - @openstack_tenant = options[:openstack_tenant] || 'admin' - @openstack_auth_uri = URI.parse(options[:openstack_auth_url]) - @openstack_management_url = @openstack_auth_uri.to_s - - @auth_token = Fog::Mock.random_base64(64) - @auth_token_expiration = (Time.now.utc + 86400).iso8601 - - @admin_tenant = self.data[:tenants].values.find do |u| - u['name'] == 'admin' - end - - if @openstack_tenant - @current_tenant = self.data[:tenants].values.find do |u| - u['name'] == @openstack_tenant + # Fog::Identity::OpenStack.new() will return a Fog::Identity::OpenStack::V2 or a Fog::Identity::OpenStack::V3, + # depending on whether the auth URL is for an OpenStack Identity V2 or V3 API endpoint + def self.new(args = {}) + if self.inspect == 'Fog::Identity::OpenStack' + if args[:openstack_auth_url] + @openstack_auth_uri = URI.parse(args[:openstack_auth_url]) + if @openstack_auth_uri.path =~ /\/v3/ + service = Fog::Identity::OpenStack::V3.new(args) end - - unless @current_tenant - @current_tenant_id = Fog::Mock.random_hex(32) - @current_tenant = self.data[:tenants][@current_tenant_id] = { - 'id' => @current_tenant_id, - 'name' => @openstack_tenant - } - else - @current_tenant_id = @current_tenant['id'] - end - else - @current_tenant = @admin_tenant - end - - @current_user = self.data[:users].values.find do |u| - u['name'] == @openstack_username - end - @current_tenant_id = Fog::Mock.random_hex(32) - - unless @current_user - @current_user_id = Fog::Mock.random_hex(32) - @current_user = self.data[:users][@current_user_id] = { - 'id' => @current_user_id, - 'name' => @openstack_username, - 'email' => "#{@openstack_username}@mock.com", - 'tenantId' => Fog::Mock.random_numbers(6).to_s, - 'enabled' => true - } - else - @current_user_id = @current_user['id'] end + service ||= Fog::Identity::OpenStack::V2.new(args) + else + service = Fog::Service.new(args) end - - def data - self.class.data[@openstack_username] - end - - def reset_data - self.class.data.delete(@openstack_username) - end - - def credentials - { :provider => 'openstack', - :openstack_auth_url => @openstack_auth_uri.to_s, - :openstack_auth_token => @auth_token, - :openstack_management_url => @openstack_management_url, - :openstack_current_user_id => @openstack_current_user_id, - :current_user => @current_user, - :current_tenant => @current_tenant} - end + service end - class Real - attr_reader :current_user - attr_reader :current_tenant - attr_reader :unscoped_token - - def initialize(options={}) - @openstack_auth_token = options[:openstack_auth_token] - - unless @openstack_auth_token - missing_credentials = Array.new - @openstack_api_key = options[:openstack_api_key] - @openstack_username = options[:openstack_username] - @openstack_region = options[:openstack_region] - - missing_credentials << :openstack_api_key unless @openstack_api_key - missing_credentials << :openstack_username unless @openstack_username - raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty? - end - - @openstack_tenant = options[:openstack_tenant] - @openstack_auth_uri = URI.parse(options[:openstack_auth_url]) - @openstack_management_url = options[:openstack_management_url] - @openstack_must_reauthenticate = false - @openstack_service_type = options[:openstack_service_type] || ['identity'] - @openstack_service_name = options[:openstack_service_name] - - @connection_options = options[:connection_options] || {} - - @openstack_current_user_id = options[:openstack_current_user_id] - - @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL' - - @current_user = options[:current_user] - @current_tenant = options[:current_tenant] - - authenticate - - @persistent = options[:persistent] || false - @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) - end - - def credentials - { :provider => 'openstack', - :openstack_auth_url => @openstack_auth_uri.to_s, - :openstack_auth_token => @auth_token, - :openstack_management_url => @openstack_management_url, - :openstack_current_user_id => @openstack_current_user_id, - :current_user => @current_user, - :current_tenant => @current_tenant } - end - - def reload - @connection.reset - end - - def request(params) - retried = false - begin - response = @connection.request(params.merge({ - :headers => { - 'Content-Type' => 'application/json', - 'Accept' => 'application/json', - 'X-Auth-Token' => @auth_token - }.merge!(params[:headers] || {}), - :path => "#{@path}/#{params[:path]}"#, - })) - rescue Excon::Errors::Unauthorized => error - raise if retried - retried = true - - @openstack_must_reauthenticate = true - authenticate - retry - rescue Excon::Errors::HTTPStatusError => error - raise case error - when Excon::Errors::NotFound - Fog::Identity::OpenStack::NotFound.slurp(error) - else - error - end - end - unless response.body.empty? - response.body = Fog::JSON.decode(response.body) - end - response - end - - private + module Common def authenticate if !@openstack_management_url || @openstack_must_reauthenticate options = { - :openstack_api_key => @openstack_api_key, - :openstack_username => @openstack_username, - :openstack_auth_token => @openstack_must_reauthenticate ? nil : @openstack_auth_token, - :openstack_auth_uri => @openstack_auth_uri, - :openstack_tenant => @openstack_tenant, - :openstack_service_type => @openstack_service_type, - :openstack_service_name => @openstack_service_name, - :openstack_endpoint_type => @openstack_endpoint_type, - :openstack_region => @openstack_region + :openstack_api_key => @openstack_api_key, + :openstack_username => @openstack_username, + :openstack_auth_token => @openstack_must_reauthenticate ? nil : @openstack_auth_token, + :openstack_auth_uri => @openstack_auth_uri, + :openstack_tenant => @openstack_tenant, + :openstack_service_type => @openstack_service_type, + :openstack_service_name => @openstack_service_name, + :openstack_endpoint_type => @openstack_endpoint_type, + :openstack_region => @openstack_region } - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] @@ -281,14 +53,17 @@ module Fog uri = URI.parse(@openstack_management_url) end - @host = uri.host - @path = uri.path + @host = uri.host + @path = uri.path @path.sub!(/\/$/, '') - @port = uri.port + @port = uri.port @scheme = uri.scheme true end + end end + + end end diff --git a/lib/fog/openstack/identity_v2.rb b/lib/fog/openstack/identity_v2.rb new file mode 100644 index 000000000..e1db204ba --- /dev/null +++ b/lib/fog/openstack/identity_v2.rb @@ -0,0 +1,264 @@ +require 'fog/openstack/core' +require 'fog/openstack/identity' + +module Fog + module Identity + class OpenStack + class V2 < Fog::Service + + requires :openstack_auth_url + recognizes :openstack_auth_token, :openstack_management_url, :persistent, + :openstack_service_type, :openstack_service_name, :openstack_tenant, + :openstack_api_key, :openstack_username, :openstack_current_user_id, + :current_user, :current_tenant, + :openstack_endpoint_type, :openstack_region + + model_path 'fog/openstack/models/identity_v2' + model :tenant + collection :tenants + model :user + collection :users + model :role + collection :roles + model :ec2_credential + collection :ec2_credentials + + request_path 'fog/openstack/requests/identity_v2' + + request :check_token + request :validate_token + + request :list_tenants + request :create_tenant + request :get_tenant + request :get_tenants_by_id + request :get_tenants_by_name + request :update_tenant + request :delete_tenant + + request :list_users + request :create_user + request :update_user + request :delete_user + request :get_user_by_id + request :get_user_by_name + request :add_user_to_tenant + request :remove_user_from_tenant + + request :list_endpoints_for_token + request :list_roles_for_user_on_tenant + request :list_user_global_roles + + request :create_role + request :delete_role + request :delete_user_role + request :create_user_role + request :get_role + request :list_roles + + request :set_tenant + + request :create_ec2_credential + request :delete_ec2_credential + request :get_ec2_credential + request :list_ec2_credentials + + class Mock + attr_reader :auth_token + attr_reader :auth_token_expiration + attr_reader :current_user + attr_reader :current_tenant + attr_reader :unscoped_token + + def self.data + @users ||= {} + @roles ||= {} + @tenants ||= {} + @ec2_credentials ||= Hash.new { |hash, key| hash[key] = {} } + @user_tenant_membership ||= {} + + @data ||= Hash.new do |hash, key| + hash[key] = { + :users => @users, + :roles => @roles, + :tenants => @tenants, + :ec2_credentials => @ec2_credentials, + :user_tenant_membership => @user_tenant_membership + } + end + end + + def self.reset! + @data = nil + @users = nil + @roles = nil + @tenants = nil + @ec2_credentials = nil + end + + def initialize(options={}) + @openstack_username = options[:openstack_username] || 'admin' + @openstack_tenant = options[:openstack_tenant] || 'admin' + @openstack_auth_uri = URI.parse(options[:openstack_auth_url]) + @openstack_management_url = @openstack_auth_uri.to_s + + @auth_token = Fog::Mock.random_base64(64) + @auth_token_expiration = (Time.now.utc + 86400).iso8601 + + @admin_tenant = self.data[:tenants].values.find do |u| + u['name'] == 'admin' + end + + if @openstack_tenant + @current_tenant = self.data[:tenants].values.find do |u| + u['name'] == @openstack_tenant + end + + unless @current_tenant + @current_tenant_id = Fog::Mock.random_hex(32) + @current_tenant = self.data[:tenants][@current_tenant_id] = { + 'id' => @current_tenant_id, + 'name' => @openstack_tenant + } + else + @current_tenant_id = @current_tenant['id'] + end + else + @current_tenant = @admin_tenant + end + + @current_user = self.data[:users].values.find do |u| + u['name'] == @openstack_username + end + @current_tenant_id = Fog::Mock.random_hex(32) + + unless @current_user + @current_user_id = Fog::Mock.random_hex(32) + @current_user = self.data[:users][@current_user_id] = { + 'id' => @current_user_id, + 'name' => @openstack_username, + 'email' => "#{@openstack_username}@mock.com", + 'tenantId' => Fog::Mock.random_numbers(6).to_s, + 'enabled' => true + } + else + @current_user_id = @current_user['id'] + end + end + + def data + self.class.data[@openstack_username] + end + + def reset_data + self.class.data.delete(@openstack_username) + end + + def credentials + {:provider => 'openstack', + :openstack_auth_url => @openstack_auth_uri.to_s, + :openstack_auth_token => @auth_token, + :openstack_management_url => @openstack_management_url, + :openstack_current_user_id => @openstack_current_user_id, + :current_user => @current_user, + :current_tenant => @current_tenant} + end + end + + class Real + attr_reader :current_user + attr_reader :current_tenant + attr_reader :unscoped_token + + include Fog::Identity::OpenStack::Common + + def initialize(options={}) + @openstack_auth_token = options[:openstack_auth_token] + + unless @openstack_auth_token + missing_credentials = Array.new + @openstack_api_key = options[:openstack_api_key] + @openstack_username = options[:openstack_username] + @openstack_region = options[:openstack_region] + + missing_credentials << :openstack_api_key unless @openstack_api_key + missing_credentials << :openstack_username unless @openstack_username + raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty? + end + + @openstack_tenant = options[:openstack_tenant] + @openstack_auth_uri = URI.parse(options[:openstack_auth_url]) + @openstack_management_url = options[:openstack_management_url] + @openstack_must_reauthenticate = false + @openstack_service_type = options[:openstack_service_type] || ['identity'] + @openstack_service_name = options[:openstack_service_name] + + @connection_options = options[:connection_options] || {} + + @openstack_current_user_id = options[:openstack_current_user_id] + + @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL' + + @current_user = options[:current_user] + @current_tenant = options[:current_tenant] + + authenticate + + @persistent = options[:persistent] || false + @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) + end + + def credentials + {:provider => 'openstack', + :openstack_auth_url => @openstack_auth_uri.to_s, + :openstack_auth_token => @auth_token, + :openstack_management_url => @openstack_management_url, + :openstack_current_user_id => @openstack_current_user_id, + :current_user => @current_user, + :current_tenant => @current_tenant} + end + + def reload + @connection.reset + end + + def request(params) + retried = false + begin + response = @connection.request(params.merge({ + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Auth-Token' => @auth_token + }.merge!(params[:headers] || {}), + :path => "#{@path}/#{params[:path]}" #, + })) + rescue Excon::Errors::Unauthorized => error + raise if retried + retried = true + + @openstack_must_reauthenticate = true + authenticate + retry + rescue Excon::Errors::HTTPStatusError => error + raise case error + when Excon::Errors::NotFound + Fog::Identity::OpenStack::NotFound.slurp(error) + else + error + end + end + unless response.body.empty? + response.body = Fog::JSON.decode(response.body) + end + response + end + + private + + + end + end + end + end +end diff --git a/lib/fog/openstack/identity_v3.rb b/lib/fog/openstack/identity_v3.rb new file mode 100644 index 000000000..be78f40ea --- /dev/null +++ b/lib/fog/openstack/identity_v3.rb @@ -0,0 +1,249 @@ +require 'fog/openstack/core' +require 'fog/openstack/identity' + +module Fog + module Identity + class OpenStack + class V3 < Fog::Service + + requires :openstack_auth_url + recognizes :openstack_auth_token, :openstack_management_url, :persistent, + :openstack_service_type, :openstack_service_name, :openstack_tenant, + :openstack_project_name, :openstack_domain_name, :openstack_userid, + :openstack_api_key, :openstack_username, :openstack_current_user_id, + :current_user, :current_tenant, + :openstack_endpoint_type, :openstack_region, :openstack_domain_id, + :openstack_domain, :openstack_project, :provider + + model_path 'fog/openstack/models/identity_v3' + model :domain + collection :domains + model :endpoint + collection :endpoints + model :project + collection :projects + model :service + collection :services + model :token + collection :tokens + model :user + collection :users + model :group + collection :groups + model :role + collection :roles + model :role_assignment + collection :role_assignments + model :os_credential + collection :os_credentials + model :policy + collection :policies + + request_path 'fog/openstack/requests/identity_v3' + + + request :list_users + request :get_user + request :create_user + request :update_user + request :delete_user + request :list_user_groups + request :list_user_projects + request :list_groups + request :get_group + request :create_group + request :update_group + request :delete_group + request :add_user_to_group + request :remove_user_from_group + request :group_user_check + request :list_group_users + request :list_roles + request :list_role_assignments + request :get_role + request :create_role + request :update_role + request :delete_role + request :auth_domains + request :auth_projects + request :list_domains + request :get_domain + request :create_domain + request :update_domain + request :delete_domain + request :list_domain_user_roles + request :grant_domain_user_role + request :check_domain_user_role + request :revoke_domain_user_role + request :list_domain_group_roles + request :grant_domain_group_role + request :check_domain_group_role + request :revoke_domain_group_role + request :list_endpoints + request :get_endpoint + request :create_endpoint + request :update_endpoint + request :delete_endpoint + request :list_projects + request :get_project + request :create_project + request :update_project + request :delete_project + request :list_project_user_roles + request :grant_project_user_role + request :check_project_user_role + request :revoke_project_user_role + request :list_project_group_roles + request :grant_project_group_role + request :check_project_group_role + request :revoke_project_group_role + request :list_services + request :get_service + request :create_service + request :update_service + request :delete_service + request :token_authenticate + request :token_validate + request :token_check + request :token_revoke + request :list_os_credentials + request :get_os_credential + request :create_os_credential + request :update_os_credential + request :delete_os_credential + request :list_policies + request :get_policy + request :create_policy + request :update_policy + request :delete_policy + + class Mock + def initialize(options={}) + + end + end + + def self.get_api_version uri, connection_options={} + connection = Fog::Core::Connection.new(uri, false, connection_options) + response = connection.request({ + :expects => [200], + :headers => {'Content-Type' => 'application/json', + 'Accept' => 'application/json'}, + :method => 'GET' + }) + + body = Fog::JSON.decode(response.body) + version = nil + unless body['version'].empty? + version = body['version']['id'] + end + if version.nil? + raise Fog::OpenStack::Errors::ServiceUnavailable.new( + "No version available at #{uri}") + end + + version + end + + class Real + attr_reader :current_user + attr_reader :current_tenant + attr_reader :unscoped_token + attr_reader :auth_token + + include Fog::Identity::OpenStack::Common + + def initialize(options={}) + @openstack_auth_token = options[:openstack_auth_token] + + @openstack_region = options[:openstack_region] + + unless @openstack_auth_token + missing_credentials = Array.new + @openstack_api_key = options[:openstack_api_key] + @openstack_username = options[:openstack_username] + @openstack_userid = options[:openstack_userid] + + missing_credentials << :openstack_api_key unless @openstack_api_key + unless @openstack_username || @openstack_userid + missing_credentials << 'openstack_username or openstack_userid' + end + raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty? + end + + + @openstack_tenant = options[:openstack_tenant] + @openstack_auth_uri = URI.parse(options[:openstack_auth_url]) + @openstack_management_url = options[:openstack_management_url] + @openstack_must_reauthenticate = false + @openstack_service_type = options[:openstack_service_type] || ['identity_v3','identityv3','identity'] + @openstack_service_name = options[:openstack_service_name] + + @connection_options = options[:connection_options] || {} + + @openstack_current_user_id = options[:openstack_current_user_id] + + @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL' + + @current_user = options[:current_user] + @current_tenant = options[:current_tenant] + + authenticate + + @persistent = options[:persistent] || false + @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) + end + + def credentials + {:provider => 'openstack', + :openstack_auth_url => @openstack_auth_uri.to_s, + :openstack_auth_token => @auth_token, + :openstack_management_url => @openstack_management_url, + :openstack_current_user_id => @openstack_current_user_id, + :current_user => @current_user, + :current_tenant => @current_tenant} + end + + def reload + @connection.reset + end + + def request(params) + retried = false + begin + response = @connection.request(params.merge({ + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Auth-Token' => @auth_token + }.merge!(params[:headers] || {}), + :path => "#{@path}/#{params[:path]}" #, + })) + rescue Excon::Errors::Unauthorized => error + raise if retried + retried = true + + @openstack_must_reauthenticate = true + authenticate + retry + rescue Excon::Errors::HTTPStatusError => error + raise case error + when Excon::Errors::NotFound + Fog::Identity::OpenStack::NotFound.slurp(error) + else + error + end + end + unless response.body.empty? + response.body = Fog::JSON.decode(response.body) + end + response + end + + + end + + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/image.rb b/lib/fog/openstack/image.rb index 2bd0b0307..5457c87c6 100644 --- a/lib/fog/openstack/image.rb +++ b/lib/fog/openstack/image.rb @@ -185,7 +185,7 @@ module Fog :openstack_endpoint_type => @openstack_endpoint_type } - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/lib/fog/openstack/metering.rb b/lib/fog/openstack/metering.rb index 44fdb60db..7007b3402 100644 --- a/lib/fog/openstack/metering.rb +++ b/lib/fog/openstack/metering.rb @@ -178,7 +178,7 @@ module Fog :openstack_endpoint_type => @openstack_endpoint_type } - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/lib/fog/openstack/models/identity/ec2_credential.rb b/lib/fog/openstack/models/identity/ec2_credential.rb deleted file mode 100644 index d203a5908..000000000 --- a/lib/fog/openstack/models/identity/ec2_credential.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'fog/core/model' - -module Fog - module Identity - class OpenStack - class Ec2Credential < Fog::Model - identity :access, :aliases => 'access_key' - - attribute :secret, :aliases => 'secret_key' - attribute :tenant_id - attribute :user_id - - def initialize(attributes) - # Old 'connection' is renamed as service and should be used instead - prepare_service_value(attributes) - super - end - - def destroy - requires :access - requires :user_id - service.delete_ec2_credential user_id, access - true - end - - def save - raise Fog::Errors::Error, 'Existing credentials cannot be altered' if - access - - self.user_id ||= user.id - self.tenant_id ||= user.tenant_id - - requires :user_id, :tenant_id - - data = service.create_ec2_credential user_id, tenant_id - - merge_attributes(data.body['credential']) - - true - end - end - end - end -end diff --git a/lib/fog/openstack/models/identity/ec2_credentials.rb b/lib/fog/openstack/models/identity/ec2_credentials.rb deleted file mode 100644 index b5676c0a3..000000000 --- a/lib/fog/openstack/models/identity/ec2_credentials.rb +++ /dev/null @@ -1,53 +0,0 @@ -require 'fog/core/collection' -require 'fog/openstack/models/identity/ec2_credential' - -module Fog - module Identity - class OpenStack - class Ec2Credentials < Fog::Collection - model Fog::Identity::OpenStack::Ec2Credential - - attribute :user - - def all - user_id = user ? user.id : nil - - ec2_credentials = service.list_ec2_credentials(user_id) - - load(ec2_credentials.body['credentials']) - end - - def create(attributes = {}) - if user then - attributes[:user_id] ||= user.id - attributes[:tenant_id] ||= user.tenant_id - end - - super attributes - end - - def destroy(access_key) - ec2_credential = self.find_by_access_key(access_key) - ec2_credential.destroy - end - - def find_by_access_key(access_key) - user_id = user ? user.id : nil - - ec2_credential = - self.find { |ec2_credential| ec2_credential.access == access_key } - - unless ec2_credential then - response = service.get_ec2_credential(user_id, access_key) - body = response.body['credential'] - body = body.merge 'service' => service - - ec2_credential = Fog::Identity::OpenStack::EC2Credential.new(body) - end - - ec2_credential - end - end - end - end -end diff --git a/lib/fog/openstack/models/identity/role.rb b/lib/fog/openstack/models/identity/role.rb deleted file mode 100644 index 06fa75cb8..000000000 --- a/lib/fog/openstack/models/identity/role.rb +++ /dev/null @@ -1,50 +0,0 @@ -require 'fog/core/model' - -module Fog - module Identity - class OpenStack - class Role < Fog::Model - identity :id - attribute :name - - def save - requires :name - data = service.create_role(name) - merge_attributes(data.body['role']) - true - end - - def destroy - requires :id - service.delete_role(id) - true - end - - def add_to_user(user, tenant) - add_remove_to_user(user, tenant, :add) - end - - def remove_to_user(user, tenant) - add_remove_to_user(user, tenant, :remove) - end - - private - def add_remove_to_user(user, tenant, ops) - requires :id - user_id = get_id(user) - tenant_id = get_id(tenant) - case ops - when :add - service.create_user_role(tenant_id, user_id, id).status == 200 - when :remove - service.delete_user_role(tenant_id, user_id, id).status == 204 - end - end - - def get_id(_) - _.is_a?(String) ? _ : _.id - end - end # class Role - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/models/identity/roles.rb b/lib/fog/openstack/models/identity/roles.rb deleted file mode 100644 index ccba660f3..000000000 --- a/lib/fog/openstack/models/identity/roles.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'fog/core/collection' -require 'fog/openstack/models/identity/role' - -module Fog - module Identity - class OpenStack - class Roles < Fog::Collection - model Fog::Identity::OpenStack::Role - - def all - load(service.list_roles.body['roles']) - end - - def get(id) - service.get_role(id) - end - end - end # class OpenStack - end # module Compute -end # module Fog diff --git a/lib/fog/openstack/models/identity/tenant.rb b/lib/fog/openstack/models/identity/tenant.rb deleted file mode 100644 index acdea9299..000000000 --- a/lib/fog/openstack/models/identity/tenant.rb +++ /dev/null @@ -1,62 +0,0 @@ -require 'fog/core/model' - -module Fog - module Identity - class OpenStack - class Tenant < Fog::Model - identity :id - - attribute :description - attribute :enabled - attribute :name - - def to_s - self.name - end - - def roles_for(user) - service.roles( - :tenant => self, - :user => user) - end - - def users - requires :id - service.users(:tenant_id => self.id) - end - - def destroy - requires :id - service.delete_tenant(self.id) - true - end - - def update(attr = nil) - requires :id - merge_attributes( - service.update_tenant(self.id, attr || attributes).body['tenant']) - self - end - - def save - requires :name - identity ? update : create - end - - def create - merge_attributes( - service.create_tenant(attributes).body['tenant']) - self - end - - def grant_user_role(user_id, role_id) - service.add_user_to_tenant(self.id, user_id, role_id) - end - - def revoke_user_role(user_id, role_id) - service.remove_user_from_tenant(self.id, user_id, role_id) - end - end # class Tenant - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/models/identity/tenants.rb b/lib/fog/openstack/models/identity/tenants.rb deleted file mode 100644 index 5d67e5a6d..000000000 --- a/lib/fog/openstack/models/identity/tenants.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'fog/core/collection' -require 'fog/openstack/models/identity/tenant' - -module Fog - module Identity - class OpenStack - class Tenants < Fog::Collection - model Fog::Identity::OpenStack::Tenant - - def all - load(service.list_tenants.body['tenants']) - end - - def find_by_id(id) - cached_tenant = self.find {|tenant| tenant.id == id} - return cached_tenant if cached_tenant - tenant_hash = service.get_tenant(id).body['tenant'] - Fog::Identity::OpenStack::Tenant.new( - tenant_hash.merge(:service => service)) - end - - def destroy(id) - tenant = self.find_by_id(id) - tenant.destroy - end - end # class Tenants - end # class OpenStack - end # module Compute -end # module Fog diff --git a/lib/fog/openstack/models/identity/user.rb b/lib/fog/openstack/models/identity/user.rb deleted file mode 100644 index 5a6ebaac2..000000000 --- a/lib/fog/openstack/models/identity/user.rb +++ /dev/null @@ -1,69 +0,0 @@ -require 'fog/core/model' - -module Fog - module Identity - class OpenStack - class User < Fog::Model - identity :id - - attribute :email - attribute :enabled - attribute :name - attribute :tenant_id, :aliases => 'tenantId' - attribute :password - - attr_accessor :email, :name, :tenant_id, :enabled, :password - - def initialize(attributes) - # Old 'connection' is renamed as service and should be used instead - prepare_service_value(attributes) - super - end - - def ec2_credentials - requires :id - service.ec2_credentials(:user => self) - end - - def save - raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? - requires :name, :tenant_id, :password - enabled = true if enabled.nil? - data = service.create_user(name, password, email, tenant_id, enabled) - merge_attributes(data.body['user']) - true - end - - def update(options = {}) - requires :id - options.merge('id' => id) - response = service.update_user(id, options) - true - end - - def update_password(password) - update({'password' => password, 'url' => "/users/#{id}/OS-KSADM/password"}) - end - - def update_tenant(tenant) - tenant = tenant.id if tenant.class != String - update({:tenantId => tenant, 'url' => "/users/#{id}/OS-KSADM/tenant"}) - end - - def update_enabled(enabled) - update({:enabled => enabled, 'url' => "/users/#{id}/OS-KSADM/enabled"}) - end - - def destroy - requires :id - service.delete_user(id) - true - end - - def roles(tenant_id = self.tenant_id) - service.list_roles_for_user_on_tenant(tenant_id, self.id).body['roles'] - end - end # class User - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/models/identity/users.rb b/lib/fog/openstack/models/identity/users.rb deleted file mode 100644 index d5a96ca6c..000000000 --- a/lib/fog/openstack/models/identity/users.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'fog/core/collection' -require 'fog/openstack/models/identity/user' - -module Fog - module Identity - class OpenStack - class Users < Fog::Collection - model Fog::Identity::OpenStack::User - - attribute :tenant_id - - def all - load(service.list_users(tenant_id).body['users']) - end - - def find_by_id(id) - self.find {|user| user.id == id} || - Fog::Identity::OpenStack::User.new( - service.get_user_by_id(id).body['user'].merge( - 'service' => service - ) - ) - end - - def find_by_name(name) - self.find {|user| user.name == name} || - Fog::Identity::OpenStack::User.new( - service.get_user_by_name(name).body['user'].merge( - 'service' => service - ) - ) - end - - def destroy(id) - user = self.find_by_id(id) - user.destroy - end - end # class Users - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/models/identity_v2/ec2_credential.rb b/lib/fog/openstack/models/identity_v2/ec2_credential.rb new file mode 100644 index 000000000..b6d82c37f --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/ec2_credential.rb @@ -0,0 +1,45 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V2 + class Ec2Credential < Fog::Model + identity :access, :aliases => 'access_key' + + attribute :secret, :aliases => 'secret_key' + attribute :tenant_id + attribute :user_id + + def initialize(attributes) + # Old 'connection' is renamed as service and should be used instead + prepare_service_value(attributes) + super + end + + def destroy + requires :access + requires :user_id + service.delete_ec2_credential user_id, access + true + end + + def save + raise Fog::Errors::Error, 'Existing credentials cannot be altered' if access + + self.user_id ||= user.id + self.tenant_id ||= user.tenant_id + + requires :user_id, :tenant_id + + data = service.create_ec2_credential user_id, tenant_id + + merge_attributes(data.body['credential']) + + true + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v2/ec2_credentials.rb b/lib/fog/openstack/models/identity_v2/ec2_credentials.rb new file mode 100644 index 000000000..fea349dc3 --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/ec2_credentials.rb @@ -0,0 +1,55 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v2/ec2_credential' + +module Fog + module Identity + class OpenStack + class V2 + class Ec2Credentials < Fog::Collection + model Fog::Identity::OpenStack::V2::Ec2Credential + + attribute :user + + def all + user_id = user ? user.id : nil + + ec2_credentials = service.list_ec2_credentials(user_id) + + load(ec2_credentials.body['credentials']) + end + + def create(attributes = {}) + if user then + attributes[:user_id] ||= user.id + attributes[:tenant_id] ||= user.tenant_id + end + + super attributes + end + + def destroy(access_key) + ec2_credential = self.find_by_access_key(access_key) + ec2_credential.destroy + end + + def find_by_access_key(access_key) + user_id = user ? user.id : nil + + ec2_credential = + self.find { |ec2_credential| ec2_credential.access == access_key } + + unless ec2_credential then + response = service.get_ec2_credential(user_id, access_key) + body = response.body['credential'] + body = body.merge 'service' => service + + ec2_credential = Fog::Identity::OpenStack::V2::EC2Credential.new(body) + end + + ec2_credential + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v2/role.rb b/lib/fog/openstack/models/identity_v2/role.rb new file mode 100644 index 000000000..a13c15153 --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/role.rb @@ -0,0 +1,52 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V2 + class Role < Fog::Model + identity :id + attribute :name + + def save + requires :name + data = service.create_role(name) + merge_attributes(data.body['role']) + true + end + + def destroy + requires :id + service.delete_role(id) + true + end + + def add_to_user(user, tenant) + add_remove_to_user(user, tenant, :add) + end + + def remove_to_user(user, tenant) + add_remove_to_user(user, tenant, :remove) + end + + private + def add_remove_to_user(user, tenant, ops) + requires :id + user_id = get_id(user) + tenant_id = get_id(tenant) + case ops + when :add + service.create_user_role(tenant_id, user_id, id).status == 200 + when :remove + service.delete_user_role(tenant_id, user_id, id).status == 204 + end + end + + def get_id(_) + _.is_a?(String) ? _ : _.id + end + end # class Role + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v2/roles.rb b/lib/fog/openstack/models/identity_v2/roles.rb new file mode 100644 index 000000000..d4726fe0f --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/roles.rb @@ -0,0 +1,22 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v2/role' + +module Fog + module Identity + class OpenStack + class V2 + class Roles < Fog::Collection + model Fog::Identity::OpenStack::V2::Role + + def all + load(service.list_roles.body['roles']) + end + + def get(id) + service.get_role(id) + end + end + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v2/tenant.rb b/lib/fog/openstack/models/identity_v2/tenant.rb new file mode 100644 index 000000000..35e955f88 --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/tenant.rb @@ -0,0 +1,64 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V2 + class Tenant < Fog::Model + identity :id + + attribute :description + attribute :enabled + attribute :name + + def to_s + self.name + end + + def roles_for(user) + service.roles( + :tenant => self, + :user => user) + end + + def users + requires :id + service.users(:tenant_id => self.id) + end + + def destroy + requires :id + service.delete_tenant(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_tenant(self.id, attr || attributes).body['tenant']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_tenant(attributes).body['tenant']) + self + end + + def grant_user_role(user_id, role_id) + service.add_user_to_tenant(self.id, user_id, role_id) + end + + def revoke_user_role(user_id, role_id) + service.remove_user_from_tenant(self.id, user_id, role_id) + end + end # class Tenant + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v2/tenants.rb b/lib/fog/openstack/models/identity_v2/tenants.rb new file mode 100644 index 000000000..5b4aff749 --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/tenants.rb @@ -0,0 +1,31 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v2/tenant' + +module Fog + module Identity + class OpenStack + class V2 + class Tenants < Fog::Collection + model Fog::Identity::OpenStack::V2::Tenant + + def all + load(service.list_tenants.body['tenants']) + end + + def find_by_id(id) + cached_tenant = self.find { |tenant| tenant.id == id } + return cached_tenant if cached_tenant + tenant_hash = service.get_tenant(id).body['tenant'] + Fog::Identity::OpenStack::V2::Tenant.new( + tenant_hash.merge(:service => service)) + end + + def destroy(id) + tenant = self.find_by_id(id) + tenant.destroy + end + end # class Tenants + end # class V2 + end # class OpenStack + end # module Compute +end # module Fog \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v2/user.rb b/lib/fog/openstack/models/identity_v2/user.rb new file mode 100644 index 000000000..652274a14 --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/user.rb @@ -0,0 +1,71 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V2 + class User < Fog::Model + identity :id + + attribute :email + attribute :enabled + attribute :name + attribute :tenant_id, :aliases => 'tenantId' + attribute :password + + attr_accessor :email, :name, :tenant_id, :enabled, :password + + def initialize(attributes) + # Old 'connection' is renamed as service and should be used instead + prepare_service_value(attributes) + super + end + + def ec2_credentials + requires :id + service.ec2_credentials(:user => self) + end + + def save + raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? + requires :name, :tenant_id, :password + enabled = true if enabled.nil? + data = service.create_user(name, password, email, tenant_id, enabled) + merge_attributes(data.body['user']) + true + end + + def update(options = {}) + requires :id + options.merge('id' => id) + response = service.update_user(id, options) + true + end + + def update_password(password) + update({'password' => password, 'url' => "/users/#{id}/OS-KSADM/password"}) + end + + def update_tenant(tenant) + tenant = tenant.id if tenant.class != String + update({:tenantId => tenant, 'url' => "/users/#{id}/OS-KSADM/tenant"}) + end + + def update_enabled(enabled) + update({:enabled => enabled, 'url' => "/users/#{id}/OS-KSADM/enabled"}) + end + + def destroy + requires :id + service.delete_user(id) + true + end + + def roles(tenant_id = self.tenant_id) + service.list_roles_for_user_on_tenant(tenant_id, self.id).body['roles'] + end + end # class User + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/models/identity_v2/users.rb b/lib/fog/openstack/models/identity_v2/users.rb new file mode 100644 index 000000000..49c81635d --- /dev/null +++ b/lib/fog/openstack/models/identity_v2/users.rb @@ -0,0 +1,43 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v2/user' + +module Fog + module Identity + class OpenStack + class V2 + class Users < Fog::Collection + model Fog::Identity::OpenStack::V2::User + + attribute :tenant_id + + def all + load(service.list_users(tenant_id).body['users']) + end + + def find_by_id(id) + self.find { |user| user.id == id } || + Fog::Identity::OpenStack::V2::User.new( + service.get_user_by_id(id).body['user'].merge( + 'service' => service + ) + ) + end + + def find_by_name(name) + self.find { |user| user.name == name } || + Fog::Identity::OpenStack::V2::User.new( + service.get_user_by_name(name).body['user'].merge( + 'service' => service + ) + ) + end + + def destroy(id) + user = self.find_by_id(id) + user.destroy + end + end # class Users + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/domain.rb b/lib/fog/openstack/models/identity_v3/domain.rb new file mode 100644 index 000000000..818a84182 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/domain.rb @@ -0,0 +1,47 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Domain < Fog::Model + identity :id + + attribute :description + attribute :enabled + attribute :name + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_domain(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_domain(self.id, attr || attributes).body['domain']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_domain(attributes).body['domain']) + self + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/domains.rb b/lib/fog/openstack/models/identity_v3/domains.rb new file mode 100644 index 000000000..1e285feb2 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/domains.rb @@ -0,0 +1,36 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/domain' + +module Fog + module Identity + class OpenStack + class V3 + class Domains < Fog::Collection + model Fog::Identity::OpenStack::V3::Domain + + def all params={} + load(service.list_domains(params).body['domains']) + end + + def auth_domains params={} + load(service.auth_domains(params).body['domains']) + end + + + def find_by_id(id) + cached_domain = self.find { |domain| domain.id == id } + return cached_domain if cached_domain + domain_hash = service.get_domain(id).body['domain'] + Fog::Identity::OpenStack::V3::Domain.new( + domain_hash.merge(:service => service)) + end + + def destroy(id) + domain = self.find_by_id(id) + domain.destroy + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/endpoint.rb b/lib/fog/openstack/models/identity_v3/endpoint.rb new file mode 100644 index 000000000..264196b77 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/endpoint.rb @@ -0,0 +1,50 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Endpoint < Fog::Model + identity :id + + attribute :description + attribute :interface + attribute :service_id + attribute :name + attribute :region + attribute :url + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_endpoint(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_endpoint(self.id, attr || attributes).body['endpoint']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_endpoint(attributes).body['endpoint']) + self + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/endpoints.rb b/lib/fog/openstack/models/identity_v3/endpoints.rb new file mode 100644 index 000000000..a870a2daa --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/endpoints.rb @@ -0,0 +1,27 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/service' + +module Fog + module Identity + class OpenStack + class V3 + class Endpoints < Fog::Collection + model Fog::Identity::OpenStack::V3::Endpoint + + def all params = {} + load(service.list_endpoints(params).body['endpoints']) + end + + def find_by_id(id) + cached_endpoint = self.find { |endpoint| endpoint.id == id } + return cached_endpoint if cached_endpoint + endpoint_hash = service.get_endpoint(id).body['endpoint'] + Fog::Identity::OpenStack::V3::Endpoint.new( + endpoint_hash.merge(:service => service)) + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/group.rb b/lib/fog/openstack/models/identity_v3/group.rb new file mode 100644 index 000000000..c304ff458 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/group.rb @@ -0,0 +1,96 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Group < Fog::Model + identity :id + + attribute :description + attribute :domain_id + attribute :name + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_group(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_group(self.id, attr || attributes).body['group']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_group(attributes).body['group']) + self + end + + def add_user user_id + requires :id + service.add_user_to_group(self.id, user_id) + end + + def remove_user user_id + requires :id + service.remove_user_from_group(self.id, user_id) + end + + def contains_user? user_id + requires :id + begin + service.group_user_check(self.id, user_id) + rescue Fog::Identity::OpenStack::NotFound + return false + end + return true + end + + def roles + requires :id, :domain_id + service.list_domain_group_roles(self.domain_id, self.id).body['roles'] + end + + def grant_role(role_id) + requires :id, :domain_id + service.grant_domain_group_role(self.domain_id, self.id, role_id) + end + + def check_role(role_id) + requires :id, :domain_id + begin + service.check_domain_group_role(self.domain_id, self.id, role_id) + rescue Fog::Identity::OpenStack::NotFound + return false + end + return true + end + + def revoke_role(role_id) + requires :id, :domain_id + service.revoke_domain_group_role(self.domain_id, self.id, role_id) + end + + def users(attr = {}) + requires :id + service.list_group_users(self.id, attr).body['users'] + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/groups.rb b/lib/fog/openstack/models/identity_v3/groups.rb new file mode 100644 index 000000000..6c33061c8 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/groups.rb @@ -0,0 +1,31 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/group' + +module Fog + module Identity + class OpenStack + class V3 + class Groups < Fog::Collection + model Fog::Identity::OpenStack::V3::Group + + def all params={} + load(service.list_groups(params).body['groups']) + end + + def find_by_id(id) + cached_group = self.find { |group| group.id == id } + return cached_group if cached_group + group_hash = service.get_group(id).body['group'] + Fog::Identity::OpenStack::V3::group.new( + group_hash.merge(:service => service)) + end + + def destroy(id) + group = self.find_by_id(id) + group.destroy + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/os_credential.rb b/lib/fog/openstack/models/identity_v3/os_credential.rb new file mode 100644 index 000000000..189c9ae73 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/os_credential.rb @@ -0,0 +1,73 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class OsCredential < Fog::Model + identity :id + + attribute :project_id + attribute :type + attribute :blob + attribute :user_id + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_os_credential(self.id) + @parsed_blob = nil + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_os_credential(self.id, attr || attributes).body['credential']) + @parsed_blob = nil + self + end + + def save + requires :blob, :type + @parsed_blob = nil + identity ? update : create + end + + def create + merge_attributes( + service.create_os_credential(attributes).body['credential']) + @parsed_blob = nil + self + end + + def parsed_blob + @parsed_blob = ::JSON.parse(blob) unless @parsed_blob + @parsed_blob + end + + def name + parsed_blob['name'] if blob + end + + def public_key + parsed_blob['public_key'] if blob + end + + def fingerprint + parsed_blob['fingerprint'] if blob + end + + def private_key + parsed_blob['private_key'] if blob + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/os_credentials.rb b/lib/fog/openstack/models/identity_v3/os_credentials.rb new file mode 100644 index 000000000..d71b573ea --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/os_credentials.rb @@ -0,0 +1,31 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/os_credential' + +module Fog + module Identity + class OpenStack + class V3 + class OsCredentials < Fog::Collection + model Fog::Identity::OpenStack::V3::OsCredential + + def all params={} + load(service.list_os_credentials(params).body['credentials']) + end + + def find_by_id(id) + cached_credential = self.find { |credential| credential.id == id } + return cached_credential if cached_credential + credential_hash = service.get_os_credential(id).body['credential'] + Fog::Identity::OpenStack::V3::Credential.new( + credential_hash.merge(:service => service)) + end + + def destroy(id) + credential = self.find_by_id(id) + credential.destroy + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/policies.rb b/lib/fog/openstack/models/identity_v3/policies.rb new file mode 100644 index 000000000..c4fb11edc --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/policies.rb @@ -0,0 +1,31 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/policy' + +module Fog + module Identity + class OpenStack + class V3 + class Policies < Fog::Collection + model Fog::Identity::OpenStack::V3::Policy + + def all params={} + load(service.list_policies(params).body['policies']) + end + + def find_by_id(id) + cached_policy = self.find { |policy| policy.id == id } + return cached_policy if cached_policy + policy_hash = service.get_policy(id).body['policy'] + Fog::Identity::OpenStack::V3::Policy.new( + policy_hash.merge(:service => service)) + end + + def destroy(id) + policy = self.find_by_id(id) + policy.destroy + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/policy.rb b/lib/fog/openstack/models/identity_v3/policy.rb new file mode 100644 index 000000000..996389f32 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/policy.rb @@ -0,0 +1,46 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Policy < Fog::Model + identity :id + + attribute :type + attribute :blob + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_policy(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_policy(self.id, attr || attributes).body['policy']) + self + end + + def save + requires :blob, :type + identity ? update : create + end + + def create + merge_attributes( + service.create_policy(attributes).body['policy']) + self + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/project.rb b/lib/fog/openstack/models/identity_v3/project.rb new file mode 100644 index 000000000..91f0e0082 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/project.rb @@ -0,0 +1,98 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Project < Fog::Model + identity :id + + attribute :domain_id + attribute :description + attribute :enabled + attribute :name + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_project(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_project(self.id, attr || attributes).body['project']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_project(attributes).body['project']) + self + end + + def user_roles(user_id) + requires :id + service.list_project_user_roles(self.id, user_id).body['roles'] + end + + def grant_role_to_user(role_id, user_id) + requires :id + service.grant_project_user_role(self.id, user_id, role_id) + end + + def check_user_role(user_id, role_id) + requires :id + begin + service.check_project_user_role(self.id, user_id, role_id) + rescue Fog::Identity::OpenStack::NotFound + return false + end + return true + end + + def revoke_role_from_user(role_id, user_id) + requires :id + service.revoke_project_user_role(self.id, user_id, role_id) + end + + def group_roles(group_id) + requires :id + service.list_project_group_roles(self.id, group_id).body['roles'] + end + + def grant_role_to_group(role_id, group_id) + requires :id + service.grant_project_group_role(self.id, group_id, role_id) + end + + def check_group_role(group_id, role_id) + requires :id + begin + service.check_project_group_role(self.id, group_id, role_id) + rescue Fog::Identity::OpenStack::NotFound + return false + end + return true + end + + def revoke_role_from_group(role_id, group_id) + requires :id + service.revoke_project_group_role(self.id, group_id, role_id) + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/projects.rb b/lib/fog/openstack/models/identity_v3/projects.rb new file mode 100644 index 000000000..64f31d7af --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/projects.rb @@ -0,0 +1,31 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/project' + +module Fog + module Identity + class OpenStack + class V3 + class Projects < Fog::Collection + model Fog::Identity::OpenStack::V3::Project + + def all params={} + load(service.list_projects(params).body['projects']) + end + + def auth_projects params={} + load(service.auth_projects(params).body['projects']) + end + + def find_by_id(id) + cached_project = self.find { |project| project.id == id } + return cached_project if cached_project + project_hash = service.get_project(id).body['project'] + Fog::Identity::OpenStack::V3::Project.new( + project_hash.merge(:service => service)) + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/role.rb b/lib/fog/openstack/models/identity_v3/role.rb new file mode 100644 index 000000000..b1ca7265d --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/role.rb @@ -0,0 +1,45 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Role < Fog::Model + identity :id + + attribute :name + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_role(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_role(self.id, attr || attributes).body['role']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_role(attributes).body['role']) + self + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/role_assignment.rb b/lib/fog/openstack/models/identity_v3/role_assignment.rb new file mode 100644 index 000000000..e03fcf1d6 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/role_assignment.rb @@ -0,0 +1,22 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class RoleAssignment < Fog::Model + attribute :scope + attribute :role + attribute :user + attribute :group + attribute :links + + def to_s + self.links['assignment'] + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/role_assignments.rb b/lib/fog/openstack/models/identity_v3/role_assignments.rb new file mode 100644 index 000000000..6b79f3dd3 --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/role_assignments.rb @@ -0,0 +1,22 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/role' + +module Fog + module Identity + class OpenStack + class V3 + class RoleAssignments < Fog::Collection + model Fog::Identity::OpenStack::V3::RoleAssignment + + def all + filter_by {} + end + + def filter_by params={} + load(service.list_role_assignments(params).body['role_assignments']) + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/roles.rb b/lib/fog/openstack/models/identity_v3/roles.rb new file mode 100644 index 000000000..4dda2799e --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/roles.rb @@ -0,0 +1,35 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/role' + +module Fog + module Identity + class OpenStack + class V3 + class Roles < Fog::Collection + model Fog::Identity::OpenStack::V3::Role + + def all params={} + load(service.list_roles(params).body['roles']) + end + + def assignments params={} + load(service.list_role_assignments(params).body['role_assignments']) + end + + def find_by_id(id) + cached_role = self.find { |role| role.id == id } + return cached_role if cached_role + role_hash = service.get_role(id).body['role'] + Fog::Identity::OpenStack::V3::role.new( + role_hash.merge(:service => service)) + end + + def destroy(id) + role = self.find_by_id(id) + role.destroy + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/service.rb b/lib/fog/openstack/models/identity_v3/service.rb new file mode 100644 index 000000000..0b0efcdde --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/service.rb @@ -0,0 +1,47 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Service < Fog::Model + identity :id + + attribute :description + attribute :type + attribute :name + attribute :links + + def to_s + self.name + end + + def destroy + requires :id + service.delete_service(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_service(self.id, attr || attributes).body['service']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_service(attributes).body['service']) + self + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/services.rb b/lib/fog/openstack/models/identity_v3/services.rb new file mode 100644 index 000000000..101b4a22b --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/services.rb @@ -0,0 +1,31 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/service' + +module Fog + module Identity + class OpenStack + class V3 + class Services < Fog::Collection + model Fog::Identity::OpenStack::V3::Service + + def all params={} + load(service.list_services(params).body['services']) + end + + def find_by_id(id) + cached_service = self.find { |service| service.id == id } + return cached_service if cached_service + service_hash = service.get_service(id).body['service'] + Fog::Identity::OpenStack::V3::Service.new( + service_hash.merge(:service => service)) + end + + def destroy(id) + service = self.find_by_id(id) + service.destroy + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/token.rb b/lib/fog/openstack/models/identity_v3/token.rb new file mode 100644 index 000000000..1da36003d --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/token.rb @@ -0,0 +1,26 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class Token < Fog::Model + + attribute :value + attribute :catalog + attribute :expires_at + attribute :issued_at + attribute :methods + attribute :project + attribute :roles + attribute :user + + def to_s + self.value + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/tokens.rb b/lib/fog/openstack/models/identity_v3/tokens.rb new file mode 100644 index 000000000..e3ffba5ed --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/tokens.rb @@ -0,0 +1,40 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/service' + +module Fog + module Identity + class OpenStack + class V3 + class Tokens < Fog::Collection + model Fog::Identity::OpenStack::V3::Token + + + def authenticate(auth) + response = service.token_authenticate(auth) + token_hash = response.body['token'] + Fog::Identity::OpenStack::V3::Token.new( + token_hash.merge(:service => service, :value => response.headers['X-Subject-Token'])) + end + + def validate(subject_token) + response = service.token_validate(subject_token) + token_hash = response.body['token'] + Fog::Identity::OpenStack::V3::Token.new( + token_hash.merge(:service => service, :value => response.headers['X-Subject-Token'])) + end + + def check(subject_token) + service.token_check(subject_token) + return true + end + + def revoke(subject_token) + service.token_revoke(subject_token) + return true + end + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/user.rb b/lib/fog/openstack/models/identity_v3/user.rb new file mode 100644 index 000000000..02ee6827f --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/user.rb @@ -0,0 +1,87 @@ +require 'fog/core/model' + +module Fog + module Identity + class OpenStack + class V3 + class User < Fog::Model + identity :id + + attribute :default_project_id + attribute :description + attribute :domain_id + attribute :email + attribute :enabled + attribute :name + attribute :links + attribute :password + + def to_s + self.name + end + + def groups + requires :id + service.list_user_groups(self.id).body['groups'] + end + + def projects + requires :id + service.list_user_projects(self.id).body['projects'] + end + + def roles + requires :id, :domain_id + service.list_domain_user_roles(self.domain_id, self.id).body['roles'] + end + + def grant_role(role_id) + requires :id, :domain_id + service.grant_domain_user_role(self.domain_id, self.id, role_id) + end + + def check_role(role_id) + requires :id, :domain_id + begin + service.check_domain_user_role(self.domain_id, self.id, role_id) + rescue Fog::Identity::OpenStack::NotFound + return false + end + return true + end + + def revoke_role(role_id) + requires :id, :domain_id + service.revoke_domain_user_role(self.domain_id, self.id, role_id) + end + + def destroy + requires :id + service.delete_user(self.id) + true + end + + def update(attr = nil) + requires :id + merge_attributes( + service.update_user(self.id, attr || attributes).body['user']) + self + end + + def save + requires :name + identity ? update : create + end + + def create + merge_attributes( + service.create_user(attributes).body['user']) + self + end + + + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/models/identity_v3/users.rb b/lib/fog/openstack/models/identity_v3/users.rb new file mode 100644 index 000000000..36d3d00ba --- /dev/null +++ b/lib/fog/openstack/models/identity_v3/users.rb @@ -0,0 +1,35 @@ +require 'fog/core/collection' +require 'fog/openstack/models/identity_v3/domain' + +module Fog + module Identity + class OpenStack + class V3 + class Users < Fog::Collection + model Fog::Identity::OpenStack::V3::User + + def all params={} + load(service.list_users(params).body['users']) + end + + def find_by_id(id) + cached_user = self.find { |user| user.id == id } + return cached_user if cached_user + user_hash = service.get_user(id).body['user'] + Fog::Identity::OpenStack::V3::User.new( + user_hash.merge(:service => service)) + end + + def find_by_name(name) + load(service.list_users(:name => name).body['users']) + end + + def destroy(id) + user = self.find_by_id(id) + user.destroy + end + end + end + end + end +end diff --git a/lib/fog/openstack/network.rb b/lib/fog/openstack/network.rb index d7b32f191..e729d9fdc 100644 --- a/lib/fog/openstack/network.rb +++ b/lib/fog/openstack/network.rb @@ -337,15 +337,7 @@ module Fog :openstack_region => @openstack_region } - case @openstack_auth_uri.path - when %r{/v2.0} - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) - when %r{/v3} - credentials = Fog::OpenStack.authenticate_v3(options, @connection_options) - else - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) - end - + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/lib/fog/openstack/orchestration.rb b/lib/fog/openstack/orchestration.rb index daec9fcf0..bb31e41c3 100644 --- a/lib/fog/openstack/orchestration.rb +++ b/lib/fog/openstack/orchestration.rb @@ -232,12 +232,7 @@ module Fog :openstack_endpoint_type => @openstack_endpoint_type } - if @openstack_auth_uri.path =~ /\/v2.0\// - - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) - else - credentials = Fog::OpenStack.authenticate_v1(options, @connection_options) - end + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/lib/fog/openstack/planning.rb b/lib/fog/openstack/planning.rb index 63e6cfe38..f2a716a92 100644 --- a/lib/fog/openstack/planning.rb +++ b/lib/fog/openstack/planning.rb @@ -185,7 +185,7 @@ module Fog :openstack_endpoint_type => @openstack_endpoint_type } - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/lib/fog/openstack/requests/compute/create_security_group.rb b/lib/fog/openstack/requests/compute/create_security_group.rb index 4b8fc437a..d5432cc7f 100644 --- a/lib/fog/openstack/requests/compute/create_security_group.rb +++ b/lib/fog/openstack/requests/compute/create_security_group.rb @@ -22,7 +22,7 @@ module Fog class Mock def create_security_group(name, description) Fog::Identity::OpenStack.new(:openstack_auth_url => credentials[:openstack_auth_url]) - tenant_id = Fog::Identity::OpenStack::Mock.data[current_tenant][:tenants].keys.first + tenant_id = Fog::Identity::OpenStack::V2::Mock.data[current_tenant][:tenants].keys.first security_group_id = Fog::Mock.random_numbers(2).to_i + 1 self.data[:security_groups][security_group_id.to_s] = { 'tenant_id' => tenant_id, diff --git a/lib/fog/openstack/requests/identity/add_user_to_tenant.rb b/lib/fog/openstack/requests/identity/add_user_to_tenant.rb deleted file mode 100644 index 4048d0067..000000000 --- a/lib/fog/openstack/requests/identity/add_user_to_tenant.rb +++ /dev/null @@ -1,34 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def add_user_to_tenant(tenant_id, user_id, role_id) - request( - :expects => 200, - :method => 'PUT', - :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" - ) - end - end # class Real - - class Mock - def add_user_to_tenant(tenant_id, user_id, role_id) - role = self.data[:roles][role_id] - self.data[:user_tenant_membership][tenant_id] ||= {} - self.data[:user_tenant_membership][tenant_id][user_id] ||= [] - self.data[:user_tenant_membership][tenant_id][user_id].push(role['id']).uniq! - - response = Excon::Response.new - response.status = 200 - response.body = { - 'role' => { - 'id' => role['id'], - 'name' => role['name'] - } - } - response - end # def add_user_to_tenant - end # class Mock - end # class OpenStack - end # module Identity -end diff --git a/lib/fog/openstack/requests/identity/check_token.rb b/lib/fog/openstack/requests/identity/check_token.rb deleted file mode 100644 index bcc0419e6..000000000 --- a/lib/fog/openstack/requests/identity/check_token.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def check_token(token_id, tenant_id=nil) - request( - :expects => [200, 203], - :method => 'HEAD', - :path => "tokens/#{token_id}"+(tenant_id ? "?belongsTo=#{tenant_id}" : '') - ) - end - end - - class Mock - def check_token(token_id, tenant_id=nil) - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/create_ec2_credential.rb b/lib/fog/openstack/requests/identity/create_ec2_credential.rb deleted file mode 100644 index 0714074da..000000000 --- a/lib/fog/openstack/requests/identity/create_ec2_credential.rb +++ /dev/null @@ -1,57 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - ## - # Create an EC2 credential for a user in a tenant. Requires - # administrator credentials. - # - # ==== Parameters - # * user_id<~String>: The id of the user to create an EC2 credential - # for - # * tenant_id<~String>: The id of the tenant to create the credential - # in - # - # ==== Returns - # * response<~Excon::Response>: - # * body<~Hash>: - # * 'credential'<~Hash>: Created EC2 credential - # * 'access'<~String>: The access key - # * 'secret'<~String>: The secret key - # * 'user_id'<~String>: The user id - # * 'tenant_id'<~String>: The tenant id - - def create_ec2_credential(user_id, tenant_id) - data = { 'tenant_id' => tenant_id } - - request( - :body => Fog::JSON.encode(data), - :expects => [200, 202], - :method => 'POST', - :path => "users/#{user_id}/credentials/OS-EC2" - ) - end - end - - class Mock - def create_ec2_credential(user_id, tenant_id) - response = Excon::Response.new - response.status = 200 - - data = { - 'access' => Fog::Mock.random_hex(32), - 'secret' => Fog::Mock.random_hex(32), - 'tenant_id' => tenant_id, - 'user_id' => user_id, - } - - self.data[:ec2_credentials][user_id][data['access']] = data - - response.body = { 'credential' => data } - - response - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/create_role.rb b/lib/fog/openstack/requests/identity/create_role.rb deleted file mode 100644 index 9f71b3240..000000000 --- a/lib/fog/openstack/requests/identity/create_role.rb +++ /dev/null @@ -1,36 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def create_role(name) - data = { - 'role' => { - 'name' => name - } - } - - request( - :body => Fog::JSON.encode(data), - :expects => [200, 202], - :method => 'POST', - :path => '/OS-KSADM/roles' - ) - end - end - - class Mock - def create_role(name) - data = { - 'id' => Fog::Mock.random_hex(32), - 'name' => name - } - self.data[:roles][data['id']] = data - Excon::Response.new( - :body => { 'role' => data }, - :status => 202 - ) - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/create_tenant.rb b/lib/fog/openstack/requests/identity/create_tenant.rb deleted file mode 100644 index 4714bcefd..000000000 --- a/lib/fog/openstack/requests/identity/create_tenant.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def create_tenant(attributes) - request( - :expects => [200], - :method => 'POST', - :path => "tenants", - :body => Fog::JSON.encode({ 'tenant' => attributes }) - ) - end # def create_tenant - end # class Real - - class Mock - def create_tenant(attributes) - response = Excon::Response.new - response.status = [200, 204][rand(1)] - response.body = { - 'tenant' => { - 'id' => "df9a815161eba9b76cc748fd5c5af73e", - 'description' => attributes[:description] || 'normal tenant', - 'enabled' => true, - 'name' => attributes[:name] || 'default' - } - } - response - end # def create_tenant - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/create_user.rb b/lib/fog/openstack/requests/identity/create_user.rb deleted file mode 100644 index b8d436725..000000000 --- a/lib/fog/openstack/requests/identity/create_user.rb +++ /dev/null @@ -1,43 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def create_user(name, password, email, tenantId=nil, enabled=true) - data = { - 'user' => { - 'name' => name, - 'password' => password, - 'tenantId' => tenantId, - 'email' => email, - 'enabled' => enabled, - } - } - - request( - :body => Fog::JSON.encode(data), - :expects => [200, 202], - :method => 'POST', - :path => '/users' - ) - end - end - - class Mock - def create_user(name, password, email, tenantId=nil, enabled=true) - response = Excon::Response.new - response.status = 200 - data = { - 'id' => Fog::Mock.random_hex(32), - 'name' => name, - 'email' => email, - 'tenantId' => tenantId, - 'enabled' => enabled - } - self.data[:users][data['id']] = data - response.body = { 'user' => data } - response - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/create_user_role.rb b/lib/fog/openstack/requests/identity/create_user_role.rb deleted file mode 100644 index 7e7d7ae19..000000000 --- a/lib/fog/openstack/requests/identity/create_user_role.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def create_user_role(tenant_id, user_id, role_id) - request( - :expects => 200, - :method => 'PUT', - :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" - ) - end - end - - class Mock - def create_user_role(tenant_id, user_id, role_id) - Excon::Response.new( - :body => { 'role' => self.data[:roles][role_id] }, - :status => 200 - ) - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/delete_ec2_credential.rb b/lib/fog/openstack/requests/identity/delete_ec2_credential.rb deleted file mode 100644 index 2bf37c2ac..000000000 --- a/lib/fog/openstack/requests/identity/delete_ec2_credential.rb +++ /dev/null @@ -1,42 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - ## - # Destroy an EC2 credential for a user. Requires administrator - # credentials. - # - # ==== Parameters - # * user_id<~String>: The id of the user to delete the credential - # for - # * access<~String>: The access key of the credential to destroy - # - # ==== Returns - # * response<~Excon::Response>: - # * body<~String>: Empty string - - def delete_ec2_credential(user_id, access) - request( - :expects => [200, 204], - :method => 'DELETE', - :path => "users/#{user_id}/credentials/OS-EC2/#{access}" - ) - end - end - - class Mock - def delete_ec2_credential(user_id, access) - raise Fog::Identity::OpenStack::NotFound unless - self.data[:ec2_credentials][user_id][access] - - self.data[:ec2_credentials][user_id].delete access - - response = Excon::Response.new - response.status = 204 - response - rescue - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/delete_role.rb b/lib/fog/openstack/requests/identity/delete_role.rb deleted file mode 100644 index a0f78563f..000000000 --- a/lib/fog/openstack/requests/identity/delete_role.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def delete_role(role_id) - request( - :expects => [200, 204], - :method => 'DELETE', - :path => "/OS-KSADM/roles/#{role_id}" - ) - end - end - - class Mock - def delete_role(role_id) - response = Excon::Response.new - if self.data[:roles][role_id] - self.data[:roles].delete(role_id) - response.status = 204 - response - else - raise Fog::Identity::OpenStack::NotFound - end - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/delete_tenant.rb b/lib/fog/openstack/requests/identity/delete_tenant.rb deleted file mode 100644 index 0f3ad5ee8..000000000 --- a/lib/fog/openstack/requests/identity/delete_tenant.rb +++ /dev/null @@ -1,31 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def delete_tenant(id) - request( - :expects => [200, 204], - :method => 'DELETE', - :path => "tenants/#{id}" - ) - end # def create_tenant - end # class Real - - class Mock - def delete_tenant(attributes) - response = Excon::Response.new - response.status = [200, 204][rand(1)] - response.body = { - 'tenant' => { - 'id' => '1', - 'description' => 'Has access to everything', - 'enabled' => true, - 'name' => 'admin' - } - } - response - end # def create_tenant - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/delete_user.rb b/lib/fog/openstack/requests/identity/delete_user.rb deleted file mode 100644 index 33096510c..000000000 --- a/lib/fog/openstack/requests/identity/delete_user.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def delete_user(user_id) - request( - :expects => [200, 204], - :method => 'DELETE', - :path => "users/#{user_id}" - ) - end - end - - class Mock - def delete_user(user_id) - self.data[:users].delete( - list_users.body['users'].find {|x| x['id'] == user_id }['id']) - - response = Excon::Response.new - response.status = 204 - response - rescue - raise Fog::Identity::OpenStack::NotFound - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/delete_user_role.rb b/lib/fog/openstack/requests/identity/delete_user_role.rb deleted file mode 100644 index 6c5ce2d09..000000000 --- a/lib/fog/openstack/requests/identity/delete_user_role.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def delete_user_role(tenant_id, user_id, role_id) - request( - :expects => 204, - :method => 'DELETE', - :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" - ) - end - end - - class Mock - def delete_user_role(tenant_id, user_id, role_id) - response = Excon::Response.new - response.status = 204 - response - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/get_ec2_credential.rb b/lib/fog/openstack/requests/identity/get_ec2_credential.rb deleted file mode 100644 index 31b32c291..000000000 --- a/lib/fog/openstack/requests/identity/get_ec2_credential.rb +++ /dev/null @@ -1,48 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - ## - # Retrieves an EC2 credential for a user. Requires administrator - # credentials. - # - # ==== Parameters - # * user_id<~String>: The id of the user to retrieve the credential - # for - # * access<~String>: The access key of the credential to retrieve - # - # ==== Returns - # * response<~Excon::Response>: - # * body<~Hash>: - # * 'credential'<~Hash>: The EC2 credential - # * 'access'<~String>: The access key - # * 'secret'<~String>: The secret key - # * 'user_id'<~String>: The user id - # * 'tenant_id'<~String>: The tenant id - - def get_ec2_credential(user_id, access) - request( - :expects => [200, 202], - :method => 'GET', - :path => "users/#{user_id}/credentials/OS-EC2/#{access}" - ) - rescue Excon::Errors::Unauthorized - raise Fog::Identity::OpenStack::NotFound - end - end - - class Mock - def get_ec2_credential(user_id, access) - ec2_credential = self.data[:ec2_credentials][user_id][access] - - raise Fog::OpenStack::Identity::NotFound unless ec2_credential - - response = Excon::Response.new - response.status = 200 - response.body = { 'credential' => ec2_credential } - response - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/get_role.rb b/lib/fog/openstack/requests/identity/get_role.rb deleted file mode 100644 index 429bdfd4d..000000000 --- a/lib/fog/openstack/requests/identity/get_role.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def get_role(id) - request( - :expects => [200, 204], - :method => 'GET', - :path => "/OS-KSADM/roles/#{id}" - ) - end - end - - class Mock - def get_role(id) - response = Excon::Response.new - if data = self.data[:roles][id] - response.status = 200 - response.body = { 'role' => data } - response - else - raise Fog::Identity::OpenStack::NotFound - end - end - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/get_tenant.rb b/lib/fog/openstack/requests/identity/get_tenant.rb deleted file mode 100644 index 875f084d2..000000000 --- a/lib/fog/openstack/requests/identity/get_tenant.rb +++ /dev/null @@ -1,31 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def get_tenant(id) - request( - :expects => [200, 204], - :method => 'GET', - :path => "tenants/#{id}" - ) - end - end # class Real - - class Mock - def get_tenant(id) - response = Excon::Response.new - response.status = [200, 204][rand(1)] - response.body = { - 'tenant' => { - 'id' => id, - 'description' => 'Has access to everything', - 'enabled' => true, - 'name' => 'admin' - } - } - response - end # def list_tenants - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/get_tenants_by_id.rb b/lib/fog/openstack/requests/identity/get_tenants_by_id.rb deleted file mode 100644 index ad69c02bc..000000000 --- a/lib/fog/openstack/requests/identity/get_tenants_by_id.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def get_tenants_by_id(tenant_id) - request( - :expects => [200], - :method => 'GET', - :path => "tenants/#{tenant_id}" - ) - end - end - - class Mock - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/get_tenants_by_name.rb b/lib/fog/openstack/requests/identity/get_tenants_by_name.rb deleted file mode 100644 index b468f86b9..000000000 --- a/lib/fog/openstack/requests/identity/get_tenants_by_name.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def get_tenants_by_name(name) - request( - :expects => [200], - :method => 'GET', - :path => "tenants?name=#{name}" - ) - end - end - - class Mock - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/get_user_by_id.rb b/lib/fog/openstack/requests/identity/get_user_by_id.rb deleted file mode 100644 index af3049ef0..000000000 --- a/lib/fog/openstack/requests/identity/get_user_by_id.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def get_user_by_id(user_id) - request( - :expects => [200, 203], - :method => 'GET', - :path => "users/#{user_id}" - ) - end - end - - class Mock - def get_user_by_id(user_id) - response = Excon::Response.new - response.status = 200 - - existing_user = self.data[:users].find do |u| - u[0] == user_id || u[1]['name'] == 'mock' - end - existing_user = existing_user[1] if existing_user - - response.body = { - 'user' => existing_user || create_user('mock', 'mock', 'mock@email.com').body['user'] - } - response - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/get_user_by_name.rb b/lib/fog/openstack/requests/identity/get_user_by_name.rb deleted file mode 100644 index 2b2e0c710..000000000 --- a/lib/fog/openstack/requests/identity/get_user_by_name.rb +++ /dev/null @@ -1,27 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def get_user_by_name(name) - request( - :expects => [200, 203], - :method => 'GET', - :path => "users?name=#{name}" - ) - end - end - - class Mock - def get_user_by_name(name) - response = Excon::Response.new - response.status = 200 - user = self.data[:users].values.select {|user| user['name'] == name}[0] - response.body = { - 'user' => user - } - response - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/list_ec2_credentials.rb b/lib/fog/openstack/requests/identity/list_ec2_credentials.rb deleted file mode 100644 index c4c955174..000000000 --- a/lib/fog/openstack/requests/identity/list_ec2_credentials.rb +++ /dev/null @@ -1,43 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - ## - # List EC2 credentials for a user. Requires administrator - # credentials. - # - # ==== Parameters - # * user_id<~String>: The id of the user to retrieve the credential - # for - # - # ==== Returns - # * response<~Excon::Response>: - # * body<~Hash>: - # * 'credentials'<~Array>: The user's EC2 credentials - # * 'access'<~String>: The access key - # * 'secret'<~String>: The secret key - # * 'user_id'<~String>: The user id - # * 'tenant_id'<~String>: The tenant id - - def list_ec2_credentials(user_id) - request( - :expects => [200, 202], - :method => 'GET', - :path => "users/#{user_id}/credentials/OS-EC2" - ) - end - end - - class Mock - def list_ec2_credentials(user_id) - ec2_credentials = self.data[:ec2_credentials][user_id].values - - response = Excon::Response.new - response.status = 200 - response.body = { 'credentials' => ec2_credentials } - response - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/list_endpoints_for_token.rb b/lib/fog/openstack/requests/identity/list_endpoints_for_token.rb deleted file mode 100644 index 4a89c2e16..000000000 --- a/lib/fog/openstack/requests/identity/list_endpoints_for_token.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def list_endpoints_for_token(token_id) - request( - :expects => [200, 203], - :method => 'HEAD', - :path => "tokens/#{token_id}/endpoints" - ) - end - end - - class Mock - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/list_roles.rb b/lib/fog/openstack/requests/identity/list_roles.rb deleted file mode 100644 index a57bdf44b..000000000 --- a/lib/fog/openstack/requests/identity/list_roles.rb +++ /dev/null @@ -1,31 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def list_roles - request( - :expects => 200, - :method => 'GET', - :path => '/OS-KSADM/roles' - ) - end - end - - class Mock - def list_roles - if self.data[:roles].empty? - ['admin', 'Member'].each do |name| - id = Fog::Mock.random_hex(32) - self.data[:roles][id] = {'id' => id, 'name' => name} - end - end - - Excon::Response.new( - :body => { 'roles' => self.data[:roles].values }, - :status => 200 - ) - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb b/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb deleted file mode 100644 index 10f24aaa5..000000000 --- a/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb +++ /dev/null @@ -1,30 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def list_roles_for_user_on_tenant(tenant_id, user_id) - request( - :expects => [200], - :method => 'GET', - :path => "tenants/#{tenant_id}/users/#{user_id}/roles" - ) - end # def list_roles_for_user_on_tenant - end # class Real - - class Mock - def list_roles_for_user_on_tenant(tenant_id, user_id) - self.data[:user_tenant_membership][tenant_id] ||= {} - self.data[:user_tenant_membership][tenant_id][user_id] ||= [] - roles = self.data[:user_tenant_membership][tenant_id][user_id].map do |role_id| - self.data[:roles][role_id] - end - - Excon::Response.new( - :body => { 'roles' => roles }, - :status => 200 - ) - end # def list_roles_for_user_on_tenant - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/list_tenants.rb b/lib/fog/openstack/requests/identity/list_tenants.rb deleted file mode 100644 index fa3506824..000000000 --- a/lib/fog/openstack/requests/identity/list_tenants.rb +++ /dev/null @@ -1,45 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def list_tenants(limit = nil, marker = nil) - params = Hash.new - params['limit'] = limit if limit - params['marker'] = marker if marker - - request( - :expects => [200, 204], - :method => 'GET', - :path => "tenants", - :query => params - ) - end - end # class Real - - class Mock - def list_tenants - Excon::Response.new( - :body => { - 'tenants_links' => [], - 'tenants' => [ - {'id' => '1', - 'description' => 'Has access to everything', - 'enabled' => true, - 'name' => 'admin'}, - {'id' => '2', - 'description' => 'Normal tenant', - 'enabled' => true, - 'name' => 'default'}, - {'id' => '3', - 'description' => 'Disabled tenant', - 'enabled' => false, - 'name' => 'disabled'} - ] - }, - :status => [200, 204][rand(1)] - ) - end # def list_tenants - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/list_user_global_roles.rb b/lib/fog/openstack/requests/identity/list_user_global_roles.rb deleted file mode 100644 index 07dc5232e..000000000 --- a/lib/fog/openstack/requests/identity/list_user_global_roles.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def list_user_global_roles(user_id) - request( - :expects => [200], - :method => 'GET', - :path => "users/#{user_id}/roles" - ) - end - end - - class Mock - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/list_users.rb b/lib/fog/openstack/requests/identity/list_users.rb deleted file mode 100644 index 28bb2345b..000000000 --- a/lib/fog/openstack/requests/identity/list_users.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def list_users(tenant_id = nil) - path = tenant_id ? "tenants/#{tenant_id}/users" : 'users' - request( - :expects => [200, 204], - :method => 'GET', - :path => path - ) - end - end # class Real - - class Mock - def list_users(tenant_id = nil) - users = self.data[:users].values - - if tenant_id - users = users.select { - |user| user['tenantId'] == tenant_id - } - end - - Excon::Response.new( - :body => { 'users' => users }, - :status => 200 - ) - end - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/remove_user_from_tenant.rb b/lib/fog/openstack/requests/identity/remove_user_from_tenant.rb deleted file mode 100644 index bc816efde..000000000 --- a/lib/fog/openstack/requests/identity/remove_user_from_tenant.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def remove_user_from_tenant(tenant_id, user_id, role_id) - request( - :expects => [200, 204], - :method => 'DELETE', - :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" - ) - end - end # class Real - - class Mock - def remove_user_from_tenant(tenant_id, user_id, role_id) - end # def remove_user_from_tenant - end # class Mock - end # class OpenStack - end # module Identity -end diff --git a/lib/fog/openstack/requests/identity/set_tenant.rb b/lib/fog/openstack/requests/identity/set_tenant.rb deleted file mode 100644 index 896107fae..000000000 --- a/lib/fog/openstack/requests/identity/set_tenant.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def set_tenant(tenant) - @openstack_must_reauthenticate = true - @openstack_tenant = tenant.to_s - authenticate - end - end - - class Mock - def set_tenant(tenant) - true - end - end - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/update_tenant.rb b/lib/fog/openstack/requests/identity/update_tenant.rb deleted file mode 100644 index c19d8c9d1..000000000 --- a/lib/fog/openstack/requests/identity/update_tenant.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def update_tenant(id, attributes) - request( - :expects => [200], - :method => 'PUT', - :path => "tenants/#{id}", - :body => Fog::JSON.encode({ 'tenant' => attributes }) - ) - end # def create_tenant - end # class Real - - class Mock - def update_tenant(id, attributes) - response = Excon::Response.new - response.status = [200, 204][rand(1)] - attributes = {'enabled' => true, 'id' => '1'}.merge(attributes) - response.body = { - 'tenant' => attributes - } - response - end # def create_tenant - end # class Mock - end # class OpenStack - end # module Identity -end # module Fog diff --git a/lib/fog/openstack/requests/identity/update_user.rb b/lib/fog/openstack/requests/identity/update_user.rb deleted file mode 100644 index 8f72e7749..000000000 --- a/lib/fog/openstack/requests/identity/update_user.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def update_user(user_id, options = {}) - url = options.delete('url') || "/users/#{user_id}" - request( - :body => Fog::JSON.encode({ 'user' => options }), - :expects => 200, - :method => 'PUT', - :path => url - ) - end - end - - class Mock - def update_user(user_id, options) - response = Excon::Response.new - if user = self.data[:users][user_id] - if options['name'] - user['name'] = options['name'] - end - response.status = 200 - response - else - raise Fog::Identity::OpenStack::NotFound - end - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity/validate_token.rb b/lib/fog/openstack/requests/identity/validate_token.rb deleted file mode 100644 index e09cea03a..000000000 --- a/lib/fog/openstack/requests/identity/validate_token.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Fog - module Identity - class OpenStack - class Real - def validate_token(token_id, tenant_id=nil) - request( - :expects => [200, 203], - :method => 'GET', - :path => "tokens/#{token_id}"+(tenant_id ? "?belongsTo=#{tenant_id}" : '') - ) - end - end - - class Mock - def validate_token(token_id, tenant_id=nil) - end - end - end - end -end diff --git a/lib/fog/openstack/requests/identity_v2/add_user_to_tenant.rb b/lib/fog/openstack/requests/identity_v2/add_user_to_tenant.rb new file mode 100644 index 000000000..d46c8c82e --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/add_user_to_tenant.rb @@ -0,0 +1,36 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def add_user_to_tenant(tenant_id, user_id, role_id) + request( + :expects => 200, + :method => 'PUT', + :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" + ) + end + end # class Real + + class Mock + def add_user_to_tenant(tenant_id, user_id, role_id) + role = self.data[:roles][role_id] + self.data[:user_tenant_membership][tenant_id] ||= {} + self.data[:user_tenant_membership][tenant_id][user_id] ||= [] + self.data[:user_tenant_membership][tenant_id][user_id].push(role['id']).uniq! + + response = Excon::Response.new + response.status = 200 + response.body = { + 'role' => { + 'id' => role['id'], + 'name' => role['name'] + } + } + response + end # def add_user_to_tenant + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end diff --git a/lib/fog/openstack/requests/identity_v2/check_token.rb b/lib/fog/openstack/requests/identity_v2/check_token.rb new file mode 100644 index 000000000..ffd5042b2 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/check_token.rb @@ -0,0 +1,22 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def check_token(token_id, tenant_id=nil) + request( + :expects => [200, 203], + :method => 'HEAD', + :path => "tokens/#{token_id}"+(tenant_id ? "?belongsTo=#{tenant_id}" : '') + ) + end + end + + class Mock + def check_token(token_id, tenant_id=nil) + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v2/create_ec2_credential.rb b/lib/fog/openstack/requests/identity_v2/create_ec2_credential.rb new file mode 100644 index 000000000..c4574c6bd --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/create_ec2_credential.rb @@ -0,0 +1,59 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + ## + # Create an EC2 credential for a user in a tenant. Requires + # administrator credentials. + # + # ==== Parameters + # * user_id<~String>: The id of the user to create an EC2 credential + # for + # * tenant_id<~String>: The id of the tenant to create the credential + # in + # + # ==== Returns + # * response<~Excon::Response>: + # * body<~Hash>: + # * 'credential'<~Hash>: Created EC2 credential + # * 'access'<~String>: The access key + # * 'secret'<~String>: The secret key + # * 'user_id'<~String>: The user id + # * 'tenant_id'<~String>: The tenant id + + def create_ec2_credential(user_id, tenant_id) + data = {'tenant_id' => tenant_id} + + request( + :body => Fog::JSON.encode(data), + :expects => [200, 202], + :method => 'POST', + :path => "users/#{user_id}/credentials/OS-EC2" + ) + end + end + + class Mock + def create_ec2_credential(user_id, tenant_id) + response = Excon::Response.new + response.status = 200 + + data = { + 'access' => Fog::Mock.random_hex(32), + 'secret' => Fog::Mock.random_hex(32), + 'tenant_id' => tenant_id, + 'user_id' => user_id, + } + + self.data[:ec2_credentials][user_id][data['access']] = data + + response.body = {'credential' => data} + + response + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/create_role.rb b/lib/fog/openstack/requests/identity_v2/create_role.rb new file mode 100644 index 000000000..b3b69dd93 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/create_role.rb @@ -0,0 +1,38 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def create_role(name) + data = { + 'role' => { + 'name' => name + } + } + + request( + :body => Fog::JSON.encode(data), + :expects => [200, 202], + :method => 'POST', + :path => '/OS-KSADM/roles' + ) + end + end + + class Mock + def create_role(name) + data = { + 'id' => Fog::Mock.random_hex(32), + 'name' => name + } + self.data[:roles][data['id']] = data + Excon::Response.new( + :body => {'role' => data}, + :status => 202 + ) + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/create_tenant.rb b/lib/fog/openstack/requests/identity_v2/create_tenant.rb new file mode 100644 index 000000000..9cf6d5a94 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/create_tenant.rb @@ -0,0 +1,34 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def create_tenant(attributes) + request( + :expects => [200], + :method => 'POST', + :path => "tenants", + :body => Fog::JSON.encode({'tenant' => attributes}) + ) + end # def create_tenant + end # class Real + + class Mock + def create_tenant(attributes) + response = Excon::Response.new + response.status = [200, 204][rand(1)] + response.body = { + 'tenant' => { + 'id' => "df9a815161eba9b76cc748fd5c5af73e", + 'description' => attributes[:description] || 'normal tenant', + 'enabled' => true, + 'name' => attributes[:name] || 'default' + } + } + response + end # def create_tenant + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/create_user.rb b/lib/fog/openstack/requests/identity_v2/create_user.rb new file mode 100644 index 000000000..e4da3029e --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/create_user.rb @@ -0,0 +1,45 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def create_user(name, password, email, tenantId=nil, enabled=true) + data = { + 'user' => { + 'name' => name, + 'password' => password, + 'tenantId' => tenantId, + 'email' => email, + 'enabled' => enabled, + } + } + + request( + :body => Fog::JSON.encode(data), + :expects => [200, 202], + :method => 'POST', + :path => '/users' + ) + end + end + + class Mock + def create_user(name, password, email, tenantId=nil, enabled=true) + response = Excon::Response.new + response.status = 200 + data = { + 'id' => Fog::Mock.random_hex(32), + 'name' => name, + 'email' => email, + 'tenantId' => tenantId, + 'enabled' => enabled + } + self.data[:users][data['id']] = data + response.body = {'user' => data} + response + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/create_user_role.rb b/lib/fog/openstack/requests/identity_v2/create_user_role.rb new file mode 100644 index 000000000..b687fc5d8 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/create_user_role.rb @@ -0,0 +1,26 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def create_user_role(tenant_id, user_id, role_id) + request( + :expects => 200, + :method => 'PUT', + :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" + ) + end + end + + class Mock + def create_user_role(tenant_id, user_id, role_id) + Excon::Response.new( + :body => {'role' => self.data[:roles][role_id]}, + :status => 200 + ) + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/delete_ec2_credential.rb b/lib/fog/openstack/requests/identity_v2/delete_ec2_credential.rb new file mode 100644 index 000000000..6f67d81e7 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/delete_ec2_credential.rb @@ -0,0 +1,43 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + ## + # Destroy an EC2 credential for a user. Requires administrator + # credentials. + # + # ==== Parameters + # * user_id<~String>: The id of the user to delete the credential + # for + # * access<~String>: The access key of the credential to destroy + # + # ==== Returns + # * response<~Excon::Response>: + # * body<~String>: Empty string + + def delete_ec2_credential(user_id, access) + request( + :expects => [200, 204], + :method => 'DELETE', + :path => "users/#{user_id}/credentials/OS-EC2/#{access}" + ) + end + end + + class Mock + def delete_ec2_credential(user_id, access) + raise Fog::Identity::OpenStack::NotFound unless self.data[:ec2_credentials][user_id][access] + + self.data[:ec2_credentials][user_id].delete access + + response = Excon::Response.new + response.status = 204 + response + rescue + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/delete_role.rb b/lib/fog/openstack/requests/identity_v2/delete_role.rb new file mode 100644 index 000000000..de1bba325 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/delete_role.rb @@ -0,0 +1,30 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def delete_role(role_id) + request( + :expects => [200, 204], + :method => 'DELETE', + :path => "/OS-KSADM/roles/#{role_id}" + ) + end + end + + class Mock + def delete_role(role_id) + response = Excon::Response.new + if self.data[:roles][role_id] + self.data[:roles].delete(role_id) + response.status = 204 + response + else + raise Fog::Identity::OpenStack::NotFound + end + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/delete_tenant.rb b/lib/fog/openstack/requests/identity_v2/delete_tenant.rb new file mode 100644 index 000000000..ab8c26e64 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/delete_tenant.rb @@ -0,0 +1,33 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def delete_tenant(id) + request( + :expects => [200, 204], + :method => 'DELETE', + :path => "tenants/#{id}" + ) + end # def create_tenant + end # class Real + + class Mock + def delete_tenant(attributes) + response = Excon::Response.new + response.status = [200, 204][rand(1)] + response.body = { + 'tenant' => { + 'id' => '1', + 'description' => 'Has access to everything', + 'enabled' => true, + 'name' => 'admin' + } + } + response + end # def create_tenant + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/delete_user.rb b/lib/fog/openstack/requests/identity_v2/delete_user.rb new file mode 100644 index 000000000..4c5d02334 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/delete_user.rb @@ -0,0 +1,30 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def delete_user(user_id) + request( + :expects => [200, 204], + :method => 'DELETE', + :path => "users/#{user_id}" + ) + end + end + + class Mock + def delete_user(user_id) + self.data[:users].delete( + list_users.body['users'].find { |x| x['id'] == user_id }['id']) + + response = Excon::Response.new + response.status = 204 + response + rescue + raise Fog::Identity::OpenStack::NotFound + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/delete_user_role.rb b/lib/fog/openstack/requests/identity_v2/delete_user_role.rb new file mode 100644 index 000000000..88123619d --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/delete_user_role.rb @@ -0,0 +1,25 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def delete_user_role(tenant_id, user_id, role_id) + request( + :expects => 204, + :method => 'DELETE', + :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" + ) + end + end + + class Mock + def delete_user_role(tenant_id, user_id, role_id) + response = Excon::Response.new + response.status = 204 + response + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/get_ec2_credential.rb b/lib/fog/openstack/requests/identity_v2/get_ec2_credential.rb new file mode 100644 index 000000000..99945672f --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/get_ec2_credential.rb @@ -0,0 +1,50 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + ## + # Retrieves an EC2 credential for a user. Requires administrator + # credentials. + # + # ==== Parameters + # * user_id<~String>: The id of the user to retrieve the credential + # for + # * access<~String>: The access key of the credential to retrieve + # + # ==== Returns + # * response<~Excon::Response>: + # * body<~Hash>: + # * 'credential'<~Hash>: The EC2 credential + # * 'access'<~String>: The access key + # * 'secret'<~String>: The secret key + # * 'user_id'<~String>: The user id + # * 'tenant_id'<~String>: The tenant id + + def get_ec2_credential(user_id, access) + request( + :expects => [200, 202], + :method => 'GET', + :path => "users/#{user_id}/credentials/OS-EC2/#{access}" + ) + rescue Excon::Errors::Unauthorized + raise Fog::Identity::OpenStack::NotFound + end + end + + class Mock + def get_ec2_credential(user_id, access) + ec2_credential = self.data[:ec2_credentials][user_id][access] + + raise Fog::OpenStack::Identity::NotFound unless ec2_credential + + response = Excon::Response.new + response.status = 200 + response.body = {'credential' => ec2_credential} + response + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/get_role.rb b/lib/fog/openstack/requests/identity_v2/get_role.rb new file mode 100644 index 000000000..f90c4fc2c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/get_role.rb @@ -0,0 +1,30 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def get_role(id) + request( + :expects => [200, 204], + :method => 'GET', + :path => "/OS-KSADM/roles/#{id}" + ) + end + end + + class Mock + def get_role(id) + response = Excon::Response.new + if data = self.data[:roles][id] + response.status = 200 + response.body = {'role' => data} + response + else + raise Fog::Identity::OpenStack::NotFound + end + end + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/get_tenant.rb b/lib/fog/openstack/requests/identity_v2/get_tenant.rb new file mode 100644 index 000000000..cf62bc05c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/get_tenant.rb @@ -0,0 +1,33 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def get_tenant(id) + request( + :expects => [200, 204], + :method => 'GET', + :path => "tenants/#{id}" + ) + end + end # class Real + + class Mock + def get_tenant(id) + response = Excon::Response.new + response.status = [200, 204][rand(1)] + response.body = { + 'tenant' => { + 'id' => id, + 'description' => 'Has access to everything', + 'enabled' => true, + 'name' => 'admin' + } + } + response + end # def list_tenants + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/get_tenants_by_id.rb b/lib/fog/openstack/requests/identity_v2/get_tenants_by_id.rb new file mode 100644 index 000000000..d3c2dd9a1 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/get_tenants_by_id.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def get_tenants_by_id(tenant_id) + request( + :expects => [200], + :method => 'GET', + :path => "tenants/#{tenant_id}" + ) + end + end + + class Mock + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/get_tenants_by_name.rb b/lib/fog/openstack/requests/identity_v2/get_tenants_by_name.rb new file mode 100644 index 000000000..ff0d290ad --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/get_tenants_by_name.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def get_tenants_by_name(name) + request( + :expects => [200], + :method => 'GET', + :path => "tenants?name=#{name}" + ) + end + end + + class Mock + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/get_user_by_id.rb b/lib/fog/openstack/requests/identity_v2/get_user_by_id.rb new file mode 100644 index 000000000..5fbfe1efd --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/get_user_by_id.rb @@ -0,0 +1,34 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def get_user_by_id(user_id) + request( + :expects => [200, 203], + :method => 'GET', + :path => "users/#{user_id}" + ) + end + end + + class Mock + def get_user_by_id(user_id) + response = Excon::Response.new + response.status = 200 + + existing_user = self.data[:users].find do |u| + u[0] == user_id || u[1]['name'] == 'mock' + end + existing_user = existing_user[1] if existing_user + + response.body = { + 'user' => existing_user || create_user('mock', 'mock', 'mock@email.com').body['user'] + } + response + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/get_user_by_name.rb b/lib/fog/openstack/requests/identity_v2/get_user_by_name.rb new file mode 100644 index 000000000..532d6e9fe --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/get_user_by_name.rb @@ -0,0 +1,29 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def get_user_by_name(name) + request( + :expects => [200, 203], + :method => 'GET', + :path => "users?name=#{name}" + ) + end + end + + class Mock + def get_user_by_name(name) + response = Excon::Response.new + response.status = 200 + user = self.data[:users].values.select { |user| user['name'] == name }[0] + response.body = { + 'user' => user + } + response + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/list_ec2_credentials.rb b/lib/fog/openstack/requests/identity_v2/list_ec2_credentials.rb new file mode 100644 index 000000000..fb272c3d5 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/list_ec2_credentials.rb @@ -0,0 +1,45 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + ## + # List EC2 credentials for a user. Requires administrator + # credentials. + # + # ==== Parameters + # * user_id<~String>: The id of the user to retrieve the credential + # for + # + # ==== Returns + # * response<~Excon::Response>: + # * body<~Hash>: + # * 'credentials'<~Array>: The user's EC2 credentials + # * 'access'<~String>: The access key + # * 'secret'<~String>: The secret key + # * 'user_id'<~String>: The user id + # * 'tenant_id'<~String>: The tenant id + + def list_ec2_credentials(user_id) + request( + :expects => [200, 202], + :method => 'GET', + :path => "users/#{user_id}/credentials/OS-EC2" + ) + end + end + + class Mock + def list_ec2_credentials(user_id) + ec2_credentials = self.data[:ec2_credentials][user_id].values + + response = Excon::Response.new + response.status = 200 + response.body = {'credentials' => ec2_credentials} + response + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/list_endpoints_for_token.rb b/lib/fog/openstack/requests/identity_v2/list_endpoints_for_token.rb new file mode 100644 index 000000000..2bead12fc --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/list_endpoints_for_token.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def list_endpoints_for_token(token_id) + request( + :expects => [200, 203], + :method => 'HEAD', + :path => "tokens/#{token_id}/endpoints" + ) + end + end + + class Mock + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/list_roles.rb b/lib/fog/openstack/requests/identity_v2/list_roles.rb new file mode 100644 index 000000000..542dbf099 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/list_roles.rb @@ -0,0 +1,33 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def list_roles + request( + :expects => 200, + :method => 'GET', + :path => '/OS-KSADM/roles' + ) + end + end + + class Mock + def list_roles + if self.data[:roles].empty? + ['admin', 'Member'].each do |name| + id = Fog::Mock.random_hex(32) + self.data[:roles][id] = {'id' => id, 'name' => name} + end + end + + Excon::Response.new( + :body => {'roles' => self.data[:roles].values}, + :status => 200 + ) + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/list_roles_for_user_on_tenant.rb b/lib/fog/openstack/requests/identity_v2/list_roles_for_user_on_tenant.rb new file mode 100644 index 000000000..da6778eba --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/list_roles_for_user_on_tenant.rb @@ -0,0 +1,32 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def list_roles_for_user_on_tenant(tenant_id, user_id) + request( + :expects => [200], + :method => 'GET', + :path => "tenants/#{tenant_id}/users/#{user_id}/roles" + ) + end # def list_roles_for_user_on_tenant + end # class Real + + class Mock + def list_roles_for_user_on_tenant(tenant_id, user_id) + self.data[:user_tenant_membership][tenant_id] ||= {} + self.data[:user_tenant_membership][tenant_id][user_id] ||= [] + roles = self.data[:user_tenant_membership][tenant_id][user_id].map do |role_id| + self.data[:roles][role_id] + end + + Excon::Response.new( + :body => {'roles' => roles}, + :status => 200 + ) + end # def list_roles_for_user_on_tenant + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/list_tenants.rb b/lib/fog/openstack/requests/identity_v2/list_tenants.rb new file mode 100644 index 000000000..b0dea07c5 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/list_tenants.rb @@ -0,0 +1,47 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def list_tenants(limit = nil, marker = nil) + params = Hash.new + params['limit'] = limit if limit + params['marker'] = marker if marker + + request( + :expects => [200, 204], + :method => 'GET', + :path => "tenants", + :query => params + ) + end + end # class Real + + class Mock + def list_tenants + Excon::Response.new( + :body => { + 'tenants_links' => [], + 'tenants' => [ + {'id' => '1', + 'description' => 'Has access to everything', + 'enabled' => true, + 'name' => 'admin'}, + {'id' => '2', + 'description' => 'Normal tenant', + 'enabled' => true, + 'name' => 'default'}, + {'id' => '3', + 'description' => 'Disabled tenant', + 'enabled' => false, + 'name' => 'disabled'} + ] + }, + :status => [200, 204][rand(1)] + ) + end # def list_tenants + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/list_user_global_roles.rb b/lib/fog/openstack/requests/identity_v2/list_user_global_roles.rb new file mode 100644 index 000000000..934084f9c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/list_user_global_roles.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def list_user_global_roles(user_id) + request( + :expects => [200], + :method => 'GET', + :path => "users/#{user_id}/roles" + ) + end + end + + class Mock + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/list_users.rb b/lib/fog/openstack/requests/identity_v2/list_users.rb new file mode 100644 index 000000000..2b28e02d8 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/list_users.rb @@ -0,0 +1,35 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def list_users(tenant_id = nil) + path = tenant_id ? "tenants/#{tenant_id}/users" : 'users' + request( + :expects => [200, 204], + :method => 'GET', + :path => path + ) + end + end # class Real + + class Mock + def list_users(tenant_id = nil) + users = self.data[:users].values + + if tenant_id + users = users.select { + |user| user['tenantId'] == tenant_id + } + end + + Excon::Response.new( + :body => {'users' => users}, + :status => 200 + ) + end + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/remove_user_from_tenant.rb b/lib/fog/openstack/requests/identity_v2/remove_user_from_tenant.rb new file mode 100644 index 000000000..e15b41a1d --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/remove_user_from_tenant.rb @@ -0,0 +1,22 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def remove_user_from_tenant(tenant_id, user_id, role_id) + request( + :expects => [200, 204], + :method => 'DELETE', + :path => "/tenants/#{tenant_id}/users/#{user_id}/roles/OS-KSADM/#{role_id}" + ) + end + end # class Real + + class Mock + def remove_user_from_tenant(tenant_id, user_id, role_id) + end # def remove_user_from_tenant + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end diff --git a/lib/fog/openstack/requests/identity_v2/set_tenant.rb b/lib/fog/openstack/requests/identity_v2/set_tenant.rb new file mode 100644 index 000000000..e14fb2fe6 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/set_tenant.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def set_tenant(tenant) + @openstack_must_reauthenticate = true + @openstack_tenant = tenant.to_s + authenticate + end + end + + class Mock + def set_tenant(tenant) + true + end + end + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/update_tenant.rb b/lib/fog/openstack/requests/identity_v2/update_tenant.rb new file mode 100644 index 000000000..c2c5f2c6c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/update_tenant.rb @@ -0,0 +1,30 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def update_tenant(id, attributes) + request( + :expects => [200], + :method => 'PUT', + :path => "tenants/#{id}", + :body => Fog::JSON.encode({'tenant' => attributes}) + ) + end # def create_tenant + end # class Real + + class Mock + def update_tenant(id, attributes) + response = Excon::Response.new + response.status = [200, 204][rand(1)] + attributes = {'enabled' => true, 'id' => '1'}.merge(attributes) + response.body = { + 'tenant' => attributes + } + response + end # def create_tenant + end # class Mock + end # class V2 + end # class OpenStack + end # module Identity +end # module Fog diff --git a/lib/fog/openstack/requests/identity_v2/update_user.rb b/lib/fog/openstack/requests/identity_v2/update_user.rb new file mode 100644 index 000000000..dba3e8f52 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/update_user.rb @@ -0,0 +1,34 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def update_user(user_id, options = {}) + url = options.delete('url') || "/users/#{user_id}" + request( + :body => Fog::JSON.encode({'user' => options}), + :expects => 200, + :method => 'PUT', + :path => url + ) + end + end + + class Mock + def update_user(user_id, options) + response = Excon::Response.new + if user = self.data[:users][user_id] + if options['name'] + user['name'] = options['name'] + end + response.status = 200 + response + else + raise Fog::Identity::OpenStack::NotFound + end + end + end + end # class V2 + end + end +end diff --git a/lib/fog/openstack/requests/identity_v2/validate_token.rb b/lib/fog/openstack/requests/identity_v2/validate_token.rb new file mode 100644 index 000000000..57ac9ffdb --- /dev/null +++ b/lib/fog/openstack/requests/identity_v2/validate_token.rb @@ -0,0 +1,22 @@ +module Fog + module Identity + class OpenStack + class V2 + class Real + def validate_token(token_id, tenant_id=nil) + request( + :expects => [200, 203], + :method => 'GET', + :path => "tokens/#{token_id}"+(tenant_id ? "?belongsTo=#{tenant_id}" : '') + ) + end + end + + class Mock + def validate_token(token_id, tenant_id=nil) + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/add_user_to_group.rb b/lib/fog/openstack/requests/identity_v3/add_user_to_group.rb new file mode 100644 index 000000000..d4496a4e1 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/add_user_to_group.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def add_user_to_group(group_id, user_id) + request( + :expects => [204], + :method => 'PUT', + :path => "groups/#{group_id}/users/#{user_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/auth_domains.rb b/lib/fog/openstack/requests/identity_v3/auth_domains.rb new file mode 100644 index 000000000..878ef1aad --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/auth_domains.rb @@ -0,0 +1,29 @@ +module Fog + module Identity + class OpenStack + class V3 + + class Real + def auth_domains(options={}) + params = Hash.new + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "auth/domains", + :query => params + ) + end + end + + class Mock + def auth_domains + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/auth_projects.rb b/lib/fog/openstack/requests/identity_v3/auth_projects.rb new file mode 100644 index 000000000..96664cbbf --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/auth_projects.rb @@ -0,0 +1,29 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def auth_projects(options={}) + params = Hash.new + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "auth/projects", + :query => params + ) + + end + end + + class Mock + def auth_projects + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/check_domain_group_role.rb b/lib/fog/openstack/requests/identity_v3/check_domain_group_role.rb new file mode 100644 index 000000000..557aa3a0e --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/check_domain_group_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def check_domain_group_role(id, group_id, role_id) + request( + :expects => [204], + :method => 'HEAD', + :path => "domains/#{id}/groups/#{group_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/check_domain_user_role.rb b/lib/fog/openstack/requests/identity_v3/check_domain_user_role.rb new file mode 100644 index 000000000..a27be6062 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/check_domain_user_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def check_domain_user_role(id, user_id, role_id) + request( + :expects => [204], + :method => 'HEAD', + :path => "domains/#{id}/users/#{user_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/check_project_group_role.rb b/lib/fog/openstack/requests/identity_v3/check_project_group_role.rb new file mode 100644 index 000000000..b6bda8ce3 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/check_project_group_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def check_project_group_role(id, group_id, role_id) + request( + :expects => [204], + :method => 'HEAD', + :path => "projects/#{id}/groups/#{group_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/check_project_user_role.rb b/lib/fog/openstack/requests/identity_v3/check_project_user_role.rb new file mode 100644 index 000000000..7a56bbb95 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/check_project_user_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def check_project_user_role(id, user_id, role_id) + request( + :expects => [204], + :method => 'HEAD', + :path => "projects/#{id}/users/#{user_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_domain.rb b/lib/fog/openstack/requests/identity_v3/create_domain.rb new file mode 100644 index 000000000..f354ed773 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_domain.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_domain(domain) + request( + :expects => [201], + :method => 'POST', + :path => "domains", + :body => Fog::JSON.encode(:domain => domain) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_endpoint.rb b/lib/fog/openstack/requests/identity_v3/create_endpoint.rb new file mode 100644 index 000000000..94013f8cb --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_endpoint.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_endpoint(endpoint) + request( + :expects => [201], + :method => 'POST', + :path => "endpoints", + :body => Fog::JSON.encode(:endpoint => endpoint) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_group.rb b/lib/fog/openstack/requests/identity_v3/create_group.rb new file mode 100644 index 000000000..9bcefe6d7 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_group.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_group(group) + request( + :expects => [201], + :method => 'POST', + :path => "groups", + :body => Fog::JSON.encode(:group => group) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_os_credential.rb b/lib/fog/openstack/requests/identity_v3/create_os_credential.rb new file mode 100644 index 000000000..ca94dfe93 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_os_credential.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_os_credential(credential) + request( + :expects => [201], + :method => 'POST', + :path => "credentials", + :body => Fog::JSON.encode(:credential => credential) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_policy.rb b/lib/fog/openstack/requests/identity_v3/create_policy.rb new file mode 100644 index 000000000..55f3d6eee --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_policy.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_policy(policy) + request( + :expects => [201], + :method => 'POST', + :path => "policies", + :body => Fog::JSON.encode(:policy => policy) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_project.rb b/lib/fog/openstack/requests/identity_v3/create_project.rb new file mode 100644 index 000000000..36797820e --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_project.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_project(project) + request( + :expects => [201], + :method => 'POST', + :path => "projects", + :body => Fog::JSON.encode(:project => project) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_role.rb b/lib/fog/openstack/requests/identity_v3/create_role.rb new file mode 100644 index 000000000..1a39f7389 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_role.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_role(role) + request( + :expects => [201], + :method => 'POST', + :path => "roles", + :body => Fog::JSON.encode(:role => role) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_service.rb b/lib/fog/openstack/requests/identity_v3/create_service.rb new file mode 100644 index 000000000..15cd4d267 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_service.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_service(service) + request( + :expects => [201], + :method => 'POST', + :path => "services", + :body => Fog::JSON.encode(:service => service) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/create_user.rb b/lib/fog/openstack/requests/identity_v3/create_user.rb new file mode 100644 index 000000000..146cf434e --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/create_user.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def create_user(user) + request( + :expects => [201], + :method => 'POST', + :path => "users", + :body => Fog::JSON.encode(:user => user) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_domain.rb b/lib/fog/openstack/requests/identity_v3/delete_domain.rb new file mode 100644 index 000000000..fb4e6986b --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_domain.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_domain(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "domains/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_endpoint.rb b/lib/fog/openstack/requests/identity_v3/delete_endpoint.rb new file mode 100644 index 000000000..2ca914c0c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_endpoint.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_endpoint(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "endpoints/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_group.rb b/lib/fog/openstack/requests/identity_v3/delete_group.rb new file mode 100644 index 000000000..44f348e01 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_group.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_group(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "groups/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_os_credential.rb b/lib/fog/openstack/requests/identity_v3/delete_os_credential.rb new file mode 100644 index 000000000..83416f7bb --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_os_credential.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_os_credential(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "credentials/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_policy.rb b/lib/fog/openstack/requests/identity_v3/delete_policy.rb new file mode 100644 index 000000000..ab47b0e80 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_policy.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_policy(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "policies/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_project.rb b/lib/fog/openstack/requests/identity_v3/delete_project.rb new file mode 100644 index 000000000..6c7ac1b28 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_project.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_project(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "projects/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_role.rb b/lib/fog/openstack/requests/identity_v3/delete_role.rb new file mode 100644 index 000000000..aaf1a04c7 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_role(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "roles/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_service.rb b/lib/fog/openstack/requests/identity_v3/delete_service.rb new file mode 100644 index 000000000..04164ff4d --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_service.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_service(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "services/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/delete_user.rb b/lib/fog/openstack/requests/identity_v3/delete_user.rb new file mode 100644 index 000000000..ba7ebf891 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/delete_user.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def delete_user(id) + request( + :expects => [204], + :method => 'DELETE', + :path => "users/#{id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_domain.rb b/lib/fog/openstack/requests/identity_v3/get_domain.rb new file mode 100644 index 000000000..1a11cd52b --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_domain.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_domain(id) + request( + :expects => [200], + :method => 'GET', + :path => "domains/#{id}" + ) + end + end + + class Mock + def get_domain(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_endpoint.rb b/lib/fog/openstack/requests/identity_v3/get_endpoint.rb new file mode 100644 index 000000000..67bc5d30d --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_endpoint.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_endpoint(id) + request( + :expects => [200], + :method => 'GET', + :path => "endpoints/#{id}" + ) + end + end + + class Mock + def get_endpoint(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_group.rb b/lib/fog/openstack/requests/identity_v3/get_group.rb new file mode 100644 index 000000000..ecf7ae7de --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_group.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_group(id) + request( + :expects => [200], + :method => 'GET', + :path => "groups/#{id}" + ) + end + end + + class Mock + def get_group(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_os_credential.rb b/lib/fog/openstack/requests/identity_v3/get_os_credential.rb new file mode 100644 index 000000000..09eafe892 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_os_credential.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_os_credential(id) + request( + :expects => [200], + :method => 'GET', + :path => "credentials/#{id}" + ) + end + end + + class Mock + def get_os_credential(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_policy.rb b/lib/fog/openstack/requests/identity_v3/get_policy.rb new file mode 100644 index 000000000..cc16e7a18 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_policy.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_policy(id) + request( + :expects => [200], + :method => 'GET', + :path => "policies/#{id}" + ) + end + end + + class Mock + def get_policy(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_project.rb b/lib/fog/openstack/requests/identity_v3/get_project.rb new file mode 100644 index 000000000..f8686321e --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_project.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_project(id) + request( + :expects => [200], + :method => 'GET', + :path => "projects/#{id}" + ) + end + end + + class Mock + def get_domain(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_role.rb b/lib/fog/openstack/requests/identity_v3/get_role.rb new file mode 100644 index 000000000..8cefe8b63 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_role.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_role(id) + request( + :expects => [200], + :method => 'GET', + :path => "roles/#{id}" + ) + end + end + + class Mock + def get_role(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_service.rb b/lib/fog/openstack/requests/identity_v3/get_service.rb new file mode 100644 index 000000000..24f77f56c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_service.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_service(id) + request( + :expects => [200], + :method => 'GET', + :path => "projects/#{id}" + ) + end + end + + class Mock + def get_service(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/get_user.rb b/lib/fog/openstack/requests/identity_v3/get_user.rb new file mode 100644 index 000000000..b92b3a1ea --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/get_user.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def get_user(id) + request( + :expects => [200], + :method => 'GET', + :path => "users/#{id}" + ) + end + end + + class Mock + def get_user(id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/grant_domain_group_role.rb b/lib/fog/openstack/requests/identity_v3/grant_domain_group_role.rb new file mode 100644 index 000000000..0df4cbc1c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/grant_domain_group_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def grant_domain_group_role(id, group_id, role_id) + request( + :expects => [204], + :method => 'PUT', + :path => "domains/#{id}/groups/#{group_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/grant_domain_user_role.rb b/lib/fog/openstack/requests/identity_v3/grant_domain_user_role.rb new file mode 100644 index 000000000..2edaf6255 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/grant_domain_user_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def grant_domain_user_role(id, user_id, role_id) + request( + :expects => [204], + :method => 'PUT', + :path => "domains/#{id}/users/#{user_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/grant_project_group_role.rb b/lib/fog/openstack/requests/identity_v3/grant_project_group_role.rb new file mode 100644 index 000000000..1c8867ed5 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/grant_project_group_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def grant_project_group_role(id, group_id, role_id) + request( + :expects => [204], + :method => 'PUT', + :path => "projects/#{id}/groups/#{group_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/grant_project_user_role.rb b/lib/fog/openstack/requests/identity_v3/grant_project_user_role.rb new file mode 100644 index 000000000..406542f5c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/grant_project_user_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def grant_project_user_role(id, user_id, role_id) + request( + :expects => [204], + :method => 'PUT', + :path => "projects/#{id}/users/#{user_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/group_user_check.rb b/lib/fog/openstack/requests/identity_v3/group_user_check.rb new file mode 100644 index 000000000..dd37b5478 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/group_user_check.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def group_user_check(group_id, user_id) + request( + :expects => [204], + :method => 'HEAD', + :path => "groups/#{group_id}/users/#{user_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_domain_group_roles.rb b/lib/fog/openstack/requests/identity_v3/list_domain_group_roles.rb new file mode 100644 index 000000000..07e57e16f --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_domain_group_roles.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_domain_group_roles(id, group_id) + request( + :expects => [200], + :method => 'GET', + :path => "domains/#{id}/groups/#{group_id}/roles" + ) + end + end + + class Mock + def list_domain_user_roles(id, group_id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_domain_user_roles.rb b/lib/fog/openstack/requests/identity_v3/list_domain_user_roles.rb new file mode 100644 index 000000000..8cbe702c2 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_domain_user_roles.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_domain_user_roles(id, user_id) + request( + :expects => [200], + :method => 'GET', + :path => "domains/#{id}/users/#{user_id}/roles" + ) + end + end + + class Mock + def list_domain_user_roles(id, user_id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_domains.rb b/lib/fog/openstack/requests/identity_v3/list_domains.rb new file mode 100644 index 000000000..dd2bb513f --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_domains.rb @@ -0,0 +1,31 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_domains(options={}) + params = Hash.new + params['name'] = options[:name] if options[:name] + params['enabled'] = options[:enabled] if options[:enabled] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "domains", + :query => params + ) + end + end + + class Mock + def list_domains + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_endpoints.rb b/lib/fog/openstack/requests/identity_v3/list_endpoints.rb new file mode 100644 index 000000000..6589ce823 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_endpoints.rb @@ -0,0 +1,31 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_endpoints(options={}) + params = Hash.new + params['service_id'] = options[:service_id] if options[:service_id] + params['interface'] = options[:interface] if options[:interface] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "endpoints", + :query => params + ) + end + end + + class Mock + def list_endpoints + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_group_users.rb b/lib/fog/openstack/requests/identity_v3/list_group_users.rb new file mode 100644 index 000000000..a9d39daba --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_group_users.rb @@ -0,0 +1,32 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_group_users(id, options={}) + params = Hash.new + params['name'] = options[:name] if options[:name] + params['domain_id'] = options[:domain_id] if options[:domain_id] + params['description'] = options[:description] if options[:description] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "groups/#{id}/users", + :query => params + ) + end + end + + class Mock + def list_group_users + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_groups.rb b/lib/fog/openstack/requests/identity_v3/list_groups.rb new file mode 100644 index 000000000..b06f57db1 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_groups.rb @@ -0,0 +1,42 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_groups(options={}) + params = Hash.new + params['user_id'] = options[:user_id] if options[:user_id] + params['domain_id'] = options[:domain_id] if options[:domain_id] + params['name'] = options[:name] if options[:name] + params['enabled'] = options[:enabled] if options[:enabled] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + if params['user_id'] then + request( + :expects => [200], + :method => 'GET', + :path => "users/#{params['user_id']}groups", + :query => params + ) + else + request( + :expects => [200], + :method => 'GET', + :path => "groups", + :query => params + ) + end + end + end + + class Mock + def list_groups + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_os_credentials.rb b/lib/fog/openstack/requests/identity_v3/list_os_credentials.rb new file mode 100644 index 000000000..57cd03e46 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_os_credentials.rb @@ -0,0 +1,29 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_os_credentials(options={}) + params = Hash.new + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + params['name'] = options[:name] if options[:name] + + request( + :expects => [200], + :method => 'GET', + :path => "credentials", + :query => params + ) + end + end + + class Mock + def list_os_credentials + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_policies.rb b/lib/fog/openstack/requests/identity_v3/list_policies.rb new file mode 100644 index 000000000..e7d68f47d --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_policies.rb @@ -0,0 +1,28 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_policies(options={}) + params = Hash.new + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "policies", + :query => params + ) + end + end + + class Mock + def list_policies + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_project_group_roles.rb b/lib/fog/openstack/requests/identity_v3/list_project_group_roles.rb new file mode 100644 index 000000000..5f6feedb3 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_project_group_roles.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_project_group_roles(id, group_id) + request( + :expects => [200], + :method => 'GET', + :path => "projects/#{id}/groups/#{group_id}/roles" + ) + end + end + + class Mock + def list_project_user_roles(id, group_id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_project_user_roles.rb b/lib/fog/openstack/requests/identity_v3/list_project_user_roles.rb new file mode 100644 index 000000000..609b31416 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_project_user_roles.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_project_user_roles(id, user_id) + request( + :expects => [200], + :method => 'GET', + :path => "projects/#{id}/users/#{user_id}/roles" + ) + end + end + + class Mock + def list_project_user_roles(id, user_id) + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_projects.rb b/lib/fog/openstack/requests/identity_v3/list_projects.rb new file mode 100644 index 000000000..b209465ba --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_projects.rb @@ -0,0 +1,42 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_projects(options={}) + params = Hash.new + params['user_id'] = options[:user_id] if options[:user_id] + params['domain_id'] = options[:domain_id] if options[:domain_id] + params['name'] = options[:name] if options[:name] + params['enabled'] = options[:enabled] if options[:enabled] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + if params['user_id'] then + request( + :expects => [200], + :method => 'GET', + :path => "users/#{params['user_id']}/projects", + :query => params + ) + else + request( + :expects => [200], + :method => 'GET', + :path => "projects", + :query => params + ) + end + end + end + + class Mock + def list_projects + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_role_assignments.rb b/lib/fog/openstack/requests/identity_v3/list_role_assignments.rb new file mode 100644 index 000000000..39e22c3d7 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_role_assignments.rb @@ -0,0 +1,35 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_role_assignments(options={}) + params = Hash.new + params['group.id'] = options[:group_id] if options[:group_id] + params['role.id'] = options[:role_id] if options[:role_id] + params['scope.domain.id'] = options[:domain_id] if options[:domain_id] + params['scope.project.id'] = options[:project_id] if options[:project_id] + params['user.id'] = options[:user_id] if options[:user_id] + params['effective'] = options[:effective] if options[:effective] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "role_assignments", + :query => params + ) + end + end + + class Mock + def list_role_assignments + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_roles.rb b/lib/fog/openstack/requests/identity_v3/list_roles.rb new file mode 100644 index 000000000..718295d9c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_roles.rb @@ -0,0 +1,42 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_roles(options={}) + params = Hash.new + params['name'] = options[:name] if options[:name] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + +# if params['user_id'] then +# Returns 404 "The resource could not be found." +# https://bugs.launchpad.net/keystone/+bug/933565 reports this - bug is set to "Won't fix" +# user_id = params.delete 'user_id' +# request( +# :expects => [200], +# :method => 'GET', +# :path => "users/#{user_id}/roles", +# :query => params +# ) +# else + request( + :expects => [200], + :method => 'GET', + :path => "roles", + :query => params + ) +# end + end + end + + class Mock + def list_roles + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_services.rb b/lib/fog/openstack/requests/identity_v3/list_services.rb new file mode 100644 index 000000000..6d5bafc36 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_services.rb @@ -0,0 +1,30 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_services(options={}) + params = Hash.new + params['type'] = options[:type] if options[:type] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "services", + :query => params + ) + end + end + + class Mock + def list_services + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_user_groups.rb b/lib/fog/openstack/requests/identity_v3/list_user_groups.rb new file mode 100644 index 000000000..b84ae6cfb --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_user_groups.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_user_groups(user_id) + request( + :expects => [200], + :method => 'GET', + :path => "users/#{user_id}/groups" + ) + end + end + + class Mock + def list_user_groups + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_user_projects.rb b/lib/fog/openstack/requests/identity_v3/list_user_projects.rb new file mode 100644 index 000000000..530d9311d --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_user_projects.rb @@ -0,0 +1,23 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_user_projects(user_id) + request( + :expects => [200], + :method => 'GET', + :path => "users/#{user_id}/projects" + ) + end + end + + class Mock + def list_user_projects + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/list_users.rb b/lib/fog/openstack/requests/identity_v3/list_users.rb new file mode 100644 index 000000000..9b21a5ddb --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/list_users.rb @@ -0,0 +1,32 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def list_users(options={}) + params = Hash.new + params['domain_id'] = options[:domain_id] if options[:domain_id] + params['name'] = options[:name] if options[:name] + params['enabled'] = options[:enabled] if options[:enabled] + + params['page'] = options.fetch(:page, 1) + params['per_page'] = options.fetch(:per_page, 30) + + request( + :expects => [200], + :method => 'GET', + :path => "users", + :query => params + ) + end + end + + class Mock + def list_users + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/remove_user_from_group.rb b/lib/fog/openstack/requests/identity_v3/remove_user_from_group.rb new file mode 100644 index 000000000..49a41093b --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/remove_user_from_group.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def remove_user_from_group(group_id, user_id) + request( + :expects => [204], + :method => 'DELETE', + :path => "groups/#{group_id}/users/#{user_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/revoke_domain_group_role.rb b/lib/fog/openstack/requests/identity_v3/revoke_domain_group_role.rb new file mode 100644 index 000000000..cf3b8e242 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/revoke_domain_group_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def revoke_domain_group_role(id, group_id, role_id) + request( + :expects => [204], + :method => 'DELETE', + :path => "domains/#{id}/groups/#{group_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/revoke_domain_user_role.rb b/lib/fog/openstack/requests/identity_v3/revoke_domain_user_role.rb new file mode 100644 index 000000000..9ff816c93 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/revoke_domain_user_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def revoke_domain_user_role(id, user_id, role_id) + request( + :expects => [204], + :method => 'DELETE', + :path => "domains/#{id}/users/#{user_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/revoke_project_group_role.rb b/lib/fog/openstack/requests/identity_v3/revoke_project_group_role.rb new file mode 100644 index 000000000..76bd8b5e5 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/revoke_project_group_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def revoke_project_group_role(id, group_id, role_id) + request( + :expects => [204], + :method => 'DELETE', + :path => "projects/#{id}/groups/#{group_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/revoke_project_user_role.rb b/lib/fog/openstack/requests/identity_v3/revoke_project_user_role.rb new file mode 100644 index 000000000..41f2a548f --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/revoke_project_user_role.rb @@ -0,0 +1,20 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def revoke_project_user_role(id, user_id, role_id) + request( + :expects => [204], + :method => 'DELETE', + :path => "projects/#{id}/users/#{user_id}/roles/#{role_id}" + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/token_authenticate.rb b/lib/fog/openstack/requests/identity_v3/token_authenticate.rb new file mode 100644 index 000000000..01da423a4 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/token_authenticate.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def token_authenticate(auth) + request( + :expects => [201], + :method => 'POST', + :path => "auth/tokens", + :body => Fog::JSON.encode(auth) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/token_check.rb b/lib/fog/openstack/requests/identity_v3/token_check.rb new file mode 100644 index 000000000..d28fd95e8 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/token_check.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def token_check(subject_token) + request( + :expects => [200, 204], + :method => 'HEAD', + :path => "auth/tokens", + :headers => {"X-Subject-Token" => subject_token, "X-Auth-Token" => auth_token, } + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/token_revoke.rb b/lib/fog/openstack/requests/identity_v3/token_revoke.rb new file mode 100644 index 000000000..88e6f0949 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/token_revoke.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def token_revoke(subject_token) + request( + :expects => [200, 204], + :method => 'DELETE', + :path => "auth/tokens", + :headers => {"X-Subject-Token" => subject_token, "X-Auth-Token" => auth_token, } + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/token_validate.rb b/lib/fog/openstack/requests/identity_v3/token_validate.rb new file mode 100644 index 000000000..a589afe64 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/token_validate.rb @@ -0,0 +1,22 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def token_validate(subject_token) + + request( + :expects => [200], + :method => 'GET', + :path => "auth/tokens", + :headers => {"X-Subject-Token" => subject_token, "X-Auth-Token" => auth_token} + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_domain.rb b/lib/fog/openstack/requests/identity_v3/update_domain.rb new file mode 100644 index 000000000..96e66e2b6 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_domain.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_domain(id, domain) + request( + :expects => [200], + :method => 'PATCH', + :path => "domains/#{id}", + :body => Fog::JSON.encode(:domain => domain) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_endpoint.rb b/lib/fog/openstack/requests/identity_v3/update_endpoint.rb new file mode 100644 index 000000000..1ee11831c --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_endpoint.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_endpoint(id, endpoint) + request( + :expects => [200], + :method => 'PATCH', + :path => "endpoints/#{id}", + :body => Fog::JSON.encode(:endpoint => endpoint) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_group.rb b/lib/fog/openstack/requests/identity_v3/update_group.rb new file mode 100644 index 000000000..231c7e46b --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_group.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_group(id, group) + request( + :expects => [200], + :method => 'PATCH', + :path => "groups/#{id}", + :body => Fog::JSON.encode(:group => group) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_os_credential.rb b/lib/fog/openstack/requests/identity_v3/update_os_credential.rb new file mode 100644 index 000000000..3bf292c5d --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_os_credential.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_os_credential(id, credential) + request( + :expects => [200], + :method => 'PATCH', + :path => "credentials/#{id}", + :body => Fog::JSON.encode(:credential => credential) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_policy.rb b/lib/fog/openstack/requests/identity_v3/update_policy.rb new file mode 100644 index 000000000..9487c4874 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_policy.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_policy(id, policy) + request( + :expects => [200], + :method => 'PATCH', + :path => "policies/#{id}", + :body => Fog::JSON.encode(:policy => policy) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_project.rb b/lib/fog/openstack/requests/identity_v3/update_project.rb new file mode 100644 index 000000000..9fe2b4c8f --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_project.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_project(id, project) + request( + :expects => [200], + :method => 'PATCH', + :path => "projects/#{id}", + :body => Fog::JSON.encode(:project => project) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_role.rb b/lib/fog/openstack/requests/identity_v3/update_role.rb new file mode 100644 index 000000000..28dd136d4 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_role.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_role(id, role) + request( + :expects => [200], + :method => 'PATCH', + :path => "roles/#{id}", + :body => Fog::JSON.encode(:role => role) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_service.rb b/lib/fog/openstack/requests/identity_v3/update_service.rb new file mode 100644 index 000000000..582046c89 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_service.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_service(id, service) + request( + :expects => [200], + :method => 'PATCH', + :path => "services/#{id}", + :body => Fog::JSON.encode(:service => service) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/requests/identity_v3/update_user.rb b/lib/fog/openstack/requests/identity_v3/update_user.rb new file mode 100644 index 000000000..f65a5c8c9 --- /dev/null +++ b/lib/fog/openstack/requests/identity_v3/update_user.rb @@ -0,0 +1,21 @@ +module Fog + module Identity + class OpenStack + class V3 + class Real + def update_user(id, user) + request( + :expects => [200], + :method => 'PATCH', + :path => "users/#{id}", + :body => Fog::JSON.encode(:user => user) + ) + end + end + + class Mock + end + end + end + end +end \ No newline at end of file diff --git a/lib/fog/openstack/volume.rb b/lib/fog/openstack/volume.rb index 2318fd48d..d525146dd 100644 --- a/lib/fog/openstack/volume.rb +++ b/lib/fog/openstack/volume.rb @@ -199,7 +199,7 @@ module Fog :openstack_endpoint_type => @openstack_endpoint_type } - credentials = Fog::OpenStack.authenticate_v2(options, @connection_options) + credentials = Fog::OpenStack.authenticate(options, @connection_options) @current_user = credentials[:user] @current_tenant = credentials[:tenant] diff --git a/spec/fog/openstack/identity_v3/authv3_a.yml b/spec/fog/openstack/identity_v3/authv3_a.yml new file mode 100644 index 000000000..620e9621b --- /dev/null +++ b/spec/fog/openstack/identity_v3/authv3_a.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 982d38981d9242abb5997063c95b15b8 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:42 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-13T12:39:42.900472Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-13T11:39:42.900505Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:42 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/authv3_b.yml b/spec/fog/openstack/identity_v3/authv3_b.yml new file mode 100644 index 000000000..9d25a71f0 --- /dev/null +++ b/spec/fog/openstack/identity_v3/authv3_b.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","domain":{"id":"default"},"name":"admin"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 94af7a45c62d436e8a12e467bb47cdc2 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:43 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-13T12:39:43.449528Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-13T11:39:43.449571Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:43 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/authv3_c.yml b/spec/fog/openstack/identity_v3/authv3_c.yml new file mode 100644 index 000000000..5689a84c9 --- /dev/null +++ b/spec/fog/openstack/identity_v3/authv3_c.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","domain":{"name":"Default"},"name":"admin"}}},"scope":{"project":{"name":"admin","domain":{"name":"Default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 16b0ac5a0d4242009556deb9b8b21dec + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:44 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-13T12:39:44.013606Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-13T11:39:44.013644Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:44 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/authv3_project.yml b/spec/fog/openstack/identity_v3/authv3_project.yml new file mode 100644 index 000000000..7b1ca11fe --- /dev/null +++ b/spec/fog/openstack/identity_v3/authv3_project.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","domain":{"name":"Default"},"name":"admin"}}},"scope":{"project":{"name":"admin","domain":{"name":"Default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 49335972ad684380b8768871f309872c + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:44 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-13T12:39:44.564162Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-13T11:39:44.564227Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:44 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/authv3_token.yml b/spec/fog/openstack/identity_v3/authv3_token.yml new file mode 100644 index 000000000..b25eb645d --- /dev/null +++ b/spec/fog/openstack/identity_v3/authv3_token.yml @@ -0,0 +1,151 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","domain":{"id":"default"},"name":"demo"}}},"scope":{"project":{"name":"demo","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 6d4d18cad41b4e508b376e8a2c8f0faa + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2255' + Date: + - Fri, 13 Mar 2015 11:39:57 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "9fe2ff9ee4384b1894a90878d3e92bab", + "name": "_member_"}], "expires_at": "2015-03-13T12:39:57.708450Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c9f75b1200f64bf09ed079206a1a1b75", + "name": "demo"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c9f75b1200f64bf09ed079206a1a1b75", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "ac33746004f1470b904e364d408cf42e", "name": "demo"}, "issued_at": "2015-03-13T11:39:57.708522Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:57 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["token"],"token":{"id":"6d4d18cad41b4e508b376e8a2c8f0faa"}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - f78591c26b75454180d20cb818cf6c6e + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2264' + Date: + - Fri, 13 Mar 2015 11:39:57 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["token", "password"], "roles": [{"id": "9fe2ff9ee4384b1894a90878d3e92bab", + "name": "_member_"}], "expires_at": "2015-03-13T12:39:57.708450Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c9f75b1200f64bf09ed079206a1a1b75", + "name": "demo"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c9f75b1200f64bf09ed079206a1a1b75", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "ac33746004f1470b904e364d408cf42e", "name": "demo"}, "issued_at": "2015-03-13T11:39:57.981619Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:58 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["token"],"token":{"id":"blahblahblah"}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '96' + Date: + - Fri, 13 Mar 2015 11:39:58 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find token, blahblahblah.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:58 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/authv3_unscoped.yml b/spec/fog/openstack/identity_v3/authv3_unscoped.yml new file mode 100644 index 000000000..cd629a49f --- /dev/null +++ b/spec/fog/openstack/identity_v3/authv3_unscoped.yml @@ -0,0 +1,334 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 146f478106c447d6aeed2a6a817e697a + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '256' + Date: + - Fri, 20 Mar 2015 13:00:03 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"issued_at": "2015-03-20T13:00:03.391982Z", "extras": + {}, "methods": ["password"], "expires_at": "2015-03-20T14:00:03.391951Z", + "user": {"domain": {"id": "default", "name": "Default"}, "id": "8d5732a0ebd9485396351d74e24c9647", + "name": "admin"}}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:00:03 GMT +- request: + method: get + uri: http://devstack.openstack.stack:5000/v3/users/8d5732a0ebd9485396351d74e24c9647/projects + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 146f478106c447d6aeed2a6a817e697a + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '393' + Date: + - Fri, 20 Mar 2015 13:00:03 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:5000/v3/users/8d5732a0ebd9485396351d74e24c9647/projects", + "previous": null, "next": null}, "projects": [{"description": "Admin Tenant", + "links": {"self": "http://devstack.openstack.stack:5000/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}]}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:00:03 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["token"],"token":{"id":"146f478106c447d6aeed2a6a817e697a"}},"scope":{"project":{"name":"admin","domain":{"name":"Default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 75e465a8e6384a6a9f1e31f58b54e34a + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2263' + Date: + - Fri, 20 Mar 2015 13:00:04 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["token", "password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-20T14:00:03.391951Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-20T13:00:04.578867Z"}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:00:04 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["token"],"token":{"id":"75e465a8e6384a6a9f1e31f58b54e34a"}},"scope":{"project":{"name":"admin","domain":{"name":"Default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 79c7966c1d654e8d88f049675bc44e38 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2263' + Date: + - Fri, 20 Mar 2015 13:00:05 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["token", "password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-20T14:00:03.391951Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-20T13:00:05.207404Z"}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:00:05 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 75e465a8e6384a6a9f1e31f58b54e34a + X-Subject-Token: + - 79c7966c1d654e8d88f049675bc44e38 + response: + status: + code: 200 + message: '' + headers: + X-Subject-Token: + - 79c7966c1d654e8d88f049675bc44e38 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2263' + Date: + - Fri, 20 Mar 2015 13:00:05 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["token", "password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-20T14:00:03.391951Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "interface": "public", "region": "europe", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "interface": "admin", + "region": "europe", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "interface": "internal", "region": "europe", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "interface": + "internal", "region": "europe", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "interface": "public", + "region": "europe", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "interface": "admin", "region": "europe", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "interface": "public", "region": "europe", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "interface": + "public", "region": "europe", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "interface": "admin", "region": "europe", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "interface": "internal", "region": "europe", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-20T13:00:05.207404Z"}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:00:05 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 75e465a8e6384a6a9f1e31f58b54e34a + X-Subject-Token: + - 79c7966c1d654e8d88f049675bc44e38 + response: + status: + code: 200 + message: '' + headers: + X-Subject-Token: + - 79c7966c1d654e8d88f049675bc44e38 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2263' + Date: + - Fri, 20 Mar 2015 13:00:05 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 20 Mar 2015 13:00:05 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 75e465a8e6384a6a9f1e31f58b54e34a + X-Subject-Token: + - random-token + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '96' + Date: + - Fri, 20 Mar 2015 13:00:06 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 20 Mar 2015 13:00:06 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv2_unscoped_token_v3.yml b/spec/fog/openstack/identity_v3/idv2_unscoped_token_v3.yml new file mode 100644 index 000000000..6672e838b --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv2_unscoped_token_v3.yml @@ -0,0 +1,467 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"passwordCredentials":{"username":"admin","password":"openstack"},"tenantName":""}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '329' + Date: + - Fri, 20 Mar 2015 13:23:56 GMT + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2015-03-20T13:23:56.806079", + "expires": "2015-03-20T14:23:56Z", "id": "f39f308ddc2d4d20b2a8041d4cf699ea"}, + "serviceCatalog": [], "user": {"username": "admin", "roles_links": [], "id": + "8d5732a0ebd9485396351d74e24c9647", "roles": [], "name": "admin"}, "metadata": + {"is_admin": 0, "roles": []}}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:56 GMT +- request: + method: get + uri: http://devstack.openstack.stack:5000/v2.0/tenants + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - f39f308ddc2d4d20b2a8041d4cf699ea + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '143' + Date: + - Fri, 20 Mar 2015 13:23:57 GMT + body: + encoding: US-ASCII + string: ! '{"tenants_links": [], "tenants": [{"description": "Admin Tenant", + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "name": "admin"}]}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:57 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"token":{"id":"f39f308ddc2d4d20b2a8041d4cf699ea"},"tenantName":"admin"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1660' + Date: + - Fri, 20 Mar 2015 13:23:57 GMT + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2015-03-20T13:23:57.819264", + "expires": "2015-03-20T14:23:56Z", "id": "fbcee892a88b410597381f780c454d91", + "tenant": {"description": "Admin Tenant", "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"region": "europe", + "publicURL": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], "endpoints_links": [], "type": + "test_stefan", "name": "test_stefan"}, {"endpoints": [{"adminURL": "http://devstack.openstack.stack:9292", + "region": "europe", "internalURL": "http://devstack.openstack.stack:9292", + "id": "0dabc688a031422381d3c92b7dfdfe4c", "publicURL": "http://devstack.openstack.stack:9292"}], + "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": + "http://devstack.openstack.stack:35357/v3", "region": "europe", "internalURL": + "http://devstack.openstack.stack:5000/v3", "id": "7002cfd6dbe74512b0b817d3b7380abb", + "publicURL": "http://devstack.openstack.stack:5000/v3"}], "endpoints_links": + [], "type": "identity_v3", "name": "identity_v3"}, {"endpoints": [{"adminURL": + "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "internalURL": + "http://devstack.openstack.stack:5000/v2.0", "id": "0b4b1e907e184880a1c3f32f00cd676f", + "publicURL": "http://devstack.openstack.stack:5000/v2.0"}], "endpoints_links": + [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", + "roles_links": [], "id": "8d5732a0ebd9485396351d74e24c9647", "roles": [{"name": + "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["7ebef8a2837246eda8f83f96ffb82b2f"]}}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:57 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["token"],"token":{"id":"fbcee892a88b410597381f780c454d91"}},"scope":{"project":{"name":"admin","domain":{"name":"Default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 7d4a3434665948ea8e96dfc6e36f5d80 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2251' + Date: + - Fri, 20 Mar 2015 13:23:58 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["token"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-20T14:23:56.000000Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-20T13:23:58.678113Z"}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:58 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v2.0/tokens/7d4a3434665948ea8e96dfc6e36f5d80 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - fbcee892a88b410597381f780c454d91 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1719' + Date: + - Fri, 20 Mar 2015 13:23:58 GMT + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2015-03-20T13:23:58.891863", + "expires": "2015-03-20T14:23:56Z", "id": "7d4a3434665948ea8e96dfc6e36f5d80", + "tenant": {"domain": {"id": "default", "name": "Default"}, "enabled": true, + "id": "c7767afa57b74f33863a420daba5f57f", "name": "admin"}}, "serviceCatalog": + [{"endpoints": [{"region": "europe", "publicURL": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], "endpoints_links": [], "type": + "test_stefan", "name": "test_stefan"}, {"endpoints": [{"adminURL": "http://devstack.openstack.stack:9292", + "region": "europe", "internalURL": "http://devstack.openstack.stack:9292", + "id": "0dabc688a031422381d3c92b7dfdfe4c", "publicURL": "http://devstack.openstack.stack:9292"}], + "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": + "http://devstack.openstack.stack:35357/v3", "region": "europe", "internalURL": + "http://devstack.openstack.stack:5000/v3", "id": "7002cfd6dbe74512b0b817d3b7380abb", + "publicURL": "http://devstack.openstack.stack:5000/v3"}], "endpoints_links": + [], "type": "identity_v3", "name": "identity_v3"}, {"endpoints": [{"adminURL": + "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "internalURL": + "http://devstack.openstack.stack:5000/v2.0", "id": "0b4b1e907e184880a1c3f32f00cd676f", + "publicURL": "http://devstack.openstack.stack:5000/v2.0"}], "endpoints_links": + [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", + "roles_links": [], "id": "8d5732a0ebd9485396351d74e24c9647", "roles": [{"id": + "7ebef8a2837246eda8f83f96ffb82b2f", "name": "admin"}], "name": "admin"}, "metadata": + {"is_admin": 0, "roles": ["7ebef8a2837246eda8f83f96ffb82b2f"]}}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:58 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v2.0/tokens/7d4a3434665948ea8e96dfc6e36f5d80 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - fbcee892a88b410597381f780c454d91 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1719' + Date: + - Fri, 20 Mar 2015 13:23:59 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:58 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v2.0/tokens/7d4a3434665948ea8e96dfc6e36f5d80?belongsTo=random-tenant-id + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - fbcee892a88b410597381f780c454d91 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 20 Mar 2015 13:23:59 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:59 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"passwordCredentials":{"username":"admin","password":"openstack"},"tenantName":""}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '329' + Date: + - Fri, 20 Mar 2015 13:24:00 GMT + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2015-03-20T13:24:00.106131", + "expires": "2015-03-20T14:24:00Z", "id": "5dbc3fe73cc54ab99b4f0f65a73cd84d"}, + "serviceCatalog": [], "user": {"username": "admin", "roles_links": [], "id": + "8d5732a0ebd9485396351d74e24c9647", "roles": [], "name": "admin"}, "metadata": + {"is_admin": 0, "roles": []}}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:23:59 GMT +- request: + method: get + uri: http://devstack.openstack.stack:5000/v2.0/tenants + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5dbc3fe73cc54ab99b4f0f65a73cd84d + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '143' + Date: + - Fri, 20 Mar 2015 13:24:00 GMT + body: + encoding: US-ASCII + string: ! '{"tenants_links": [], "tenants": [{"description": "Admin Tenant", + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "name": "admin"}]}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:24:00 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"token":{"id":"5dbc3fe73cc54ab99b4f0f65a73cd84d"},"tenantName":"admin"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1660' + Date: + - Fri, 20 Mar 2015 13:24:01 GMT + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2015-03-20T13:24:01.009880", + "expires": "2015-03-20T14:24:00Z", "id": "c06c0016398c4542b38f63ecd8ec0889", + "tenant": {"description": "Admin Tenant", "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"region": "europe", + "publicURL": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], "endpoints_links": [], "type": + "test_stefan", "name": "test_stefan"}, {"endpoints": [{"adminURL": "http://devstack.openstack.stack:9292", + "region": "europe", "internalURL": "http://devstack.openstack.stack:9292", + "id": "0dabc688a031422381d3c92b7dfdfe4c", "publicURL": "http://devstack.openstack.stack:9292"}], + "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": + "http://devstack.openstack.stack:35357/v3", "region": "europe", "internalURL": + "http://devstack.openstack.stack:5000/v3", "id": "7002cfd6dbe74512b0b817d3b7380abb", + "publicURL": "http://devstack.openstack.stack:5000/v3"}], "endpoints_links": + [], "type": "identity_v3", "name": "identity_v3"}, {"endpoints": [{"adminURL": + "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "internalURL": + "http://devstack.openstack.stack:5000/v2.0", "id": "0b4b1e907e184880a1c3f32f00cd676f", + "publicURL": "http://devstack.openstack.stack:5000/v2.0"}], "endpoints_links": + [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", + "roles_links": [], "id": "8d5732a0ebd9485396351d74e24c9647", "roles": [{"name": + "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["7ebef8a2837246eda8f83f96ffb82b2f"]}}}' + http_version: + recorded_at: Fri, 20 Mar 2015 13:24:00 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v2.0/tokens/7d4a3434665948ea8e96dfc6e36f5d80?belongsTo=random-tenant-id + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - c06c0016398c4542b38f63ecd8ec0889 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 20 Mar 2015 13:24:01 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 20 Mar 2015 13:24:01 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3.yml b/spec/fog/openstack/identity_v3/idv3.yml new file mode 100644 index 000000000..210fc40d1 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - d8291e2a2a2046259316f7c2d4253e92 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:42 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-13T12:39:42.184710Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:5000/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:5000/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:5000/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-13T11:39:42.184747Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:42 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_credential.yml b/spec/fog/openstack/identity_v3/idv3_credential.yml new file mode 100644 index 000000000..6bdafa7f1 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_credential.yml @@ -0,0 +1,111 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '126' + Date: + - Fri, 13 Mar 2015 11:40:30 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:30 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '126' + Date: + - Fri, 13 Mar 2015 11:40:31 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:31 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials/atlantis + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '97' + Date: + - Fri, 13 Mar 2015 11:40:31 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find credential, atlantis.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:31 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_credential_crud.yml b/spec/fog/openstack/identity_v3/idv3_credential_crud.yml new file mode 100644 index 000000000..b6d900319 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_credential_crud.yml @@ -0,0 +1,528 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=u-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:40:31 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:31 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/users + body: + encoding: UTF-8 + string: ! '{"user":{"name":"u-foobar","email":"foobar@example.com","password":"s3cret!"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '246' + Date: + - Fri, 13 Mar 2015 11:40:31 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/660d8086a1db41078c0d64fa568db135"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "660d8086a1db41078c0d64fa568db135"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:31 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '834' + Date: + - Fri, 13 Mar 2015 11:40:31 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "Service Tenant", + "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/46c5dbf37d144a98b075c701d02d5336"}, + "enabled": true, "id": "46c5dbf37d144a98b075c701d02d5336", "domain_id": "default", + "name": "service"}, {"description": "Admin Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}, {"description": "Demo Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c9f75b1200f64bf09ed079206a1a1b75"}, + "enabled": true, "id": "c9f75b1200f64bf09ed079206a1a1b75", "domain_id": "default", + "name": "demo"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:31 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '126' + Date: + - Fri, 13 Mar 2015 11:40:31 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:31 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '126' + Date: + - Fri, 13 Mar 2015 11:40:32 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:32 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/credentials + body: + encoding: UTF-8 + string: ! '{"credential":{"type":"ec2","project_id":"46c5dbf37d144a98b075c701d02d5336","user_id":"660d8086a1db41078c0d64fa568db135","blob":"{\"access\":\"9c4e774a-f644-498f-90c4-970b3f817fc5\",\"secret\":\"7e084117-b13d-4656-9eca-85376b690897\"}"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '459' + Date: + - Fri, 13 Mar 2015 11:40:32 GMT + body: + encoding: US-ASCII + string: ! '{"credential": {"user_id": "660d8086a1db41078c0d64fa568db135", "links": + {"self": "http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}, + "blob": "{\"access\":\"9c4e774a-f644-498f-90c4-970b3f817fc5\",\"secret\":\"7e084117-b13d-4656-9eca-85376b690897\"}", + "project_id": "46c5dbf37d144a98b075c701d02d5336", "type": "ec2", "id": "9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:32 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '569' + Date: + - Fri, 13 Mar 2015 11:40:32 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [{"user_id": "660d8086a1db41078c0d64fa568db135", + "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}, + "blob": "{\"access\":\"9c4e774a-f644-498f-90c4-970b3f817fc5\",\"secret\":\"7e084117-b13d-4656-9eca-85376b690897\"}", + "project_id": "46c5dbf37d144a98b075c701d02d5336", "type": "ec2", "id": "9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}], + "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:32 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae + body: + encoding: UTF-8 + string: ! '{"credential":{"blob":"{\"access\":\"9c4e774a-f644-498f-90c4-970b3f817fc5\",\"secret\":\"62307bcd-ca3c-47ae-a114-27a6cadb5bc9\"}"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '459' + Date: + - Fri, 13 Mar 2015 11:40:32 GMT + body: + encoding: US-ASCII + string: ! '{"credential": {"user_id": "660d8086a1db41078c0d64fa568db135", "links": + {"self": "http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}, + "blob": "{\"access\":\"9c4e774a-f644-498f-90c4-970b3f817fc5\",\"secret\":\"62307bcd-ca3c-47ae-a114-27a6cadb5bc9\"}", + "project_id": "46c5dbf37d144a98b075c701d02d5336", "type": "ec2", "id": "9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:32 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '569' + Date: + - Fri, 13 Mar 2015 11:40:32 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [{"user_id": "660d8086a1db41078c0d64fa568db135", + "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}, + "blob": "{\"access\":\"9c4e774a-f644-498f-90c4-970b3f817fc5\",\"secret\":\"62307bcd-ca3c-47ae-a114-27a6cadb5bc9\"}", + "project_id": "46c5dbf37d144a98b075c701d02d5336", "type": "ec2", "id": "9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}], + "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:32 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '569' + Date: + - Fri, 13 Mar 2015 11:40:32 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [{"user_id": "660d8086a1db41078c0d64fa568db135", + "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}, + "blob": "{\"access\":\"9c4e774a-f644-498f-90c4-970b3f817fc5\",\"secret\":\"62307bcd-ca3c-47ae-a114-27a6cadb5bc9\"}", + "project_id": "46c5dbf37d144a98b075c701d02d5336", "type": "ec2", "id": "9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae"}], + "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:32 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:33 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:33 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '126' + Date: + - Fri, 13 Mar 2015 11:40:33 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:33 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials/9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '153' + Date: + - Fri, 13 Mar 2015 11:40:33 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find credential, 9e7bb4e633cc08cc863fe15351911e267f2a953b24c1a80f0f35e173303bafae.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:33 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/credentials?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '126' + Date: + - Fri, 13 Mar 2015 11:40:33 GMT + body: + encoding: US-ASCII + string: ! '{"credentials": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/credentials", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:33 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_domain.yml b/spec/fog/openstack/identity_v3/idv3_domain.yml new file mode 100644 index 000000000..099ae9a09 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_domain.yml @@ -0,0 +1,195 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:40:00 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:00 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:40:00 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:00 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:40:00 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:00 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:40:01 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:01 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains/atlantis + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '93' + Date: + - Fri, 13 Mar 2015 11:40:01 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find domain, atlantis.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:01 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_domain_crud.yml b/spec/fog/openstack/identity_v3/idv3_domain_crud.yml new file mode 100644 index 000000000..2267091bb --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_domain_crud.yml @@ -0,0 +1,686 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:23 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "The request you have made requires authentication.", + "code": 401, "title": "Unauthorized"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:23 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Mon, 23 Mar 2015 09:25:23 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-23T10:25:23.470130Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-23T09:25:23.470157Z"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:23 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '299' + Date: + - Mon, 23 Mar 2015 09:25:23 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"enabled": true, "id": "ba65992194244fab9373e54a1633875a", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/ba65992194244fab9373e54a1633875a"}, + "name": "foobar"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:23 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/domains/ba65992194244fab9373e54a1633875a + body: + encoding: UTF-8 + string: ! '{"domain":{"enabled":false}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '194' + Date: + - Mon, 23 Mar 2015 09:25:23 GMT + body: + encoding: US-ASCII + string: ! '{"domain": {"enabled": false, "id": "ba65992194244fab9373e54a1633875a", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/ba65992194244fab9373e54a1633875a"}, + "name": "foobar"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:23 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/domains/ba65992194244fab9373e54a1633875a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:23 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:23 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '118' + Date: + - Mon, 23 Mar 2015 09:25:24 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:24 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '118' + Date: + - Mon, 23 Mar 2015 09:25:24 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:24 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '118' + Date: + - Mon, 23 Mar 2015 09:25:24 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:24 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/domains + body: + encoding: UTF-8 + string: ! '{"domain":{"name":"foobar"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '193' + Date: + - Mon, 23 Mar 2015 09:25:24 GMT + body: + encoding: US-ASCII + string: ! '{"domain": {"enabled": true, "id": "0308bdfa443d4e88934803de4346fa9c", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c"}, + "name": "foobar"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:24 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '299' + Date: + - Mon, 23 Mar 2015 09:25:24 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"enabled": true, "id": "0308bdfa443d4e88934803de4346fa9c", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c"}, + "name": "foobar"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:24 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c + body: + encoding: UTF-8 + string: ! '{"domain":{"name":"baz","enabled":false}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '191' + Date: + - Mon, 23 Mar 2015 09:25:25 GMT + body: + encoding: US-ASCII + string: ! '{"domain": {"enabled": false, "id": "0308bdfa443d4e88934803de4346fa9c", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c"}, + "name": "baz"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '297' + Date: + - Mon, 23 Mar 2015 09:25:25 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"enabled": false, "id": "0308bdfa443d4e88934803de4346fa9c", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c"}, + "name": "baz"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '518' + Date: + - Mon, 23 Mar 2015 09:25:25 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"enabled": false, "id": "0308bdfa443d4e88934803de4346fa9c", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c"}, + "name": "baz"}, {"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:25 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:25 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Mon, 23 Mar 2015 09:25:25 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains/0308bdfa443d4e88934803de4346fa9c + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '117' + Date: + - Mon, 23 Mar 2015 09:25:25 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find domain, 0308bdfa443d4e88934803de4346fa9c.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '118' + Date: + - Mon, 23 Mar 2015 09:25:26 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 5c8be712c59844cb9ba0ddef957a3005 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '118' + Date: + - Mon, 23 Mar 2015 09:25:26 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/domains", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:26 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml b/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml new file mode 100644 index 000000000..8cb13085d --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml @@ -0,0 +1,906 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:40:06 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:06 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:40:06 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:06 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/domains + body: + encoding: UTF-8 + string: ! '{"domain":{"name":"d-foobar"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '195' + Date: + - Fri, 13 Mar 2015 11:40:06 GMT + body: + encoding: US-ASCII + string: ! '{"domain": {"enabled": true, "id": "a65c38b2bcd44efbadc75de42eb59a88", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88"}, + "name": "d-foobar"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:06 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Fri, 13 Mar 2015 11:40:06 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:06 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/groups + body: + encoding: UTF-8 + string: ! '{"group":{"name":"g-foobar","description":"Group of Foobar users","domain_id":"a65c38b2bcd44efbadc75de42eb59a88"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '265' + Date: + - Fri, 13 Mar 2015 11:40:06 GMT + body: + encoding: US-ASCII + string: ! '{"group": {"domain_id": "a65c38b2bcd44efbadc75de42eb59a88", "description": + "Group of Foobar users", "id": "e422a0ebad2f442dadabaf7ee63a1ccb", "links": + {"self": "http://devstack.openstack.stack:35357/v3/groups/e422a0ebad2f442dadabaf7ee63a1ccb"}, + "name": "g-foobar"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:06 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=u-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:40:07 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:07 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/users + body: + encoding: UTF-8 + string: ! '{"user":{"name":"u-foobar","email":"foobar@example.com","password":"s3cret!","domain_id":"a65c38b2bcd44efbadc75de42eb59a88"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '271' + Date: + - Fri, 13 Mar 2015 11:40:07 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/75ef67037d524192ba73e14ee1ec6299"}, + "domain_id": "a65c38b2bcd44efbadc75de42eb59a88", "enabled": true, "email": + "foobar@example.com", "id": "75ef67037d524192ba73e14ee1ec6299"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:07 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/users/75ef67037d524192ba73e14ee1ec6299/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '194' + Date: + - Fri, 13 Mar 2015 11:40:07 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/users/75ef67037d524192ba73e14ee1ec6299/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:07 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '514' + Date: + - Fri, 13 Mar 2015 11:40:07 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:07 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/roles + body: + encoding: UTF-8 + string: ! '{"role":{"name":"foobar_role"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '177' + Date: + - Fri, 13 Mar 2015 11:40:07 GMT + body: + encoding: US-ASCII + string: ! '{"role": {"id": "aa0ca3d1b00e45efbd22dfb213bc8018", "links": {"self": + "http://devstack.openstack.stack:35357/v3/roles/aa0ca3d1b00e45efbd22dfb213bc8018"}, + "name": "foobar_role"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:07 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/groups/e422a0ebad2f442dadabaf7ee63a1ccb/roles/aa0ca3d1b00e45efbd22dfb213bc8018 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:07 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:07 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/groups/e422a0ebad2f442dadabaf7ee63a1ccb/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '362' + Date: + - Fri, 13 Mar 2015 11:40:08 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/groups/e422a0ebad2f442dadabaf7ee63a1ccb/roles", + "previous": null, "next": null}, "roles": [{"id": "aa0ca3d1b00e45efbd22dfb213bc8018", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/aa0ca3d1b00e45efbd22dfb213bc8018"}, + "name": "foobar_role"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:08 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/users/75ef67037d524192ba73e14ee1ec6299/roles/aa0ca3d1b00e45efbd22dfb213bc8018 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Fri, 13 Mar 2015 11:40:08 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:08 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?effective=true&page=1&per_page=30&user.id=75ef67037d524192ba73e14ee1ec6299 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '136' + Date: + - Fri, 13 Mar 2015 11:40:08 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:08 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/groups/e422a0ebad2f442dadabaf7ee63a1ccb/users/75ef67037d524192ba73e14ee1ec6299 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:08 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:08 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/users/75ef67037d524192ba73e14ee1ec6299/roles/aa0ca3d1b00e45efbd22dfb213bc8018 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Fri, 13 Mar 2015 11:40:09 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:09 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?effective=true&page=1&per_page=30&user.id=75ef67037d524192ba73e14ee1ec6299 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '631' + Date: + - Fri, 13 Mar 2015 11:40:09 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [{"scope": {"domain": {"id": "a65c38b2bcd44efbadc75de42eb59a88"}}, + "role": {"id": "aa0ca3d1b00e45efbd22dfb213bc8018"}, "user": {"id": "75ef67037d524192ba73e14ee1ec6299"}, + "links": {"assignment": "http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/groups/e422a0ebad2f442dadabaf7ee63a1ccb/roles/aa0ca3d1b00e45efbd22dfb213bc8018", + "membership": "http://devstack.openstack.stack:35357/v3/groups/e422a0ebad2f442dadabaf7ee63a1ccb/users/75ef67037d524192ba73e14ee1ec6299"}}], + "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:09 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?group.id=e422a0ebad2f442dadabaf7ee63a1ccb&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '495' + Date: + - Fri, 13 Mar 2015 11:40:09 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [{"role": {"id": "aa0ca3d1b00e45efbd22dfb213bc8018"}, + "group": {"id": "e422a0ebad2f442dadabaf7ee63a1ccb"}, "links": {"assignment": + "http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/groups/e422a0ebad2f442dadabaf7ee63a1ccb/roles/aa0ca3d1b00e45efbd22dfb213bc8018"}, + "scope": {"domain": {"id": "a65c38b2bcd44efbadc75de42eb59a88"}}}], "links": + {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", "previous": + null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:09 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88/groups/e422a0ebad2f442dadabaf7ee63a1ccb/roles/aa0ca3d1b00e45efbd22dfb213bc8018 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:09 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:09 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?effective=true&page=1&per_page=30&user.id=75ef67037d524192ba73e14ee1ec6299 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '136' + Date: + - Fri, 13 Mar 2015 11:40:09 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:09 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/users/75ef67037d524192ba73e14ee1ec6299 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:09 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:09 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/groups/e422a0ebad2f442dadabaf7ee63a1ccb + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:10 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:10 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/roles/aa0ca3d1b00e45efbd22dfb213bc8018 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:10 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:10 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88 + body: + encoding: UTF-8 + string: ! '{"domain":{"enabled":false}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '196' + Date: + - Fri, 13 Mar 2015 11:40:10 GMT + body: + encoding: US-ASCII + string: ! '{"domain": {"enabled": false, "id": "a65c38b2bcd44efbadc75de42eb59a88", + "links": {"self": "http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88"}, + "name": "d-foobar"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:10 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/domains/a65c38b2bcd44efbadc75de42eb59a88 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:10 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:10 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml b/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml new file mode 100644 index 000000000..27fb9ba84 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml @@ -0,0 +1,505 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:40:03 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:03 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/users + body: + encoding: UTF-8 + string: ! '{"user":{"name":"foobar","email":"foobar@example.com","password":"s3cret!"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '244' + Date: + - Fri, 13 Mar 2015 11:40:03 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/69cbfbf7de024d2ea6fc5a4695793b9e"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "69cbfbf7de024d2ea6fc5a4695793b9e"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:04 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '169' + Date: + - Fri, 13 Mar 2015 11:40:04 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:04 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '514' + Date: + - Fri, 13 Mar 2015 11:40:04 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:04 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/roles + body: + encoding: UTF-8 + string: ! '{"role":{"name":"foobar_role"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '177' + Date: + - Fri, 13 Mar 2015 11:40:04 GMT + body: + encoding: US-ASCII + string: ! '{"role": {"id": "c801a2f5f30f4aaca684ef0311e8529a", "links": {"self": + "http://devstack.openstack.stack:35357/v3/roles/c801a2f5f30f4aaca684ef0311e8529a"}, + "name": "foobar_role"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:04 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles/c801a2f5f30f4aaca684ef0311e8529a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:04 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:04 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '336' + Date: + - Fri, 13 Mar 2015 11:40:04 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles", + "previous": null, "next": null}, "roles": [{"id": "c801a2f5f30f4aaca684ef0311e8529a", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/c801a2f5f30f4aaca684ef0311e8529a"}, + "name": "foobar_role"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:04 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?page=1&per_page=30&user.id=69cbfbf7de024d2ea6fc5a4695793b9e + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '443' + Date: + - Fri, 13 Mar 2015 11:40:05 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [{"scope": {"domain": {"id": "default"}}, "role": + {"id": "c801a2f5f30f4aaca684ef0311e8529a"}, "user": {"id": "69cbfbf7de024d2ea6fc5a4695793b9e"}, + "links": {"assignment": "http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles/c801a2f5f30f4aaca684ef0311e8529a"}}], + "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:05 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '443' + Date: + - Fri, 13 Mar 2015 11:40:05 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [{"scope": {"domain": {"id": "default"}}, "role": + {"id": "c801a2f5f30f4aaca684ef0311e8529a"}, "user": {"id": "69cbfbf7de024d2ea6fc5a4695793b9e"}, + "links": {"assignment": "http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles/c801a2f5f30f4aaca684ef0311e8529a"}}], + "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:05 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles/c801a2f5f30f4aaca684ef0311e8529a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:05 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:05 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles/c801a2f5f30f4aaca684ef0311e8529a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:05 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:05 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/domains/default/users/69cbfbf7de024d2ea6fc5a4695793b9e/roles/c801a2f5f30f4aaca684ef0311e8529a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Fri, 13 Mar 2015 11:40:05 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:05 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/users/69cbfbf7de024d2ea6fc5a4695793b9e + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:05 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:05 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/roles/c801a2f5f30f4aaca684ef0311e8529a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:05 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:05 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_endpoint.yml b/spec/fog/openstack/identity_v3/idv3_endpoint.yml new file mode 100644 index 000000000..31ace1bca --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_endpoint.yml @@ -0,0 +1,303 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Fri, 13 Mar 2015 11:40:27 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:27 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Fri, 13 Mar 2015 11:40:28 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Fri, 13 Mar 2015 11:40:28 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Fri, 13 Mar 2015 11:40:28 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints/atlantis + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '95' + Date: + - Fri, 13 Mar 2015 11:40:28 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find endpoint, atlantis.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:28 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml b/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml new file mode 100644 index 000000000..6500fa776 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml @@ -0,0 +1,718 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:40 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "The request you have made requires authentication.", + "code": 401, "title": "Unauthorized"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:40 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Mon, 23 Mar 2015 09:25:41 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-23T10:25:41.056565Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-23T09:25:41.056603Z"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:41 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Mon, 23 Mar 2015 09:25:41 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:41 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Mon, 23 Mar 2015 09:25:41 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:41 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Mon, 23 Mar 2015 09:25:41 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:41 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/endpoints + body: + encoding: UTF-8 + string: ! '{"endpoint":{"service_id":"8e53f1d389df4059aeab1acfece2fc66","interface":"internal","name":"foobar","url":"http://example.com/foobar","enabled":false}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '325' + Date: + - Mon, 23 Mar 2015 09:25:41 GMT + body: + encoding: US-ASCII + string: ! '{"endpoint": {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1"}, + "url": "http://example.com/foobar", "region": null, "enabled": false, "interface": + "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", "id": "6630d6372db34df7a82c6584fe6c99a1"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:41 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?interface=internal&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1368' + Date: + - Mon, 23 Mar 2015 09:25:41 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"name": "foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1"}, + "url": "http://example.com/foobar", "region": null, "enabled": false, "interface": + "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", "id": "6630d6372db34df7a82c6584fe6c99a1"}, + {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:41 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1 + body: + encoding: UTF-8 + string: ! '{"endpoint":{"name":"baz","url":"http://example.com/baz"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '319' + Date: + - Mon, 23 Mar 2015 09:25:42 GMT + body: + encoding: US-ASCII + string: ! '{"endpoint": {"name": "baz", "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1"}, + "url": "http://example.com/baz", "region": null, "enabled": false, "interface": + "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", "id": "6630d6372db34df7a82c6584fe6c99a1"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:42 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?interface=internal&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1362' + Date: + - Mon, 23 Mar 2015 09:25:42 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"name": "baz", "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1"}, + "url": "http://example.com/baz", "region": null, "enabled": false, "interface": + "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", "id": "6630d6372db34df7a82c6584fe6c99a1"}, + {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:42 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3528' + Date: + - Mon, 23 Mar 2015 09:25:42 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"name": "baz", "links": {"self": + "http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1"}, + "url": "http://example.com/baz", "region": null, "enabled": false, "interface": + "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", "id": "6630d6372db34df7a82c6584fe6c99a1"}, + {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:42 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:42 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:42 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Mon, 23 Mar 2015 09:25:42 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:42 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints/6630d6372db34df7a82c6584fe6c99a1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '119' + Date: + - Mon, 23 Mar 2015 09:25:43 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find endpoint, 6630d6372db34df7a82c6584fe6c99a1.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:43 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/endpoints?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 8e8b1b7d7ab442e087c448bf5b91c255 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '3221' + Date: + - Mon, 23 Mar 2015 09:25:43 GMT + body: + encoding: US-ASCII + string: ! '{"endpoints": [{"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0b4b1e907e184880a1c3f32f00cd676f"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "public", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "0b4b1e907e184880a1c3f32f00cd676f"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/0dabc688a031422381d3c92b7dfdfe4c"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "public", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/3387dfbf7bc440728e7aa1488f6ca96e"}, + "url": "http://localhost/testurl/$(tenant_id)s", "region": "europe", "enabled": + true, "interface": "public", "service_id": "d36a1f72832b428688b7dae7d0ab8a39", + "id": "3387dfbf7bc440728e7aa1488f6ca96e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/53d872f1c5d04f35ac69509e41600c0b"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/67aa3eedc510444faadb9ef3c7e8b2e4"}, + "url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "8e53f1d389df4059aeab1acfece2fc66", + "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/7002cfd6dbe74512b0b817d3b7380abb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "7002cfd6dbe74512b0b817d3b7380abb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/768f3eb8b29d49a19c4d50a85541d42e"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a0c5556c80e448aca907a3ee785bd602"}, + "url": "http://devstack.openstack.stack:9292", "region": "europe", "enabled": + true, "interface": "internal", "service_id": "ee073ec39e804cca96d2440d8f109932", + "id": "a0c5556c80e448aca907a3ee785bd602"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/a7c634aa7f034284b62ddf974ddc04eb"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "public", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints/cba56e3e7a9c4ddfb39e1e4053bd04ab"}, + "url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "enabled": + true, "interface": "admin", "service_id": "a47e0f0014fa409993cef0bd984a5ac6", + "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/endpoints", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:43 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml b/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml new file mode 100644 index 000000000..b8a50006b --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml @@ -0,0 +1,975 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Fri, 13 Mar 2015 11:39:51 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:51 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Fri, 13 Mar 2015 11:39:51 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:51 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/groups + body: + encoding: UTF-8 + string: ! '{"group":{"name":"foobar","description":"Group of Foobar users"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '238' + Date: + - Fri, 13 Mar 2015 11:39:51 GMT + body: + encoding: US-ASCII + string: ! '{"group": {"domain_id": "default", "description": "Group of Foobar + users", "id": "8f298c0da6a744bf9440540132fc8709", "links": {"self": "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709"}, + "name": "foobar"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:51 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '343' + Date: + - Fri, 13 Mar 2015 11:39:51 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": + "Group of Foobar users", "id": "8f298c0da6a744bf9440540132fc8709", "links": + {"self": "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709"}, + "name": "foobar"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:51 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709 + body: + encoding: UTF-8 + string: ! '{"group":{"name":"baz","description":"Group of Baz users"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '232' + Date: + - Fri, 13 Mar 2015 11:39:52 GMT + body: + encoding: US-ASCII + string: ! '{"group": {"domain_id": "default", "description": "Group of Baz users", + "id": "8f298c0da6a744bf9440540132fc8709", "links": {"self": "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709"}, + "name": "baz"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:52 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:39:52 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": + "Group of Baz users", "id": "8f298c0da6a744bf9440540132fc8709", "links": {"self": + "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709"}, + "name": "baz"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:52 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Fri, 13 Mar 2015 11:39:52 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": + "Group of Baz users", "id": "8f298c0da6a744bf9440540132fc8709", "links": {"self": + "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709"}, + "name": "baz"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:52 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/users + body: + encoding: UTF-8 + string: ! '{"user":{"name":"foobar1","email":"foobar1@example.com","password":"s3cret!1"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '246' + Date: + - Fri, 13 Mar 2015 11:39:52 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "foobar1", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/975c312e54354059984fb7f8e8483cae"}, + "domain_id": "default", "enabled": true, "email": "foobar1@example.com", "id": + "975c312e54354059984fb7f8e8483cae"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:52 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/users + body: + encoding: UTF-8 + string: ! '{"user":{"name":"foobar2","email":"foobar2@example.com","password":"s3cret!2"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '246' + Date: + - Fri, 13 Mar 2015 11:39:52 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "foobar2", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/538e1793b93248f7be2e92524978011c"}, + "domain_id": "default", "enabled": true, "email": "foobar2@example.com", "id": + "538e1793b93248f7be2e92524978011c"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:52 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/975c312e54354059984fb7f8e8483cae/groups + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '155' + Date: + - Fri, 13 Mar 2015 11:39:53 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/users/975c312e54354059984fb7f8e8483cae/groups", + "previous": null, "next": null}, "groups": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:53 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '154' + Date: + - Fri, 13 Mar 2015 11:39:53 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:53 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users/975c312e54354059984fb7f8e8483cae + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:53 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:53 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/975c312e54354059984fb7f8e8483cae/groups + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '376' + Date: + - Fri, 13 Mar 2015 11:39:53 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/users/975c312e54354059984fb7f8e8483cae/groups", + "previous": null, "next": null}, "groups": [{"domain_id": "default", "description": + "Group of Baz users", "id": "8f298c0da6a744bf9440540132fc8709", "links": {"self": + "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709"}, + "name": "baz"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:53 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users/975c312e54354059984fb7f8e8483cae + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:53 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:53 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users/538e1793b93248f7be2e92524978011c + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:54 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:54 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '628' + Date: + - Fri, 13 Mar 2015 11:39:54 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "foobar2", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/538e1793b93248f7be2e92524978011c"}, + "domain_id": "default", "enabled": true, "email": "foobar2@example.com", "id": + "538e1793b93248f7be2e92524978011c"}, {"name": "foobar1", "links": {"self": + "http://devstack.openstack.stack:35357/v3/users/975c312e54354059984fb7f8e8483cae"}, + "domain_id": "default", "enabled": true, "email": "foobar1@example.com", "id": + "975c312e54354059984fb7f8e8483cae"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:54 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users/975c312e54354059984fb7f8e8483cae + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:54 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:54 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users/975c312e54354059984fb7f8e8483cae + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '84' + Date: + - Fri, 13 Mar 2015 11:39:54 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:54 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '390' + Date: + - Fri, 13 Mar 2015 11:39:54 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "foobar2", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/538e1793b93248f7be2e92524978011c"}, + "domain_id": "default", "enabled": true, "email": "foobar2@example.com", "id": + "538e1793b93248f7be2e92524978011c"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:54 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/users/975c312e54354059984fb7f8e8483cae + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:55 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:55 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/users/538e1793b93248f7be2e92524978011c + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:55 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:55 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users/538e1793b93248f7be2e92524978011c + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Fri, 13 Mar 2015 11:39:55 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:55 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '154' + Date: + - Fri, 13 Mar 2015 11:39:55 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:55 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:55 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:55 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Fri, 13 Mar 2015 11:39:56 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:56 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups/8f298c0da6a744bf9440540132fc8709 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Fri, 13 Mar 2015 11:39:56 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find group, 8f298c0da6a744bf9440540132fc8709.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:56 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Fri, 13 Mar 2015 11:39:56 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:56 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_policy.yml b/spec/fog/openstack/identity_v3/idv3_policy.yml new file mode 100644 index 000000000..2401a7632 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_policy.yml @@ -0,0 +1,147 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Fri, 13 Mar 2015 11:40:33 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:33 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Fri, 13 Mar 2015 11:40:33 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:33 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Fri, 13 Mar 2015 11:40:34 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:34 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies/atlantis + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '93' + Date: + - Fri, 13 Mar 2015 11:40:34 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find policy, atlantis.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:34 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_policy_crud.yml b/spec/fog/openstack/identity_v3/idv3_policy_crud.yml new file mode 100644 index 000000000..b6fe88eff --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_policy_crud.yml @@ -0,0 +1,368 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Fri, 13 Mar 2015 11:40:34 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:34 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/policies + body: + encoding: UTF-8 + string: ! '{"policy":{"type":"application/json","blob":"{\"foobar_user\":[\"role:compute-user\"]}"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '240' + Date: + - Fri, 13 Mar 2015 11:40:34 GMT + body: + encoding: US-ASCII + string: ! '{"policy": {"type": "application/json", "id": "ba1d80e5632346f1847b585eea231de2", + "links": {"self": "http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2"}, + "blob": "{\"foobar_user\":[\"role:compute-user\"]}"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:34 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '348' + Date: + - Fri, 13 Mar 2015 11:40:34 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": [{"type": "application/json", + "id": "ba1d80e5632346f1847b585eea231de2", "links": {"self": "http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2"}, + "blob": "{\"foobar_user\":[\"role:compute-user\"]}"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:34 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2 + body: + encoding: UTF-8 + string: ! '{"policy":{"blob":"{\"baz_user\":[\"role:compute-user\"]}"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '237' + Date: + - Fri, 13 Mar 2015 11:40:34 GMT + body: + encoding: US-ASCII + string: ! '{"policy": {"type": "application/json", "id": "ba1d80e5632346f1847b585eea231de2", + "links": {"self": "http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2"}, + "blob": "{\"baz_user\":[\"role:compute-user\"]}"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:34 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '345' + Date: + - Fri, 13 Mar 2015 11:40:35 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": [{"type": "application/json", + "id": "ba1d80e5632346f1847b585eea231de2", "links": {"self": "http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2"}, + "blob": "{\"baz_user\":[\"role:compute-user\"]}"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '345' + Date: + - Fri, 13 Mar 2015 11:40:35 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": [{"type": "application/json", + "id": "ba1d80e5632346f1847b585eea231de2", "links": {"self": "http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2"}, + "blob": "{\"baz_user\":[\"role:compute-user\"]}"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:35 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:40:35 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Fri, 13 Mar 2015 11:40:35 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies/ba1d80e5632346f1847b585eea231de2 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '117' + Date: + - Fri, 13 Mar 2015 11:40:35 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find policy, ba1d80e5632346f1847b585eea231de2.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/policies?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Fri, 13 Mar 2015 11:40:35 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/policies", + "previous": null, "next": null}, "policies": []}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:35 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_project.yml b/spec/fog/openstack/identity_v3/idv3_project.yml new file mode 100644 index 000000000..d9a5d4142 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_project.yml @@ -0,0 +1,211 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '834' + Date: + - Fri, 13 Mar 2015 11:40:13 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "Service Tenant", + "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/46c5dbf37d144a98b075c701d02d5336"}, + "enabled": true, "id": "46c5dbf37d144a98b075c701d02d5336", "domain_id": "default", + "name": "service"}, {"description": "Admin Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}, {"description": "Demo Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c9f75b1200f64bf09ed079206a1a1b75"}, + "enabled": true, "id": "c9f75b1200f64bf09ed079206a1a1b75", "domain_id": "default", + "name": "demo"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:13 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '834' + Date: + - Fri, 13 Mar 2015 11:40:13 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "Service Tenant", + "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/46c5dbf37d144a98b075c701d02d5336"}, + "enabled": true, "id": "46c5dbf37d144a98b075c701d02d5336", "domain_id": "default", + "name": "service"}, {"description": "Admin Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}, {"description": "Demo Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c9f75b1200f64bf09ed079206a1a1b75"}, + "enabled": true, "id": "c9f75b1200f64bf09ed079206a1a1b75", "domain_id": "default", + "name": "demo"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:13 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '834' + Date: + - Fri, 13 Mar 2015 11:40:14 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "Service Tenant", + "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/46c5dbf37d144a98b075c701d02d5336"}, + "enabled": true, "id": "46c5dbf37d144a98b075c701d02d5336", "domain_id": "default", + "name": "service"}, {"description": "Admin Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}, {"description": "Demo Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c9f75b1200f64bf09ed079206a1a1b75"}, + "enabled": true, "id": "c9f75b1200f64bf09ed079206a1a1b75", "domain_id": "default", + "name": "demo"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:14 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '834' + Date: + - Fri, 13 Mar 2015 11:40:14 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "Service Tenant", + "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/46c5dbf37d144a98b075c701d02d5336"}, + "enabled": true, "id": "46c5dbf37d144a98b075c701d02d5336", "domain_id": "default", + "name": "service"}, {"description": "Admin Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}, {"description": "Demo Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c9f75b1200f64bf09ed079206a1a1b75"}, + "enabled": true, "id": "c9f75b1200f64bf09ed079206a1a1b75", "domain_id": "default", + "name": "demo"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:14 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/atlantis + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '94' + Date: + - Fri, 13 Mar 2015 11:40:14 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find project, atlantis.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:14 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_project_crud.yml b/spec/fog/openstack/identity_v3/idv3_project_crud.yml new file mode 100644 index 000000000..49860e4f1 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_project_crud.yml @@ -0,0 +1,663 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:26:20 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "The request you have made requires authentication.", + "code": 401, "title": "Unauthorized"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:20 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Mon, 23 Mar 2015 09:26:20 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-23T10:26:20.490423Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-23T09:26:20.490451Z"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:20 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/domains?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '337' + Date: + - Mon, 23 Mar 2015 09:26:20 GMT + body: + encoding: US-ASCII + string: ! '{"domains": [{"links": {"self": "http://devstack.openstack.stack:35357/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:35357/v3/domains", "previous": null, "next": + null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:20 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:26:20 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:20 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:26:21 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:20 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:26:21 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:21 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:26:21 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:21 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/projects + body: + encoding: UTF-8 + string: ! '{"project":{"name":"p-foobar"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '240' + Date: + - Mon, 23 Mar 2015 09:26:21 GMT + body: + encoding: US-ASCII + string: ! '{"project": {"description": "", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16"}, + "enabled": true, "id": "396f6765ab5742ce81551e5f3c814d16", "domain_id": "default", + "name": "p-foobar"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:21 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '347' + Date: + - Mon, 23 Mar 2015 09:26:21 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "", "links": + {"self": "http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16"}, + "enabled": true, "id": "396f6765ab5742ce81551e5f3c814d16", "domain_id": "default", + "name": "p-foobar"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:21 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16 + body: + encoding: UTF-8 + string: ! '{"project":{"name":"p-baz","enabled":false}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '251' + Date: + - Mon, 23 Mar 2015 09:26:21 GMT + body: + encoding: US-ASCII + string: ! '{"project": {"description": "", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16"}, + "extra": {}, "enabled": false, "id": "396f6765ab5742ce81551e5f3c814d16", "domain_id": + "default", "name": "p-baz"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:21 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '345' + Date: + - Mon, 23 Mar 2015 09:26:22 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "", "links": + {"self": "http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16"}, + "enabled": false, "id": "396f6765ab5742ce81551e5f3c814d16", "domain_id": "default", + "name": "p-baz"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1061' + Date: + - Mon, 23 Mar 2015 09:26:22 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "", "links": + {"self": "http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16"}, + "enabled": false, "id": "396f6765ab5742ce81551e5f3c814d16", "domain_id": "default", + "name": "p-baz"}, {"description": "Service Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/46c5dbf37d144a98b075c701d02d5336"}, + "enabled": true, "id": "46c5dbf37d144a98b075c701d02d5336", "domain_id": "default", + "name": "service"}, {"description": "Admin Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}, {"description": "Demo Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c9f75b1200f64bf09ed079206a1a1b75"}, + "enabled": true, "id": "c9f75b1200f64bf09ed079206a1a1b75", "domain_id": "default", + "name": "demo"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:22 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:26:22 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '834' + Date: + - Mon, 23 Mar 2015 09:26:22 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": [{"description": "Service Tenant", + "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/46c5dbf37d144a98b075c701d02d5336"}, + "enabled": true, "id": "46c5dbf37d144a98b075c701d02d5336", "domain_id": "default", + "name": "service"}, {"description": "Admin Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c7767afa57b74f33863a420daba5f57f"}, + "enabled": true, "id": "c7767afa57b74f33863a420daba5f57f", "domain_id": "default", + "name": "admin"}, {"description": "Demo Tenant", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/c9f75b1200f64bf09ed079206a1a1b75"}, + "enabled": true, "id": "c9f75b1200f64bf09ed079206a1a1b75", "domain_id": "default", + "name": "demo"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/396f6765ab5742ce81551e5f3c814d16 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '118' + Date: + - Mon, 23 Mar 2015 09:26:22 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find project, 396f6765ab5742ce81551e5f3c814d16.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:26:22 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 2bb3096cd7654937ba0748ed3012cfd5 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:26:23 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:26:23 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml b/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml new file mode 100644 index 000000000..2b7422185 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml @@ -0,0 +1,1378 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:31 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "The request you have made requires authentication.", + "code": 401, "title": "Unauthorized"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:31 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Mon, 23 Mar 2015 09:25:32 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-23T10:25:32.124999Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-23T09:25:32.125027Z"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:32 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:25:32 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:32 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects?name=p-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '120' + Date: + - Mon, 23 Mar 2015 09:25:32 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:32 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/projects + body: + encoding: UTF-8 + string: ! '{"project":{"name":"p-foobar"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '240' + Date: + - Mon, 23 Mar 2015 09:25:32 GMT + body: + encoding: US-ASCII + string: ! '{"project": {"description": "", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4"}, + "enabled": true, "id": "bbcb7e7ab8af4911aced6d47d885a4a4", "domain_id": "default", + "name": "p-foobar"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:32 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:32 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:32 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/roles + body: + encoding: UTF-8 + string: ! '{"role":{"name":"baz"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '169' + Date: + - Mon, 23 Mar 2015 09:25:32 GMT + body: + encoding: US-ASCII + string: ! '{"role": {"id": "a9a762f8001c48a392e1be2899a4e2d7", "links": {"self": + "http://devstack.openstack.stack:35357/v3/roles/a9a762f8001c48a392e1be2899a4e2d7"}, + "name": "baz"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:32 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=u-foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '350' + Date: + - Mon, 23 Mar 2015 09:25:33 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/660d8086a1db41078c0d64fa568db135"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "660d8086a1db41078c0d64fa568db135"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:33 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/users/660d8086a1db41078c0d64fa568db135 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:33 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:33 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/users + body: + encoding: UTF-8 + string: ! '{"user":{"name":"u-foobar","email":"foobar@example.com","password":"s3cret!"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '246' + Date: + - Mon, 23 Mar 2015 09:25:33 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "0f30d9da31aa47d59633d522cc6857ba"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:33 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/groups?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Mon, 23 Mar 2015 09:25:33 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/groups", + "previous": null, "next": null}, "groups": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:33 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/groups + body: + encoding: UTF-8 + string: ! '{"group":{"name":"g-foobar","description":"Group of Foobar users"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '240' + Date: + - Mon, 23 Mar 2015 09:25:33 GMT + body: + encoding: US-ASCII + string: ! '{"group": {"domain_id": "default", "description": "Group of Foobar + users", "id": "44e4c1c97bde4f20a86c21ecc7f94ee7", "links": {"self": "http://devstack.openstack.stack:35357/v3/groups/44e4c1c97bde4f20a86c21ecc7f94ee7"}, + "name": "g-foobar"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:33 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/users/0f30d9da31aa47d59633d522cc6857ba + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:34 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:33 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '159' + Date: + - Mon, 23 Mar 2015 09:25:34 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:34 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?effective=true&page=1&per_page=30&scope.project.id=bbcb7e7ab8af4911aced6d47d885a4a4&user.id=0f30d9da31aa47d59633d522cc6857ba + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '136' + Date: + - Mon, 23 Mar 2015 09:25:34 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:34 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '195' + Date: + - Mon, 23 Mar 2015 09:25:34 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:34 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:34 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:34 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '386' + Date: + - Mon, 23 Mar 2015 09:25:34 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects", + "previous": null, "next": null}, "projects": [{"description": "", "links": + {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4"}, + "enabled": true, "id": "bbcb7e7ab8af4911aced6d47d885a4a4", "domain_id": "default", + "name": "p-foobar"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:34 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:35 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '354' + Date: + - Mon, 23 Mar 2015 09:25:35 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles", + "previous": null, "next": null}, "roles": [{"id": "a9a762f8001c48a392e1be2899a4e2d7", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/a9a762f8001c48a392e1be2899a4e2d7"}, + "name": "baz"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:35 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:35 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '159' + Date: + - Mon, 23 Mar 2015 09:25:35 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:35 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/users/0f30d9da31aa47d59633d522cc6857ba/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Mon, 23 Mar 2015 09:25:35 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '196' + Date: + - Mon, 23 Mar 2015 09:25:35 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:35 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?effective=true&page=1&per_page=30&scope.project.id=bbcb7e7ab8af4911aced6d47d885a4a4&user.id=0f30d9da31aa47d59633d522cc6857ba + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '136' + Date: + - Mon, 23 Mar 2015 09:25:35 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:35 GMT +- request: + method: put + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:36 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:36 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:36 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:36 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '355' + Date: + - Mon, 23 Mar 2015 09:25:36 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles", + "previous": null, "next": null}, "roles": [{"id": "a9a762f8001c48a392e1be2899a4e2d7", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/a9a762f8001c48a392e1be2899a4e2d7"}, + "name": "baz"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:36 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/role_assignments?effective=true&page=1&per_page=30&scope.project.id=bbcb7e7ab8af4911aced6d47d885a4a4&user.id=0f30d9da31aa47d59633d522cc6857ba + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '633' + Date: + - Mon, 23 Mar 2015 09:25:36 GMT + body: + encoding: US-ASCII + string: ! '{"role_assignments": [{"scope": {"project": {"id": "bbcb7e7ab8af4911aced6d47d885a4a4"}}, + "role": {"id": "a9a762f8001c48a392e1be2899a4e2d7"}, "user": {"id": "0f30d9da31aa47d59633d522cc6857ba"}, + "links": {"assignment": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles/a9a762f8001c48a392e1be2899a4e2d7", + "membership": "http://devstack.openstack.stack:35357/v3/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/users/0f30d9da31aa47d59633d522cc6857ba"}}], + "links": {"self": "http://devstack.openstack.stack:35357/v3/role_assignments", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:36 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '386' + Date: + - Mon, 23 Mar 2015 09:25:36 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects", + "previous": null, "next": null}, "projects": [{"description": "", "links": + {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4"}, + "enabled": true, "id": "bbcb7e7ab8af4911aced6d47d885a4a4", "domain_id": "default", + "name": "p-foobar"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:36 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:37 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:36 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '159' + Date: + - Mon, 23 Mar 2015 09:25:37 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba/projects", + "previous": null, "next": null}, "projects": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:37 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4/groups/44e4c1c97bde4f20a86c21ecc7f94ee7/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Mon, 23 Mar 2015 09:25:37 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:37 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/users/0f30d9da31aa47d59633d522cc6857ba + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:37 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:37 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/groups/44e4c1c97bde4f20a86c21ecc7f94ee7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:37 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:37 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/roles/a9a762f8001c48a392e1be2899a4e2d7 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:37 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:37 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4 + body: + encoding: UTF-8 + string: ! '{"project":{"enabled":false}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '254' + Date: + - Mon, 23 Mar 2015 09:25:38 GMT + body: + encoding: US-ASCII + string: ! '{"project": {"description": "", "links": {"self": "http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4"}, + "extra": {}, "enabled": false, "id": "bbcb7e7ab8af4911aced6d47d885a4a4", "domain_id": + "default", "name": "p-foobar"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:38 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/projects/bbcb7e7ab8af4911aced6d47d885a4a4 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 09fa2fc6e9f04f7f99aff28e13b19f51 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:38 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:38 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_role.yml b/spec/fog/openstack/identity_v3/idv3_role.yml new file mode 100644 index 000000000..ff17a4d20 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_role.yml @@ -0,0 +1,199 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '514' + Date: + - Fri, 13 Mar 2015 11:40:10 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:10 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '514' + Date: + - Fri, 13 Mar 2015 11:40:11 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:11 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '514' + Date: + - Fri, 13 Mar 2015 11:40:11 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:11 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '514' + Date: + - Fri, 13 Mar 2015 11:40:11 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:11 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles/atlantis + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '91' + Date: + - Fri, 13 Mar 2015 11:40:11 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find role, atlantis.", "code": 404, + "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:11 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_role_crud.yml b/spec/fog/openstack/identity_v3/idv3_role_crud.yml new file mode 100644 index 000000000..736d0c644 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_role_crud.yml @@ -0,0 +1,616 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:26 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "The request you have made requires authentication.", + "code": 401, "title": "Unauthorized"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:26 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 6430c4d643834dd48af5ba347638d2ac + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Mon, 23 Mar 2015 09:25:26 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-23T10:25:26.823674Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-23T09:25:26.823703Z"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:26 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:26 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:26 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:27 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:27 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:27 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:27 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:27 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:27 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/roles + body: + encoding: UTF-8 + string: ! '{"role":{"name":"foobar"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '172' + Date: + - Mon, 23 Mar 2015 09:25:27 GMT + body: + encoding: US-ASCII + string: ! '{"role": {"id": "7c660edd59564b28ad4e6533b5b1a92f", "links": {"self": + "http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f"}, + "name": "foobar"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:27 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '276' + Date: + - Mon, 23 Mar 2015 09:25:27 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7c660edd59564b28ad4e6533b5b1a92f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f"}, + "name": "foobar"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:27 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f + body: + encoding: UTF-8 + string: ! '{"role":{"name":"baz"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '169' + Date: + - Mon, 23 Mar 2015 09:25:27 GMT + body: + encoding: US-ASCII + string: ! '{"role": {"id": "7c660edd59564b28ad4e6533b5b1a92f", "links": {"self": + "http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f"}, + "name": "baz"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:27 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '273' + Date: + - Mon, 23 Mar 2015 09:25:28 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7c660edd59564b28ad4e6533b5b1a92f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f"}, + "name": "baz"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '675' + Date: + - Mon, 23 Mar 2015 09:25:28 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7c660edd59564b28ad4e6533b5b1a92f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f"}, + "name": "baz"}, {"id": "7ebef8a2837246eda8f83f96ffb82b2f", "links": {"self": + "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:28 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:28 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '514' + Date: + - Mon, 23 Mar 2015 09:25:28 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "links": {"self": "http://devstack.openstack.stack:35357/v3/roles/7ebef8a2837246eda8f83f96ffb82b2f"}, + "name": "admin"}, {"links": {"self": "http://devstack.openstack.stack:35357/v3/roles/9fe2ff9ee4384b1894a90878d3e92bab"}, + "enabled": "True", "description": "Default role for project membership", "name": + "_member_", "id": "9fe2ff9ee4384b1894a90878d3e92bab"}]}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles/7c660edd59564b28ad4e6533b5b1a92f + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Mon, 23 Mar 2015 09:25:28 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find role, 7c660edd59564b28ad4e6533b5b1a92f.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:28 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:28 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/roles?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 6430c4d643834dd48af5ba347638d2ac + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:29 GMT + body: + encoding: US-ASCII + string: ! '{"links": {"self": "http://devstack.openstack.stack:35357/v3/roles", + "previous": null, "next": null}, "roles": []}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:29 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_service.yml b/spec/fog/openstack/identity_v3/idv3_service.yml new file mode 100644 index 000000000..9908d1f6a --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_service.yml @@ -0,0 +1,223 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Fri, 13 Mar 2015 11:40:25 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Fri, 13 Mar 2015 11:40:25 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Fri, 13 Mar 2015 11:40:25 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Fri, 13 Mar 2015 11:40:25 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:25 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/atlantis + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '94' + Date: + - Fri, 13 Mar 2015 11:40:25 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find project, atlantis.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:40:25 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_services_crud.yml b/spec/fog/openstack/identity_v3/idv3_services_crud.yml new file mode 100644 index 000000000..91c5e78d7 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_services_crud.yml @@ -0,0 +1,562 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:38 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "The request you have made requires authentication.", + "code": 401, "title": "Unauthorized"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:38 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 87116e162faa449cbf58a9c4229c02d6 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Mon, 23 Mar 2015 09:25:38 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-23T10:25:38.814687Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-23T09:25:38.814715Z"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:38 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Mon, 23 Mar 2015 09:25:38 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:38 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Mon, 23 Mar 2015 09:25:39 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:39 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/services + body: + encoding: UTF-8 + string: ! '{"service":{"type":"volume","name":"foobar"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '213' + Date: + - Mon, 23 Mar 2015 09:25:39 GMT + body: + encoding: US-ASCII + string: ! '{"service": {"enabled": true, "type": "volume", "name": "foobar", + "links": {"self": "http://devstack.openstack.stack:35357/v3/services/2a485dc447b24eeda7e6a995252caa56"}, + "id": "2a485dc447b24eeda7e6a995252caa56"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:39 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30&type=volume + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '320' + Date: + - Mon, 23 Mar 2015 09:25:39 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"enabled": true, "type": "volume", "name": "foobar", + "links": {"self": "http://devstack.openstack.stack:35357/v3/services/2a485dc447b24eeda7e6a995252caa56"}, + "id": "2a485dc447b24eeda7e6a995252caa56"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:39 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/services/2a485dc447b24eeda7e6a995252caa56 + body: + encoding: UTF-8 + string: ! '{"service":{"name":"baz"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '210' + Date: + - Mon, 23 Mar 2015 09:25:39 GMT + body: + encoding: US-ASCII + string: ! '{"service": {"enabled": true, "type": "volume", "name": "baz", "links": + {"self": "http://devstack.openstack.stack:35357/v3/services/2a485dc447b24eeda7e6a995252caa56"}, + "id": "2a485dc447b24eeda7e6a995252caa56"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:39 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1347' + Date: + - Mon, 23 Mar 2015 09:25:39 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"enabled": true, "type": "volume", "name": "baz", + "links": {"self": "http://devstack.openstack.stack:35357/v3/services/2a485dc447b24eeda7e6a995252caa56"}, + "id": "2a485dc447b24eeda7e6a995252caa56"}, {"name": "keystone", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:39 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1347' + Date: + - Mon, 23 Mar 2015 09:25:39 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"enabled": true, "type": "volume", "name": "baz", + "links": {"self": "http://devstack.openstack.stack:35357/v3/services/2a485dc447b24eeda7e6a995252caa56"}, + "id": "2a485dc447b24eeda7e6a995252caa56"}, {"name": "keystone", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:39 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/services/2a485dc447b24eeda7e6a995252caa56 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Mon, 23 Mar 2015 09:25:40 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:40 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Mon, 23 Mar 2015 09:25:40 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:40 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/projects/2a485dc447b24eeda7e6a995252caa56 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '118' + Date: + - Mon, 23 Mar 2015 09:25:40 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find project, 2a485dc447b24eeda7e6a995252caa56.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:40 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/services?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - 87116e162faa449cbf58a9c4229c02d6 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1148' + Date: + - Mon, 23 Mar 2015 09:25:40 GMT + body: + encoding: US-ASCII + string: ! '{"services": [{"name": "keystone", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/8e53f1d389df4059aeab1acfece2fc66"}, + "enabled": true, "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", + "description": "OpenStack Identity"}, {"name": "identity_v3", "links": {"self": + "http://devstack.openstack.stack:35357/v3/services/a47e0f0014fa409993cef0bd984a5ac6"}, + "enabled": true, "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", + "description": "OpenStack KeyStone V3 Service"}, {"description": "Test for + endpoint parameter expansion; can be deleted", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/d36a1f72832b428688b7dae7d0ab8a39"}, + "enabled": true, "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", + "name": "test_stefan"}, {"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/services/ee073ec39e804cca96d2440d8f109932"}, + "enabled": true, "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", + "description": "OpenStack Image Service"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/services", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:40 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_token.yml b/spec/fog/openstack/identity_v3/idv3_token.yml new file mode 100644 index 000000000..f453a1dee --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_token.yml @@ -0,0 +1,240 @@ +--- +http_interactions: +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"id":"8d5732a0ebd9485396351d74e24c9647","password":"openstack"}}},"scope":{"project":{"domain":{"id":"default"},"name":"admin"}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - 2f27c85725f246ebbdb68e6c446969ad + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:56 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-13T12:39:56.727527Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-13T11:39:56.727572Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:56 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + X-Subject-Token: + - 2f27c85725f246ebbdb68e6c446969ad + response: + status: + code: 200 + message: '' + headers: + X-Subject-Token: + - 2f27c85725f246ebbdb68e6c446969ad + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:56 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-13T12:39:56.727527Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "interface": "public", "region": "europe", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "interface": "admin", + "region": "europe", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "interface": "internal", "region": "europe", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "interface": + "internal", "region": "europe", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "interface": "public", + "region": "europe", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "interface": "admin", "region": "europe", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "interface": "public", "region": "europe", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "interface": + "public", "region": "europe", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "interface": "admin", "region": "europe", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "interface": "internal", "region": "europe", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-13T11:39:56.727572Z"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:56 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + X-Subject-Token: + - 2f27c85725f246ebbdb68e6c446969ad + response: + status: + code: 200 + message: '' + headers: + X-Subject-Token: + - 2f27c85725f246ebbdb68e6c446969ad + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Fri, 13 Mar 2015 11:39:57 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:57 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + X-Subject-Token: + - 2f27c85725f246ebbdb68e6c446969ad + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:57 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:57 GMT +- request: + method: head + uri: http://devstack.openstack.stack:35357/v3/auth/tokens + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + X-Subject-Token: + - 2f27c85725f246ebbdb68e6c446969ad + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '116' + Date: + - Fri, 13 Mar 2015 11:39:57 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:57 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_user_crud.yml b/spec/fog/openstack/identity_v3/idv3_user_crud.yml new file mode 100644 index 000000000..ea8b0c7e7 --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_user_crud.yml @@ -0,0 +1,572 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:39:46 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:47 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:39:47 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:47 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:39:47 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:47 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:39:48 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:48 GMT +- request: + method: post + uri: http://devstack.openstack.stack:35357/v3/users + body: + encoding: UTF-8 + string: ! '{"user":{"name":"foobar","email":"foobar@example.com","password":"s3cret!"}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 201 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '244' + Date: + - Fri, 13 Mar 2015 11:39:48 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "89d387887cda4197beb2fe8e9feb3158"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:48 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '348' + Date: + - Fri, 13 Mar 2015 11:39:48 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "89d387887cda4197beb2fe8e9feb3158"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:48 GMT +- request: + method: patch + uri: http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158 + body: + encoding: UTF-8 + string: ! '{"user":{"name":"baz","enabled":false}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '284' + Date: + - Fri, 13 Mar 2015 11:39:49 GMT + body: + encoding: US-ASCII + string: ! '{"user": {"name": "baz", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158"}, + "extra": {"email": "foobar@example.com"}, "domain_id": "default", "enabled": + false, "email": "foobar@example.com", "id": "89d387887cda4197beb2fe8e9feb3158"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:49 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '346' + Date: + - Fri, 13 Mar 2015 11:39:49 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "baz", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158"}, + "domain_id": "default", "enabled": false, "email": "foobar@example.com", "id": + "89d387887cda4197beb2fe8e9feb3158"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:49 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1090' + Date: + - Fri, 13 Mar 2015 11:39:49 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/3c5a9e9790614a60b5c19712d8e97c6d"}, + "domain_id": "default", "enabled": true, "email": null, "id": "3c5a9e9790614a60b5c19712d8e97c6d"}, + {"name": "baz", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158"}, + "domain_id": "default", "enabled": false, "email": "foobar@example.com", "id": + "89d387887cda4197beb2fe8e9feb3158"}, {"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}, {"domain_id": "default", "name": "demo", + "links": {"self": "http://devstack.openstack.stack:35357/v3/users/ac33746004f1470b904e364d408cf42e"}, + "id": "ac33746004f1470b904e364d408cf42e", "enabled": true, "email": "andrew@battye.com", + "default_project_id": "c9f75b1200f64bf09ed079206a1a1b75"}], "links": {"self": + "http://devstack.openstack.stack:35357/v3/users", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:49 GMT +- request: + method: delete + uri: http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 204 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Length: + - '0' + Date: + - Fri, 13 Mar 2015 11:39:49 GMT + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:49 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '856' + Date: + - Fri, 13 Mar 2015 11:39:50 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/3c5a9e9790614a60b5c19712d8e97c6d"}, + "domain_id": "default", "enabled": true, "email": null, "id": "3c5a9e9790614a60b5c19712d8e97c6d"}, + {"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}, {"domain_id": "default", "name": "demo", + "links": {"self": "http://devstack.openstack.stack:35357/v3/users/ac33746004f1470b904e364d408cf42e"}, + "id": "ac33746004f1470b904e364d408cf42e", "enabled": true, "email": "andrew@battye.com", + "default_project_id": "c9f75b1200f64bf09ed079206a1a1b75"}], "links": {"self": + "http://devstack.openstack.stack:35357/v3/users", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:50 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/89d387887cda4197beb2fe8e9feb3158 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '115' + Date: + - Fri, 13 Mar 2015 11:39:50 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find user, 89d387887cda4197beb2fe8e9feb3158.", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:50 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '856' + Date: + - Fri, 13 Mar 2015 11:39:50 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/3c5a9e9790614a60b5c19712d8e97c6d"}, + "domain_id": "default", "enabled": true, "email": null, "id": "3c5a9e9790614a60b5c19712d8e97c6d"}, + {"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}, {"domain_id": "default", "name": "demo", + "links": {"self": "http://devstack.openstack.stack:35357/v3/users/ac33746004f1470b904e364d408cf42e"}, + "id": "ac33746004f1470b904e364d408cf42e", "enabled": true, "email": "andrew@battye.com", + "default_project_id": "c9f75b1200f64bf09ed079206a1a1b75"}], "links": {"self": + "http://devstack.openstack.stack:35357/v3/users", "previous": null, "next": + null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:50 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=foobar&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:39:50 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:50 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=baz&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Fri, 13 Mar 2015 11:39:50 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Fri, 13 Mar 2015 11:39:51 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3/idv3_users.yml b/spec/fog/openstack/identity_v3/idv3_users.yml new file mode 100644 index 000000000..123de709e --- /dev/null +++ b/spec/fog/openstack/identity_v3/idv3_users.yml @@ -0,0 +1,393 @@ +--- +http_interactions: +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d8291e2a2a2046259316f7c2d4253e92 + response: + status: + code: 401 + message: '' + headers: + Www-Authenticate: + - Keystone uri="http://devstack.openstack.stack:35357" + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:21 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "The request you have made requires authentication.", + "code": 401, "title": "Unauthorized"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:21 GMT +- request: + method: post + uri: http://devstack.openstack.stack:5000/v3/auth/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"openstack","id":"8d5732a0ebd9485396351d74e24c9647"}}},"scope":{"project":{"name":"admin","domain":{"id":"default"}}}}}' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + response: + status: + code: 201 + message: '' + headers: + X-Subject-Token: + - d448367868f7446696b876c5fb251fa4 + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '2254' + Date: + - Mon, 23 Mar 2015 09:25:21 GMT + body: + encoding: US-ASCII + string: ! '{"token": {"methods": ["password"], "roles": [{"id": "7ebef8a2837246eda8f83f96ffb82b2f", + "name": "admin"}], "expires_at": "2015-03-23T10:25:21.353957Z", "project": + {"domain": {"id": "default", "name": "Default"}, "id": "c7767afa57b74f33863a420daba5f57f", + "name": "admin"}, "catalog": [{"endpoints": [{"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "public", "id": "0b4b1e907e184880a1c3f32f00cd676f"}, + {"url": "http://devstack.openstack.stack:35357/v2.0", "region": "europe", + "interface": "admin", "id": "53d872f1c5d04f35ac69509e41600c0b"}, {"url": "http://devstack.openstack.stack:35357/v2.0", + "region": "europe", "interface": "internal", "id": "67aa3eedc510444faadb9ef3c7e8b2e4"}], + "type": "identity", "id": "8e53f1d389df4059aeab1acfece2fc66", "name": "keystone"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:35357/v3", "region": + "europe", "interface": "internal", "id": "7002cfd6dbe74512b0b817d3b7380abb"}, + {"url": "http://devstack.openstack.stack:35357/v3", "region": "europe", "interface": + "public", "id": "a7c634aa7f034284b62ddf974ddc04eb"}, {"url": "http://devstack.openstack.stack:35357/v3", + "region": "europe", "interface": "admin", "id": "cba56e3e7a9c4ddfb39e1e4053bd04ab"}], + "type": "identity_v3", "id": "a47e0f0014fa409993cef0bd984a5ac6", "name": "identity_v3"}, + {"endpoints": [{"url": "http://localhost/testurl/c7767afa57b74f33863a420daba5f57f", + "region": "europe", "interface": "public", "id": "3387dfbf7bc440728e7aa1488f6ca96e"}], + "type": "test_stefan", "id": "d36a1f72832b428688b7dae7d0ab8a39", "name": "test_stefan"}, + {"endpoints": [{"url": "http://devstack.openstack.stack:9292", "region": "europe", + "interface": "public", "id": "0dabc688a031422381d3c92b7dfdfe4c"}, {"url": + "http://devstack.openstack.stack:9292", "region": "europe", "interface": "admin", + "id": "768f3eb8b29d49a19c4d50a85541d42e"}, {"url": "http://devstack.openstack.stack:9292", + "region": "europe", "interface": "internal", "id": "a0c5556c80e448aca907a3ee785bd602"}], + "type": "image", "id": "ee073ec39e804cca96d2440d8f109932", "name": "glance"}], + "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": + "8d5732a0ebd9485396351d74e24c9647", "name": "admin"}, "issued_at": "2015-03-23T09:25:21.354000Z"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:21 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d448367868f7446696b876c5fb251fa4 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1094' + Date: + - Mon, 23 Mar 2015 09:25:21 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/3c5a9e9790614a60b5c19712d8e97c6d"}, + "domain_id": "default", "enabled": true, "email": null, "id": "3c5a9e9790614a60b5c19712d8e97c6d"}, + {"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/660d8086a1db41078c0d64fa568db135"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "660d8086a1db41078c0d64fa568db135"}, {"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}, {"domain_id": "default", "name": "demo", + "links": {"self": "http://devstack.openstack.stack:35357/v3/users/ac33746004f1470b904e364d408cf42e"}, + "id": "ac33746004f1470b904e364d408cf42e", "enabled": true, "email": "andrew@battye.com", + "default_project_id": "c9f75b1200f64bf09ed079206a1a1b75"}], "links": {"self": + "http://devstack.openstack.stack:35357/v3/users", "previous": null, "next": + null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:21 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d448367868f7446696b876c5fb251fa4 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1094' + Date: + - Mon, 23 Mar 2015 09:25:21 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/3c5a9e9790614a60b5c19712d8e97c6d"}, + "domain_id": "default", "enabled": true, "email": null, "id": "3c5a9e9790614a60b5c19712d8e97c6d"}, + {"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/660d8086a1db41078c0d64fa568db135"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "660d8086a1db41078c0d64fa568db135"}, {"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}, {"domain_id": "default", "name": "demo", + "links": {"self": "http://devstack.openstack.stack:35357/v3/users/ac33746004f1470b904e364d408cf42e"}, + "id": "ac33746004f1470b904e364d408cf42e", "enabled": true, "email": "andrew@battye.com", + "default_project_id": "c9f75b1200f64bf09ed079206a1a1b75"}], "links": {"self": + "http://devstack.openstack.stack:35357/v3/users", "previous": null, "next": + null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:21 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users/u-random-blah + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d448367868f7446696b876c5fb251fa4 + response: + status: + code: 404 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '96' + Date: + - Mon, 23 Mar 2015 09:25:21 GMT + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find user, u-random-blah.", "code": + 404, "title": "Not Found"}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:21 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d448367868f7446696b876c5fb251fa4 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1094' + Date: + - Mon, 23 Mar 2015 09:25:22 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/3c5a9e9790614a60b5c19712d8e97c6d"}, + "domain_id": "default", "enabled": true, "email": null, "id": "3c5a9e9790614a60b5c19712d8e97c6d"}, + {"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/660d8086a1db41078c0d64fa568db135"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "660d8086a1db41078c0d64fa568db135"}, {"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}, {"domain_id": "default", "name": "demo", + "links": {"self": "http://devstack.openstack.stack:35357/v3/users/ac33746004f1470b904e364d408cf42e"}, + "id": "ac33746004f1470b904e364d408cf42e", "enabled": true, "email": "andrew@battye.com", + "default_project_id": "c9f75b1200f64bf09ed079206a1a1b75"}], "links": {"self": + "http://devstack.openstack.stack:35357/v3/users", "previous": null, "next": + null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d448367868f7446696b876c5fb251fa4 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '1094' + Date: + - Mon, 23 Mar 2015 09:25:22 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "glance", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/3c5a9e9790614a60b5c19712d8e97c6d"}, + "domain_id": "default", "enabled": true, "email": null, "id": "3c5a9e9790614a60b5c19712d8e97c6d"}, + {"name": "u-foobar", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/660d8086a1db41078c0d64fa568db135"}, + "domain_id": "default", "enabled": true, "email": "foobar@example.com", "id": + "660d8086a1db41078c0d64fa568db135"}, {"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}, {"domain_id": "default", "name": "demo", + "links": {"self": "http://devstack.openstack.stack:35357/v3/users/ac33746004f1470b904e364d408cf42e"}, + "id": "ac33746004f1470b904e364d408cf42e", "enabled": true, "email": "andrew@battye.com", + "default_project_id": "c9f75b1200f64bf09ed079206a1a1b75"}], "links": {"self": + "http://devstack.openstack.stack:35357/v3/users", "previous": null, "next": + null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=admin&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d448367868f7446696b876c5fb251fa4 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '345' + Date: + - Mon, 23 Mar 2015 09:25:22 GMT + body: + encoding: US-ASCII + string: ! '{"users": [{"name": "admin", "links": {"self": "http://devstack.openstack.stack:35357/v3/users/8d5732a0ebd9485396351d74e24c9647"}, + "domain_id": "default", "enabled": true, "email": "andrew@batty.com", "id": + "8d5732a0ebd9485396351d74e24c9647"}], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:22 GMT +- request: + method: get + uri: http://devstack.openstack.stack:35357/v3/users?name=pimpernel&page=1&per_page=30 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - fog/1.28.0 fog-core/1.29.0 + Content-Type: + - application/json + Accept: + - application/json + X-Auth-Token: + - d448367868f7446696b876c5fb251fa4 + response: + status: + code: 200 + message: '' + headers: + Vary: + - X-Auth-Token + X-Distribution: + - Ubuntu + Content-Type: + - application/json + Content-Length: + - '114' + Date: + - Mon, 23 Mar 2015 09:25:22 GMT + body: + encoding: US-ASCII + string: ! '{"users": [], "links": {"self": "http://devstack.openstack.stack:35357/v3/users", + "previous": null, "next": null}}' + http_version: + recorded_at: Mon, 23 Mar 2015 09:25:22 GMT +recorded_with: VCR 2.9.3 diff --git a/spec/fog/openstack/identity_v3_spec.rb b/spec/fog/openstack/identity_v3_spec.rb new file mode 100644 index 000000000..09e7be3ed --- /dev/null +++ b/spec/fog/openstack/identity_v3_spec.rb @@ -0,0 +1,929 @@ +require 'fog/openstack/identity' +require 'fog/openstack/identity_v3' +require 'rspec/core' +require 'vcr' + +RSpec.describe Fog::Identity::OpenStack::V3 do + + before :each do |example| + @os_auth_url = ENV['OS_AUTH_URL'] + + # if OS_AUTH_URL is set but FOG_MOCK is not, don't record anything and just pass through the requests + VCR.configure do |c| + c.ignore_request do |request| + ENV['FOG_MOCK']!='true' && !ENV['OS_AUTH_URL'].nil? + end + end if @os_auth_url + + # Fail-safe URL which matches the VCR recordings + @os_auth_url ||= 'http://devstack.openstack.stack:5000/v3' + + VCR.configure do |config| + config.allow_http_connections_when_no_cassette = true + config.hook_into :webmock + config.cassette_library_dir = "spec/fog/openstack/identity_v3" + config.default_cassette_options = {:record => :none} + end + + unless example.metadata[:skip_preauthentication] + VCR.use_cassette('idv3') do + @id_v3 = Fog::Identity::OpenStack::V3.new( + :openstack_project_name => ENV['OS_TENANT_NAME'] || 'admin', + :openstack_domain_name => 'Default', + :openstack_api_key => ENV['OS_PASSWORD'] || 'openstack', + :openstack_username => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") unless @id_v3 + end + end + end + + it 'authenticates with password, userid and domain_id', :skip_preauthentication do + VCR.use_cassette('authv3_a') do + Fog::Identity::OpenStack::V3.new( + :openstack_project_name => ENV['OS_TENANT_NAME'] || 'admin', + :openstack_domain_name => 'Default', + :openstack_api_key => ENV['OS_PASSWORD'] || 'openstack', + :openstack_username => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") + end + end + + it 'authenticates with password, username and domain_id', :skip_preauthentication do + VCR.use_cassette('authv3_b') do + Fog::Identity::OpenStack::V3.new( + :openstack_project_name => ENV['OS_TENANT_NAME'] || 'admin', + :openstack_domain_name => 'Default', + :openstack_api_key => ENV['OS_PASSWORD'] || 'openstack', + :openstack_username => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") + end + end + + it 'authenticates with password, username and domain_name', :skip_preauthentication do + VCR.use_cassette('authv3_c') do + Fog::Identity::OpenStack::V3.new( + :openstack_project_name => ENV['OS_TENANT_NAME'] || 'admin', + :openstack_domain_name => 'Default', + :openstack_api_key => ENV['OS_PASSWORD'] || 'openstack', + :openstack_username => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") + end + end + + it 'authenticates with project scope', :skip_preauthentication do + VCR.use_cassette('authv3_project') do + Fog::Identity::OpenStack::V3.new( + :openstack_project_name => ENV['OS_TENANT_NAME'] || 'admin', + :openstack_domain_name => 'Default', + :openstack_api_key => ENV['OS_PASSWORD'] || 'openstack', + :openstack_username => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") + end + end + + it "get an unscoped token using v2, then use it to get a scoped token in v3", :skip_preauthentication do + VCR.use_cassette('idv2_unscoped_token_v3') do + + # Juno Keystone + # Get an initial unscoped token by authenticating with username & password + openstack_auth_url = @os_auth_url.gsub(/v3/, 'v2.0') + @id_v2 = Fog::Identity::OpenStack.new( + :openstack_api_key => ENV['OS_PASSWORD'] || 'openstack', + :openstack_username => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_url => "#{openstack_auth_url}/tokens") + + # Exchange it for a project-scoped token + auth = Fog::Identity::OpenStack::V3.new( + :openstack_project_name => ENV['OS_USERNAME'] || 'admin', + :openstack_domain_name => 'Default', + :openstack_tenant => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_token => @id_v2.credentials[:openstack_auth_token], + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") + + token = auth.credentials[:openstack_auth_token] + + # We can use the scoped token to validate the scoped token + validated_token = @id_v2.validate_token(token) + expect(validated_token).to_not be_nil + + @id_v2.check_token(token) + expect { @id_v2.check_token(token, 'random-tenant-id') }.to raise_error(Excon::Errors::Unauthorized) + end + end + + it 'get an unscoped token, then use it to get a scoped token', :skip_preauthentication do + VCR.use_cassette('authv3_unscoped') do + + # Juno Keystone + @id_v3 = Fog::Identity::OpenStack::V3.new( + :openstack_api_key => ENV['OS_PASSWORD'] || 'openstack', + :openstack_userid => '8d5732a0ebd9485396351d74e24c9647', + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") + + # Exchange it for a project-scoped token + auth = Fog::Identity::OpenStack::V3.new( + :openstack_project_name => ENV['OS_USERNAME'] || 'admin', + :openstack_domain_name => 'Default', + :openstack_tenant => ENV['OS_USERNAME'] || 'admin', + :openstack_auth_token => @id_v3.credentials[:openstack_auth_token], + :openstack_auth_url => "#{@os_auth_url}/auth/tokens") + + token = auth.credentials[:openstack_auth_token] + + # We can use the unscoped token to validate the scoped token + validated_token = @id_v3.tokens.validate(token) + expect(validated_token).to_not be_nil + + @id_v3.tokens.check(token) + expect { @id_v3.tokens.check('random-token') }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "find specific user, lists users" do + VCR.use_cassette('idv3_users') do + + other_user = @id_v3.users.find_by_id '8d5732a0ebd9485396351d74e24c9647' + + expect(other_user).to_not be_nil + expect { nonexistent_user = @id_v3.users.find_by_id 'u-random-blah' }.to raise_error(Fog::Identity::OpenStack::NotFound) + + users = @id_v3.users + expect(users).to_not be_nil + expect(users.length).to_not be 0 + + users_all = @id_v3.users.all + expect(users_all).to_not be_nil + expect(users_all.length).to_not be 0 + + admin_user = @id_v3.users.find_by_name 'admin' + expect(admin_user.length).to be 1 + + expect(@id_v3.users.find_by_name('pimpernel').length).to be 0 + end + end + + it 'CRUD users' do + VCR.use_cassette('idv3_user_crud') do + + # Make sure there are no existing users called foobar or baz + ['foobar', 'baz'].each do |username| + user = @id_v3.users.find_by_name(username).first + user.update(:enabled => false) if user + user.destroy if user + end + expect(@id_v3.users.find_by_name('foobar').length).to be 0 + expect(@id_v3.users.find_by_name('baz').length).to be 0 + + # Create a user called foobar + foobar_user = @id_v3.users.create(:name => 'foobar', + :email => 'foobar@example.com', + :password => 's3cret!') + foobar_id = foobar_user.id + expect(@id_v3.users.find_by_name('foobar').length).to be 1 + + # Rename it to baz and disable it (required so we can delete it) + foobar_user.update(:name => 'baz', :enabled => false) + expect(foobar_user.name).to eq 'baz' + + # Read the user freshly and check the name & enabled state + expect(@id_v3.users.find_by_name('baz').length).to be 1 + baz_user = @id_v3.users.find_by_id foobar_id + expect(baz_user).to_not be_nil + expect(baz_user.name).to eq 'baz' + expect(baz_user.email).to eq 'foobar@example.com' + expect(baz_user.enabled).to be false + + # Delete the user + baz_user.destroy + # Check that the deletion worked + expect { @id_v3.users.find_by_id foobar_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + expect(@id_v3.users.all.select { |user| ['foobar', 'baz'].include? user.name }.length).to be 0 + expect(@id_v3.users.find_by_name('foobar').length).to be 0 + expect(@id_v3.users.find_by_name('baz').length).to be 0 + end + end + + it "CRUD & manipulate groups" do + VCR.use_cassette('idv3_group_crud_mutation') do + + # Make sure there are no existing groups called foobar or baz + @id_v3.groups.all.select { |group| ['foobar', 'baz'].include? group.name }.each do |group| + group.destroy + end + expect(@id_v3.groups.all.select { |group| ['foobar', 'baz'].include? group.name }.length).to be 0 + + # Create a group called foobar + foobar_group = @id_v3.groups.create(:name => 'foobar', :description => "Group of Foobar users") + foobar_id = foobar_group.id + expect(@id_v3.groups.all.select { |group| group.name == 'foobar' }.length).to be 1 + + # Rename it to baz + foobar_group.update(:name => 'baz', :description => "Group of Baz users") + expect(foobar_group.name).to eq 'baz' + + # Read the group freshly and check the name + expect(@id_v3.groups.all.select { |group| group.name == 'baz' }.length).to be 1 + baz_group = @id_v3.groups.find_by_id foobar_id + expect(baz_group).to_not be_nil + expect(baz_group.name).to eq 'baz' + + # Add users to the group + foobar_user1 = @id_v3.users.create(:name => 'foobar1', + :email => 'foobar1@example.com', + :password => 's3cret!1') + foobar_user2 = @id_v3.users.create(:name => 'foobar2', + :email => 'foobar2@example.com', + :password => 's3cret!2') + + expect(foobar_user1.groups.length).to be 0 + expect(baz_group.users.length).to be 0 + + baz_group.add_user(foobar_user1.id) + + # Check that a user is in the group + expect(foobar_user1.groups.length).to be 1 + expect(baz_group.contains_user? foobar_user1.id).to be true + + baz_group.add_user(foobar_user2.id) + + # List users in the group + expect(baz_group.users.length).to be 2 + + + # Remove a user from the group + baz_group.remove_user(foobar_user1.id) + expect(baz_group.contains_user? foobar_user1.id).to be false + expect(baz_group.users.length).to be 1 + + # Delete the users and make sure they are no longer in the group + foobar_user1.destroy + foobar_user2.destroy + expect(baz_group.contains_user? foobar_user2.id).to be false + expect(baz_group.users.length).to be 0 + + # Delete the group + baz_group.destroy + expect { @id_v3.groups.find_by_id foobar_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + expect(@id_v3.groups.all.select { |group| ['foobar', 'baz'].include? group.name }.length).to be 0 + end + end + + it "gets a token, checks it and then revokes it" do + VCR.use_cassette('idv3_token') do + auth = {:auth => {:identity => {:methods => %w{password}, + :password => {:user => {:id => '8d5732a0ebd9485396351d74e24c9647', :password => 'openstack'}}}, + :scope => {:project => {:domain => {:id => 'default'}, :name => 'admin'}}}} + + token = @id_v3.tokens.authenticate(auth) + expect(token).to_not be_nil + + validated_token = @id_v3.tokens.validate token.value + expect(validated_token).to_not be_nil + + @id_v3.tokens.check(token.value) + @id_v3.tokens.revoke(token.value) + + expect { @id_v3.tokens.check(token.value) }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it 'authenticates with a token' do + VCR.use_cassette('authv3_token') do + # Setup - get a non-admin token to check by using username/password authentication to start with + auth_url = "#{@os_auth_url}/auth/tokens" + nonadmin_v3 = Fog::Identity::OpenStack::V3.new( + :openstack_project_name => 'demo', + :openstack_domain_id => 'default', + :openstack_api_key => 'openstack', + :openstack_username => 'demo', + :openstack_region => 'europe', + :openstack_auth_url => auth_url) + + # Test - check the token validity by using it to create a new Fog::Identity::OpenStack::V3 instance + token_check = Fog::Identity::OpenStack::V3.new( + :openstack_auth_token => nonadmin_v3.auth_token, + :openstack_region => 'europe', + :openstack_auth_url => auth_url) + + expect(token_check).to_not be_nil + + expect { Fog::Identity::OpenStack::V3.new( + :openstack_auth_token => 'blahblahblah', + :openstack_region => 'europe', + :openstack_auth_url => auth_url) }.to raise_error(Excon::Errors::NotFound) + end + end + + it "lists domains" do + VCR.use_cassette('idv3_domain') do + + domains = @id_v3.domains + expect(domains).to_not be_nil + expect(domains.length).to_not be 0 + + domains_all = @id_v3.domains.all + expect(domains_all).to_not be_nil + expect(domains_all.length).to_not be 0 + + default_domain = @id_v3.domains.find_by_id 'default' + expect(default_domain).to_not be_nil + + expect { @id_v3.domains.find_by_id 'atlantis' }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "CRUD domains" do + VCR.use_cassette('idv3_domain_crud') do + + # Make sure there are no existing domains called foobar or baz + ['foobar', 'baz'].each do |domain_name| + @id_v3.domains.all(:name => domain_name).each do |domain| + domain.update(:enabled => false) if domain + domain.destroy if domain + end + expect(@id_v3.domains.all(:name => domain_name).length).to be 0 + end + + # Create a domain called foobar + foobar_domain = @id_v3.domains.create(:name => 'foobar') + foobar_id = foobar_domain.id + expect(@id_v3.domains.all(:name => 'foobar').length).to be 1 + + # Rename it to baz and disable it (required so we can delete it) + foobar_domain.update(:name => 'baz', :enabled => false) + expect(foobar_domain.name).to eq 'baz' + + # Read the domain freshly and check the name & enabled state + expect(@id_v3.domains.all(:name => 'baz').length).to be 1 + baz_domain = @id_v3.domains.find_by_id foobar_id + expect(baz_domain).to_not be_nil + expect(baz_domain.name).to eq 'baz' + expect(baz_domain.enabled).to be false + + # Delete the domain + baz_domain.destroy + # Check that the deletion worked + expect { @id_v3.domains.find_by_id foobar_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + ['foobar', 'baz'].each do |domain_name| + expect(@id_v3.domains.all(:name => domain_name).length).to be 0 + end + end + end + + it "Manipulates roles on domains" do + # Note that the domain is implicit in the user operations here + + VCR.use_cassette('idv3_domain_roles_mutation') do + + foobar_user = @id_v3.users.find_by_name('foobar').first + foobar_user.destroy if foobar_user + foobar_user = @id_v3.users.create(:name => 'foobar', + :email => 'foobar@example.com', + :password => 's3cret!') + + # User has no roles initially + expect(foobar_user.roles.length).to be 0 + + # Create a role and add it to the user in the user's domain + foobar_role = @id_v3.roles.all.select { |role| role.name == 'foobar_role' }.first + foobar_role.destroy if foobar_role + foobar_role = @id_v3.roles.create(:name => 'foobar_role') + foobar_user.grant_role(foobar_role.id) + expect(foobar_user.roles.length).to be 1 + assignments = @id_v3.role_assignments.filter_by(:user_id => foobar_user.id) + expect(assignments.length).to be 1 + expect(assignments.first.role['id']).to eq foobar_role.id + expect(assignments.first.user['id']).to eq foobar_user.id + expect(assignments.first.scope['domain']['id']).to eq foobar_user.domain_id + expect(assignments.first.links['assignment'].end_with? "/v3/domains/#{foobar_user.domain_id}/users/#{foobar_user.id}/roles/#{foobar_role.id}").to be true + + # Quick test of @id_v3.role_assignments.all while we're at it + all_assignments = @id_v3.role_assignments.all + expect(assignments.length).to be >= 1 + + # Check that the user has the role + expect(foobar_user.check_role(foobar_role.id)).to be true + + # Revoke the role from the user + foobar_user.revoke_role(foobar_role.id) + expect(foobar_user.check_role(foobar_role.id)).to be false + + foobar_user.destroy + foobar_role.destroy + end + end + + it "Manipulates roles on domain groups" do + VCR.use_cassette('idv3_domain_group_roles_mutation') do + + # Make sure there is no existing domain called foobar + @id_v3.domains.all.select { |domain| ['d-foobar'].include? domain.name }.each do |domain| + domain.update(:enabled => false) + domain.destroy + end + expect(@id_v3.domains.all.select { |domain| domain.name == 'd-foobar' }.length).to be 0 + + # Create a domain called foobar + foobar_domain = @id_v3.domains.create(:name => 'd-foobar') + + # Create a group in this domain + @id_v3.groups.all.select { |group| ['g-foobar'].include? group.name }.each do |group| + group.destroy + end + foobar_group = @id_v3.groups.create(:name => 'g-foobar', + :description => "Group of Foobar users", + :domain_id => foobar_domain.id) + + # Create a user in the domain + foobar_user = @id_v3.users.find_by_name('u-foobar').first + foobar_user.destroy if foobar_user + foobar_user = @id_v3.users.create(:name => 'u-foobar', + :email => 'foobar@example.com', + :password => 's3cret!', + :domain_id => foobar_domain.id) + + # User has no roles initially + expect(foobar_user.roles.length).to be 0 + + # Create a role and add it to the domain group + foobar_role = @id_v3.roles.all.select { |role| role.name == 'foobar_role' }.first + foobar_role.destroy if foobar_role + foobar_role = @id_v3.roles.create(:name => 'foobar_role') + + foobar_group.grant_role foobar_role.id + expect(foobar_group.roles.length).to be 1 + + # Add user to the group and check that it inherits the role + expect(foobar_user.check_role foobar_role.id).to be false + expect(@id_v3.role_assignments.filter_by(:user_id => foobar_user.id, :effective => true).length).to be 0 + foobar_group.add_user foobar_user.id + expect(foobar_user.check_role foobar_role.id).to be false # Still false in absolute assignment terms + assignments = @id_v3.role_assignments.filter_by(:user_id => foobar_user.id, :effective => true) + expect(assignments.length).to be 1 + expect(assignments.first.role['id']).to eq foobar_role.id + expect(assignments.first.user['id']).to eq foobar_user.id + expect(assignments.first.scope['domain']['id']).to eq foobar_user.domain_id + expect(assignments.first.links['assignment'].end_with? "/v3/domains/#{foobar_domain.id}/groups/#{foobar_group.id}/roles/#{foobar_role.id}").to be true + expect(assignments.first.links['membership'].end_with? "/v3/groups/#{foobar_group.id}/users/#{foobar_user.id}").to be true + + group_assignments = @id_v3.role_assignments.filter_by(:group_id => foobar_group.id) + expect(group_assignments.length).to be 1 + expect(group_assignments.first.role['id']).to eq foobar_role.id + expect(group_assignments.first.group['id']).to eq foobar_group.id + expect(group_assignments.first.scope['domain']['id']).to eq foobar_user.domain_id + expect(group_assignments.first.links['assignment'].end_with? "/v3/domains/#{foobar_domain.id}/groups/#{foobar_group.id}/roles/#{foobar_role.id}").to be true + + # Revoke the role from the group and check the user no longer has it + foobar_group.revoke_role foobar_role.id + expect(@id_v3.role_assignments.filter_by(:user_id => foobar_user.id, :effective => true).length).to be 0 + + # Clean up + foobar_user.destroy + foobar_group.destroy + foobar_role.destroy + foobar_domain.update(:enabled => false) + foobar_domain.destroy + end + end + + it "lists roles and assignments" do + VCR.use_cassette('idv3_role') do + + roles = @id_v3.roles + expect(roles).to_not be_nil + expect(roles.length).to_not be 0 + + roles_all = @id_v3.roles.all + expect(roles_all).to_not be_nil + expect(roles_all.length).to_not be 0 + + default_role = @id_v3.roles.find_by_id '9fe2ff9ee4384b1894a90878d3e92bab' + expect(default_role).to_not be_nil + + expect { @id_v3.roles.find_by_id 'atlantis' }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "CRUD roles" do + VCR.use_cassette('idv3_role_crud') do + + # Make sure there are no existing roles called foobar or baz + ['foobar', 'baz'].each do |role_name| + @id_v3.roles.all(:name => role_name).each do |role| + role.update(:enabled => false) + role.destroy + end + expect(@id_v3.roles.all(:name => role_name).length).to be 0 + end + + # Create a role called foobar + foobar_role = @id_v3.roles.create(:name => 'foobar') + foobar_id = foobar_role.id + expect(@id_v3.roles.all(:name => 'foobar').length).to be 1 + + # Rename it to baz + foobar_role.update(:name => 'baz') + expect(foobar_role.name).to eq 'baz' + + # Read the role freshly and check the name & enabled state + expect(@id_v3.roles.all(:name => 'baz').length).to be 1 + baz_role = @id_v3.roles.find_by_id foobar_id + expect(baz_role).to_not be_nil + expect(baz_role.name).to eq 'baz' + + # Delete the role + baz_role.destroy + # Check that the deletion worked + expect { @id_v3.roles.find_by_id foobar_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + ['foobar', 'baz'].each do |role_name| + expect(@id_v3.roles.all(:name => role_name).length).to be 0 + end + end + end + + it "lists projects" do + VCR.use_cassette('idv3_project') do + + projects = @id_v3.projects + expect(projects).to_not be_nil + expect(projects.length).to_not be 0 + + projects_all = @id_v3.projects.all + expect(projects_all).to_not be_nil + expect(projects_all.length).to_not be 0 + + default_project = @id_v3.projects.find_by_id 'c9f75b1200f64bf09ed079206a1a1b75' + expect(default_project).to_not be_nil + + expect { @id_v3.projects.find_by_id 'atlantis' }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "CRUD projects" do + VCR.use_cassette('idv3_project_crud') do + + default_domain = @id_v3.domains.find_by_id 'default' + + # Make sure there are no existing projects called foobar or baz + ['p-foobar', 'p-baz'].each do |project_name| + @id_v3.projects.all(:name => project_name).each do |project| + project.update(:enabled => false) if project + project.destroy if project + end + expect(@id_v3.projects.all(:name => project_name).length).to be 0 + end + + # Create a project called foobar - should not work without domain id? + foobar_project = @id_v3.projects.create(:name => 'p-foobar') + foobar_id = foobar_project.id + expect(@id_v3.projects.all(:name => 'p-foobar').length).to be 1 + expect(foobar_project.domain_id).to eq default_domain.id + + # Rename it to baz and disable it (required so we can delete it) + foobar_project.update(:name => 'p-baz', :enabled => false) + expect(foobar_project.name).to eq 'p-baz' + + # Read the project freshly and check the name & enabled state + expect(@id_v3.projects.all(:name => 'p-baz').length).to be 1 + baz_project = @id_v3.projects.find_by_id foobar_id + expect(baz_project).to_not be_nil + expect(baz_project.name).to eq 'p-baz' + expect(baz_project.enabled).to be false + + # Delete the project + baz_project.destroy + + # Check that the deletion worked + expect { @id_v3.projects.find_by_id foobar_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + ['p-foobar', 'p-baz'].each do |project_name| + expect(@id_v3.projects.all(:name => project_name).length).to be 0 + end + end + end + + it "Manipulates projects - add/remove users/groups via role assignment/revocation" do + VCR.use_cassette('idv3_project_group_user_roles_mutation') do + + # Make sure there is no existing project called foobar + @id_v3.projects.all(:name => 'p-foobar').each do |project| + project.update(:enabled => false) + project.destroy + end + expect(@id_v3.projects.all(:name => 'p-foobar').length).to be 0 + + # Create a project called foobar + foobar_project = @id_v3.projects.create(:name => 'p-foobar') + + # Create a role called baz + @id_v3.roles.all(:name => 'baz').each do |role| + role.update(:enabled => false) + role.destroy + end + baz_role = @id_v3.roles.create(:name => 'baz') + + # Create a user + foobar_user = @id_v3.users.find_by_name('u-foobar').first + foobar_user.destroy if foobar_user + foobar_user = @id_v3.users.create(:name => 'u-foobar', + :email => 'foobar@example.com', + :password => 's3cret!') + + # Create a group and add the user to it + @id_v3.groups.all.select { |group| ['g-foobar'].include? group.name }.each do |group| + group.destroy + end + foobar_group = @id_v3.groups.create(:name => 'g-foobar', + :description => "Group of Foobar users") + foobar_group.add_user foobar_user.id + + # User has no projects initially + expect(foobar_user.projects.length).to be 0 + expect(@id_v3.role_assignments.filter_by(:user_id => foobar_user.id, + :project_id => foobar_project.id, + :effective => true).length).to be 0 + expect(foobar_project.user_roles(foobar_user.id).length).to be 0 + + # Grant role to the user in the new project - this assigns the project to the user + foobar_project.grant_role_to_user(baz_role.id, foobar_user.id) + expect(foobar_user.projects.length).to be 1 + expect(foobar_project.check_user_role(foobar_user.id, baz_role.id)).to be true + expect(foobar_project.user_roles(foobar_user.id).length).to be 1 + + # Revoke role from the user in the new project - this removes the user from the project + foobar_project.revoke_role_from_user(baz_role.id, foobar_user.id) + expect(foobar_user.projects.length).to be 0 + expect(foobar_project.check_user_role(foobar_user.id, baz_role.id)).to be false + + # Group initially has no roles in project + expect(foobar_project.group_roles(foobar_group.id).length).to be 0 + + expect(@id_v3.role_assignments.filter_by(:user_id => foobar_user.id, + :project_id => foobar_project.id, + :effective => true).length).to be 0 + + # Grant role to the group in the new project - this assigns the project to the group + foobar_project.grant_role_to_group(baz_role.id, foobar_group.id) + expect(foobar_project.check_group_role(foobar_group.id, baz_role.id)).to be true + expect(foobar_project.group_roles(foobar_group.id).length).to be 1 + + # Now we check that a user has the role in that project + assignments = @id_v3.role_assignments.filter_by(:user_id => foobar_user.id, + :project_id => foobar_project.id, + :effective => true) + expect(assignments.length).to be 1 + expect(assignments.first.role['id']).to eq baz_role.id + expect(assignments.first.user['id']).to eq foobar_user.id + expect(assignments.first.scope['project']['id']).to eq foobar_project.id + expect(assignments.first.links['assignment'].end_with? "/v3/projects/#{foobar_project.id}/groups/#{foobar_group.id}/roles/#{baz_role.id}").to be true + expect(assignments.first.links['membership'].end_with? "/v3/groups/#{foobar_group.id}/users/#{foobar_user.id}").to be true + + # and we check that the user is in the project because of group membership + expect(foobar_user.projects.length).to be 1 + + # Revoke role from the group in the new project - this removes the group from the project + foobar_project.revoke_role_from_group(baz_role.id, foobar_group.id) + expect(foobar_user.projects.length).to be 0 + expect(foobar_project.check_group_role(foobar_group.id, baz_role.id)).to be false + + # Clean up + foobar_user.destroy + foobar_group.destroy + baz_role.destroy + foobar_project.update(:enabled => false) + foobar_project.destroy + end + end + + it "lists services" do + VCR.use_cassette('idv3_service') do + + services = @id_v3.services + expect(services).to_not be_nil + expect(services.length).to_not be 0 + + services_all = @id_v3.services.all + expect(services_all).to_not be_nil + expect(services_all.length).to_not be 0 + + some_service = @id_v3.services.find_by_id services_all.first.id + expect(some_service).to_not be_nil + + expect { @id_v3.services.find_by_id 'atlantis' }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "CRUD services" do + VCR.use_cassette('idv3_services_crud') do + + all_services = @id_v3.services.all + + # Make sure there are no existing services called foobar or baz + @id_v3.services.all.select { |service| ['foobar', 'baz'].include? service.name }.each do |service| + service.destroy + end + expect(all_services.select { |service| ['foobar', 'baz'].include? service.name }.length).to be 0 + + # Create a service called foobar + foobar_service = @id_v3.services.create(:type => 'volume', :name => 'foobar') + foobar_id = foobar_service.id + expect(@id_v3.services.all(:type => 'volume').select { |service| service.name == 'foobar' }.length).to be 1 + + # Rename it to baz + foobar_service.update(:name => 'baz') + expect(foobar_service.name).to eq 'baz' + + # Read the service freshly and check the name + expect(@id_v3.services.all.select { |service| service.name == 'baz' }.length).to be 1 + baz_service = @id_v3.services.find_by_id foobar_id + expect(baz_service).to_not be_nil + expect(baz_service.name).to eq 'baz' + expect(baz_service.type).to eq 'volume' + + # Delete the service + baz_service.destroy + + # Check that the deletion worked + expect { @id_v3.services.find_by_id foobar_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + expect(@id_v3.services.all.select { |service| ['foobar', 'baz'].include? service.name }.length).to be 0 + end + end + + it "lists endpoints" do + VCR.use_cassette('idv3_endpoint') do + + endpoints = @id_v3.endpoints + expect(endpoints).to_not be_nil + expect(endpoints.length).to_not be 0 + + endpoints_all = @id_v3.endpoints.all + expect(endpoints_all).to_not be_nil + expect(endpoints_all.length).to_not be 0 + + some_endpoint = @id_v3.endpoints.find_by_id endpoints_all.first.id + expect(some_endpoint).to_not be_nil + + expect { @id_v3.endpoints.find_by_id 'atlantis' }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "CRUD endpoints" do + VCR.use_cassette('idv3_endpoints_crud') do + + service = @id_v3.services.all.first + all_endpoints = @id_v3.endpoints.all + + # Make sure there are no existing endpoints called foobar or baz + @id_v3.endpoints.all.select { |endpoint| ['foobar', 'baz'].include? endpoint.name }.each do |endpoint| + endpoint.destroy + end + expect(all_endpoints.select { |endpoint| ['foobar', 'baz'].include? endpoint.name }.length).to be 0 + + # Create a endpoint called foobar + foobar_endpoint = @id_v3.endpoints.create(:service_id => service.id, + :interface => 'internal', + :name => 'foobar', + :url => 'http://example.com/foobar', + :enabled => false) + foobar_id = foobar_endpoint.id + expect(@id_v3.endpoints.all(:interface => 'internal').select { |endpoint| endpoint.name == 'foobar' }.length).to be 1 + + # Rename it to baz + foobar_endpoint.update(:name => 'baz', :url => 'http://example.com/baz') + expect(foobar_endpoint.name).to eq 'baz' + expect(foobar_endpoint.url).to eq 'http://example.com/baz' + + # Read the endpoint freshly and check the name + expect(@id_v3.endpoints.all(:interface => 'internal').select { |endpoint| endpoint.name == 'baz' }.length).to be 1 + baz_endpoint = @id_v3.endpoints.find_by_id foobar_id + expect(baz_endpoint).to_not be_nil + expect(baz_endpoint.name).to eq 'baz' + expect(baz_endpoint.url).to eq 'http://example.com/baz' + expect(baz_endpoint.interface).to eq 'internal' + + # Delete the endpoint + baz_endpoint.destroy + + # Check that the deletion worked + expect { @id_v3.endpoints.find_by_id foobar_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + expect(@id_v3.endpoints.all.select { |endpoint| ['foobar', 'baz'].include? endpoint.name }.length).to be 0 + end + end + + it "lists OS credentials" do + VCR.use_cassette('idv3_credential') do + credentials = @id_v3.os_credentials + expect(credentials).to_not be_nil + + credentials_all = @id_v3.os_credentials.all + expect(credentials_all).to_not be_nil + + expect { @id_v3.os_credentials.find_by_id 'atlantis' }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "CRUD OS credentials" do + VCR.use_cassette('idv3_credential_crud') do + + # Create a user + foobar_user = @id_v3.users.find_by_name('u-foobar').first + foobar_user.destroy if foobar_user + foobar_user = @id_v3.users.create(:name => 'u-foobar', + :email => 'foobar@example.com', + :password => 's3cret!') + + project = @id_v3.projects.all.first + + access_key = '9c4e774a-f644-498f-90c4-970b3f817fc5' + secret_key = '7e084117-b13d-4656-9eca-85376b690897' + + # OpenStack Keystone requires the blob to be a JSON string - i.e. not JSON, but a string containing JSON :-/ + blob_json = {:access => access_key, + :secret => secret_key}.to_json + + # Make sure there are no existing ec2 credentials + @id_v3.os_credentials.all.select { |credential| credential.type == 'foo' || credential.type == 'ec2' }.each do |credential| + credential.destroy + end + expect(@id_v3.os_credentials.all.select { |credential| credential.type == 'ec2' }.length).to be 0 + + # Create a credential + foo_credential = @id_v3.os_credentials.create(:type => 'ec2', + :project_id => project.id, + :user_id => foobar_user.id, + :blob => blob_json) + credential_id = foo_credential.id + expect(@id_v3.os_credentials.all.select { |credential| credential.type == 'ec2' }.length).to be 1 + + # Update secret key + new_secret_key = '62307bcd-ca3c-47ae-a114-27a6cadb5bc9' + new_blob_json = {:access => access_key, + :secret => new_secret_key}.to_json + foo_credential.update(:blob => new_blob_json) + expect(JSON.parse(foo_credential.blob)['secret']).to eq new_secret_key + + # Read the credential freshly and check the secret key + expect(@id_v3.os_credentials.all.select { |credential| credential.type == 'ec2' }.length).to be 1 + updated_credential = @id_v3.os_credentials.find_by_id credential_id + expect(updated_credential).to_not be_nil + expect(updated_credential.type).to eq 'ec2' + expect(JSON.parse(updated_credential.blob)['secret']).to eq new_secret_key + + # Delete the credential + updated_credential.destroy + + # Check that the deletion worked + expect { @id_v3.os_credentials.find_by_id credential_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + expect(@id_v3.os_credentials.all.select { |credential| credential.type == 'ec2' }.length).to be 0 + end + end + + it "lists policies" do + VCR.use_cassette('idv3_policy') do + policies = @id_v3.policies + expect(policies).to_not be_nil + expect(policies.length).to be 0 + + policies_all = @id_v3.policies.all + expect(policies_all).to_not be_nil + expect(policies_all.length).to be 0 + + expect { @id_v3.policies.find_by_id 'atlantis' }.to raise_error(Fog::Identity::OpenStack::NotFound) + end + end + + it "CRUD policies" do + VCR.use_cassette('idv3_policy_crud') do + + blob = {'foobar_user' => ['role:compute-user']}.to_json + + # Make sure there are no existing policies + expect(@id_v3.policies.all.select { |policy| policy.type == 'application/json' }.length).to be 0 + + # Create a policy + foo_policy = @id_v3.policies.create(:type => 'application/json', + :blob => blob) + policy_id = foo_policy.id + expect(@id_v3.policies.all.select { |policy| policy.type == 'application/json' }.length).to be 1 + + # Update policy blob + new_blob = {'baz_user' => ['role:compute-user']}.to_json + foo_policy.update(:blob => new_blob) + expect(foo_policy.blob).to eq new_blob + + # Read the policy freshly and check the secret key + expect(@id_v3.policies.all.select { |policy| policy.type == 'application/json' }.length).to be 1 + updated_policy = @id_v3.policies.find_by_id policy_id + expect(updated_policy).to_not be_nil + expect(updated_policy.type).to eq 'application/json' + expect(updated_policy.blob).to eq new_blob + + # Delete the policy + updated_policy.destroy + + # Check that the deletion worked + expect { @id_v3.policies.find_by_id policy_id }.to raise_error(Fog::Identity::OpenStack::NotFound) + expect(@id_v3.policies.all.select { |policy| policy.type == 'application/json' }.length).to be 0 + end + end + +end