Contributing to DevCentral CodeShare: A Quick Reference.

Introduction to CodeShare

CodeShare is a mechanism for you to share your iRules and policies with the rest of the DevCentral community. By extension, it is also a place for you to find code and policies that can help you resolve problems, without reinventing the wheel. Some of the items posted in the CodeShare are generated by F5 staff, but increasingly they are uploaded by users like you who had a problem to solve and were willing to share their solution.

Accessing CodeShare

CodeShare is implemented in three different areas – iRules, iControl, and WA Policies. All three of these areas are accessible through the “Samples” button shown on every DevCentral page.

Here is how you can access these items:

-         iRules: Because iRules is a scripting language where the source code is the solution, we are able to offer iRules in-line in a page with documentation describing the purpose and function of each section of the iRule.  Copying and pasting the iRule code out of the CodeShare page and into your iRules Editor (or other tool you use to develop and maintain iRules) will give you the solution. The documentation interspersed will help you understand the purpose and limitations of pieces of the code.

-         iControl: iControl CodeShare uploads come in a couple of  different formats – script-based (as in iControl with Perl), and executable-based (as in iControl with VS.NET or Java). Script based entries are handled exactly like iRules entries – you can copy and paste the code from the webpage, and the rest of the page explains how, when, and where to use it for best results.

-         Web Accelerator Policies: Web Accelerator policies generally require two files to make them work – the GlobablFragments.XML.tmpl, which is modified to include recognition of the file type being accelerated, and the filename.XML file that includes instructions on how exactly Web Accelerator should handle that filetype.

These two files are linked on a single webpage for you to download. Simply right-click and choose “save as” to save each of these files locally. If you want to review what is in them before downloading, you can just click on them and they will display in your browser.

 

Why Contribute to the CodeShare

Think you have a solution that others could benefit from? Then upload it to the CodeShare and let others have access to your work! Part of the community is you offering items for your peers to utilize. Who knows, one of those peers might enhance or refine your solution and re-upload it, giving you a better solution than you’d have had on your own for no more investment. It’s building on each others’ work that makes the community strong. It’s happening now for some groups of users, and it could be helping you too.

How to Contribute

If you click on the “Samples” button, one of the links near the top of the page is “Contribute to the CodeShare!” when you click on this link, it takes you to a page that asks for the information about the sample you’re uploading. We’ll walk through the fields right here, so you are aware of what information you’re going to need to know:

-         Title This seems easy, but try to give it a title descriptive enough that when you were out looking for a solution of this kind, it would have been clear this could help you.

-         Category Choose the category of solution you are uploading – iRules, iControl, Web Accelerator, or FirePass. This helps the system group all like solutions together in one place for easier perusal.

-         Description This section is utilized as the summary of what this particular contribution does – so make it as descriptive as necessary to help people understand exactly what your contribution does, but don’t over-do it.

-         If you are uploading a sample iRule… Since iRules are all text (TCL) files, you can just cut and paste the iRule right there. No worries about documentation, you’ll get a chance to edit this before it goes away.

-         File If there is a file associated with this codeshare (eg: it did not all just go into the box above as text), then select it from your local filesystem here.

-         Name and email Address are not editable. This is so that we know how to get hold of you should there be major issues with your contribution. Note that name is actually username, so if you wish your real name associated with your code creation, then you should include it in the “description” section, or add it in the steps below.

-         Show my email address. This check box defaults to “yes”, but you can uncheck it. If it is checked, there is a link that other users can use to directly email you about your codeshare entry.

That’s it! Note that the iRules upload system does not accept files. The system just does not look for one, it expected you to paste the iRule into the “if you are uploading a sample irule” box.

When you click the “Upload” button, it takes you to the editing view of a Wiki Page with all of the relevant information filled in. All you need to do is expand upon the documentation in any way you wish (including not at all if the description and name are enough for you), and then click “Save”. If you need help with editing a Wiki Page, try this document: Editing Wiki Pages

Note that if you change your mind after clicking “Upload”, you can hit cancel from this page, but your file has been added to our repository already, so cancel does not undo that part. You must contact one of the DevCentral staff to get your file removed from the repository. This is only a concern in cases where (a) your upload includes a file, and (b) you decide after clicking the upload button that you do not want to share your code-fragment after all.