in google-cloud-server/src/main/kotlin/jetbrains/buildServer/clouds/google/GoogleCloudClientFactory.kt [71:109]
override fun parseImageData(params: CloudClientParameters): Collection<GoogleCloudImageDetails> {
if (!params.getParameter(CloudImageParameters.SOURCE_IMAGES_JSON).isNullOrEmpty()) {
return GoogleUtils.parseImageData(GoogleCloudImageDetails::class.java, params)
}
return params.cloudImages.map {
GoogleCloudImageDetails(
it.id!!,
it.getParameter(GoogleConstants.IMAGE_TYPE)?.let { type ->
GoogleCloudImageType.valueOf(type)
},
it.getParameter(GoogleConstants.SOURCE_PROJECT),
it.getParameter(GoogleConstants.SOURCE_IMAGE),
it.getParameter(GoogleConstants.SOURCE_IMAGE_FAMILY),
it.getParameter(GoogleConstants.INSTANCE_TEMPLATE),
it.getParameter(GoogleConstants.ZONE)!!,
it.getParameter(GoogleConstants.NETWORK_ID),
it.getParameter(GoogleConstants.SUBNET_ID),
it.getParameter(GoogleConstants.SUBNET_INPUT_ID),
(it.getParameter(GoogleConstants.SUBNET_MANUALLY) ?: "").toBoolean(),
(it.getParameter(GoogleConstants.MACHINE_CUSTOM) ?: "").toBoolean(),
it.getParameter(GoogleConstants.MACHINE_TYPE),
it.getParameter(GoogleConstants.MACHINE_CORES),
it.getParameter(GoogleConstants.MACHINE_MEMORY),
(it.getParameter(GoogleConstants.MACHINE_MEMORY_EXT) ?: "").toBoolean(),
(it.getParameter(GoogleConstants.MAX_INSTANCES_COUNT) ?: "1").toInt(),
it.agentPoolId,
it.getParameter(GoogleConstants.PROFILE_ID)!!,
(it.getParameter(GoogleConstants.PREEMPTIBLE) ?: "").toBoolean(),
it.getParameter(GoogleConstants.DISK_TYPE),
it.getParameter(GoogleConstants.DISK_SIZE_GB),
it.getParameter(GoogleConstants.METADATA),
(it.getParameter(GoogleConstants.GROWING_ID) ?: "").toBoolean(),
(it.getParameter(GoogleConstants.EXTERNAL_IP) ?: "").toBoolean(),
it.getParameter(GoogleConstants.SERVICE_ACCOUNT),
it.getParameter(GoogleConstants.SCOPES)
)
}
}