@@ -21,15 +21,12 @@ public class WMLConnectorImpl extends ConnectorImpl implements WMLConnector {
2121
2222
2323
24- Credentials credentials ;
25- String wml_url ;
26- String instance_id ;
27-
28- String api_url = null ;
24+ protected String wml_url ;
25+ protected String wml_instance_id ;
26+ protected String api_url = null ;
2927
3028 public WMLConnectorImpl (Credentials credentials ) {
31- super (credentials .IAM_URL , credentials .USE_V4_FINAL ? credentials .USER_APIKEY : credentials .WML_APIKEY );
32- this .credentials = credentials ;
29+ super (credentials , false );
3330 this .wml_url = credentials .WML_URL ;
3431 if (credentials .USE_V4_FINAL ) {
3532 api_url = credentials .API_URL ;
@@ -38,7 +35,7 @@ public WMLConnectorImpl(Credentials credentials) {
3835 LOGGER .info ("WMLConnector using V4 BETA APIs" );
3936 }
4037
41- this .instance_id = credentials .WML_INSTANCE_ID ;
38+ this .wml_instance_id = credentials .WML_INSTANCE_ID ;
4239 lookupBearerToken ();
4340 }
4441
@@ -64,7 +61,7 @@ public void updateStatus() {
6461 HashMap <String , String > headers = new HashMap <String , String >();
6562 headers .put ("Accept" , "application/json" );
6663 headers .put ("Authorization" , "bearer " + bearerToken );
67- headers .put ("ML-Instance-ID" , instance_id );
64+ headers .put ("ML-Instance-ID" , wml_instance_id );
6865 headers .put ("cache-control" , "no-cache" );
6966
7067 String url = "" ;
@@ -163,7 +160,7 @@ public void delete() {
163160 HashMap <String , String > headers = new HashMap <String , String >();
164161 headers .put ("Accept" , "application/json" );
165162 headers .put ("Authorization" , "bearer " + bearerToken );
166- headers .put ("ML-Instance-ID" , instance_id );
163+ headers .put ("ML-Instance-ID" , wml_instance_id );
167164 headers .put ("cache-control" , "no-cache" );
168165
169166 doDelete (wml_url + "/v4/jobs/" + job_id + "?hard_delete=true" , headers );
@@ -399,7 +396,7 @@ public WMLJob createJob(String deployment_id,
399396 HashMap <String , String > headers = new HashMap <String , String >();
400397 headers .put ("Accept" , "application/json" );
401398 headers .put ("Authorization" , "bearer " + bearerToken );
402- headers .put ("ML-Instance-ID" , instance_id );
399+ headers .put ("ML-Instance-ID" , wml_instance_id );
403400 headers .put ("cache-control" , "no-cache" );
404401 headers .put ("Content-Type" , "application/json" );
405402
@@ -500,7 +497,7 @@ public String createNewModel(String modelName, ModelType type, String modelAsset
500497 {
501498 HashMap <String , String > headers = new HashMap <String , String >();
502499 headers .put ("Authorization" , "bearer " + bearerToken );
503- headers .put ("ML-Instance-ID" , instance_id );
500+ headers .put ("ML-Instance-ID" , wml_instance_id );
504501 headers .put ("cache-control" , "no-cache" );
505502 headers .put ("Content-Type" , "application/json" );
506503
@@ -531,7 +528,7 @@ public String createNewModel(String modelName, ModelType type, String modelAsset
531528 {
532529 HashMap <String , String > headers = new HashMap <String , String >();
533530 headers .put ("Authorization" , "bearer " + bearerToken );
534- headers .put ("ML-Instance-ID" , instance_id );
531+ headers .put ("ML-Instance-ID" , wml_instance_id );
535532 headers .put ("cache-control" , "no-cache" );
536533
537534
@@ -557,7 +554,7 @@ public String getModelHref(String modelId, boolean displayModel) {
557554
558555 HashMap <String , String > headers = new HashMap <String , String >();
559556 headers .put ("Authorization" , "bearer " + bearerToken );
560- headers .put ("ML-Instance-ID" , instance_id );
557+ headers .put ("ML-Instance-ID" , wml_instance_id );
561558 headers .put ("cache-control" , "no-cache" );
562559 headers .put ("Content-Type" , "application/json" );
563560
@@ -574,7 +571,7 @@ public String deployModel(String deployName, String model_id, TShirtSize size, i
574571
575572 HashMap <String , String > headers = new HashMap <String , String >();
576573 headers .put ("Authorization" , "bearer " + bearerToken );
577- headers .put ("ML-Instance-ID" , instance_id );
574+ headers .put ("ML-Instance-ID" , wml_instance_id );
578575 headers .put ("cache-control" , "no-cache" );
579576 headers .put ("Content-Type" , "application/json" );
580577
@@ -616,7 +613,7 @@ public void deleteDeployment(String deployment_id) {
616613
617614 HashMap <String , String > headers = new HashMap <String , String >();
618615 headers .put ("Authorization" , "bearer " + bearerToken );
619- headers .put ("ML-Instance-ID" , instance_id );
616+ headers .put ("ML-Instance-ID" , wml_instance_id );
620617 headers .put ("cache-control" , "no-cache" );
621618 headers .put ("Content-Type" , "application/json" );
622619
@@ -662,7 +659,7 @@ public String createDeploymentSpace(String name) {
662659 HashMap <String , String > headers = new HashMap <String , String >();
663660 headers .put ("Accept" , "application/json" );
664661 headers .put ("Authorization" , "bearer " + bearerToken );
665- headers .put ("ML-Instance-ID" , instance_id );
662+ headers .put ("ML-Instance-ID" , wml_instance_id );
666663 headers .put ("cache-control" , "no-cache" );
667664 headers .put ("Content-Type" , "application/json" );
668665
@@ -713,7 +710,7 @@ public JSONObject getDeployments() {
713710 HashMap <String , String > headers = new HashMap <String , String >();
714711 headers .put ("Accept" , "application/json" );
715712 headers .put ("Authorization" , "bearer " + bearerToken );
716- headers .put ("ML-Instance-ID" , instance_id );
713+ headers .put ("ML-Instance-ID" , wml_instance_id );
717714 headers .put ("cache-control" , "no-cache" );
718715
719716 String url = "" ;
0 commit comments