cdn.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 (
  16. "yunion.io/x/cloudmux/pkg/apis/compute"
  17. "yunion.io/x/cloudmux/pkg/cloudprovider"
  18. "yunion.io/x/onecloud/pkg/apis"
  19. )
  20. const (
  21. CDN_DOMAIN_STATUS_ONLINE = compute.CDN_DOMAIN_STATUS_ONLINE
  22. CDN_DOMAIN_STATUS_OFFLINE = compute.CDN_DOMAIN_STATUS_OFFLINE
  23. CDN_DOMAIN_STATUS_DELETING = "deleting"
  24. CDN_DOMAIN_STATUS_DELETE_FAILED = "delete_failed"
  25. CDN_DOMAIN_STATUS_PROCESSING = compute.CDN_DOMAIN_STATUS_PROCESSING
  26. CDN_DOMAIN_STATUS_REJECTED = compute.CDN_DOMAIN_STATUS_REJECTED
  27. CDN_DOMAIN_STATUS_UNKNOWN = "unknown"
  28. CDN_DOMAIN_AREA_MAINLAND = compute.CDN_DOMAIN_AREA_MAINLAND
  29. CDN_DOMAIN_AREA_OVERSEAS = compute.CDN_DOMAIN_AREA_OVERSEAS
  30. CDN_DOMAIN_AREA_GLOBAL = compute.CDN_DOMAIN_AREA_GLOBAL
  31. CDN_DOMAIN_ORIGIN_TYPE_DOMAIN = "domain"
  32. CDN_DOMAIN_ORIGIN_TYPE_IP = "ip"
  33. CDN_DOMAIN_ORIGIN_TYPE_BUCKET = compute.CDN_DOMAIN_ORIGIN_TYPE_BUCKET
  34. CDN_DOMAIN_ORIGIN_THIRED_PARTY = "third_party"
  35. // Qcloud
  36. CDN_SERVICE_TYPE_WEB = "web" // 静态加速
  37. CND_SERVICE_TYPE_DOWNLOAD = "download" // 下载加速
  38. CND_SERVICE_TYPE_MEDIA = "media" // 流媒体点播加速
  39. )
  40. type CdnDomain struct {
  41. // cdn加速域名
  42. Domain string `json:"domain"`
  43. // 状态 rejected(域名未审核)|processing(部署中)|online|offline
  44. Status string `json:"status"`
  45. // 区域 mainland|overseas|global
  46. Area string `json:"area"`
  47. // cdn Cname
  48. Cname string `json:"cname"`
  49. // 源站
  50. Origin string `json:"origin"`
  51. // 源站类型 domain|ip|bucket
  52. OriginType string `json:"origin_type"`
  53. }
  54. type CdnDomains struct {
  55. Data []CdnDomain `json:"data"`
  56. }
  57. type CDNDomainCreateInput struct {
  58. apis.EnabledStatusInfrasResourceBaseCreateInput
  59. // 源站信息
  60. // required: true
  61. Origins *cloudprovider.SCdnOrigins
  62. // 服务类型
  63. // required: true
  64. // enmu: web, download, media
  65. ServiceType string `json:"service_type"`
  66. // 加速区域
  67. // enmu: mainland, overseas, global
  68. // requrired: true
  69. Area string `json:"area"`
  70. CloudproviderResourceInput
  71. DeletePreventableCreateInput
  72. }
  73. type CDNDomainDetails struct {
  74. apis.VirtualResourceDetails
  75. ManagedResourceInfo
  76. }
  77. type CDNDomainListInput struct {
  78. apis.VirtualResourceListInput
  79. apis.ExternalizedResourceBaseListInput
  80. apis.EnabledResourceBaseListInput
  81. ManagedResourceListInput
  82. }
  83. type CDNCustomHostnameOutput struct {
  84. Data []cloudprovider.CustomHostname `json:"data"`
  85. }
  86. type CDNDeleteCustomHostnameInput struct {
  87. Id string `json:"id"`
  88. }