api: define and use REALM_ID_SCHEMA
This commit is contained in:
parent
1e7639bfc4
commit
2165f0d450
|
@ -18,8 +18,7 @@ use crate::api2::types::*;
|
||||||
description: "User configuration (without password).",
|
description: "User configuration (without password).",
|
||||||
properties: {
|
properties: {
|
||||||
realm: {
|
realm: {
|
||||||
description: "Realm ID.",
|
schema: REALM_ID_SCHEMA,
|
||||||
type: String,
|
|
||||||
},
|
},
|
||||||
comment: {
|
comment: {
|
||||||
schema: SINGLE_LINE_COMMENT_SCHEMA,
|
schema: SINGLE_LINE_COMMENT_SCHEMA,
|
||||||
|
|
|
@ -514,6 +514,12 @@ pub const BLOCKDEVICE_NAME_SCHEMA: Schema = StringSchema::new("Block device name
|
||||||
.max_length(64)
|
.max_length(64)
|
||||||
.schema();
|
.schema();
|
||||||
|
|
||||||
|
pub const REALM_ID_SCHEMA: Schema = StringSchema::new("Realm name.")
|
||||||
|
.format(&PROXMOX_SAFE_ID_FORMAT)
|
||||||
|
.min_length(2)
|
||||||
|
.max_length(32)
|
||||||
|
.schema();
|
||||||
|
|
||||||
// Complex type definitions
|
// Complex type definitions
|
||||||
|
|
||||||
#[api(
|
#[api(
|
||||||
|
|
Loading…
Reference in New Issue