osuosl / iam

Invoicing and metrics project
Other
4 stars 0 forks source link

Create Core Models [3 + 1 + 1] #18

Closed pop closed 8 years ago

pop commented 8 years ago

Below are the listed core models:

Clients

required:
  id: (integer) Client's Unique ID.
  name: (string) Client's human readable name.
  resources_specific_field_1 (var) Any specific metadata about the resource

Resources

required:
  id: (integer) Resources unique ID.
  project_id (foreign key) Resources associated project.
not required:
  project_id (foreign key) Project which owns this resource.
  cluster (string) Specifies ganeti cluster fqdn if applicable, null if not
  resources_specific_field_ 2 (var) ...etc
  ...
  resources_specific_field_ n (var) ...etc

Projects

required:
  id (integer) Project's unique ID.
  client_id (foreign key) Project's owner.
  name (string) Project's human readable name.
not required:
  client_id (foreign key) Client which owns this project.
  resources (serialized list) For example: "cpu,ftp,db"

DiskUsage

required:
  id (integer) Measurement unique id.
  resource_id (foreign key) Resource which owns this measurement.
not required:
  timestamp (datetime) Time the measurement was recorded.
  value (float) Measurement value (in units dictated by the plugin)

Edit: Added client_id to projects and project_id to resources.

alxngyn commented 8 years ago

looks good!
I'd say we should have client_id in projects required so we have a human trace for any problems with that project. Then resources should have project_id required too in case the resource fails we have a person of contact as well.

pop commented 8 years ago

@alxngyn I agree. What do you think about that change @Kennric? I added it in the the issue description, but we can change it back if you don't like it.

pop commented 8 years ago

Resolved with #27