Skip to content

Commit f670a91

Browse files
committed
udpate vars
1 parent 91eab22 commit f670a91

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

r/sparkr/R/osconfig.R

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,24 +170,30 @@ CloudObjectStorage <- setRefClass("CloudObjectStorage",
170170
},
171171

172172
validateInput = function (credentials, cosType, authMethod) {
173+
requiredKeys = get_required_key_array(cosType, authMethod)
174+
175+
# check the existence of all required values in credentials
176+
for (name in names(requiredKeys)) {
177+
178+
}
173179

174180
},
175181

176182
get_required_key_array = function (cosType, authMethod) {
177-
required_key_softlayer_cos = ["endpoint", "accessKey", "secretKey"]
178-
required_key_list_iam_api_key = ["endpoint", "apiKey", "serviceId"]
179-
required_key_list_iam_token = ["endpoint", "iamToken", "serviceId"]
183+
requiredKeySoftlayerCos = list("endpoint", "accessKey", "secretKey")
184+
requiredKeyListIamApiKey = list("endpoint", "apiKey", "serviceId")
185+
requiredKeyListIamToken = list("endpoint", "iamToken", "serviceId")
180186

181187
if (cosType == "bluemix_cos") {
182188
if (authMethod == "api_key") {
183-
return required_key_list_iam_api_key
189+
return requiredKeyListIamApiKey
184190
} else if (authMethod == "iam_token") {
185-
return required_key_list_iam_token
191+
return requiredKeyListIamToken
186192
} else {
187193
stop("Invalid input: authMethod. authMethod is optional but if set, it should have one of the following values: api_key, iam_token")
188194
}
189195
} else if (cosType == "softlayer_cos") {
190-
return required_key_softlayer_cos
196+
return requiredKeySoftlayerCos
191197
} else {
192198
stop("Invalid input: cosType. cosType is optional but if set, it should have one of the following values: softlayer_cos, bluemix_cos")
193199
}

0 commit comments

Comments
 (0)