keypair.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package compute
  15. import "yunion.io/x/onecloud/pkg/apis"
  16. var KEYPAIR_SCHEMAS = []string{
  17. KEYPAIRE_SCHEME_RSA,
  18. // OpenSSH deprecated DSA keys
  19. //KEYPAIRE_SCHEME_DSA,
  20. KEYPAIRE_SCHEME_ECDSA,
  21. KEYPAIRE_SCHEME_ED25519,
  22. }
  23. type KeypairCreateInput struct {
  24. apis.UserResourceCreateInput
  25. // 公钥内容,若为空则自动生成公钥
  26. PublicKey string `json:"public_key"`
  27. // swagger:ignore
  28. PrivateKey string `json:"private_key"`
  29. // swagger:ignore
  30. Fingerprint string `json:"fingerprint"`
  31. // 秘钥类型
  32. // enum: ["RSA"]
  33. // default: RSA
  34. Scheme string `json:"scheme"`
  35. }
  36. type KeypairDetails struct {
  37. apis.UserResourceDetails
  38. apis.SharableResourceBaseInfo
  39. SKeypair
  40. // 私钥长度
  41. PrivateKeyLen int `json:"private_key_len"`
  42. // 关联云主机次数
  43. LinkedGuestCount int `json:"linked_guest_count"`
  44. }