sasctl.services.model_publish#
Enables publishing objects such as models to various destinations.
- class sasctl._services.model_publish.ModelPublish[source]#
Bases:
Service
Enables publishing objects such as models to various destinations.
The service provides methods for managing publish destinations like CAS, Hadoop, Teradata, or SAS Micro Analytic Service
Methods
create_cas_destination
(name, library, table)Define a new CAS publishing destination.
create_destination
(name, type_[, ...])Define a new publishing destination.
create_mas_destination
(name, uri[, description])Define a new Micro Analytic Server (MAS) publishing destination.
delete
(*args, **kwargs)Send a DELETE request.
delete_destination
(item)Delete a destination instance.
get
(*args, **kwargs)Send a GET request.
get_destination
(item[, refresh])Return a destination instance.
get_link
(obj, rel)Get link information from a resource.
head
(*args, **kwargs)Send a HEAD request.
info
()Version and build information for the service.
is_available
()Check if the service is currently available.
list_destinations
([filter, start, limit])List all destinations available in the environment.
post
(*args, **kwargs)Send a POST request.
publish_model
(model, destination[, name, ...])Publish a model to an existing publishing destination.
put
(*args, **kwargs)Send a PUT request.
request
(verb, path[, session, format_])Send an HTTP request with a session.
request_link
(obj, rel, **kwargs)Request a link from a resource.
update_destination
(item)Update a destination instance.
is_uuid
list_models
- classmethod create_cas_destination(name, library, table, server=None, description=None)[source]#
Define a new CAS publishing destination.
- Parameters:
- namestr
Name of the publishing destination.
- librarystr
The CAS library in which table will be stored.
- tablestr
Name of the CAS table in which models will be stored.
- serverstr, optional
Name of the CAS server. Defaults to ‘cas-shared-default’.
- descriptionstr, optional
Description of the publishing destination.
- Returns:
- RestObj
- classmethod create_destination(name, type_, cas_server=None, cas_library=None, cas_table=None, description=None, mas_uri=None, hdfs_dir=None, conf_dir=None, user=None, database_library=None)[source]#
Define a new publishing destination.
- Parameters:
- namestr
Name of the publishing destination.
- type_{‘cas’, ‘mas’, ‘hadoop’, ‘teradata’}
Type of publishing definition being created
- cas_serverstr, optional
Name of the CAS server. Defaults to ‘cas-shared-default’. Required if type_ is ‘cas’, otherwise ignored.
- cas_librarystr, optional
The CAS library in which cas_table will be stored. Required if type_ is ‘cas’, otherwise ignored.
- cas_tablestr, optional
Name of the CAS table in which models will be stored. Required if type_ is ‘cas’, otherwise ignored.
- descriptionstr, optional
Description of the publishing destination.
- mas_uristr, optional
Required if type_ is ‘mas’, otherwise ignored.
- hdfs_dirstr, optional
Required if type_ is ‘hadoop’, otherwise ignored.
- conf_dirstr, optional
Required if type_ is ‘hadoop’, otherwise ignored.
- userstr, optional
Required if type_ is ‘hadoop’, otherwise ignored.
- database_librarystr, optional
Required if type_ is ‘teradata’, otherwise ignored.
- Returns:
- RestObj
- classmethod create_mas_destination(name, uri, description=None)[source]#
Define a new Micro Analytic Server (MAS) publishing destination.
- Parameters:
- namestr
Name of the publishing destination.
- uristr
The base URI that contains the host, the protocol, and optionally the port, which addresses the remote SAS Micro Analytic Service to use. Example: http://spam.com
- descriptionstr, optional
Description of the publishing destination.
- Returns:
- RestObj
- classmethod delete_destination(item)[source]#
Delete a destination instance.
- Parameters:
- itemstr or dict
Name or dictionary representation of publishing destination.
- Returns:
- None
- classmethod get_destination(item, refresh=False)#
Return a destination instance.
- Parameters:
- itemstr or dict
Name, ID, or dictionary representation of the destination.
- refreshbool, optional
Obtain an updated copy of the destination.
- Returns:
- RestObj or None
A dictionary containing the destination attributes or None.
Notes
If item is a complete representation of the destination it will be returned unless refresh is set. This prevents unnecessary REST calls when data is already available on the client.
- classmethod list_destinations(filter=None, start=None, limit=None, **kwargs)#
List all destinations available in the environment.
- Parameters:
- filterstr, optional
- startint, optional
Zero-based index of the first item to return. Defaults to 0.
- limitint, optional
The maximum number of items to return. Defaults to 20.
- Returns:
- list
A list of dictionaries containing the destinations.
Notes
See the filtering reference for details on the filter parameter.
- classmethod publish_model(model, destination, name=None, code=None, notes=None)[source]#
Publish a model to an existing publishing destination.
- Parameters:
- modelstr or dict
The name or id of the model, or a dictionary representation of the model.
- destinationstr or dict
The name or id of the publishing destination, or a dictionary representation of the destination
- namestr, optional
Name of the published model. Defaults to the model name.
- codestr, optional
The code to be published.
- notes
- Returns:
- classmethod update_destination(item)#
Update a destination instance.
- Parameters:
- itemdict
- Returns:
- None