messages

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns Messages optionally limited by the conditions provided in ListOpts.

Types

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult contains the response body and error from a Delete request.

func Delete

func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult)

Delete will delete the existing Message with the provided ID.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult contains the response body and error from a Get request.

func Get

func Get(client *gophercloud.ServiceClient, id string) (r GetResult)

Get retrieves the Message with the provided ID. To extract the Message object from the response, call the Extract method on the GetResult.

func (GetResult) Extract

func (r GetResult) Extract() (*Message, error)

Extract will get the Message object out of the commonResult object.

type ListOpts

type ListOpts struct {
	// The message ID
	ID string `q:"id"`
	// The ID of the action during which the message was created
	ActionID string `q:"action_id"`
	// The ID of the message detail
	DetailID string `q:"detail_id"`
	// The message level
	MessageLevel string `q:"message_level"`
	// The UUID of the request during which the message was created
	RequestID string `q:"request_id"`
	// The UUID of the resource for which the message was created
	ResourceID string `q:"resource_id"`
	// The type of the resource for which the message was created
	ResourceType string `q:"resource_type"`
	// The key to sort a list of messages
	SortKey string `q:"sort_key"`
	// The key to sort a list of messages
	SortDir string `q:"sort_dir"`
	// The maximum number of messages to return
	Limit int `q:"limit"`
}

ListOpts holds options for listing Messages. It is passed to the messages.List function.

func (ListOpts) ToMessageListQuery

func (opts ListOpts) ToMessageListQuery() (string, error)

ToMessageListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToMessageListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type Message

type Message struct {
	// The message ID
	ID string `json:"id"`
	// The UUID of the project where the message was created
	ProjectID string `json:"project_id"`
	// The ID of the action during which the message was created
	ActionID string `json:"action_id"`
	// The ID of the message detail
	DetailID string `json:"detail_id"`
	// The message level
	MessageLevel string `json:"message_level"`
	// The UUID of the request during which the message was created
	RequestID string `json:"request_id"`
	// The UUID of the resource for which the message was created
	ResourceID string `json:"resource_id"`
	// The type of the resource for which the message was created
	ResourceType string `json:"resource_type"`
	// The message text
	UserMessage string `json:"user_message"`
	// The date and time stamp when the message was created
	CreatedAt time.Time `json:"-"`
	// The date and time stamp when the message will expire
	ExpiresAt time.Time `json:"-"`
}

Message contains all the information associated with an OpenStack Message.

func ExtractMessages

func ExtractMessages(r pagination.Page) ([]Message, error)

ExtractMessages extracts and returns Messages. It is used while iterating over a messages.List call.

func (*Message) UnmarshalJSON

func (r *Message) UnmarshalJSON(b []byte) error

type MessagePage

type MessagePage struct {
	pagination.SinglePageBase
}

MessagePage is a pagination.pager that is returned from a call to the List function.

func (MessagePage) IsEmpty

func (r MessagePage) IsEmpty() (bool, error)

IsEmpty returns true if a ListResult contains no Messages.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL