Last active
February 16, 2023 12:44
-
-
Save tuxfight3r/0dcdab36e5ef46f82718bedc0cb62455 to your computer and use it in GitHub Desktop.
Revisions
-
tuxfight3r revised this gist
Sep 19, 2017 . No changes.There are no files selected for viewing
-
tuxfight3r revised this gist
Sep 19, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,27 +19,31 @@ curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ -X PATCH \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "test", "path": "/data/testpath1", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' #Add aditional value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ -X PATCH \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "add", "path": "/data/testpath1", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' #Delete a value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ -X PATCH \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "remove", "path": "/data/testpath4" }]' #Replace a value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ -X PATCH \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "replace", "path": "/data/testpath", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' @@ -50,13 +54,15 @@ curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/merge-patch+json" \ -H "Accept: application/json" \ -X PATCH \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '{"data":{"testpath2":"oliverconfigmaptest2"}}' #Remove a basic merge json via curl merges/adds the given data to a configmap curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/merge-patch+json" \ -H "Accept: application/json" \ -X PATCH \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '{"data":{"testpath4": null}}' -
tuxfight3r revised this gist
Sep 19, 2017 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,13 @@ curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest ## USES JSON PATCH ## #Test if a value exists inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "test", "path": "/data/testpath1", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' #Add aditional value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -
tuxfight3r revised this gist
Sep 19, 2017 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,5 +46,12 @@ curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '{"data":{"testpath2":"oliverconfigmaptest2"}}' #Remove a basic merge json via curl merges/adds the given data to a configmap curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/merge-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '{"data":{"testpath4": null}}'
-
tuxfight3r renamed this gist
Sep 19, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
tuxfight3r renamed this gist
Sep 19, 2017 . 1 changed file with 17 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,21 +12,33 @@ curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest ## USES JSON PATCH ## #Add aditional value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "add", "path": "/data/testpath1", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' #Delete a value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "remove", "path": "/data/testpath4" }]' #Replace a value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "replace", "path": "/data/testpath", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' ## USES MERGE PATCH ## #Add a basic merge json via curl merges/adds the given data to a configmap curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/merge-patch+json" \ -
tuxfight3r created this gist
Sep 19, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ #Login to openshift and retrieve token curl -u admin -kv -H "X-CSRF-Token: xxx" \ 'https://master.cluster.local:8443/oauth/authorize?client_id=openshift-challenging-client&response_type=token' #It should give you a bearer token like this https://master.cluster.local:8443/oauth/token/implicit#access_token=aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4&expires_in=86400&scope=user%3Afull&token_type=Bearer TOKEN="aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4" #Get a configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest #Replace a value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "replace", "path": "/data/testpath", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' #Add aditional value inside configmap named configmaptest curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/json-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '[{ "op": "add", "path": "/data/testpath1", "value": "CN=p-ocp-user,OU=openshift,OU=DEVOPS" }]' #Add a basic merge json via curl merges/adds the given data to a configmap curl -H 'Authorization: Bearer aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4' \ -H "Content-Type: application/merge-patch+json" \ -H "Accept: application/json" \ https://master.cluster.local:8443//api/v1/namespaces/ocp_test/configmaps/configmaptest \ --data '{"data":{"testpath2":"oliverconfigmaptest2"}}'