Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

3scale application apply/create: cannot create an application if another app with the same user_key / app_id exists for another service #183

Closed
nmasse-itix opened this issue Jun 26, 2019 · 0 comments · Fixed by #186

Comments

@nmasse-itix
Copy link
Contributor

Current behavior

Create a service svc1, a plan and an app:

$ 3scale import openapi -d 3scale-saas -t svc1 https://raw.githubusercontent.com/rh-integration/3scale-toolbox-jenkins-samples/master/saas-usecase-apikey/swagger.yaml
Created service id: 2555417814790, name: Beer Catalog API
Service proxy updated
destroying all mapping rules
Created GET /api/beer/{name}$ endpoint
Created GET /api/beer/findByStatus/{status}$ endpoint
Created GET /api/beer$ endpoint

$ 3scale application-plan apply 3scale-saas svc1 test --name=test 
Applied application plan id: 2357356101963; Default: false

$ 3scale application apply 3scale-saas my-super-secret-key --account=nmasse+test@redhat.com --name="Test Application" --plan=test --service=svc1
Applied application id: 1409618476816

Create a service svc2, a plan and an app:

$ 3scale import openapi -d 3scale-saas -t svc2 https://raw.githubusercontent.com/rh-integration/3scale-toolbox-jenkins-samples/master/saas-usecase-apikey/swagger.yaml
Created service id: 2555417814794, name: Beer Catalog API
destroying all mapping rules
Created GET /api/beer/{name}$ endpoint
Created GET /api/beer/findByStatus/{status}$ endpoint
Created GET /api/beer$ endpoint
Service proxy updated

$ 3scale application-plan apply 3scale-saas svc2 test --name=test 
Applied application plan id: 2357356101966; Default: false

$ 3scale application apply 3scale-saas my-super-secret-key --account=nmasse+test@redhat.com --name="Test Application" --plan=test --service=svc2
Applied application id: 1409618476816

As you can see, the last call to application-plan apply update the application of svc1 instead of creating a new application for svc2.

Expected behavior

The last call to application-plan apply creates a new application for svc2:

$ 3scale application apply 3scale-saas my-super-secret-key --account=nmasse+test@redhat.com --name="Test Application" --plan=test --service=svc2
Applied application id: 123456

(When calling /admin/api/applications/find.json, specify the service_id to restrict the search to one specific service.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant