New tenants list (#1160)

* New Tenants Listing

* Removed all warnings and duplciate comments
This commit is contained in:
Daniel Valdivia
2021-10-28 10:29:38 -07:00
committed by GitHub
parent 610c8a4653
commit 7a5cc660d4
18 changed files with 735 additions and 259 deletions

View File

@@ -379,7 +379,7 @@ func init() {
"tags": [
"UserAPI"
],
"summary": "Logout from Console.",
"summary": "Logout from Operator.",
"operationId": "Logout",
"responses": {
"200": {
@@ -2895,6 +2895,22 @@ func init() {
"tenantList": {
"type": "object",
"properties": {
"capacity": {
"type": "integer",
"format": "int64"
},
"capacity_raw": {
"type": "integer",
"format": "int64"
},
"capacity_raw_usage": {
"type": "integer",
"format": "int64"
},
"capacity_usage": {
"type": "integer",
"format": "int64"
},
"creation_date": {
"type": "string"
},
@@ -3007,6 +3023,27 @@ func init() {
"health_status": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"capacity": {
"type": "integer",
"format": "int64"
},
"capacity_usage": {
"type": "integer",
"format": "int64"
},
"raw": {
"type": "integer",
"format": "int64"
},
"raw_usage": {
"type": "integer",
"format": "int64"
}
}
},
"write_quorum": {
"type": "integer",
"format": "int32"
@@ -3526,7 +3563,7 @@ func init() {
"tags": [
"UserAPI"
],
"summary": "Logout from Console.",
"summary": "Logout from Operator.",
"operationId": "Logout",
"responses": {
"200": {
@@ -5203,6 +5240,27 @@ func init() {
}
}
},
"TenantStatusUsage": {
"type": "object",
"properties": {
"capacity": {
"type": "integer",
"format": "int64"
},
"capacity_usage": {
"type": "integer",
"format": "int64"
},
"raw": {
"type": "integer",
"format": "int64"
},
"raw_usage": {
"type": "integer",
"format": "int64"
}
}
},
"UpdateTenantSecurityRequestCustomCertificates": {
"type": "object",
"properties": {
@@ -6599,6 +6657,22 @@ func init() {
"tenantList": {
"type": "object",
"properties": {
"capacity": {
"type": "integer",
"format": "int64"
},
"capacity_raw": {
"type": "integer",
"format": "int64"
},
"capacity_raw_usage": {
"type": "integer",
"format": "int64"
},
"capacity_usage": {
"type": "integer",
"format": "int64"
},
"creation_date": {
"type": "string"
},
@@ -6711,6 +6785,27 @@ func init() {
"health_status": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"capacity": {
"type": "integer",
"format": "int64"
},
"capacity_usage": {
"type": "integer",
"format": "int64"
},
"raw": {
"type": "integer",
"format": "int64"
},
"raw_usage": {
"type": "integer",
"format": "int64"
}
}
},
"write_quorum": {
"type": "integer",
"format": "int32"

View File

@@ -50,7 +50,7 @@ func NewLogout(ctx *middleware.Context, handler LogoutHandler) *Logout {
/* Logout swagger:route POST /logout UserAPI logout
Logout from Console.
Logout from Operator.
*/
type Logout struct {

View File

@@ -526,6 +526,12 @@ func getTenantDetailsResponse(session *models.Principal, params operator_api.Ten
DrivesOffline: minTenant.Status.DrivesOffline,
DrivesOnline: minTenant.Status.DrivesOnline,
WriteQuorum: minTenant.Status.WriteQuorum,
Usage: &models.TenantStatusUsage{
Raw: minTenant.Status.Usage.RawCapacity,
RawUsage: minTenant.Status.Usage.RawUsage,
Capacity: minTenant.Status.Usage.Capacity,
CapacityUsage: minTenant.Status.Usage.Usage,
},
}
// get tenant service
@@ -824,16 +830,20 @@ func listTenants(ctx context.Context, operatorClient OperatorClientI, namespace
}
tenants = append(tenants, &models.TenantList{
CreationDate: tenant.ObjectMeta.CreationTimestamp.Format(time.RFC3339),
DeletionDate: deletion,
Name: tenant.ObjectMeta.Name,
PoolCount: int64(len(tenant.Spec.Pools)),
InstanceCount: instanceCount,
VolumeCount: volumeCount,
CurrentState: tenant.Status.CurrentState,
Namespace: tenant.ObjectMeta.Namespace,
TotalSize: totalSize,
HealthStatus: string(tenant.Status.HealthStatus),
CreationDate: tenant.ObjectMeta.CreationTimestamp.Format(time.RFC3339),
DeletionDate: deletion,
Name: tenant.ObjectMeta.Name,
PoolCount: int64(len(tenant.Spec.Pools)),
InstanceCount: instanceCount,
VolumeCount: volumeCount,
CurrentState: tenant.Status.CurrentState,
Namespace: tenant.ObjectMeta.Namespace,
TotalSize: totalSize,
HealthStatus: string(tenant.Status.HealthStatus),
CapacityRaw: tenant.Status.Usage.RawCapacity,
CapacityRawUsage: tenant.Status.Usage.RawUsage,
Capacity: tenant.Status.Usage.Capacity,
CapacityUsage: tenant.Status.Usage.Usage,
})
}