Bug #12004

API: cannot query environments by name

Added by Elodie B almost 3 years ago. Updated 7 days ago.

Status:Closed
Priority:Normal
Assignee:Shlomi Zadok
Category:API
Target version:1.9.3
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:1.9.2
Pull request:https://github.com/theforeman/foreman/pull/2800

Description

I upgraded from 1.8 series to 1.9.2 yesterday. With 1.8 I was able to get environments informations with the API by doing a GET with environment name, for example with curl:
curl -k -u user:secret -H "Accept: version=2,application/json" -H "Content-Type: application/json" https://foreman.mydomain/api/environments/production

Since the upgrade, I am only able to query environment with id:
curl -k -u user:secret -H "Content-Type: application/json" https://foreman.mydomain/api/environments/production
return "message": "Resource environment not found by id 'production'"

I sent an email to users mailing-list and Dominic told me to open an issue and it might be linked to #11037

Thank you


Related issues

Related to Foreman - Bug #11037: Puppet class importer crashes with ruby stack trace tryin... Closed 07/07/2015

Associated revisions

Revision eb8d0ff5
Added by Shlomi Zadok over 2 years ago

Fixes #12004, #11999 - Remove reserved words from Environment friendly_id

Restores use of friendly_id, but removes 'new', 'edit' etc from the
reserved words list to ensure they can be used as identifiers.

Reverts the id-name parameterization to purely name, which fixes
related bugs that caused the parameter value to be used as a Puppet
environment name in class imports, rather than the resource name.

Revision 30ef8b6f
Added by Shlomi Zadok over 2 years ago

Fixes #12004, #11999 - Remove reserved words from Environment friendly_id

Restores use of friendly_id, but removes 'new', 'edit' etc from the
reserved words list to ensure they can be used as identifiers.

Reverts the id-name parameterization to purely name, which fixes
related bugs that caused the parameter value to be used as a Puppet
environment name in class imports, rather than the resource name.

(cherry picked from commit eb8d0ff5fc76002f568bbb94eced10ca6b8b36a9)

Revision 879346fd
Added by Shlomi Zadok over 2 years ago

Fixes #12004, #11999 - Remove reserved words from Environment friendly_id

Restores use of friendly_id, but removes 'new', 'edit' etc from the
reserved words list to ensure they can be used as identifiers.

Reverts the id-name parameterization to purely name, which fixes
related bugs that caused the parameter value to be used as a Puppet
environment name in class imports, rather than the resource name.

(cherry picked from commit eb8d0ff5fc76002f568bbb94eced10ca6b8b36a9)

History

#1 Updated by Dominic Cleal almost 3 years ago

  • Related to Bug #11037: Puppet class importer crashes with ruby stack trace trying to import an environment named: new added

#2 Updated by Dominic Cleal almost 3 years ago

  • Category set to API
  • Legacy Backlogs Release (now unused) set to 91

#3 Updated by The Foreman Bot almost 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2800 added

#4 Updated by Shlomi Zadok almost 3 years ago

  • Assignee set to Shlomi Zadok

#5 Updated by Shlomi Zadok over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF