Skip to content

Commit

Permalink
Adding ghe-manage-v1-initialize-instance-configuration-with-license-u…
Browse files Browse the repository at this point in the history
…pload.sh for #178
  • Loading branch information
gm3dmo committed Nov 15, 2024
1 parent 3a1d798 commit 7d5b4d4
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ghe-manage-v1-get-the-configured-ssh-keys.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-server@3.14/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-configured-ssh-keys
# https://docs.github.com/en/enterprise-server/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-configured-ssh-keys
# GET /manage/v1/access/ssh


Expand Down
2 changes: 1 addition & 1 deletion ghe-manage-v1-get-the-enterprise-license-information.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-server@3.14/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-enterprise-license-information
# https://docs.github.com/en/enterprise-server/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-enterprise-license-information
# GET /manage/v1/config/license


Expand Down
2 changes: 1 addition & 1 deletion ghe-manage-v1-get-the-status-of-a-ghe-config-apply-run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-server@3.14/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-status-of-a-ghe-config-apply-run
# https://docs.github.com/en/enterprise-server/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-status-of-a-ghe-config-apply-run
# GET /manage/v1/config/apply

curl ${curl_custom_flags} \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-server@3.14/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-status-of-services-running-on-all-cluster-nodes
# https://docs.github.com/en/enterprise-server/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-status-of-services-running-on-all-cluster-nodes
# GET /manage/v1/cluster/status

curl ${curl_custom_flags} \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-server@3.14/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-system-requirement-check-results-for-configured-cluster-nodes
# https://docs.github.com/en/enterprise-server/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#get-the-system-requirement-check-results-for-configured-cluster-nodes
# GET /manage/v1/checks/system-requirements


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/[email protected]/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#initialize-instance-configuration-with-license-upload
# POST /manage/v1/config/init


if [ -z "$1" ]
then
license_file="tmp/enterprise.ghl"
else
license_file=$1
fi


curl -L ${curl_custom_flags} \
-u "api_key:${mgmt_password}" \
-H "Content-Type: multipart/form-data" \
"https://${hostname}:${mgmt_port}/manage/v1/config/init" --form "license=@${license_file}"

# This fails
# "https://${hostname}:${mgmt_port}/manage/v1/config/init" --form "license=@${license_file}" --form "password=${mgmt_password}"
# The error message:
# {"error":{"message":"failed to initialize config: invalid request: password already set","request_id":"602e3c4a-4a50-4d9b-8539-f0dfe794d3b4"}}
curl: (22) The requested URL returned error: 400


2 changes: 1 addition & 1 deletion ghe-manage-v1-trigger-a-ghe-config-apply-run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-server@3.14/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#trigger-a-ghe-config-apply-run
# https://docs.github.com/en/enterprise-server/rest/enterprise-admin/manage-ghes?apiVersion=2022-11-28#trigger-a-ghe-config-apply-run
# POST /manage/v1/config/apply

curl -L ${curl_custom_flags} \
Expand Down

0 comments on commit 7d5b4d4

Please sign in to comment.