Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Created a powershell script to generate data identically to its bash …
Browse files Browse the repository at this point in the history
…counterpart (#176)
  • Loading branch information
avdaredevil authored and k8s-ci-robot committed Dec 3, 2019
1 parent f2ec34e commit c091c8e
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/e2e/Make-Requests.ps1
@@ -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

0 comments on commit c091c8e

Please sign in to comment.