Skip to content

Commit

Permalink
Remove command to create an orgs
Browse files Browse the repository at this point in the history
Signed-off-by: sonali wale <sonali.wale@progress.com>
  • Loading branch information
sonali wale committed Jan 10, 2022
1 parent 07332a0 commit d251c51
Show file tree
Hide file tree
Showing 20 changed files with 1,570 additions and 2,359 deletions.
58 changes: 0 additions & 58 deletions .studio/infra-proxy-service
Original file line number Diff line number Diff line change
Expand Up @@ -331,61 +331,3 @@ EOF
done
log_line "Sample data loaded of $records users for server with server name '$server_prefix' and server id '$server_id'"
}

document "infra_service_load_sample_orgs" <<DOC
Before running this command make sure either run 'start_infra_proxy_service' or 'start_all_services'
Hits the create org endpoint inside the infra-proxy-service. (CreateInfraServerOrgs)
It creates the organisations on chef server
1. -N No of records Default: 50
2. -S Chef Infra Server id, which should be available on chef server and added in automate
3. -O Chef organization's name prefix Default: chef-org
Example:
-----------------------------
infra_service_load_sample_orgs -N 100 -S chef-server -O chef-org
DOC

function infra_service_load_sample_orgs() {
install_if_missing core/jq-static jq
install_if_missing core/grpcurl grpcurl

local OPTIND opt
local records=50
local server_id
local org_prefix="chef-org"
while getopts ":N:S:O:" opt; do
case $opt in
N) records="$OPTARG"
;;
S) server_id="$OPTARG"
;;
O) org_prefix="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
;;
: )
echo "Invalid option: $OPTARG requires an argument" 1>&2
;;
esac
done
shift $((OPTIND -1))

log_line "Started Loading sample organizations..."
log_line "Total number of records: $records"
log_line "Chef Infra Server's id: $server_id"
log_line "Chef organization's name prefix: $org_prefix"

local ip_address
local timestamp
for _ in $(seq 1 ${records}); do
timestamp=$(date +%s%N)

chef-automate dev grpcurl infra-proxy-service -- -d \
"$(cat << EOF
{"server_id": "${server_id}", "name": "${org_prefix}-${timestamp}", "full_name": "${org_prefix}-${timestamp}"}
EOF
)" chef.automate.domain.infra_proxy.service.InfraProxyService.CreateInfraServerOrgs >/dev/null
done
log_line "Sample organisations loaded..."
}
35 changes: 0 additions & 35 deletions api/external/infra_proxy/infra_proxy.pb.client_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d251c51

Please sign in to comment.