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

Command to create the organisations in chef server #6534

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

sonali523
Copy link
Contributor

@sonali523 sonali523 commented Jan 10, 2022

🔩 Description: What code changed, and why?

Command to add the sample data of organisations in chef server using web ui key

⛓️ Related Resources

#6532

👍 Definition of Done

I have added changes to load the sample data of organisations in chef server
Using command we can add the sample organisations in server on chef server side using web ui key.
For script, added an API to create the organisations on chef server.
API reads the web ui key of given chef server and make request to create an organisations.

👟 How to Build and Test the Change

  1. Command to add the orgs in server
    You need to enter the hab studio then check the services are running.
    To start the services you can use start_infra_proxy_service or start_all_services
    Then run infra_service_load_sample_orgs

    Options:
    -N: Number of records, default 50
    -S: Chef infra server id, which should be available on chef server and added in automate
    -O: Chef organization's name prefix, default: chef-org

    Example:
    infra_service_load_sample_orgs -N 50 -S local-dev -O chef-org

  2. API to create an orgs in chef server
    Steps to build:

    rebuild components/infra-proxy-service
    rebuild components/automate-gateway
    

    Steps to test:

    1. Ensure Chef Infra Server is running. If it is not start it with start_chef_server
    2. Add the chef-server test environment credentials and extract the SERVER IDs
    3. Add the organisation name and full name in the request.

    Request

    curl --location --request POST 'https://a2-dev.test/api/v0/infra/servers/{SERVERID}/infraserverorgs' \
    --header 'api-token: your admin token' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "name":"test",
      "full_name": "test chef software"
    }'
    

    Response
    {}

✅ Checklist

All PRs must tick these:

With occasional exceptions, all PRs from Progress employees must tick these:

  • Is the code clear? (complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)
  • Consistency checked? (user notifications, user prompts, visual patterns, code patterns, variable names)
  • Repeated code blocks eliminated? (adapt and reuse existing components, blocks, functions, etc.)
  • Spelling, grammar, typos checked? (at a minimum use make spell in any component directory)
  • Code well-formatted? (indents, line breaks, etc. improve rather than hinder readability)

All PRs from Progress employees should tick these if appropriate:

  • Tests added/updated? (all new code needs new tests)
  • Docs added/updated? (all customer-facing changes)

Please add a note next to any checkbox above if you are NOT ticking it.

📷 Screenshots, if applicable

@sonali523 sonali523 added automate-infra-proxy-api using for automate infra proxy backend api's Team: Stalwart Migrate Chef Manage, UI bugs, UX improvements, CVE Issues infra-user-mgnt labels Jan 10, 2022
@sonali523 sonali523 self-assigned this Jan 10, 2022
sonali wale added 2 commits January 11, 2022 18:56
Signed-off-by: sonali wale <sonali.wale@progress.com>
Signed-off-by: sonali wale <sonali.wale@progress.com>
@sonarcloud
Copy link

sonarcloud bot commented Jan 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@kalroy kalroy merged commit 6743922 into feature/infra_user_management Jan 12, 2022
@kalroy kalroy deleted the sonali/sample_orgs_data branch January 12, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automate-infra-proxy-api using for automate infra proxy backend api's infra-user-mgnt Team: Stalwart Migrate Chef Manage, UI bugs, UX improvements, CVE Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants