This repository has been archived by the owner on Dec 2, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a powershell script to generate data identically to its bash …
…counterpart (#176)
- Loading branch information
1 parent
f2ec34e
commit c091c8e
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env powershell | ||
|
||
# This script is used to send requests to a Kubeflow metadata server to | ||
# verify it works. | ||
|
||
$Host_Addr = "http://localhost" | ||
$PORT = 8080 | ||
|
||
$CommonParams = @{"ContentType" = "application/json"} | ||
# List all artifact types. | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/artifact_types" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# List the predefined model type. | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/artifact_types/kubeflow.org/alpha/model" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# Update the specified model type. | ||
Invoke-RestMethod -Method 'PATCH' "${Host_Addr}:$PORT/api/v1alpha1/artifact_types" -Body $(cat update_model_type.json) @CommonParams | ConvertTo-Json -Compress | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/artifact_types/kubeflow.org/alpha/model" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# Add a model artifact | ||
Invoke-RestMethod -Method 'POST' "${Host_Addr}:$PORT/api/v1alpha1/artifact_types/kubeflow.org/alpha/model/artifacts" -Body $(cat artifact_model_1.json) @CommonParams | ConvertTo-Json -Compress | ||
|
||
# List all artifacts. | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/artifacts" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# List all model artifacts | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/artifact_types/kubeflow.org/alpha/model/artifacts" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# Get the model artifcat with ID=1. | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/artifact_types/kubeflow.org/alpha/model/artifacts/1" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# List all execution types. | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/execution_types" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# List the predefined execution type. | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/execution_types/kubeflow.org/alpha/execution" @CommonParams | ConvertTo-Json -Compress | ||
|
||
# Update the the specified execution type. | ||
Invoke-RestMethod -Method 'PATCH' "${Host_Addr}:$PORT/api/v1alpha1/execution_types" -Body $(cat update_execution_type.json) @CommonParams | ConvertTo-Json -Compress | ||
Invoke-RestMethod "${Host_Addr}:$PORT/api/v1alpha1/execution_types/kubeflow.org/alpha/execution" @CommonParams | ConvertTo-Json -Compress |