[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Any document about the resource format definition in V3?



+++ DeShuai Ma [12/12/14 02:07 -0500]:
Hi,
 Is there any document about the resource format definition?
 In the v3 origin example we can see there is some json file for the resource. for example: the "sample-app/application-template-dockerbuild.json" file.
 But when I want to modify it or write a new one, I don't know which is optional, which is required, or others resource property I can added.

 Any help will be very thanks.

Someone else will probably chime in with a faster way to get this
information but here's the general idea:

* Api structs are typically stored in files called types.go
* In this case you're working with a Template so you would look in
 https://github.com/openshift/origin/blob/master/pkg/template/api/types.go

The metadata in the struct are struct tags
(http://golang.org/pkg/reflect/#StructTag) and they are read by the
json package.  One challenge is easily navigating the embedded
structs.  I suggest using ctags.

Another challenge is understanding the usage of the RawExtension type.
The comments in the kubernetes code are pretty good:
https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/runtime/types.go#L69

--Brenton

--------

DeShuai Ma

_______________________________________________
dev mailing list
dev lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]