Skip to content

Commit

Permalink
Add AnsibleVariable to entities
Browse files Browse the repository at this point in the history
  • Loading branch information
dosas committed Aug 22, 2024
1 parent ff0656d commit 3353ca4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -9172,3 +9172,37 @@ def __init__(self, server_config=None, **kwargs):
'read_type': 'base',
}
super().__init__(server_config=server_config, **kwargs)


class AnsibleVariable(Entity, EntityCreateMixin, EntityReadMixin, EntityDeleteMixin):
"""A representation of a Ansible Variable entity."""

def __init__(self, server_config=None, **kwargs):
self._fields = {
'variable': entity_fields.StringField(required=True),
'ansible_role_id': entity_fields.IntegerField(required=True),
'default_value': entity_fields.StringField(),
'override_value_order': entity_fields.StringField(),
'description': entity_fields.StringField(),
'validator_type': entity_fields.ListField(),
'validator_rule': entity_fields.StringField(),
'variable_type': entity_fields.StringField(
default='string',
choices=(
'string',
'boolean',
'integer',
'real',
'array',
'hash',
'yaml',
'json',
),
),
'merge_overrides': entity_fields.BooleanField(),
'merge_default': entity_fields.BooleanField(),
'avoid_duplicates': entity_fields.BooleanField(),
'override': entity_fields.BooleanField(),
}
self._meta = {'api_path': 'ansible/api/ansible_variables'}
super().__init__(server_config=server_config, **kwargs)

0 comments on commit 3353ca4

Please sign in to comment.