|
9 | 9 |
|
10 | 10 | type ( |
11 | 11 | IRuntimeAPI interface { |
12 | | - Create(ctx context.Context, opts *model.RuntimeInstallationArgs) (*model.RuntimeCreationResponse, error) |
| 12 | + Create(ctx context.Context, runtimeName, cluster, runtimeVersion, ingressHost string, componentNames []string) (*model.RuntimeCreationResponse, error) |
13 | 13 | Get(ctx context.Context, name string) (*model.Runtime, error) |
14 | 14 | List(ctx context.Context) ([]model.Runtime, error) |
15 | 15 | Delete(ctx context.Context, runtimeName string) (int, error) |
@@ -52,18 +52,24 @@ func newArgoRuntimeAPI(codefresh *codefresh) IRuntimeAPI { |
52 | 52 | return &argoRuntime{codefresh: codefresh} |
53 | 53 | } |
54 | 54 |
|
55 | | -func (r *argoRuntime) Create(ctx context.Context, opts *model.RuntimeInstallationArgs) (*model.RuntimeCreationResponse, error) { |
| 55 | +func (r *argoRuntime) Create(ctx context.Context, runtimeName, cluster, runtimeVersion, ingressHost string, componentNames []string) (*model.RuntimeCreationResponse, error) { |
56 | 56 | jsonData := map[string]interface{}{ |
57 | 57 | "query": ` |
58 | | - mutation CreateRuntime($installationArgs: RuntimeInstallationArgs!) { |
59 | | - runtime(installationArgs: $installationArgs) { |
| 58 | + mutation CreateRuntime( |
| 59 | + $runtimeName: String!, $cluster: String!, $runtimeVersion: String!, $ingressHost: String, $componentNames: [String]! |
| 60 | + ) { |
| 61 | + runtime(runtimeName: $runtimeName, cluster: $cluster, runtimeVersion: $runtimeVersion, ingressHost: $ingressHost, componentNames: $componentNames) { |
60 | 62 | name |
61 | 63 | newAccessToken |
62 | 64 | } |
63 | 65 | } |
64 | 66 | `, |
65 | 67 | "variables": map[string]interface{}{ |
66 | | - "installationArgs": opts, |
| 68 | + "runtimeName": runtimeName, |
| 69 | + "cluster": cluster, |
| 70 | + "runtimeVersion": runtimeVersion, |
| 71 | + "ingressHost": ingressHost, |
| 72 | + "componentNames": componentNames, |
67 | 73 | }, |
68 | 74 | } |
69 | 75 |
|
|
0 commit comments