github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/docs/apidocs/static_includes/_overview.html (about)

     1  <H1 id="-strong-api-overview-strong-"><STRONG>API OVERVIEW</STRONG></H1>
     2  
     3  <P>Welcome to the Jenkins X API.  You can use the Jenkins X API to read
     4  and write Kubernetes resource objects via a Jenkins X API endpoint.</P>
     5  
     6  <H2 id="resource-categories">Resource Categories</H2>
     7  
     8  <P>This is a high-level overview of the basic types of resources provide by the Jenkins X API and their primary
     9  	functions.</P>
    10  <P><B>Apps</B> resources describe extensions to Jenkins X.</P>
    11  <P><B>Pipelines & Environments</B> resources describe the work being done by Jenkins X.</P>
    12  <P><B>User Management</B> resources describe the user management done by Jenkins X.</P>
    13  
    14  <HR />
    15  
    16  <H2 id="resource-objects">Resource Objects</H2>
    17  
    18  <P>Resource objects typically have 3 components:</P>
    19  <UL>
    20  <LI><B>Resource ObjectMeta</B>: This is metadata about the resource, such as its name, type, api version, annotations, and labels.  This contains
    21  fields that maybe updated both by the end user and the system (e.g. annotations).</LI>
    22  <LI><B>ResourceSpec</B>: This is defined by the user and describes the desired state of system.  Fill this in when creating or updating an object.</LI>
    23  <LI><B>ResourceStatus</B>: This is filled in by the server and reports the current state of the system.  In most cases, users don't need to change this.</LI>
    24  </UL>
    25  
    26  <HR />
    27  
    28  <H2 id="resource-operations">Resource Operations</H2>
    29  
    30  <P>Most resources provide the following Operations:</P>
    31  
    32  <H4 id="resource-operations-create">Create</H4>
    33  
    34  <P>Create operations will create the resource in the storage backend.  After a resource is create the system will apply
    35  the desired state.</P>
    36  
    37  <H4 id="resource-operations-update">Update</H4>
    38  
    39  <P>Updates come in 2 forms: <B>Replace</B> and <B>Patch</B>:
    40  
    41  <UL>
    42  <LI><B>Replace</B>:
    43  Replacing a resource object will update the resource by replacing the existing spec with the provided one.  For
    44  read-then-write operations this is safe because an optimistic lock failure will occur if the resource was modified
    45  between the read and write. <I>Note</I>: The <I>ResourceStatus</I> will be ignored by the system and will not be updated.
    46  To update the status, one must invoke the specific status update operation.<BR />
    47  
    48  Note: Replacing a resource object may not result immediately in changes being propagated to downstream objects.  For instance
    49  replacing a <CODE>ConfigMap</CODE> or <CODE>Secret</CODE> resource will not result in all <I>Pod</I>s seeing the changes unless the <I>Pod</I>s are
    50  restarted out of band.<BR />
    51  
    52  Note: <STRONG>Where possible using <CODE>Patch</CODE> is preferable over <CODE>UPDATE</CODE></STRONG> as if new fields have been added to the resource object that is not known about by the running code these will be lost.</P></LI>
    53  
    54  <LI><B>Patch</B>:
    55  Patch will apply a change to a specific field.  How the change is merged is defined per field.  Lists may either be
    56  replaced or merged.  Merging lists will not preserve ordering.<BR />
    57  
    58  <B>Patches will never cause optimistic locking failures, and the last write will win.</B>  Patches are recommended
    59  when the full state is not read before an update, or when failing on optimistic locking is undesirable. <I>When patching
    60  complex types, arrays and maps, how the patch is applied is defined on a per-field basis and may either replace
    61  the field's current value, or merge the contents into the current value.</I></LI>
    62  </UL>
    63  
    64  <H4 id="resource-operations-read">Read</H4>
    65  
    66  <P>Reads come in 3 forms: <B>Get</B>, <B>List</B> and <B>Watch</B>:<P>
    67  
    68  <UL>
    69  <LI><B>Get</B>: Get will retrieve a specific resource object by name.</LI>
    70  <LI><B>List</B>: List will retrieve all resource objects of a specific type within a namespace, and the results can be restricted to resources matching a selector query.<BR />
    71  <B>List All Namespaces</B>: Like <B>List</B> but retrieves resources across all namespaces.</LI>
    72  <LI><B>Watch</B>: Watch will stream results for an object(s) as it is updated.  Similar to a callback, watch is used to respond to resource changes.</LI>
    73  </UL>
    74  
    75  <H4 id="resource-operations-read">Delete</H4>
    76  
    77  <P>Delete will delete a resource.  Depending on the specific resource, child objects may or may not be garbage collected by the server.  See
    78  notes on specific resource objects for details.</P>
    79  
    80  <H4 id="resource-operations-additional">Additional Operations</H4>
    81  
    82  <P>Resources may define additional operations specific to that resource type.</P>
    83  
    84  <UL>
    85  	<LI><B>Rollback</B>: Rollback a PodTemplate to a previous version.  Only available for some resource types.</LI>
    86  	<LI><B>Read / Write Scale</B>: Read or Update the number of replicas for the given resource.  Only available for some resource types.</LI>
    87  	<LI><B>Read / Write Status</B>: Read or Update the Status for a resource object.  The Status can only changed through these update operations.</LI>
    88  </UL>
    89  <HR />