forked from YangCatalog/web_root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontribute.html
425 lines (388 loc) · 22.7 KB
/
contribute.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<!DOCTYPE html>
<html lang="en">
<head>
<title>YANG Catalog | Contribute</title>
<!--# include file="inc.head.html" -->
</head>
<body class="page-template-default page page-id-3 mp6 customizer-styles-applied has-header-search navigation-default sidebar-right has-site-logo highlander-enabled highlander-light small-screen medium-screen large-screen">
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content">Skip to content</a>
<header id="masthead" class="site-header" role="banner">
<a href="/" class="header-image" rel="home">
<img src="img/blur.jpg" alt="" scale="0" width="1230" height="100">
</a>
<!-- .header-image -->
<div class="header-wrapper clear">
<div class="site-branding" style="max-width: 904px;">
<a href="/" class="site-logo-link" rel="home"><img src="img/all-yang-modules1.jpg" class="site-logo attachment-edin-logo" alt="" data-size="edin-logo" width="219" height="192"></a>
<p class="site-title"><a href="/" rel="home">YANG Catalog</a></p>
</div>
<!-- .site-branding -->
</div>
<!-- .header-wrapper -->
</header>
<!-- #masthead -->
<div id="content" class="site-content">
<div class="hero with-featured-image">
<div class="hero-wrapper">
<h1 class="page-title">Contribute to YANG Catalog</h1></div>
</div>
<!-- .hero -->
<div class="content-wrapper clear">
<div id="primary" class="content-area" style="width: 100%; margin-left: 10px; margin-right: 10px;">
<main id="main" class="site-main" role="main">
<div class="entry-title">Table of Contents</div>
<p>What are you trying to do?</p>
<ul style="list-style-type:circle">
<li><a href="#model_creator">I am a vendor or Standars Development Organization, and I want to provide my module metadata.</a></li>
<li><a href="#vendor">I am a vendor, and I want to provide my implementation metadata.</a></li>
<li><a href="#model_get">I want to search for module metadata.</a></li>
<li><a href="#model_delete">I am a vendor or Standards Development Organization, and I want to delete my module metadata.</a></li>
<li><a href="#hack">Hack YANG Catalog.</a></li>
</ul>
<hr/>
<article id="post-3" class="post-3 page type-page status-publish has-post-thumbnail hentry">
<a name="model_creator"></a>
<div class="entry-title">Add Model Metadata</div>
<div class="entry-content">
<p>If you are a Standard Development Organization (SDO), an open source project, or an organization such as a vendor that creates proprietary models,
and you want to add your models' metadata to the Catalog, do the following. <b>NOTE:</b> the Catalog is not a clearing house for model
downloads. While it provides metadata about models, it only provides links to external sites from which the models themselves can be download.</p>
<ol>
<li>Check your modules into <a href="https://github.com">GitHub</a>. Ideally submit your modules directly to the <a href="https://github.com/YangModels/yang">
https://github.com/YangModels/yang</a> repository via a <a href="https://help.github.com/articles/about-pull-requests/">pull request</a>. Alternatively, you can use any public repository, and then also add a git sub-module to the
<a href="https://github.com/YangModels/yang">
https://github.com/YangModels/yang</a> repository via a <a href="https://help.github.com/articles/about-pull-requests/">pull request</a>.</li>
<li><a href="/create.html">Request</a> a new YANG Catalog API account if you do not have one already.</li>
<li>Once the account is requested, wait until confirmation before proceeding.</li>
<li>Use an HTTP PUT request to <a href="/api/modules">https://yangcatalog.org/api/modules</a> with a JSON payload modeled after the <a href="https://raw.githubusercontent.com/xorrkaz/netmod-yang-catalog/master/module-metadata.yang">
model-metadata.yang</a> model (current revision: <b>2017-07-27</b>). Note, this module requires the
<a href="https://raw.githubusercontent.com/xorrkaz/netmod-yang-catalog/master/yang-catalog.yang">yang-catalog</a> module. The module-metadata.yang has the following tree structure:<br/>
<pre>
module: module-metadata
+--rw modules
+--rw module* [name revision organization]
+--rw name yang:yang-identifier
+--rw revision union
+--rw generated-from? enumeration
+--rw maturity-level? enumeration
+--rw document-name? string
+--rw author-email? yc:email-address
+--rw reference? inet:uri
+--rw module-classification enumeration
+--rw organization string
+--rw ietf
| +--rw ietf-wg? string
+--rw source-file
+--rw owner string
+--rw repository string
+--rw path path
+--rw branch? string
</pre> For example:<br/>
<pre>
PUT https://yangcatalog.org/api/modules
Content-type: application/json
{
"modules": {
"module": [
{
"name": "example-jukebox",
"revision": "2014-01-20",
"organization": "example",
"maturity-level": "ratified",
"author-email": "[email protected]",
"module-classification": "network-element",
"source-file": {
"repository": "foo",
"owner": "bar",
"path": "standard/ietf/DRAFT/example-jukebox.yang"
}
}
]
}
}
</pre>
</li>
<li>After submitting the request, if you are authorized, you will receive a job ID in the JSON-formatted reply. For example:<br/>
<pre>
{
"info": "Verification successful",
"job-id": "88bd8c4c-8809-4de8-85c8-39d522d4bcdf"
}
</pre>
<li>Perform an HTTP GET request to <b>https://yangcatalog.org/api/job/{job_id}</b> to get the status of the job. The job result will remain "In progress" until the job completes. When the job has completed you will receive either a "Finished"
(on success) or "Failed" (on failure) result. Reason will remain null if the result is other then "Failed, otherwise it will give a information on why it failed. For example, after obtaining the job ID above, perform an HTTP GET to https://yangcatalog.org/api/job/88bd8c4c-8809-4de8-85c8-39d522d4bcdf to get the current status:<br/>
<pre>
{
"info": {
"job-id": "88bd8c4c-8809-4de8-85c8-39d522d4bcdf",
"reason": null,
"result": "In progress"
}
}
</pre>
<li>Once the job has completed successfully, test the result by querying the <a href="#model_get">search API</a>.</li>
<li>Contact <a href="mailto:[email protected]">[email protected]</a> if you run into problems.</li>
</ol>
<p>While some metadata can be extracted from models by the API backend (these are called <i>extractable</i> fields), metadata such as "maturity-level" and "conformance-type" must be provided by the model creator (these are the <i>non-extractable</i> fields). The reason the module-metadata model is broken out from the main yang-catalog module is to focus more on the non-extractable fields. The more metadata from the module-metadata model that can be included the more robust and detailed
the Catalog will be.</p>
</div>
</article>
<article id="post-4" class="post-4 page type-page status-publish has-post-thumbnail hentry">
<a name="vendor"></a>
<div class="entry-title">Add Implementation Metadata</div>
<div class="entry-content">
<p>If you are a vendor that implements YANG models in your product, then you can upload platform metadata to the Catalog in order to specify what platforms (and software releases) implement which YANG models. This is done using the following
steps:
</p>
<ol>
<li><a href="/create.html">Request</a> a new YANG Catalog API account if you do not have one already.</li>
<li>Once the account is requested, wait until confirmation before proceeding.</li>
<li>Use an HTTP PUT request to <a href="/api/platforms">https://yangcatalog.org/api/platforms</a> with a JSON payload modeled after the <a href="https://raw.githubusercontent.com/xorrkaz/netmod-yang-catalog/master/platform-implementation-metadata.yang">
platform-implementation-metadata.yang</a> model (current revision: <b>2017-09-27</b>). Note, his module requires the
<a href="https://raw.githubusercontent.com/xorrkaz/netmod-yang-catalog/master/yang-catalog.yang">yang-catalog</a> module. The platform-implementation-metadata module has the following tree structure:<br/>
<pre>
module: platform-implementation-metadata
+--rw platforms
+--rw platform* [vendor name software-version software-flavor]
+--rw vendor string
+--rw name string
+--rw netconf-capabilities* string
+--rw product-ids* string
+--rw software-version string
+--rw software-flavor string
+--rw os-version? string
+--rw feature-set? string
+--rw os-type? string
+--rw module-list-file
+--rw type? enumeration
+--rw owner string
+--rw repository string
+--rw path yc:path
+--rw branch? string
</pre> For example:<br/>
<pre>
PUT https://yangcatalog.org/api/platforms
Content-type: application/json
{
"platforms" {
"platform": [
{
"vendor": "example",
"name": "baz",
"module-list-file": {
"type": "capabilities",
"repository": "foo",
"owner": "bar",
"path": "vendor/example/baz/baz-netconf-capability.xml"
},
"platform-ids": [
"BAZ4000", "BAZ4100"
],
"software-flavor": "ALL",
"software-version": "1.2.3",
"os-type": "bazOS"
}
]
}
}
</pre>
</li>
<li>After submitting the request, if you are authorized, you will receive a job ID in the JSON-formatted reply. For example:<br/>
<pre>
{
"info": "Verification successful",
"job-id": "88bd8c4c-8809-4de8-85c8-39d522d4bcdf"
}
</pre>
<li>Perform an HTTP GET request to <b>https://yangcatalog.org/api/job/{job_id}</b> to get the status of the job. The job result will remain "In progress" until the job completes. When the job has completed you will receive either a "Finished"
(on success) or "Failed" (on failure) result. For example, after obtaining the job ID above, perform an HTTP GET to https://yangcatalog.org/api/job/88bd8c4c-8809-4de8-85c8-39d522d4bcdf to get the current status:<br/>
<pre>
{
"info": {
"job-id": "88bd8c4c-8809-4de8-85c8-39d522d4bcdf",
"reason": null,
"result": "In progress"
}
}
</pre>
<li>Once the job has completed successfully, test the result by querying the <a href="#model_get">search API</a>.</li>
<li>Contact <a href="mailto:[email protected]">[email protected]</a> if you run into problems.</li>
</ol>
</div>
</article>
<article id="post-5" class="post-5 page type-page status-publish has-post-thumbnail hentry">
<a name="model_get"></a>
<div class="entry-title">Get Module and Implementation Metadata</div>
<div class="entry-content">
<p>If you want to search for metadata on a specific module, or you are looking for modules that contain specific metadata, you can do the following:</p>
<ol>
<li>Use an HTTP GET request to
<b>https://yangcatalog.org/api/search/modules/{name},{revision},{organization}</b> to receive all the metadata for a specific module and revision.</li>
<li>Use an HTTP GET request to
<b>https://yangcatalog.org/api/search/{key}/{value}</b> to receive all the modules that contain a specific metadata.
<br/>For example, to find all modules with a successful compilation status: <a href="https://yangcatalog.org/api/search/compilation-status/passed">
https://yangcatalog.org/api/search/compilation-status/passed</a>
<br/>To find all modules from the netconf working group in the IETF: <a href="https://yangcatalog.org/api/search/ietf/ietf-wg/netconf">
https://yangcatalog.org/api/search/ietf/ietf-wg/netconf</a>
<br/>This method will work for any node within the <a href="https://raw.githubusercontent.com/xorrkaz/netmod-yang-catalog/master/yang-catalog.yang">
yang-catalog</a>:<br/>
<pre>
+--rw catalog
+--rw modules
| +--rw module* [name revision organization]
| +--rw name yang:yang-identifier
| +--rw revision union
| +--rw organization string
| +--rw ietf
| | +--rw ietf-wg? string
| +--rw namespace inet:uri
| +--rw schema? inet:uri
| +--rw generated-from? enumeration
| +--rw maturity-level? enumeration
| +--rw document-name? string
| +--rw author-email? yc:email-address
| +--rw reference? inet:uri
| +--rw module-classification enumeration
| +--rw compilation-status? enumeration
| +--rw compilation-result? inet:uri
| +--rw prefix? string
| +--rw yang-version? enumeration
| +--rw description? string
| +--rw contact? string
| +--rw module-type? enumeration
| +--rw belongs-to? yang:yang-identifier
| +--rw tree-type? enumeration
| +--rw submodule* [name revision]
| | +--rw name yang:yang-identifier
| | +--rw revision union
| | +--rw schema? inet:uri
| +--rw dependencies* [name]
| | +--rw name yang:yang-identifier
| | +--rw revision? union
| | +--rw schema? inet:uri
| +--rw dependents* [name]
| | +--rw name yang:yang-identifier
| | +--rw revision? union
| | +--rw schema? inet:uri
| +--rw semantic-version? yc:semver
| +--rw derived-semantic-version? yc:semver
| +--rw implementations
| +--rw implementation* [vendor platform software-version software-flavor]
| +--rw vendor string
| +--rw platform string
| +--rw software-version string
| +--rw software-flavor string
| +--rw os-version? string
| +--rw feature-set? string
| +--rw os-type? string
| +--rw feature* yang:yang-identifier
| +--rw deviation* [name revision]
| | +--rw name yang:yang-identifier
| | +--rw revision union
| +--rw conformance-type? enumeration
+--rw vendors
+--rw vendor* [name]
+--rw name string
+--rw platforms
+--rw platform* [name]
+--rw name string
+--rw software-versions
+--rw software-version* [name]
+--rw name string
+--rw software-flavors
+--rw software-flavor* [name]
+--rw name string
+--rw protocols
| +--rw protocol* [name]
| +--rw name identityref
| +--rw protocol-version* string
| +--rw capabilities* string
+--rw modules
+--rw module* [name revision organization]
+--rw name -> /catalog/modules/module/name
+--rw revision -> /catalog/modules/module/revision
+--rw organization -> /catalog/modules/module/organization
+--rw os-version? string
+--rw feature-set? string
+--rw os-type? string
+--rw feature* yang:yang-identifier
+--rw deviation* [name revision]
| +--rw name yang:yang-identifier
| +--rw revision union
+--rw conformance-type? enumeration
</pre>
</li>
</ol>
</div>
</article>
<article id="post-6" class="post-6 page type-page status-publish has-post-thumbnail hentry">
<a name="model_delete"></a>
<div class="entry-title">Delete Module Metadata</div>
<div class="entry-content">
<p>If you need to delete metadata relative to one of your specific modules, do the following:</p>
<ol>
<li><a href="/create.html">Request</a> a new YANG Catalog API account if you do not have one already.</li>
<li>Once the account is requested, wait until confirmation before proceeding.</li>
<li>Use an HTTP DELETE request to delete specific module
<b>https://yangcatalog.org/api/modules/module/{name},{revision},{organization}</b>
</li>
<li>Use an HTTP DELETE request to delete modules on specific implementation metadata
<b>https://yangcatalog.org/api/vendors/vendor/{name}</b>.
You can continue deeper on the vendors branch up to software-flavor
</li>
</ol>
<p><b>NOTE:</b> Deleting implementation metadata is currently not possible.</p>
</div>
</article>
<article id="post-7" class="post-7 page type-page status-publish has-post-thumbnail hentry">
<a name="hack"></a>
<div class="entry-title">Hacking Yangcatalog.org</div>
<div class="entry-content">
<p>All of the code behind <a href="https://yangcatalog.org">yangcatalog.org</a> is Open Source. However, it is spread out across multiple <a href="https://github.org">
GitHub</a> repositories. If you are interested in hacking the code that directly drives the YANG Catalog, pick your repository from the list below:</p>
<ul>
<li>YANG Catalog API and backend in <a href="https://github.com/YangCatalog/backend">https://github.com/YangCatalog/backend</a></li>
<li>YANG Catalog Search in <a href="https://github.com/YangCatalog/search">https://github.com/YangCatalog/search</a></li>
<li>YANG Catalog Regex validator in <a href="https://github.com/YangCatalog/yangre">https://github.com/YangCatalog/yangre</a></li>
<li>YANG Catalog static web pages in <a href="https://github.com/YangCatalog/web_root">https://github.com/YangCatalog/web_root</a></li>
<li>YANG Models <a href="https://github.com/YangModels/yang/">https://github.com/YangModels/yang/</a>
Models in the <tt>vendor</tt> and <tt>standard</tt> directories
</li>
<li>YANG Catalog and related API models in <a href="https://github.com/xorrkaz/netmod-yang-catalog">https://github.com/xorrkaz/netmod-yang-catalog</a></li>
<li>Capabilities and metadata generation scripts in <a href="https://github.com/einarnn/ncc">https://github.com/einarnn/ncc</a></li>
<li>ConfD (not Open Source) is at <a href="https://developer.cisco.com/site/confD/">https://developer.cisco.com/site/confD/</a></li>
</ul>
<p>In order to contribute back to YANG Catalog, checkout one of the repositories, make your changes, and then create a
<a href="https://help.github.com/articles/about-pull-requests/">pull request</a> to have your code merged.</p>
<p>To get updates about changes with YANG Catalog, <a href="https://www.marcuscom.com/mailman/listinfo/yangcatalog-announce">subscribe
</a> to <b>[email protected]</b>.</p>
<p>Download a YangCatalog <a href="https://www.getpostman.com/">postman</a> collection
<a href="/downloadables/yangcatalog.postman_collection.json" download="yangcatalog.postman_collection.json"> here </a> to
explore the API with examples.</p>
</div>
<!-- .entry-content -->
</article>
<!-- #post-## -->
</main>
<!-- #main -->
</div>
<!-- #primary -->
</div>
<!-- .content-wrapper -->
</div>
<!-- #content -->
<!--# include file="inc.footer.html" -->
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="footer-wrapper clear">
<div class="site-info">
</div>
<!-- .site-info -->
</div>
<!-- .footer-wrapper -->
</footer>
<!-- #colophon -->
</div>
<!-- #page -->
</body>
</html>