Skip to content

ark_uap_sia_db_profiles

ArkUAPSIADBMongoAuthProfile

Bases: ArkUAPSIADBProfile

Source code in ark_sdk_python/models/services/uap/sia/db/ark_uap_sia_db_profiles.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
class ArkUAPSIADBMongoAuthProfile(ArkUAPSIADBProfile):
    global_builtin_roles: Annotated[
        List[ArkSIADBMongoGlobalBuiltinRole],
        Field(max_length=DB_PROFILE_MAXIMUM_ENTITIES, description='The list of global builtin roles to assign to the user'),
    ]
    database_builtin_roles: Annotated[
        Dict[
            DatabaseName,
            Annotated[
                List[ArkSIADBMongoDatabaseBuiltinRole],
                Field(
                    max_length=DB_PROFILE_MAXIMUM_ENTITIES,
                    description='The list of database specific builtin roles to assign to the user upon connecting to the specified database',
                ),
            ],
        ],
        Field(
            max_length=UAP_SIA_DB_TARGETS_MAX_ITEMS_COUNT,
            description='The list of database builtin roles to assign to the user, for each database',
        ),
    ]
    database_custom_roles: Annotated[
        Dict[
            DatabaseName,
            Annotated[
                List[Annotated[str, StringConstraints(strict=True, min_length=1, max_length=DB_ROLE_MAX_LENGTH)]],
                Field(
                    max_length=DB_PROFILE_MAXIMUM_ENTITIES,
                    description='The list of database specific custom roles to assign to the user upon connecting to the specified database',
                ),
            ],
        ],
        Field(
            max_length=UAP_SIA_DB_TARGETS_MAX_ITEMS_COUNT,
            description='The list of database custom roles to assign to the user, for each database',
        ),
    ]

    @overrides
    def databases_count(self) -> int:
        """
        Returns the number of all databases the defined by the profile.
        It includes all the databases defined by the profile, and the instance itself
        """
        return 1 + len(self.database_custom_roles.keys() | self.database_builtin_roles.keys())

    @model_validator(mode='after')
    def validate_global_roles(self) -> Self:
        _validate_global_roles(
            global_builtin_roles=self.global_builtin_roles,
            global_custom_roles=None,
            database_builtin_roles=self.database_builtin_roles,
            database_custom_roles=self.database_custom_roles,
        )

        return self

    @model_validator(mode='after')
    def validate_databases_roles(self) -> Self:
        _validate_databases_roles_logic(
            database_builtin_roles=self.database_builtin_roles,
            database_custom_roles=self.database_custom_roles,
        )

        return self

databases_count()

Returns the number of all databases the defined by the profile. It includes all the databases defined by the profile, and the instance itself

Source code in ark_sdk_python/models/services/uap/sia/db/ark_uap_sia_db_profiles.py
167
168
169
170
171
172
173
@overrides
def databases_count(self) -> int:
    """
    Returns the number of all databases the defined by the profile.
    It includes all the databases defined by the profile, and the instance itself
    """
    return 1 + len(self.database_custom_roles.keys() | self.database_builtin_roles.keys())

ArkUAPSIADBProfile

Bases: ArkCamelizedModel

Source code in ark_sdk_python/models/services/uap/sia/db/ark_uap_sia_db_profiles.py
89
90
91
92
93
94
95
class ArkUAPSIADBProfile(ArkCamelizedModel):
    # pylint: disable=no-self-use
    def databases_count(self) -> int:
        """
        Returns the number of all databases the defined by the profile.
        """
        return 1

databases_count()

Returns the number of all databases the defined by the profile.

Source code in ark_sdk_python/models/services/uap/sia/db/ark_uap_sia_db_profiles.py
91
92
93
94
95
def databases_count(self) -> int:
    """
    Returns the number of all databases the defined by the profile.
    """
    return 1

ArkUAPSIADBSqlServerAuthProfile

Bases: ArkUAPSIADBProfile

Source code in ark_sdk_python/models/services/uap/sia/db/ark_uap_sia_db_profiles.py
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
class ArkUAPSIADBSqlServerAuthProfile(ArkUAPSIADBProfile):
    global_builtin_roles: Annotated[
        List[ArkSIADBSqlServerGlobalBuiltinRole],
        Field(
            description='The list of global builtin roles to assign to the user',
            default_factory=list,
        ),
    ]
    global_custom_roles: Annotated[
        List[SqlServerRole],
        Field(
            max_length=DB_PROFILE_MAXIMUM_ENTITIES,
            description='The list of global custom roles to assign to the user',
            default_factory=list,
        ),
    ]
    database_builtin_roles: Annotated[
        Dict[
            DatabaseName,
            Annotated[
                List[ArkSIADBSqlServerDatabaseBuiltinRole],
                Field(
                    max_length=DB_PROFILE_MAXIMUM_ENTITIES,
                    description='The list of database specific builtin roles to assign to the user upon connecting to the specified database',
                ),
            ],
        ],
        Field(
            max_length=UAP_SIA_DB_TARGETS_MAX_ITEMS_COUNT,
            description='The list of database builtin roles to assign to the user, for each database',
            default_factory=dict,
        ),
    ]
    database_custom_roles: Annotated[
        Dict[
            DatabaseName,
            Annotated[
                List[SqlServerRole],
                Field(
                    max_length=DB_PROFILE_MAXIMUM_ENTITIES,
                    description='The list of per database specific custom roles to assign to the user upon connecting to the specified database',
                ),
            ],
        ],
        Field(
            max_length=UAP_SIA_DB_TARGETS_MAX_ITEMS_COUNT,
            description='The list of database custom roles to assign to the user, for each database',
            default_factory=dict,
        ),
    ]

    @overrides
    def databases_count(self) -> int:
        """
        Returns the number of all databases the defined by the profile.
        It includes all the databases defined by the profile, and the instance itself
        """
        return 1 + len(self.database_custom_roles.keys() | self.database_builtin_roles.keys())

    @model_validator(mode='after')
    def validate_global_roles(self) -> Self:
        _validate_global_roles(
            global_builtin_roles=self.global_builtin_roles,
            global_custom_roles=self.global_custom_roles,
            database_builtin_roles=self.database_builtin_roles,
            database_custom_roles=self.database_custom_roles,
        )

        return self

    @model_validator(mode='after')
    def validate_databases_roles(self) -> Self:
        _validate_databases_roles_logic(
            database_builtin_roles=self.database_builtin_roles,
            database_custom_roles=self.database_custom_roles,
        )

        return self

databases_count()

Returns the number of all databases the defined by the profile. It includes all the databases defined by the profile, and the instance itself

Source code in ark_sdk_python/models/services/uap/sia/db/ark_uap_sia_db_profiles.py
247
248
249
250
251
252
253
@overrides
def databases_count(self) -> int:
    """
    Returns the number of all databases the defined by the profile.
    It includes all the databases defined by the profile, and the instance itself
    """
    return 1 + len(self.database_custom_roles.keys() | self.database_builtin_roles.keys())