Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
ruby-liudesk-cmdb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
ruby-liudesk-cmdb
Commits
08d836a4
Verified
Commit
08d836a4
authored
2 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Add some preliminary documentation strings
parent
827e1bde
No related branches found
No related tags found
No related merge requests found
Pipeline
#99250
passed
2 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/liudesk_cmdb/models/linux_client.rb
+18
-1
18 additions, 1 deletion
lib/liudesk_cmdb/models/linux_client.rb
with
18 additions
and
1 deletion
lib/liudesk_cmdb/models/linux_client.rb
+
18
−
1
View file @
08d836a4
...
@@ -2,6 +2,17 @@
...
@@ -2,6 +2,17 @@
module
LiudeskCMDB::Models
module
LiudeskCMDB::Models
# Linux Client v1
# Linux Client v1
#
# @!attribute [r] created_date
# @return [Time] the date of creation
# @!attribute [r] updated_date
# @return [Time] the date of change
# @!attribute hardware_id
# @return [String] the ID for the underlying HardwareV1 object
# @!attribute hostname
# @return [String] the hostname of the client
# @!attribute division
# @return [String?] the division the client belongs to
class
LinuxClientV1
<
LiudeskCMDB
::
Model
class
LinuxClientV1
<
LiudeskCMDB
::
Model
api_name
"Clients"
api_name
"Clients"
model_name
"linux"
model_name
"linux"
...
@@ -28,15 +39,21 @@ module LiudeskCMDB::Models
...
@@ -28,15 +39,21 @@ module LiudeskCMDB::Models
hostname
hostname
end
end
# Get an instance of the underlying hardware object
#
# @return [HardwareV1] the hardware underlying this client
def
hardware
def
hardware
@hardware
||=
LiudeskCMDB
::
Models
::
HardwareV1
.
get
(
client
,
hardware_id
)
@hardware
||=
LiudeskCMDB
::
Models
::
HardwareV1
.
get
(
client
,
hardware_id
)
end
end
# Change the underlying hardware object
#
# @param hardware [HardwareV1] the new hardware object to assign
def
hardware
=
(
hardware
)
def
hardware
=
(
hardware
)
raise
ArgumentError
,
"Must be a HardwareV1"
unless
hardware
.
is_a?
LinudeskCMDB
::
Models
::
HardwareV1
raise
ArgumentError
,
"Must be a HardwareV1"
unless
hardware
.
is_a?
LinudeskCMDB
::
Models
::
HardwareV1
@hardware
=
hardware
self
.
hardware_id
=
hardware
.
guid
if
hardware
self
.
hardware_id
=
hardware
.
guid
if
hardware
@hardware
=
hardware
end
end
end
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment