zotregistry.dev/zot@v1.4.4-0.20240314164342-eec277e14d20/pkg/extensions/search/schema.graphql (about)

     1  # Exclude these linters because current implementation of the clients would need an update
     2  # lint-disable fields-are-camel-cased, input-object-values-are-camel-cased
     3  # Exclude this linter as we have a different implementation for pagination
     4  # lint-disable relay-page-info-spec
     5  # Exclude this linters and fix the issues later
     6  # lint-disable type-fields-sorted-alphabetically, input-object-fields-sorted-alphabetically, enum-values-sorted-alphabetically
     7  
     8  """
     9  A timestamp
    10  """
    11  scalar Time
    12  
    13  
    14  """
    15  Contains the tag of the image and a list of CVEs
    16  """
    17  type CVEResultForImage {
    18      """
    19      Tag affected by the CVEs
    20      """
    21      Tag: String
    22      """
    23      List of CVE objects which affect this specific image:tag
    24      """
    25      CVEList: [CVE]
    26      """
    27      Summary of the findings for this image
    28      """
    29      Summary: ImageVulnerabilitySummary
    30      """
    31      The CVE pagination information, see PageInfo object for more details
    32      """
    33      Page: PageInfo
    34  }
    35  
    36  """
    37  ImageIdentifier
    38  """
    39  type ImageIdentifier {
    40      """
    41      Repo name of the image
    42      """
    43      Repo: String!
    44      """
    45      The tag of the image
    46      """
    47      Tag: String!
    48      """
    49      The digest of the image
    50      """
    51      Digest: String
    52      """
    53      The platform of the image
    54      """
    55      Platform: Platform
    56  }
    57  
    58  """
    59  Contains the diff results of subtracting Subtrahend's CVEs from Minuend's CVEs 
    60  """
    61  type CVEDiffResult {
    62      """
    63      Minuend is the image from which CVE's we subtract
    64      """
    65      Minuend: ImageIdentifier!
    66      """
    67      Subtrahend is the image which CVE's are subtracted
    68      """
    69      Subtrahend: ImageIdentifier!
    70      """
    71      List of CVE objects which are present in minuend but not in subtrahend
    72      """
    73      CVEList: [CVE]
    74      """
    75      Summary of the findings for this image
    76      """
    77      Summary: ImageVulnerabilitySummary
    78      """
    79      The CVE pagination information, see PageInfo object for more details
    80      """
    81      Page: PageInfo
    82  }
    83  
    84  """
    85  Contains various details about the CVE (Common Vulnerabilities and Exposures)
    86  and a list of PackageInfo about the affected packages
    87  """
    88  type CVE {
    89      """
    90      CVE ID
    91      """
    92      Id: String
    93      """
    94      A short title describing the CVE
    95      """
    96      Title: String
    97      """
    98      A detailed description of the CVE
    99      """
   100      Description: String
   101      """
   102      Reference for the given CVE
   103      """
   104      Reference: String
   105      """
   106      The impact the CVE has, one of "UNKNOWN", "LOW", "MEDIUM", "HIGH", "CRITICAL"
   107      """
   108      Severity: String
   109      """
   110      Information on the packages in which the CVE was found
   111      """
   112      PackageList: [PackageInfo]
   113  }
   114  
   115  """
   116  Contains the name of the package, the current installed version and the version where the CVE was fixed
   117  """
   118  type PackageInfo {
   119      """
   120      Name of the package affected by a CVE
   121      """
   122      Name: String
   123      """
   124      Path where the vulnerable package is located
   125      """
   126      PackagePath: String
   127      """
   128      Current version of the package, typically affected by the CVE
   129      """
   130      InstalledVersion: String
   131      """
   132      Minimum version of the package in which the CVE is fixed
   133      """
   134      FixedVersion: String
   135  }
   136  
   137  """
   138  Contains details about the repo: both general information on the repo, and the list of images
   139  """
   140  type RepoInfo {
   141      """
   142      List of images in the repo
   143      """
   144      Images: [ImageSummary]
   145      """
   146      Details about the repository itself
   147      """
   148      Summary: RepoSummary
   149  }
   150  
   151  """
   152  Search results, can contain images, repositories and layers
   153  """
   154  type GlobalSearchResult {
   155      """
   156      Pagination information
   157      """
   158      Page: PageInfo
   159      """
   160      List of images matching the search criteria
   161      """
   162      Images: [ImageSummary]
   163      """
   164      List of repositories matching the search criteria
   165      """
   166      Repos: [RepoSummary]
   167      """
   168      List of layers matching the search criteria
   169      NOTE: the actual search logic for layers is not implemented at the moment
   170      """
   171      Layers: [LayerSummary]
   172  }
   173  
   174  """
   175  Details about a specific image, it is used by queries returning a list of images
   176  We define an image as a pairing or a repository and a tag belonging to that repository
   177  """
   178  type ImageSummary {
   179      """
   180      Name of the repository where the image is found
   181      """
   182      RepoName: String
   183      """
   184      Tag identifying the image within the repository
   185      """
   186      Tag: String
   187      """
   188      The digest of the descriptor of this image
   189      """
   190      Digest: String
   191      """
   192      The media type of the descriptor of this image
   193      """
   194      MediaType: String
   195      """
   196      List of manifests for all supported versions of the image for different operating systems and architectures
   197      """
   198      Manifests: [ManifestSummary]
   199      """
   200      Total size of the files associated with all images (manifest, config, layers)
   201      """
   202      Size: String
   203      """
   204      Number of downloads of the manifest of this image
   205      """
   206      DownloadCount: Int
   207      """
   208      Timestamp of the last modification done to the image (from config or the last updated layer)
   209      """
   210      LastUpdated: Time
   211      """
   212      Human-readable description of the software packaged in the image
   213      """
   214      Description: String
   215      """
   216      True if the image has a signature associated with it, false otherwise
   217      """
   218      IsSigned: Boolean 
   219      """
   220      Info about signature validity
   221      """
   222      SignatureInfo: [SignatureSummary]
   223      """
   224      License(s) under which contained software is distributed as an SPDX License Expression
   225      """
   226      Licenses: String  #  The value of the annotation if present, 'unknown' otherwise).
   227      """
   228      Labels associated with this image
   229      NOTE: currently this field is unused
   230      """
   231      Labels: String
   232      """
   233      Human-readable title of the image
   234      """
   235      Title: String
   236      """
   237      URL to get source code for building the image
   238      """
   239      Source: String
   240      """
   241      URL to get documentation on the image
   242      """
   243      Documentation: String
   244      """
   245      Vendor associated with this image, the distributing entity, organization or individual
   246      """
   247      Vendor: String
   248      """
   249      Contact details of the people or organization responsible for the image
   250      """
   251      Authors: String
   252      """
   253      Short summary of the identified CVEs
   254      """
   255      Vulnerabilities: ImageVulnerabilitySummary
   256      """
   257      Information about objects that reference this image
   258      """
   259      Referrers: [Referrer]
   260      """
   261      True if current user has delete permission on this tag.
   262      """
   263      IsDeletable: Boolean
   264  }
   265  """
   266  Details about a specific version of an image for a certain operating system and architecture.
   267  """
   268  type ManifestSummary {
   269      """
   270      Digest of the manifest file associated with this image
   271      """
   272      Digest: String
   273      """
   274      Digest of the config file associated with this image
   275      """
   276      ConfigDigest: String
   277      """
   278      Timestamp of the last update to an image inside this repository
   279      """
   280      LastUpdated: Time
   281      """
   282      Total size of the files associated with this manifest (manifest, config, layers)
   283      """
   284      Size: String
   285      """
   286      True if the manifest has a signature associated with it, false otherwise
   287      """
   288      IsSigned: Boolean
   289      """
   290      Info about signature validity
   291      """
   292      SignatureInfo: [SignatureSummary]
   293      """
   294      OS and architecture supported by this image
   295      """
   296      Platform: Platform
   297      """
   298      Total number of image manifest downloads from this repository
   299      """
   300      DownloadCount: Int
   301      """
   302      List of layers matching the search criteria
   303      NOTE: the actual search logic for layers is not implemented at the moment
   304      """
   305      Layers: [LayerSummary]
   306      """
   307      Information about the history of the specific image, see LayerHistory
   308      """
   309      History: [LayerHistory]
   310      """
   311      Short summary of the identified CVEs
   312      """
   313      Vulnerabilities: ImageVulnerabilitySummary
   314      """
   315      Information about objects that reference this image
   316      """
   317      Referrers: [Referrer]
   318      """
   319      Value of the artifactType field if present else the value of the config media type
   320      """
   321      ArtifactType: String
   322  }
   323  
   324  """
   325  Contains summary of vulnerabilities found in a specific image
   326  """
   327  type ImageVulnerabilitySummary {
   328      """
   329      Maximum severity of all CVEs found in this image
   330      """
   331      MaxSeverity: String
   332      """
   333      Count of all CVEs found in this image
   334      """
   335      Count: Int
   336      """
   337      Coresponds to CVSS 3 score NONE
   338      """
   339      UnknownCount: Int
   340      """
   341      Coresponds to CVSS 3 score LOW
   342      """
   343      LowCount: Int
   344      """
   345      Coresponds to CVSS 3 score MEDIUM
   346      """
   347      MediumCount: Int
   348      """
   349      Coresponds to CVSS 3 score HIGH
   350      """
   351      HighCount: Int
   352      """
   353      Coresponds to CVSS 3 score CRITICAL
   354      """
   355      CriticalCount: Int
   356  }
   357  
   358  """
   359  Details of a specific repo, it is used by queries returning a list of repos
   360  """
   361  type RepoSummary {
   362      """
   363      Name of the repository
   364      """
   365      Name: String
   366      """
   367      Timestamp of the last update to an image inside this repository
   368      """
   369      LastUpdated: Time
   370      """
   371      Total size of the files within this repository
   372      """
   373      Size: String
   374      """
   375      List of platforms supported by this repository
   376      """
   377      Platforms: [Platform]
   378      """
   379      Vendors associated with this image, the distributing entities, organizations or individuals
   380      """
   381      Vendors: [String]
   382      """
   383      Details of the newest image inside the repository
   384      NOTE: not the image with the `latest` tag, the one with the most recent created timestamp
   385      """
   386      NewestImage: ImageSummary
   387      """
   388      Total number of image manifest downloads from this repository
   389      """
   390      DownloadCount: Int
   391      """
   392      Number of stars attributed to this repository by users
   393      """
   394      StarCount: Int
   395      """
   396      True if the repository is bookmarked by the current user, false otherwise
   397      """
   398      IsBookmarked: Boolean
   399      """
   400      True if the repository is starred by the current user, false otherwise
   401      """
   402      IsStarred: Boolean
   403      """
   404      Rank represents how good the match was between the queried repo name and this repo summary.
   405      """
   406      Rank: Int
   407  }
   408  
   409  """
   410  Contains details about a specific layer which is part of an image
   411  """
   412  type LayerSummary {
   413      """
   414      The size of the layer in bytes
   415      """
   416      Size: String  # Int64 is not supported.
   417      """
   418      Digest of the layer content
   419      """
   420      Digest: String
   421  }
   422  
   423  """
   424  Information on how a layer was created
   425  """
   426  type HistoryDescription {
   427      """
   428      Created is the time when the layer was created.
   429      """
   430      Created: Time
   431      """
   432      CreatedBy is the command which created the layer.
   433      """
   434      CreatedBy: String
   435      """
   436      Author is the author of the build point.
   437      """
   438      Author: String
   439      """
   440      Comment is a custom message set when creating the layer.
   441      """
   442      Comment: String
   443      """
   444      EmptyLayer is used to mark if the history item created a filesystem diff.
   445      """
   446      EmptyLayer: Boolean
   447  }
   448  
   449  """
   450  Information about how/when a layer was built
   451  """
   452  type LayerHistory {
   453      """
   454      Information specific to the layer such as size and digest.
   455      """
   456      Layer: LayerSummary
   457      """
   458      Additional information about how the layer was created.
   459      """
   460      HistoryDescription: HistoryDescription
   461  }
   462  
   463  """
   464  Annotation is Key:Value pair representing custom data which is otherwise
   465  not available in other fields.
   466  """
   467  type Annotation {
   468      """
   469      Custom key
   470      """
   471      Key: String
   472      """
   473      Value associated with the custom key
   474      """
   475      Value: String
   476  }
   477  
   478  """
   479  A referrer is an object which has a reference to a another object
   480  """
   481  type Referrer {
   482      """
   483      Referrer MediaType
   484      See https://github.com/opencontainers/artifacts for more details
   485      """
   486      MediaType:    String
   487      """
   488      Referrer ArtifactType
   489      See https://github.com/opencontainers/artifacts for more details
   490      """
   491      ArtifactType: String
   492      """
   493      Total size of the referrer files in bytes
   494      """
   495      Size:         Int
   496      """
   497      Digest of the manifest file of the referrer
   498      """
   499      Digest:       String
   500      """
   501      A list of annotations associated with this referrer
   502      """
   503      Annotations:  [Annotation]!
   504  }
   505  
   506  """
   507  Contains details about the OS and architecture of the image
   508  """
   509  type Platform {
   510      """
   511      The name of the operating system which the image is built to run on,
   512      Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
   513      """
   514      Os: String
   515      """
   516      The name of the compilation architecture which the image is built to run on,
   517      Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
   518      """
   519      Arch: String
   520  }
   521  
   522  """
   523  Contains details about the signature
   524  """
   525  type SignatureSummary {
   526      """
   527      Tool is the tool used for signing image
   528      """
   529      Tool: String
   530      """
   531      True if the signature is trusted, false otherwise
   532      """
   533      IsTrusted: Boolean
   534      """
   535      Author is the author of the signature
   536      """
   537      Author: String
   538  }
   539  
   540  """
   541  All sort criteria usable with pagination, some of these criteria applies only
   542  to certain queries. For example sort by severity is available for CVEs but not
   543  for repositories
   544  """
   545  enum SortCriteria {
   546      """
   547      How relevant the result is based on the user input used while searching
   548      Applies to: images and repositories
   549      """
   550      RELEVANCE
   551      """
   552      Sort by the most recently created timestamp of the images
   553      Applies to: images and repositories
   554      """
   555      UPDATE_TIME
   556      """
   557      Sort alphabetically ascending
   558      Applies to: images, repositories and CVEs
   559      """
   560      ALPHABETIC_ASC
   561      """
   562      Sort alphabetically descending
   563      Applies to: images, repositories and CVEs
   564      """
   565      ALPHABETIC_DSC
   566      """
   567      Sort from the most severe to the least severe
   568      Applies to: CVEs
   569      """
   570      SEVERITY
   571      """
   572      Sort by the total number of stars given by users
   573      Applies to: repositories
   574      """
   575      STARS
   576      """
   577      Sort by the total download count
   578      Applies to: repositories and images
   579      """
   580      DOWNLOADS
   581  }
   582  
   583  """
   584  Information on current page returned by the API
   585  """
   586  type PageInfo {
   587      """
   588      The total number of objects on all pages
   589      """
   590      TotalCount: Int!
   591      """
   592      The number of objects in this page
   593      """
   594      ItemCount: Int!
   595  }
   596  
   597  """
   598  Pagination parameters
   599  If PageInput is empty, the request should return all objects.
   600  """
   601  input PageInput {
   602      """
   603      The maximum amount of results to return for this page
   604      Negative values are not allowed
   605      """
   606      limit: Int
   607      """
   608      The results page number you want to receive
   609      Negative values are not allowed
   610      """
   611      offset: Int
   612      """
   613      The criteria used to sort the results on the page
   614      """
   615      sortBy: SortCriteria
   616  }
   617  
   618  """
   619  PlatformInput contains the Os and the Arch of the input image
   620  """
   621  input PlatformInput {
   622      """
   623      The os of the image
   624      """
   625      Os: String
   626      """
   627      The arch of the image
   628      """
   629      Arch: String
   630  }
   631  
   632  """
   633  ImageInput 
   634  """
   635  input ImageInput {
   636      """
   637      Repo name of the image
   638      """
   639      Repo: String!
   640      """
   641      The tag of the image
   642      """
   643      Tag: String!
   644      """
   645      The digest of the image
   646      """
   647      Digest: String
   648      """
   649      The platform of the image
   650      """
   651      Platform: PlatformInput
   652  }
   653  
   654  """
   655  Paginated list of RepoSummary objects
   656  """
   657  type PaginatedReposResult {
   658      """
   659      Information on the returned page
   660      """
   661      Page: PageInfo
   662      """
   663      List of repositories
   664      """
   665      Results: [RepoSummary!]!
   666  }
   667  
   668  """
   669  Paginated list of ImageSummary objects
   670  """
   671  type PaginatedImagesResult {
   672      """
   673      Information on the returned page
   674      """
   675      Page: PageInfo
   676      """
   677      List of images
   678      """
   679      Results: [ImageSummary!]!
   680  }
   681  
   682  """
   683  Apply various types of filters to the queries made for repositories and images
   684  For example we only want to display repositories which contain images with
   685  a certain OS ar Architecture.
   686  """
   687  input Filter {
   688      """
   689      Only return images or repositories supporting the operating systems in the list
   690      Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
   691      """
   692      Os: [String]
   693      """
   694      Only return images or repositories supporting the build architectures in the list
   695      Should be values listed in the Go Language document https://go.dev/doc/install/source#environment
   696      """
   697      Arch: [String]
   698      """
   699      Only return images or repositories with at least one signature
   700      """
   701      HasToBeSigned: Boolean
   702      """
   703      Only returns images or repositories that are bookmarked or not bookmarked
   704      """
   705      IsBookmarked: Boolean
   706      """
   707      Only returns images or repositories that are starred or not starred
   708      """
   709      IsStarred: Boolean
   710  }
   711  
   712  """
   713  Queries supported by the zot server
   714  """
   715  type Query {
   716      """
   717      Returns a CVE list for the image specified in the argument
   718      """
   719      CVEListForImage(
   720          "Image name in format `repository:tag` or `repository@digest`"
   721          image: String!,
   722          "Sets the parameters of the requested page"
   723          requestedPage: PageInput
   724          "Search term for specific CVE by title/id"
   725          searchedCVE: String
   726          "Search term that must not be present in the returned results"
   727          excludedCVE: String
   728          "Severity of the CVEs that should be present in the returned results"
   729          severity: String
   730      ): CVEResultForImage!
   731  
   732      """
   733      Returns a list with CVE's that are present in `image` but not in `comparedImage`
   734      """
   735      CVEDiffListForImages(
   736          "Image name in format `repository:tag` or `repository@digest`"
   737          minuend: ImageInput!,
   738          "Compared image name in format `repository:tag` or `repository@digest`"
   739          subtrahend: ImageInput!,
   740          "Sets the parameters of the requested page"
   741          requestedPage: PageInput
   742          "Search term for specific CVE by title/id"
   743          searchedCVE: String
   744          "Search term that must not be present in the returned results"
   745          excludedCVE: String
   746      ): CVEDiffResult!
   747  
   748      """
   749      Returns a list of images vulnerable to the CVE of the specified ID
   750      """
   751      ImageListForCVE(
   752          "CVE ID"
   753          id: String!,
   754          "Filter to apply before returning the results"
   755          filter: Filter,
   756          "Sets the parameters of the requested page"
   757          requestedPage: PageInput
   758      ): PaginatedImagesResult!
   759  
   760      """
   761      Returns a list of images that are no longer vulnerable to the CVE of the specified ID,
   762      from the specified repository
   763      """
   764      ImageListWithCVEFixed(
   765          "CVE ID"
   766          id: String!,
   767          "Repository name"
   768          image: String!,
   769          "Filter to apply before returning the results"
   770          filter: Filter,
   771          "Sets the parameters of the requested page"
   772          requestedPage: PageInput
   773      ): PaginatedImagesResult!
   774  
   775      """
   776      Returns a list of images which contain the specified digest 
   777      """
   778      ImageListForDigest(
   779          "Digest to be used in searching for images"
   780          id: String!,
   781          "Sets the parameters of the requested page"
   782          requestedPage: PageInput
   783      ): PaginatedImagesResult!
   784  
   785      """
   786      Returns a list of repositories with the newest tag (most recently created timestamp)
   787      """
   788      RepoListWithNewestImage(
   789          "Sets the parameters of the requested page"
   790          requestedPage: PageInput
   791      ): PaginatedReposResult!
   792  
   793      """
   794      Returns all the images from the specified repository | from all repositories if specified repository is ""
   795      """
   796      ImageList(
   797          "Repository name"
   798          repo: String!,
   799          "Sets the parameters of the requested page"
   800          requestedPage: PageInput
   801      ): PaginatedImagesResult!
   802  
   803      """
   804      Obtain detailed information about a repository and container images within
   805      """
   806      ExpandedRepoInfo(
   807          "Repository name"
   808          repo: String!
   809      ): RepoInfo!
   810  
   811      """
   812      Searches within repos, images, and layers
   813      """
   814      GlobalSearch(
   815          """
   816          Query string, searches for repository names by default,
   817          when containing `:` it searches for tags inside a repository
   818          """
   819          query: String!,
   820          "Filter to apply on the matches"
   821          filter: Filter,
   822          "Sets the parameters of the requested page"
   823          requestedPage: PageInput
   824      ): GlobalSearchResult!
   825  
   826      """
   827      List of images which use the argument image
   828      """
   829      DerivedImageList(
   830          "Image name in the format `repository:tag`"
   831          image: String!,
   832          "Digest of a specific manifest inside the image. When null whole image is considered"
   833          digest: String,
   834          "Sets the parameters of the requested page"
   835          requestedPage: PageInput
   836      ): PaginatedImagesResult!
   837  
   838      """
   839      List of images on which the argument image depends on
   840      """
   841      BaseImageList(
   842          "Image name in the format `repository:tag`"
   843          image: String!,
   844          "Digest of a specific manifest inside the image. When null whole image is considered"
   845          digest: String,
   846          "Sets the parameters of the requested page"
   847          requestedPage: PageInput
   848      ): PaginatedImagesResult!
   849  
   850      """
   851      Search for a specific image using its name
   852      """
   853      Image(
   854          "Image name in the format `repository:tag`"
   855          image: String!
   856      ): ImageSummary!
   857  
   858      """
   859      Returns a list of descriptors of an image or artifact manifest that are found in a <repo> and have a subject field of <digest>
   860      Can be filtered based on a specific artifact type <type>
   861      """
   862      Referrers(
   863          "Repository name"
   864          repo: String!,
   865          "Digest the referrers are referring to"
   866          digest: String!,
   867          "Types of artifacts to return in the referrer list"
   868          type: [String!]
   869      ): [Referrer]!
   870  
   871      """
   872      Receive RepoSummaries of repos starred by current user
   873      """
   874      StarredRepos(
   875          "Sets the parameters of the requested page (how many to include and offset)"
   876          requestedPage: PageInput
   877      ): PaginatedReposResult!
   878  
   879      """
   880      Receive RepoSummaries of repos bookmarked by current user
   881      """
   882      BookmarkedRepos(
   883          "Sets the parameters of the requested page (how many to include and offset)"
   884          requestedPage: PageInput
   885      ): PaginatedReposResult!
   886  }