@@ -10,6 +10,14 @@ import (
|
||||
|
||||
// ---- 实例 IP ----
|
||||
|
||||
// @Summary ---- 实例 IP ----
|
||||
// @Tags 计算
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Param body body object true "请求体(见接口说明)"
|
||||
// @Success 200 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/change-public-ip [post]
|
||||
func (h *ociConfigHandler) changePublicIP(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -27,6 +35,14 @@ func (h *ociConfigHandler) changePublicIP(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"publicIp": ip})
|
||||
}
|
||||
|
||||
// @Summary 实例添加 IPv6 地址
|
||||
// @Tags 计算
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Param body body object true "请求体(见接口说明)"
|
||||
// @Success 201 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/ipv6-addresses [post]
|
||||
func (h *ociConfigHandler) addInstanceIpv6(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -45,6 +61,13 @@ func (h *ociConfigHandler) addInstanceIpv6(c *gin.Context) {
|
||||
c.JSON(http.StatusCreated, gin.H{"ipv6Address": address})
|
||||
}
|
||||
|
||||
// @Summary 移除实例 IPv6 地址
|
||||
// @Tags 计算
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Success 204 "无内容"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/ipv6-addresses [delete]
|
||||
func (h *ociConfigHandler) deleteInstanceIpv6(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -65,6 +88,13 @@ type attachVnicRequest struct {
|
||||
oci.AttachVnicInput
|
||||
}
|
||||
|
||||
// @Summary 实例 VNIC 列表
|
||||
// @Tags 计算
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Success 200 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/vnics [get]
|
||||
func (h *ociConfigHandler) listInstanceVnics(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -78,6 +108,14 @@ func (h *ociConfigHandler) listInstanceVnics(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, vnics)
|
||||
}
|
||||
|
||||
// @Summary 附加 VNIC
|
||||
// @Tags 计算
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Param body body attachVnicRequest true "请求体"
|
||||
// @Success 201 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/vnics [post]
|
||||
func (h *ociConfigHandler) attachVnic(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -96,6 +134,13 @@ func (h *ociConfigHandler) attachVnic(c *gin.Context) {
|
||||
c.JSON(http.StatusCreated, vnic)
|
||||
}
|
||||
|
||||
// @Summary 分离 VNIC
|
||||
// @Tags 计算
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param attachmentId path string true "attachmentId"
|
||||
// @Success 204 "无内容"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/vnic-attachments/{attachmentId} [delete]
|
||||
func (h *ociConfigHandler) detachVnic(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -109,6 +154,15 @@ func (h *ociConfigHandler) detachVnic(c *gin.Context) {
|
||||
}
|
||||
|
||||
// addVnicIpv6 为指定 VNIC 添加 IPv6;body.address 留空自动分配。
|
||||
//
|
||||
// @Summary 为指定 VNIC 添加 IPv6
|
||||
// @Tags 计算
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param vnicId path string true "vnicId"
|
||||
// @Param body body object true "请求体(见接口说明)"
|
||||
// @Success 201 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/vnics/{vnicId}/ipv6-addresses [post]
|
||||
func (h *ociConfigHandler) addVnicIpv6(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -137,6 +191,13 @@ type attachBootVolumeRequest struct {
|
||||
BootVolumeID string `json:"bootVolumeId" binding:"required"`
|
||||
}
|
||||
|
||||
// @Summary 引导卷附件列表
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Success 200 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/boot-volume-attachments [get]
|
||||
func (h *ociConfigHandler) listBootVolumeAttachments(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -150,6 +211,14 @@ func (h *ociConfigHandler) listBootVolumeAttachments(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, atts)
|
||||
}
|
||||
|
||||
// @Summary 附加引导卷
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Param body body attachBootVolumeRequest true "请求体"
|
||||
// @Success 201 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/boot-volume-attachments [post]
|
||||
func (h *ociConfigHandler) attachBootVolume(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -168,6 +237,14 @@ func (h *ociConfigHandler) attachBootVolume(c *gin.Context) {
|
||||
c.JSON(http.StatusCreated, att)
|
||||
}
|
||||
|
||||
// @Summary 更换实例引导卷
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Param body body attachBootVolumeRequest true "请求体"
|
||||
// @Success 200 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/replace-boot-volume [post]
|
||||
func (h *ociConfigHandler) replaceBootVolume(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -186,6 +263,13 @@ func (h *ociConfigHandler) replaceBootVolume(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, att)
|
||||
}
|
||||
|
||||
// @Summary 分离引导卷
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param attachmentId path string true "attachmentId"
|
||||
// @Success 204 "无内容"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/boot-volume-attachments/{attachmentId} [delete]
|
||||
func (h *ociConfigHandler) detachBootVolume(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -206,6 +290,12 @@ type attachVolumeRequest struct {
|
||||
ReadOnly bool `json:"readOnly"`
|
||||
}
|
||||
|
||||
// @Summary 块存储卷列表
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Success 200 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/volumes [get]
|
||||
func (h *ociConfigHandler) listBlockVolumes(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -219,6 +309,13 @@ func (h *ociConfigHandler) listBlockVolumes(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, volumes)
|
||||
}
|
||||
|
||||
// @Summary 卷附件列表
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Success 200 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/volume-attachments [get]
|
||||
func (h *ociConfigHandler) listVolumeAttachments(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -232,6 +329,14 @@ func (h *ociConfigHandler) listVolumeAttachments(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, atts)
|
||||
}
|
||||
|
||||
// @Summary 附加块存储卷
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param instanceId path string true "instanceId"
|
||||
// @Param body body attachVolumeRequest true "请求体"
|
||||
// @Success 201 {object} map[string]any
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/instances/{instanceId}/volume-attachments [post]
|
||||
func (h *ociConfigHandler) attachVolume(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
@@ -250,6 +355,13 @@ func (h *ociConfigHandler) attachVolume(c *gin.Context) {
|
||||
c.JSON(http.StatusCreated, att)
|
||||
}
|
||||
|
||||
// @Summary 分离块存储卷
|
||||
// @Tags 存储
|
||||
// @Param id path int true "配置 ID"
|
||||
// @Param attachmentId path string true "attachmentId"
|
||||
// @Success 204 "无内容"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/oci-configs/{id}/volume-attachments/{attachmentId} [delete]
|
||||
func (h *ociConfigHandler) detachVolume(c *gin.Context) {
|
||||
id, ok := pathID(c)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user