-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add capability to create asset types via API #191
Conversation
Lets get more feedback on this. With some specific examples of why we are doing this. May be even have a review internally first. |
The test suite is working, except one method:
I am not sure why its not finding the data key, because it is sending
|
the data field is an array play.api.libs.json.JsArray of play.api.libs.json.JsObject It is not a JsObject itself. You can change
and
But please make sure you verify everything once more. |
@@ -19,6 +19,7 @@ case class AssetType(name: String, label: String, id: Int = 0) extends Validated | |||
object AssetType extends Schema with AnormAdapter[AssetType] { | |||
|
|||
override val tableDef = table[AssetType]("asset_type") | |||
val reservedNames = List("SERVER_NODE","SERVER_CHASSIS","RACK","SWITCH","ROUTER","POWER_CIRCUIT","POWER_STRIP","DATA_CENTER","CONFIGURATION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, these should be externalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all hardcoded in the evolutions, and are in some way or another used by collins internally.
I haven't tested, but this LGTM. |
add capability to create asset types via API
Like the title says, this allows API users to create, delete, and list AssetTypes.
I still need to add tests for this, but this will enable us to create new asset types to support different usage of collins assets (i.e. SERVICE or REPLICA_CONTROLLERs).
@Primer42 @maddalab