diff --git a/simplyblock_web/api/v2/cluster.py b/simplyblock_web/api/v2/cluster.py index 4100bbd3f..92e6169e6 100644 --- a/simplyblock_web/api/v2/cluster.py +++ b/simplyblock_web/api/v2/cluster.py @@ -45,38 +45,41 @@ class HashicorpVaultSettings(BaseModel): base_url: Optional[Annotated[AnyUrl, UrlConstraints(allowed_schemes=["https"])]] = None +_immutable = {"x-immutable": True} + + class ClusterParams(BaseModel): name: str = "" - blk_size: Literal[512, 4096] = 512 - page_size_in_blocks: int = Field(2097152, gt=0) + blk_size: Literal[512, 4096] = Field(default=512, json_schema_extra=_immutable) + page_size_in_blocks: int = Field(2097152, gt=0, json_schema_extra=_immutable) cap_warn: util.Percent = 0 cap_crit: util.Percent = 0 prov_cap_warn: util.Percent = 0 prov_cap_crit: util.Percent = 0 - distr_ndcs: int = 1 - distr_npcs: int = 1 - distr_bs: int = 4096 - distr_chunk_bs: int = 4096 - ha_type: Literal['single', 'ha'] = 'ha' - qpair_count: int = 256 - max_queue_size: int = 128 - inflight_io_threshold: int = 4 - enable_node_affinity: bool = False - strict_node_anti_affinity: bool = False - is_single_node: bool = False - fabric: str = "tcp" + distr_ndcs: int = Field(default=1, json_schema_extra=_immutable) + distr_npcs: int = Field(default=1, json_schema_extra=_immutable) + distr_bs: int = Field(default=4096, json_schema_extra=_immutable) + distr_chunk_bs: int = Field(default=4096, json_schema_extra=_immutable) + ha_type: Literal['single', 'ha'] = Field(default='ha', json_schema_extra=_immutable) + qpair_count: int = Field(default=256, json_schema_extra=_immutable) + max_queue_size: int = Field(default=128, json_schema_extra=_immutable) + inflight_io_threshold: int = Field(default=4, json_schema_extra=_immutable) + enable_node_affinity: bool = Field(default=False, json_schema_extra=_immutable) + strict_node_anti_affinity: bool = Field(default=False, json_schema_extra=_immutable) + is_single_node: bool = Field(default=False, json_schema_extra=_immutable) + fabric: str = Field(default="tcp", json_schema_extra=_immutable) cr_name: str = "" cr_namespace: str = "" cr_plural: str = "" cluster_ip: str = "" grafana_secret: str = "" - client_data_nic: str = "" - max_fault_tolerance: int = 1 - nvmf_base_port: int = 4420 - rpc_base_port: int = 8080 - snode_api_port: int = 50001 + client_data_nic: str = Field(default="", json_schema_extra=_immutable) + max_fault_tolerance: int = Field(default=1, json_schema_extra=_immutable) + nvmf_base_port: int = Field(default=4420, json_schema_extra=_immutable) + rpc_base_port: int = Field(default=8080, json_schema_extra=_immutable) + snode_api_port: int = Field(default=50001, json_schema_extra=_immutable) backup_config: Optional[BackupConfigParams] = None - hashicorp_vault_settings: Optional[HashicorpVaultSettings] = None + hashicorp_vault_settings: Optional[HashicorpVaultSettings] = Field(default=None, json_schema_extra=_immutable) @api.get('/', name='clusters:list') diff --git a/simplyblock_web/static/openapi.json b/simplyblock_web/static/openapi.json index 883326f2a..ae5fbe229 100644 --- a/simplyblock_web/static/openapi.json +++ b/simplyblock_web/static/openapi.json @@ -6048,13 +6048,15 @@ 4096 ], "title": "Blk Size", - "default": 512 + "default": 512, + "x-immutable": true }, "page_size_in_blocks": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Page Size In Blocks", - "default": 2097152 + "default": 2097152, + "x-immutable": true }, "cap_warn": { "type": "integer", @@ -6087,22 +6089,26 @@ "distr_ndcs": { "type": "integer", "title": "Distr Ndcs", - "default": 1 + "default": 1, + "x-immutable": true }, "distr_npcs": { "type": "integer", "title": "Distr Npcs", - "default": 1 + "default": 1, + "x-immutable": true }, "distr_bs": { "type": "integer", "title": "Distr Bs", - "default": 4096 + "default": 4096, + "x-immutable": true }, "distr_chunk_bs": { "type": "integer", "title": "Distr Chunk Bs", - "default": 4096 + "default": 4096, + "x-immutable": true }, "ha_type": { "type": "string", @@ -6111,42 +6117,50 @@ "ha" ], "title": "Ha Type", - "default": "ha" + "default": "ha", + "x-immutable": true }, "qpair_count": { "type": "integer", "title": "Qpair Count", - "default": 256 + "default": 256, + "x-immutable": true }, "max_queue_size": { "type": "integer", "title": "Max Queue Size", - "default": 128 + "default": 128, + "x-immutable": true }, "inflight_io_threshold": { "type": "integer", "title": "Inflight Io Threshold", - "default": 4 + "default": 4, + "x-immutable": true }, "enable_node_affinity": { "type": "boolean", "title": "Enable Node Affinity", - "default": false + "default": false, + "x-immutable": true }, "strict_node_anti_affinity": { "type": "boolean", "title": "Strict Node Anti Affinity", - "default": false + "default": false, + "x-immutable": true }, "is_single_node": { "type": "boolean", "title": "Is Single Node", - "default": false + "default": false, + "x-immutable": true }, "fabric": { "type": "string", "title": "Fabric", - "default": "tcp" + "default": "tcp", + "x-immutable": true }, "cr_name": { "type": "string", @@ -6176,27 +6190,32 @@ "client_data_nic": { "type": "string", "title": "Client Data Nic", - "default": "" + "default": "", + "x-immutable": true }, "max_fault_tolerance": { "type": "integer", "title": "Max Fault Tolerance", - "default": 1 + "default": 1, + "x-immutable": true }, "nvmf_base_port": { "type": "integer", "title": "Nvmf Base Port", - "default": 4420 + "default": 4420, + "x-immutable": true }, "rpc_base_port": { "type": "integer", "title": "Rpc Base Port", - "default": 8080 + "default": 8080, + "x-immutable": true }, "snode_api_port": { "type": "integer", "title": "Snode Api Port", - "default": 50001 + "default": 50001, + "x-immutable": true }, "backup_config": { "anyOf": [ @@ -8125,4 +8144,4 @@ } } } -} \ No newline at end of file +}