public class RestApiUtils extends Object
| Constructor and Description |
|---|
RestApiUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Map<QueryParamName,String> |
artifactDownloadAssetParams(@NonNull DownloadArtifactAssetOptions options,
@NonNull String experimentKey)
Extracts query parameters from provided
DownloadArtifactAssetOptions to be used to download specific
asset associated with Comet artifact. |
static Map<QueryParamName,String> |
artifactVersionDetailsParams(@NonNull GetArtifactOptions options,
@NonNull String experimentKey)
Extracts query parameters from provided
GetArtifactOptions object to be used for getting details about
particular artifact version. |
static Map<QueryParamName,String> |
artifactVersionFilesParams(@NonNull GetArtifactOptions options)
Extracts query parameters from provided
GetArtifactOptions object to be used for getting list of assets
associated with particular artifact. |
static Map<FormParamName,Object> |
assetFormParameters(@NonNull Asset asset)
Extracts form parameters from the provided
Asset. |
static Map<QueryParamName,String> |
assetQueryParameters(@NonNull AssetImpl asset,
@NonNull String experimentKey)
Extracts query parameters from the provided
Asset. |
static ArtifactRequest |
createArtifactUpsertRequest(ArtifactImpl artifact)
The factory to create
ArtifactRequest instance to be used to upsert Comet artifact. |
static ArtifactRequest |
createArtifactVersionStateRequest(String artifactVersionId,
ArtifactVersionState state)
Creates request to signal the state of the artifact version send operation.
|
static GitMetadataRest |
createGitMetadataRequest(GitMetaData metaData)
The factory to create
GitMetadataRest request instance. |
static AddGraphRest |
createGraphRequest(@NonNull String graph)
The factory to create
AddGraphRest instance. |
static ExperimentTimeRequest |
createLogEndTimeRequest(long endTimeMillis)
The factory to create
ExperimentTimeRequest instance. |
static HtmlRest |
createLogHtmlRequest(@NonNull String html,
boolean override)
The factory to create
HtmlRest instance. |
static OutputUpdate |
createLogLineRequest(@NonNull String line,
long offset,
boolean stderr,
String context)
The factory to create
OutputUpdate instance. |
static MetricRest |
createLogMetricRequest(@NonNull String metricName,
@NonNull Object metricValue,
@NonNull ExperimentContext context)
The factory to create
MetricRest instance. |
static LogOtherRest |
createLogOtherRequest(@NonNull String key,
@NonNull Object value)
The factory to create
LogOtherRest instance. |
static ParameterRest |
createLogParamRequest(@NonNull String parameterName,
@NonNull Object paramValue,
@NonNull ExperimentContext context)
The factory to create
ParameterRest instance. |
static ExperimentTimeRequest |
createLogStartTimeRequest(long startTimeMillis)
The factory to create
ExperimentTimeRequest instance. |
static RegistryModelCreateRequest |
createRegistryModelCreateRequest(RegistryModelImpl model)
Prepares request to create new registry record of the model associated with particular experiment.
|
static RegistryModelItemCreateRequest |
createRegistryModelItemCreateRequest(RegistryModelImpl model)
Prepares request which can be used to update the existing registry record of the model associated
with particular experiment.
|
static RegistryModelNotesUpdateRequest |
createRegistryModelNotesUpdateRequest(String notes,
String registryName,
String workspace)
Creates request to create/update notes of the registry model.
|
static RegistryModelUpdateRequest |
createRegistryModelUpdateRequest(String registryModelName,
String description,
Boolean isPublic)
Creates request to update the registry model.
|
static AddExperimentTagsRest |
createTagRequest(@NonNull String tag)
The factory to create
AddExperimentTagsRest instance. |
static Map<QueryParamName,String> |
downloadModelParams(@NonNull String workspace,
@NonNull String registryName,
@NonNull DownloadModelOptions options)
Creates query parameters to be used to download model from the Comet registry.
|
Map<String,Object> |
metadataFromJson(String json)
Converts JSON encoded metadata into
Map object. |
public static MetricRest createLogMetricRequest(@NonNull @NonNull String metricName, @NonNull @NonNull Object metricValue, @NonNull @NonNull ExperimentContext context)
MetricRest instance.metricName - the metric namemetricValue - the metric valuecontext - the current contextMetricRest instance.public static ParameterRest createLogParamRequest(@NonNull @NonNull String parameterName, @NonNull @NonNull Object paramValue, @NonNull @NonNull ExperimentContext context)
ParameterRest instance.parameterName - the name of the parameterparamValue - the value of the parametercontext - the current contextParameterRest instance.public static OutputUpdate createLogLineRequest(@NonNull @NonNull String line, long offset, boolean stderr, String context)
OutputUpdate instance.line - the log lineoffset - the log line offsetstderr - the flag to indicate if it's from StdErrcontext - the current contextOutputUpdate instance.public static HtmlRest createLogHtmlRequest(@NonNull @NonNull String html, boolean override)
HtmlRest instance.html - the HTML code to be logged.override - the flag to indicate whether it should override already saved version.HtmlRest instance.public static LogOtherRest createLogOtherRequest(@NonNull @NonNull String key, @NonNull @NonNull Object value)
LogOtherRest instance.key - the parameter name/key.value - the parameter value.LogOtherRest instance.public static AddExperimentTagsRest createTagRequest(@NonNull @NonNull String tag)
AddExperimentTagsRest instance.tag - the tag valueAddExperimentTagsRest instancepublic static AddGraphRest createGraphRequest(@NonNull @NonNull String graph)
AddGraphRest instance.graph - the NN graph representation.AddGraphRest instance.public static ExperimentTimeRequest createLogStartTimeRequest(long startTimeMillis)
ExperimentTimeRequest instance.startTimeMillis - the experiment's start time in milliseconds.ExperimentTimeRequest instance.public static ExperimentTimeRequest createLogEndTimeRequest(long endTimeMillis)
ExperimentTimeRequest instance.endTimeMillis - the experiment's end time in milliseconds.ExperimentTimeRequest instance.public static GitMetadataRest createGitMetadataRequest(GitMetaData metaData)
GitMetadataRest request instance.metaData - the GitMetaData model object from public API.GitMetadataRest instance.public static ArtifactRequest createArtifactUpsertRequest(ArtifactImpl artifact)
ArtifactRequest instance to be used to upsert Comet artifact.artifact - the ArtifactImpl instance.ArtifactRequest instance.public static ArtifactRequest createArtifactVersionStateRequest(String artifactVersionId, ArtifactVersionState state)
artifactVersionId - the identifier of the artifact version.state - the ArtifactVersionState signaling state of the operation.ArtifactRequest instance.public static RegistryModelCreateRequest createRegistryModelCreateRequest(RegistryModelImpl model)
model - the RegistryModelImpl instance holding all required data.RegistryModelCreateRequest.public static RegistryModelItemCreateRequest createRegistryModelItemCreateRequest(RegistryModelImpl model)
model - the RegistryModelImpl instance holding all required data.RegistryModelItemCreateRequest.public static RegistryModelNotesUpdateRequest createRegistryModelNotesUpdateRequest(String notes, String registryName, String workspace)
notes - the notes to be created.registryName - the registry model name.workspace - the workspace name.RegistryModelNotesUpdateRequest.public static RegistryModelUpdateRequest createRegistryModelUpdateRequest(String registryModelName, String description, Boolean isPublic)
registryModelName - the new name for the model.description - the new description for the model.isPublic - the flag to change visibility status of the model.RegistryModelUpdateRequest.public Map<String,Object> metadataFromJson(String json)
Map object.json - the JSON encoded metadata string.Map object.public static Map<QueryParamName,String> downloadModelParams(@NonNull @NonNull String workspace, @NonNull @NonNull String registryName, @NonNull @NonNull DownloadModelOptions options)
workspace - the name of the model's workspace.registryName - the model's name in the registry.options - the additional download options.public static Map<QueryParamName,String> assetQueryParameters(@NonNull @NonNull AssetImpl asset, @NonNull @NonNull String experimentKey)
Asset.asset - the AssetImpl to extract HTTP query parameters from.experimentKey - the key of the Comet experiment.public static Map<FormParamName,Object> assetFormParameters(@NonNull @NonNull Asset asset)
Asset.asset - the Asset to extract HTTP form parameters from.public static Map<QueryParamName,String> artifactVersionDetailsParams(@NonNull @NonNull GetArtifactOptions options, @NonNull @NonNull String experimentKey)
GetArtifactOptions object to be used for getting details about
particular artifact version.options - the GetArtifactOptionsexperimentKey - the current experiment's keypublic static Map<QueryParamName,String> artifactVersionFilesParams(@NonNull @NonNull GetArtifactOptions options)
GetArtifactOptions object to be used for getting list of assets
associated with particular artifact.options - the GetArtifactOptionspublic static Map<QueryParamName,String> artifactDownloadAssetParams(@NonNull @NonNull DownloadArtifactAssetOptions options, @NonNull @NonNull String experimentKey)
DownloadArtifactAssetOptions to be used to download specific
asset associated with Comet artifact.options - the DownloadArtifactAssetOptionsexperimentKey - the current experiment's keyCopyright © 2022. All rights reserved.