-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
3 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
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
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
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
18 changes: 18 additions & 0 deletions
18
gate-web/src/main/java/com/netflix/spinnaker/gate/util/OesRestApi.java
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,18 @@ | ||
package com.netflix.spinnaker.gate.util; | ||
|
||
import java.io.IOException; | ||
import okhttp3.*; | ||
|
||
public class OesRestApi { | ||
private static OkHttpClient httpClient = new OkHttpClient(); | ||
|
||
public static boolean initiateUserGroupInPlatform(String url) throws IOException { | ||
MediaType JSON = MediaType.parse("application/json; charset=utf-8"); | ||
RequestBody body = RequestBody.create(JSON, ""); | ||
Request request = new Request.Builder().url(url).put(body).build(); | ||
|
||
try (Response response = httpClient.newCall(request).execute()) { | ||
return response.isSuccessful(); | ||
} | ||
} | ||
} |