google-cloud-java获取当前实例ID和区域

时间:2018-12-20 11:38:48

标签: google-cloud-platform

我有一个Java应用程序,需要知道它的实例ID。 如何使用google-cloud-java库执行此操作?

在Go中,这非常简单:

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {

    guard let image1 = info[UIImagePickerController.InfoKey.originalImage]
        as? UIImage else {
            return
    }
    print(image1)
  //  firstImg.image = image1 as UIImage
    if addAttachBtn1.isSelected == true{
         firstImg.image = image1 as UIImage
    }else if addAttach2.isSelected == true{
        secondImg.image = image1 as UIImage
    }else if addAttach3.isSelected{
        thirdImg.image = image1 as UIImage
    }else if addAttach4.isSelected{
        fourthImg.image = image1 as UIImage
    }else{
        fifthImg.image = image1
    }

    dismiss(animated:true, completion: nil)
}

1 个答案:

答案 0 :(得分:2)